function openWin() {
window.open("https://secure.efxnow.com/NewOLS_FRXC_RU/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 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 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("http://www.forex.com/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/images/flash/tour_ru.html","tour2","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no,left=50,top=50,width=799, height=545");
}

function openTour3() {
window.open("../tour/windows-ru.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_ru.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 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 openvideo() {
window.open("http://www.forex.com/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;
                                                   
  if ((document.gsearch.q.value.length == 0) || ( x == 'Поиск'))
  {
  	//ask the user to enter something
    alert('Пожалуйста введите слово, фразу или вопрос');
    
    //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 align="center"><span class="cellpad2">Каждая сделка, совершаемая на Forex, является высоко рискованной. Поэтому проведение торговых операций на рынке <br>не рекомендуется каждому. Контракты по спот золоту и серебру не регулируются Законом о товарно-сырьевых биржах США.<br>  <a href="risk_warning.html" style="text-decoration: underline">Прочитайте полное разглашение риска</a>.<br><br>44 Wall Street, 7th Floor, New York, New York 10005<br />Тел.: (8-10-800-2) 308-10-12 или 1.908.212.3912 | Email: <a href="mailto:russiansupport@forex.com">russiansupport@forex.com</a><br /><a href="javascript:openWin()">Соглашение Клиента</a> | <a href="privacy_policy.html">Политика Конфиденциальности</a> | <a href="risk_warning.html">Предупреждение о Риске</a><br />&copy;' + current_year + ' FOREX.com </span></p>');
}

function writeFooterHome()
{
	document.write('<p align="center"><span class="cellpad2"><sup>1</sup>Повышение кредитного плеча увеличивает риск. Каждая сделка, совершаемая на Forex, является высоко рискованной.<br> Поэтому проведение торговых операций на рынке не рекомендуется каждому. Контракты по спот золоту и серебру не регулируются Законом о товарно-сырьевых биржах США.  <a href="risk_warning.html" style="text-decoration: underline">Прочитайте полное разглашение риска</a>.<br><br>44 Wall Street, 7th Floor, New York, New York 10005<br />Тел.: (8-10-800-2) 308-10-12 или 1.908.212.3912 | Email: <a href="mailto:russiansupport@forex.com">russiansupport@forex.com</a><br /><a href="javascript:openWin()">Соглашение Клиента</a> | <a href="privacy_policy.html">Политика Конфиденциальности</a> | <a href="risk_warning.html">Предупреждение о Риске</a><br />&copy;' + current_year + ' FOREX.com </span></p>');
}


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 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 openTerms() {
window.open("../metatraderuk/ru/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");
}

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");
}