var GoogleAr = new Array("en|de","en|es", "en|fr", "en|it", "en|pt","en|ko","en|ar");
var EctacoAr = new Array("13","12", "19", "6", "8", "22", "3");
var EctacoArIndex = new Array("7","20", "6", "10", "15", "11", "1");

function checkHash(str)
{
	for(var i=0; i<10; i++){
		if(str == hasharray[i]) return true;
	}
	return false;
}

function Killer()
{
	if (self.parent.frames.length != 0)
	if (self.parent.location != document.location){self.parent.location = document.location;}
}

function addbookmark(bookmarkurl,bookmarktitle)
{
	if(document.all && window.external) {window.external.AddFavorite(bookmarkurl,bookmarktitle);}
	else {alert('We are sorry you have to add the bookmark manually yourself.');}
}

function MakeAdSense()
{
	if(myhash != "" && sitehash == ""){self.parent.location = myhash;}
}

function ShowAdSense()
{
	document.write("<" + "script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"><\/script" + ">");
}

function checkdata(formname,hashznak){
	selectlen = eval("document." + formname + ".langpair.length");
	for(var i=0; i<selectlen; i++){
		if(eval("document." + formname + ".langpair.options[i].selected") == true){
			var sprache = eval("document." + formname + ".langpair.options[i].value");
			var selndex = i;
			for(var j=0; j<GoogleAr.length; j++){
				if(GoogleAr[j] == sprache){allE(EctacoArIndex[j]); cook(EctacoAr[j],"ectaco"); break;}
			}
		}
	}
	allF(selndex);
	eval("document." + formname + ".but.focus()");
	cook(sprache,"google");
}

function checkdataEctaco(formname,hashznak){
	selectlen = eval("document." + formname + ".lang.length");
	for(var i=0; i<selectlen; i++){
		if(eval("document." + formname + ".lang.options[i].selected") == true){
			var sprache = eval("document." + formname + ".lang.options[i].value");
			var selndex = i;
			for(var j=0; j<EctacoAr.length; j++){
				if(EctacoAr[j] == sprache){allF(j); cook(GoogleAr[j],"google"); break;}
			}
		}
	}
	allE(selndex);
	eval("document." + formname + ".but.focus()");
	cook(sprache,"ectaco");
}

function allF(selndex){
	for(var k=1; k<11; k++){
		eval("document.f" + k + ".langpair.selectedIndex = " + selndex);
	}
}

function allE(selndex){
	for(var k=1; k<11; k++){
		eval("document.e" + k + ".lang.selectedIndex = " + selndex);
	}
}

function cook(val,flag){
	var ablauf = new Date();
	var infuenfTagen = ablauf.getTime() + (5 * 24 * 60 * 60 * 1000);
	ablauf.setTime(infuenfTagen);
	if(flag == "google"){
		document.cookie = "Language=" + escape(val) + "; expires=" + ablauf.toGMTString() + "; path=/";
	} else {
		document.cookie = "LangEctaco=" + escape(val) + "; expires=" + ablauf.toGMTString() + "; path=/";
	}
}

function blocker(){
alert("Note!\n" + 
"English-test.net is trying to open a pop-up window (content, no advertisement)." + "\n" + 
"Please, check your browser settings and enable pop-up windows." + 
"\n\n" + 
"Help" + "\n" + 
"Netscape 7.1 users" + "\n" + 
"Select 'settings' in the menu 'edit'." + "\n" + 
"Select 'pop-up windows' in 'security settings'." + "\n" + 
"Add 'english-test.net' to the list of 'exceptions...' in 'block pop-ups'." + "\n" + 
"\n" + 
"Users of the Google toolbar" + "\n" + 
"(Click on 'options' in your Goolge Toolbar in order to enable or disable the popup-blocker.)" + "\n" + 
"While the English-test.net site is open, please click on the Button 'pop-ups are blocked', in order to allow pop-ups." + "\n" + 
"(If you click this button once more, English-test.net pop-ups will be blocked again)." + "\n" + 
 "\n" + 
"" + "\n" + 
"" + "\n" + 
"" );
}

function e(str){window.status="Add bookmark for word " + str;}
function shs(w,id) {window.status = w;return true;}
function cls(){window.status='';}
function pop(){window.status='Why link to translation doesn\'t work?';}
function ro(){window.status='Electronic pocket talking dictionaries and Translation Software';}
function rd(){self.location.href = "http://www.english-test.net/translators/"}
function nb(){window.status='Add bookmark';}
function enb(){window.status='Email this test to a friend';}
function eca(){return "Translate";}
