
var arrURLs = new Array;

arrURLs[0] = "de"; // German
arrURLs[1] = "fr"; // French
arrURLs[2] = "it"; // Italian
arrURLs[3] = "es"; // Spanish
arrURLs[4] = "pt"; // Portuguese
arrURLs[5] = "nl"; // Dutch
arrURLs[6] = "zh"; // Chinese-simp
arrURLs[7] = "zt"; // Chinese-trad
arrURLs[8] = "el"; // Greek
arrURLs[9] = "ja"; // Japanese
arrURLs[10] = "ko"; // Korean


function lngSelect_onchange()
{
	var iLang = lngSelect.selectedIndex;
	
//////////	
	var strPage = document.location.href;
	
	if(strPage.lastIndexOf("mac_keylogger.html") != -1 && iLang == 4) // ES
	{
		document.location = "mac_keylogger_spanish.html";
		return;
	}

	if(strPage.lastIndexOf("mac_keylogger_spanish.html") != -1) // ES
	{
		document.location = "mac_keylogger.html";
		return;
	}

	if(strPage.lastIndexOf("buy_keylogger_for_mac.html") != -1 && iLang == 4) // ES
	{
		document.location = "buy_keylogger_for_mac_spanish.html";
		return;
	}

	if(strPage.lastIndexOf("buy_keylogger_for_mac_spanish.html") != -1) // ES
	{
		document.location = "buy_keylogger_for_mac.html";
		return;
	}

	if(strPage.lastIndexOf("mac_keylogger.html") != -1 && iLang == 1) // DE
	{
		document.location = "mac_keylogger_german.html";
		return;
	}

	if(strPage.lastIndexOf("mac_keylogger_german.html") != -1)
	{
		document.location = "mac_keylogger.html";
		return;
	}

	if(strPage.lastIndexOf("buy_keylogger_for_mac.html") != -1 && iLang == 1) // DE
	{
		document.location = "buy_keylogger_for_mac_german.html";
		return;
	}
    

	if(strPage.lastIndexOf("buy_keylogger_for_mac.html") != -1 && iLang == 1) // DE
	{
		document.location = "buy_keylogger_for_mac_german.html";
		return;
	}

	if(strPage.lastIndexOf("buy_keylogger_for_mac_german.html") != -1) // DE
	{
		document.location = "buy_keylogger_for_mac.html";
		return;
	}
	
	if(strPage.lastIndexOf("orderbpk.html") != -1 && iLang == 1) // DE
	{
		document.location = "orderbpk_german.html";
		return;
	}

	if(strPage.lastIndexOf("orderbpk_german.html") != -1) // DE
	{
		document.location = "orderbpk.html";
		return;
	}
    
    if(strPage.lastIndexOf("bpk.html") != -1 && iLang == 1) // DE
	{
		document.location = "bpk_german.html";
		return;
	}
    
    if(strPage.lastIndexOf("bpk_german.html") != -1) // DE
	{
		document.location = "bpk.html";
		return;
	}

    if(strPage.lastIndexOf("orderbpk.html") != -1 && iLang == 1) // DE
	{
		document.location = "orderbpk_german.html";
		return;
	}

	if(strPage.lastIndexOf("orderbpk_german.html") != -1) // DE
	{
		document.location = "orderbpk.html";
		return;
	}
    
    if(strPage.lastIndexOf("bpk.html") != -1 && iLang == 4) // ES
	{
		document.location = "bpk_spanish.html";
		return;
	}
    
    if(strPage.lastIndexOf("bpk_spanish.html") != -1) // ES
	{
		document.location = "bpk.html";
		return;
	}
    
    if(strPage.lastIndexOf("mac_keylogger.html") != -1 && iLang == 3) // IT
	{
		document.location = "mac_keylogger_italian.html";
		return;
	}

	if(strPage.lastIndexOf("mac_keylogger_italian.html") != -1) // IT
	{
		document.location = "mac_keylogger.html";
		return;
	}

	if(strPage.lastIndexOf("buy_keylogger_for_mac.html") != -1 && iLang == 3) // IT
	{
		document.location = "buy_keylogger_for_mac_italian.html";
		return;
	}

	if(strPage.lastIndexOf("buy_keylogger_for_mac_italian.html") != -1) // IT
	{
		document.location = "buy_keylogger_for_mac.html";
		return;
	}

		

	if(iLang == 0) return;

//////////

	var answer = confirm("The translation to other languages will be made automatically with Babelfish web service, and it can be low quality. Do you want to proceed?\n\n" +
	"Attention: do not place your orders from the translated pages - that won't work. Use english version only to purchase from our site!")
	
	if (answer)
	{
		document.location.href="http://babelfish.yahoo.com/translate_url?doit=done&tt=url&intl=1&fr=bf-res&trurl=" +
		escape(document.location.href) + "&lp=en_" + arrURLs[lngSelect.selectedIndex - 1] + "&btnTrUrl=Translate";
	}
	
	
}
