function openWin() {
window.open("https://secure.efxnow.com/NewOLS_GCUK_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");
}

current_date = new Date();
current_year = current_date.getYear();
if (current_year < 1000)
current_year+=1900;

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 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 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-uk.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-uk.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/uk/forextradercharts.html","TourForexTraderCharts","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no,left=50,top=50,width=1200, height=900");
}

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 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=458,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">9th Floor, 12 Camomile Street, London EC3A 7PT United Kingdom<br />Tel: +44 020 7398 5030 or 0800 032 1948 | Email: <a href="mailto:ukinfo@forex.com">ukinfo@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><br><br>FOREX.com is a trading name of GAIN Capital - FOREX.com UK Limited and is authorised and regulated by the Financial Services Authority.  FSA No. 190864.</span></p>');
}

function writeFooter2()
{
	document.write('<tr>');
  document.write('<td height="1" colspan="3" valign="top">');
  document.write('<table width="773" align=center border="0" cellpadding="0" cellspacing="0" class="footerbox">');
	document.write('<tr align="center" valign="top">');
  document.write('<td colspan="2">');
  document.write('<span class="footer">Please note that forex and other leveraged trading involves significant risk of loss.  It is not suitable for all investors and you should make sure you understand the risks involved, seeking independent advice if necessary.<br><br>');
  document.write('</td>');
  document.write('</tr></table>');
  document.write('<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"><p 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></p></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" class="footer"><br>');
  document.write('<span class="footer">Contracts for Difference (CFDs) are not available to US residents. <br><br>FOREX.com is a trading name of GAIN Capital - FOREX.com UK Limited and is authorised and regulated by the Financial Services Authority.  FSA No. 190864. <br><br>');
  document.write('9th Floor, 12 Camomile Street, London EC3A 7PT United Kingdom<br>');
  document.write('Tel: +44 (0)207 398 5030 or 0800 032 1948 | Email: <a href="mailto:ukinfo@forex.com">ukinfo@forex.com</a><br>');
  document.write('&copy;' + current_year + ' FOREX.com UK');
  document.write('</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">Please note that forex and other leveraged trading involves significant risk of loss.  It is not suitable for all investors and you should make sure you understand the risks involved, seeking independent advice if necessary.<br><br>By providing your email address on this form, you consent to receiving emails from FOREX.com. In the event you receive an email from FOREX.com and do not wish to receive similar emails in the future, simply follow the instructions to unsubscribe. Your information will never be shared with a third party. We respect your privacy; please read our <a href="javascript:openPrivacy();" style="text-decoration:underline;">Privacy Policy</a>.<br><br>Contracts for Difference (CFDs) are not available to US residents. <br><br>FOREX.com is a trading name of GAIN Capital - FOREX.com UK Limited and is authorised and regulated by the Financial Services Authority.  FSA No. 190864.<br><br>');
  document.write('9th Floor, 12 Camomile Street, London EC3A 7PT United Kingdom<br>');
  document.write('Tel: +44 (0)207 398 5030 or 0800 032 1948 | Email: <a href="mailto:ukinfo@forex.com">ukinfo@forex.com</a><br>');
  document.write('&copy;' + current_year + ' FOREX.com UK');
  document.write('</span></td>');
  document.write('</tr>');
  document.write('</table></td>');
  document.write('</tr>');
}

function writeMiniFooter3()
{
	document.write('<tr>');
  document.write('<td height="1" colspan="3" valign="top">');
  document.write('<table width="773" align=center border="0" cellpadding="0" cellspacing="0" class="footerbox">');
	document.write('<tr align="center" valign="top">');
  document.write('<td colspan="2">');
  document.write('<span class="footer">Please note that forex and other leveraged trading involves significant risk of loss.  It is not suitable for all investors and you should make sure you understand the risks involved, seeking independent advice if necessary.<br><br>');
  document.write('</td>');
  document.write('</tr></table>');
  document.write('<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"><p 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></p></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" class="footer"><br>');
  document.write('<span class="footer">By providing your email address on this form, you consent to receiving emails from FOREX.com. In the event you receive an email from FOREX.com and do not wish to receive similar emails in the future, simply follow the instructions to unsubscribe. Your information will never be shared with a third party.  We respect your privacy; please read our <a href="javascript:openPrivacyLanding();" style="text-decoration: underline">Privacy Policy</a>.<br><Br>Contracts for Difference (CFDs) are not available to US residents. <br><br>FOREX.com is a trading name of GAIN Capital - FOREX.com UK Limited and is authorised and regulated by the Financial Services Authority.  FSA No. 190864. <br><br>');
  document.write('9th Floor, 12 Camomile Street, London EC3A 7PT United Kingdom<br>');
  document.write('Tel: +44 (0)207 398 5030 or 0800 032 1948 | Email: <a href="mailto:ukinfo@forex.com">ukinfo@forex.com</a><br>');
  document.write('&copy;' + current_year + ' FOREX.com UK');
  document.write('</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" class="footerbox">');
	document.write('<tr align="left" valign="top">');
  document.write('<td colspan="2">');
  document.write('<span class="bodycopyNew">Please note that forex and other leveraged trading involves significant risk of loss.  It is not suitable for all investors and you should make sure you understand the risks involved, seeking independent advice if necessary.<br><br>');
  document.write('</td>');
  document.write('</tr></table>');
  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"><p 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></p></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">Contracts for Difference (CFDs) are not available to US residents. <br><br>FOREX.com is a trading name of GAIN Capital - FOREX.com UK Limited and is authorised and regulated by the Financial Services Authority.  FSA No. 190864. <br><br>');
  document.write('9th Floor, 12 Camomile Street, London EC3A 7PT United Kingdom<br>');
  document.write('Tel: +44 (0)207 398 5030 or 0800 032 1948 | Email: <a href="mailto:ukinfo@forex.com">ukinfo@forex.com</a><br>');
  document.write('&copy;' + current_year + ' FOREX.com UK</span>');
  document.write('</td>');
  document.write('</tr>');
  document.write('</table>');
}

function writeFooter404()
{
	document.write('<tr>');
  document.write('<td height="1" colspan="3" valign="top">');
  document.write('<table width="773"  border="0" cellpadding="0" cellspacing="0" class="footerbox">');
	document.write('<tr align="center" valign="top">');
  document.write('<td colspan="2">');
  document.write('<span class="bodycopyNew">Please note that forex and other leveraged trading involves significant risk of loss.  It is not suitable for all investors and you should make sure you understand the risks involved, seeking independent advice if necessary.<br><br>');
  document.write('</td>');
  document.write('</tr></table>');
  document.write('<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/uk/forex_site_map.html">Site Map</a> | <a href="http://www.forex.com/uk/contact_us.html">Contact Us</a> | <a href="http://www.forex.com/uk/index.html">Home</a> | <a href="http://www.forex.com/uk/learn.html">Learn</a> | <a href="http://www.forex.com/uk/trade.html">Trade</a> | <a href="http://www.forex.com/uk/forex_platform_advantages.html">Platforms</a> | <a href="http://www.forex.com/uk/resources.html">Resources</a> | <a href="http://www.forex.com/uk/about.html">About</a> | <a href="http://www.forex.com/uk/contact_us.html">Support</a></p></td>');
  document.write('<td align="right" class="footerlinks"><a href="http://www.forex.com/land-international.html">International</a> | <a href="javascript:openWin();">Customer Agreement</a> | <a href="http://www.forex.com/uk/privacy_policy.html">Privacy Policy</a> | <a href="http://www.forex.com/uk/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">Contracts for Difference (CFDs) are not available to US residents. <br><br>FOREX.com is a trading name of GAIN Capital - FOREX.com UK Limited and is authorised and regulated by the Financial Services Authority.  FSA No. 190864. <br><br>');
  document.write('9th Floor, 12 Camomile Street, London EC3A 7PT United Kingdom<br>');
  document.write('Tel: +44 (0)207 398 5030 or 0800 032 1948 | Email: <a href="mailto:ukinfo@forex.com">ukinfo@forex.com</a><br>');
  document.write('&copy;' + current_year + ' FOREX.com UK</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() {
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_policy.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("holiday09.html","holiday","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no,left=50,top=50,width=572, height=653");
}