function openWin() {
window.open("https://secure.efxnow.com/NewOLS_FRXC_AR/agreement.aspx","popWin","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=0,top=0,width=568, height=500");
}

function gpWin() {
    window.open('https://www.trancentrix.com/gaincapital/gainlogin-final.html','main2','location=yes,status=yes,toolbar=yes,menubar=yes,resizable=yes,scrollbars=yes,width=494,height=554, left=10,top=10');    
}

function popUp() {
window.open("romania.html","popWin3","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=50,top=50,width=350, height=185");
}

function openWin2() {
window.open("forex_uva_rules.html","popWin3","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=0,top=0,width=568, height=500");
}

current_date = new Date();
current_year = current_date.getYear();
if (current_year < 1000)
current_year+=1900;

function tsWin() {
window.open("tradeshow-chicago.html","tsWin","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=50,top=50,width=500, height=210");
}

function pcWin() {
window.open("mini-forex-platform-comparison.html","pcWin","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no,left=50,top=50,width=546, height=273");
}

function sslWin() {
window.open("loginsec.html","sslWin","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=50,top=50,width=500, height=275");
}

function semWin() {
window.open("seminar.html","semWin","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no,left=50,top=50,width=400, height=125");
}

function viewexamples() {
window.open("forexinsider.html","sslWin","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=50,top=50,width=500, height=275");
}

function disclaimer() {
window.open("mac_disclaimer.html","disc","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=200,top=200,width=500, height=400");
}

function openResults() {
		window.opener.location.href="forex_managed_accounts_program.html";
		window.close();
}

function openTour() {
window.open("forex-autochartist-tour.html","tour","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no,left=50,top=50,width=530, height=575");
}

function openTour2() {
window.open("tour.html","tour2","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no,left=50,top=50,width=625, height=458");
}

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}

function toolWin(url) {
window.open (url, "tools", "status=yes,toolbar=yes,directories=no,menubar=yes,location=yes,resizable=yes,scrollbars=yes,left=50,top=50,width=450, height=450");
}

function openaml() {
window.open("aml.html","sslWin","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=50,top=50,width=500, height=150");
}

function openvideo() {
window.open("njtc-video.html","vidWin","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=100,top=100,width=424, height=355");
}

function trim(s) {
  			while (s.substring(0,1) == ' ') {
    			s = s.substring(1,s.length);
  			}
  			while (s.substring(s.length-1,s.length) == ' ') {
    			s = s.substring(0,s.length-1);
  			}
  			return s;
			}
			
function checkemail(){
			var testresults;			
			var str=document.newsletter_form.email.value;
			var filter=/^(['_a-z0-9-+]+)(\.['_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,5})$/i
			if (filter.test(str))
				testresults=true
			else				
				testresults=false				
			return (testresults)			
			}

function ValidateSearch()
{
  //make sure the search box has something other than 'search site' or ''
  
  //special lowercase function and blank space removal so Liz can't search for search site
  document.gsearch.q.value = trim(document.gsearch.q.value);  
  x = document.gsearch.q.value.toLowerCase();
                                                   
  if ((document.gsearch.q.value.length == 0) || ( x == 'search site'))
  {
  	//ask the user to enter something
    alert('Please type a word, phrase or question');
    
    //and return false so the form doesn't get submitted                                
    return false;
  } 
  
  //everything checks out, submit the form
  return true;
                        
}

function openNewsletter() {
var strURL = "forex-newsletter-signup.html?email=" + trim(document.newsletter_form.email.value);
window.open(strURL,"newsletter","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no,left=50,top=50,width=458,height=412");
}

function writeFooter()
{
	document.write('<p dir="RTL" align="center"><span class="arabic_main_text"><font color="#666666" size="1">تجارة العملات تحمل درجة عالية من خطر الخسارة وهي قد لا تكون مناسبة لجميع المستثمرين. <a href="risk_warning.html">الرجاء قراءة كشف المخاطرة</a>.</font></span></p><p align="center">44 Wall Street, 7th Floor, New York, New York 10005<br>+1 646 649 8897 <span dir="rtl">هاتف :</span> | <a href="mailto:arabicinfo@forex.com" class="footer2">arabicinfo@forex.com</a> : البريد الإلكتروني <br><a href="javascript:openWin()" class="footer2">اتفاقية العملاء</a> | <a href="privacy_policy.html" class="footer2">سياسة الخصوصية</a> | <a href="risk_warning.html" class="footer2">الإنذار بالمخاطر</a><br>&copy;<script language="Javascript">document.write(current_year);</script> FOREX.com</p>');
}