function openWin() {
window.open("https://secure.efxnow.com/NewOLS_FRXC_EN/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("http://www.forex.com/tour/index.html","tour2","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no,left=50,top=50,width=620, height=525");
}

function openTour3() {
window.open("http://www.forex.com/tour/windows.html","tour3","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no,left=50,top=50,width=940, height=630");
}

function openTour4() {
window.open("http://www.forex.com/tour/web.html","tour4","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no,left=50,top=50,width=940, height=630");
}

function openTour5() {
window.open("tour/forex_trader_charts_tour.html","tour5","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no,left=50,top=50,width=700, height=500");
}

function openTourForexTraderCharts() {
window.open("http://video.forex.com/tour/forexcharts.html","TourForexTraderCharts","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no,left=50,top=50,width=630, height=520");
}

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 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=437,height=412");
}

function openNewsletter2() {
var strURL = "http://www.forex.com/forex-newsletter-signup.html";
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 align="center"><span class="cellpad2"><span style="font-size: 10pt">Forex trading involves significant risk of loss and is not suitable for all investors. <a href="risk_warning.html" style="text-decoration: underline; font-size: 10pt">Read full disclosure</a>.<br>Spot Gold and Silver contracts are not subject to regulation under the U.S. Commodity Exchange Act.</span><br><br>44 Wall Street, 7th Floor, New York, New York 10005<br />Tel: 1.877.FOREXGO (367.3946) or 1.908.731.0750 | Email: <a href="mailto:info@forex.com">info@forex.com</a><br /><a href="javascript:openWin()">Customer Agreement</a> | <a href="privacy_policy.html">Privacy Policy</a> | <a href="risk_warning.html">Risk Warning</a><br />&copy;' + current_year + ' FOREX.com </span></p>');
}

function writeFooter2()
{
	document.write('<tr>');
  document.write('<td height="1" colspan="3" valign="top"><table width="773"  border="0" cellpadding="0" cellspacing="0" background="images/header/footer_bg.gif" class="footerbox" align="center">');
  document.write('<tr valign="top">');
  document.write('<td align="left" class="footerlinks"><a href="forex_site_map.html">Site Map</a> | <a href="contact_us.html">Contact Us</a> | <a href="index.html">Home</a> | <a href="learn.html">Learn</a> | <a href="trade.html">Trade</a> | <a href="forex_platform_advantages.html">Platforms</a> | <a href="resources.html">Resources</a> | <a href="about.html">About</a> | <a href="contact_us.html">Support</a></td>');
  document.write('<td align="right" class="footerlinks"><a href="javascript:openWin();">Customer Agreement</a> | <a href="privacy_policy.html">Privacy Policy</a> | <a href="risk_warning.html">Risk Warning</a></td>');
  document.write('</tr>');
  document.write('<tr align="center" valign="top">');
  document.write('<td colspan="2" class="footer"><br>');
  document.write('<span class="footer">Member, National Futures Association (NFA # 0339826).<br>Forex trading involves significant risk of loss and is not suitable for all investors. <a href="risk_warning.html">Read full disclosure</a><br>Spot Gold and Silver contracts are not subject to regulation under the U.S. Commodity Exchange Act.<br>');
  document.write('44 Wall Street, 7th Floor, New York, New York 10005<br>');
  document.write('Tel: 1.877.FOREXGO (367.3946) or 1.908.731.0750 | Email: <a href="mailto:info@forex.com">info@forex.com</a><br>&copy;' + current_year + ' FOREX.com</span></td>');
  document.write('</tr>');
  document.write('</table></td>');
  document.write('</tr>');
}

function writeMiniFooter2()
{	
  document.write('<tr align="center" valign="top">');
  document.write('<td colspan="2" class="footer"><br>');
  document.write('<span class="footer">Forex trading involves significant risk of loss and is not suitable for all investors. <a href="risk_warning.html">Read full disclosure</a><br>Spot Gold and Silver contracts are not subject to regulation under the U.S. Commodity Exchange Act.<br>');
  document.write('44 Wall Street, 7th Floor, New York, New York 10005<br>');
  document.write('Tel: 1.877.FOREXGO (367.3946) or 1.908.731.0750 | Email: <a href="mailto:info@forex.com">info@forex.com</a><br>&copy;' + current_year + ' FOREX.com</span></td>');
  document.write('</tr>');
  document.write('</table></td>');
  document.write('</tr>');
}

function writeFooter3()
{
	document.write('<table width="906"  border="0" cellpadding="0" cellspacing="0" background="images/home/footer_bg.gif" class="footerbox">');
  document.write('<tr valign="top">');
  document.write('<td align="left" class="footerlinks"><a href="forex_site_map.html">Site Map</a> | <a href="contact_us.html">Contact Us</a> | <a href="index.html">Home</a> | <a href="learn.html">Learn</a> | <a href="trade.html">Trade</a> | <a href="forex_platform_advantages.html">Platforms</a> | <a href="resources.html">Resources</a> | <a href="about.html">About</a> | <a href="contact_us.html">Support</a></td>');
  document.write('<td align="right" class="footerlinks"><a href="land-international.html">International</a> | <a href="javascript:openWin();">Customer Agreement</a> | <a href="privacy_policy.html">Privacy Policy</a> | <a href="risk_warning.html">Risk Warning</a></td>');
  document.write('</tr>');
  document.write('<tr align="center" valign="top">');
  document.write('<td colspan="2"><br>');
  document.write('<span class="footer">Member, National Futures Association (NFA # 0339826).<br>Forex trading involves significant risk of loss and is not suitable for all investors. <a href="risk_warning.html">Read full disclosure</a><br>Spot Gold and Silver contracts are not subject to regulation under the U.S. Commodity Exchange Act.<br>*Increasing leverage increases risk.<br>');
  document.write('44 Wall Street, 7th Floor, New York, New York 10005<br>');
  document.write('Tel: 1.877.FOREXGO (367.3946) or 1.908.731.0750 | Email: <a href="mailto:info@forex.com">info@forex.com</a><br>');
  document.write('&copy;' + current_year + ' FOREX.com</span>');
  document.write('</td>');
  document.write('</tr>');
  document.write('</table>');
}

function writeFooter404()
{
	document.write('<tr>');
  document.write('<td height="1" colspan="3" valign="top"><table width="773"  border="0" cellpadding="0" cellspacing="0" background="http://www.forex.com/images/header/footer_bg.gif" class="footerbox" align="center">');
  document.write('<tr valign="top">');
  document.write('<td align="left"><p class="footerlinks"><a href="http://www.forex.com/forex_site_map.html">Site Map</a> | <a href="http://www.forex.com/contact_us.html">Contact Us</a> | <a href="http://www.forex.com/index.html">Home</a> | <a href="http://www.forex.com/learn.html">Learn</a> | <a href="http://www.forex.com/trade.html">Trade</a> | <a href="http://www.forex.com/forex_platform_advantages.html">Platforms</a> | <a href="http://www.forex.com/resources.html">Resources</a> | <a href="http://www.forex.com/about.html">About</a> | <a href="http://www.forex.com/contact_us.html">Support</a></p></td>');
  document.write('<td align="right" class="footerlinks"><a href="javascript:openWin();">Customer Agreement</a> | <a href="http://www.forex.com/privacy_policy.html">Privacy Policy</a> | <a href="http://www.forex.com/risk_warning.html">Risk Warning</a></td>');
  document.write('</tr>');
  document.write('<tr align="center" valign="top">');
  document.write('<td colspan="2" class="footer"><br>');
  document.write('<span class="footer">Member, National Futures Association (NFA # 0339826).<br>Forex trading involves significant risk of loss and is not suitable for all investors. <a href="http://www.forex.com/risk_warning.html">Read full disclosure</a><br>Spot Gold and Silver contracts are not subject to regulation under the U.S. Commodity Exchange Act.<br>');
  document.write('44 Wall Street, 7th Floor, New York, New York 10005<br>');
  document.write('Tel: 1.877.FOREXGO (367.3946) or 1.908.731.0750 | Email: <a href="mailto:info@forex.com">info@forex.com</a><br>&copy;' + current_year + ' FOREX.com</span></td>');
  document.write('</tr>');
  document.write('</table></td>');
  document.write('</tr>');
}

function openHomeLanding() {
window.open("index.html","popWin","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=0,top=0,width=568, height=500");
}

function openPrivacyLanding() {
window.open("privacy_policy.html","popWin","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=0,top=0,width=568, height=500");
}

function openLearnLanding() {
_uacct = "UA-225222-2";	
urchinTracker('/internal/land/dummies/learn_text');	
_uacct = 'UA-225222-8';
window.open("learn.html","popWin","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=0,top=0,width=568, height=500");
}

function openPrivacy() {
window.open("privacy_policy2.html","tour","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=50,top=50,width=530, height=475");
}

function openManagedRisk() {
window.open("risk_warning_managed_accounts.html","tour","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=50,top=50,width=530, height=475");
}

function openLandingLearn() {
window.open("learn.html","tour","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=50,top=50,width=790, height=600");
}

function openLandingTrade() {
window.open("trade.html","tour","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=50,top=50,width=790, height=600");
}

function openLandingPlatforms() {
window.open("forex_platform_advantages.html","tour","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=50,top=50,width=790, height=600");
}

function openLandingAbout() {
window.open("about.html","tour","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=50,top=50,width=790, height=600");
}

function openHoliday() {
window.open("holiday.html","holiday","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no,left=50,top=50,width=583, height=720");
}

function openTerms() {
window.open("metatraderuk/terms.html","tour","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=50,top=50,width=530, height=475");
}