var ToDoWatcher;
function boom(){
//checkFields(document.f.q, document.f, getRadioGroupState('TextCorrGroup'), document.f.SE); 
//doo(f.q);
pl_search(document.f.q, document.f, getRadioGroupState('TextCorrGroup'), document.f.SE);
}
function chk() 
{
enableSubmit(false);
//document.all.ads.height="65";
connector_pl_search(document.f.q,document.f,1);
//checkFields(document.f.q, document.f, getRadioGroupState('TextCorrGroup'), document.f.SE); 

}

function showDiv( id ){ 
 //document.all.textBox1.style.visibility = 'hidden'; 
 //document.all.textBox1.value = ''; 
 //document.all.textBox2.style.visibility = 'hidden'; 
 //document.all.textBox2.value = ''; 
 //document.all.textBox3.style.visibility = 'hidden'; 
 //document.all.textBox3.value = ''; 
 //document.all[ id ].style.visibility = 'visible'; 
 

/////////////////////////////////////////////////////Changed to hide Iface on main
//document.f.ce.style.visibility = 'visible';
 
//document.getElementById('Ilabel').innerHTML='Interface:';

////////////////////////////////////////////////////////////// (Find out why was hidden), removed for now.
// document.all.textBoxAllC.style.visibility= 'visible';


///////////////////////////////////////////
//                Fill the interface
// 
/////////////////////////////////////////////////////Changed to hide Iface on main
//if(id=="textBox1") {fillInterfaceG(); document.f.Iface.options[9].selected=true;}
//if(id=="textBox2") {fillInterfaceY(); document.f.Iface.options[4].selected=true;}
//if(id=="textBox3") {fillInterfaceM(); }

//document.all[ id ].focus(); 
 
}


function showAllCountry (id){

if(id=="textBox1")    //Google
{
fillAllCountry(GC);

	if(getCookie("Gcountry")!=null)
		{       
			document.f.textBoxAllC.options[getCookie("Gcountry")].selected=true;
			/////////////////////////////////////////////////////Changed to hide Iface on main
			//document.f.Iface.options[getCookie("GInterface")].selected=true;
		}
	else document.f.textBoxAllC.options[65].selected=true;
	}
if(id=="textBox2"){    //Yahoo
fillAllCountry(YC);
	
	if(getCookie("Ycountry")!=null)
	{
		document.f.textBoxAllC.options[getCookie("Ycountry")].selected=true;
		//Changed to hide Iface on main
		//document.f.Iface.options[getCookie("YInterface")].selected=true;	
		
	}
	else
	{
	 document.f.textBoxAllC.options[23].selected=true;
	//Changed to hide Iface on main
	//document.f.Iface.options[0].selected=true;
	}
}
if(id=="textBox3") {  //MSN
fillAllCountry(MC);

	if(getCookie("Mcountry")!=null)
		{
			document.f.textBoxAllC.options[getCookie("Mcountry")].selected=true;
			//Changed to hide Iface on main
			//document.f.Iface.options[getCookie("MInterface")].selected=true;
		}
	else 
	{
	document.f.textBoxAllC.options[20].selected=true;
	//Changed to hide Iface on main
	//document.f.Iface.options[4].selected=true;
	}
}
}
//
//                   MAIN SEARCH BLOCK
//
function pl_search(ctrl, form, corrLevel, se)
{
var PL_LN ="en"
ctrl = con_raw_findCtrl(ctrl);
var ctrltxt ="";
ctrltxt=ctrl.value;
var query = "";     
var inter="en"; //document.f.Iface.value;
var engine="";
var loca="";
var cntry="";

if(se[0].checked==true)
  {     ctrltxt=converttog(ctrltxt);
	engine="Google";
	if(theVirk.getLayout()) 
	{
		PL_LN = getLangByKbd_google(theVirk.getLayout());
		if (PL_LN == "ALERT") 
	     	{
			PL_LN = "en";
             	}	
	}
         
	loca='&cr=country'+form.textBoxAllC.value;
	cntry=form.textBoxAllC.value;
	query = 'http://www.google.com/search?';
	query = query + 'lr=lang_' + PL_LN + loca + '&q=' + ctrltxt + '&hl=' + inter + '&ie=UTF-8&oe=UTF-8';
	

  }	
else if(se[2].checked == true)
  {     ctrltxt=converttog(ctrltxt);
	engine="MSN";
	if(theVirk.getLayout()) 
	{
		PL_LN = getLangByKbd_msn(theVirk.getLayout());
		if (PL_LN == "ALERT") 
	     	{
			PL_LN = "en";
             	}	
	}
	
	
	if( form.textBoxAllC.value == '' ) { loca = ''; }
	else loca='loc%3A'+form.textBoxAllC.value + '+';
	cntry=form.textBoxAllC.value;  
	query = 'http://search.msn.com/results.aspx?';
	query = query + 'q=' + loca + 'language%3A' + PL_LN+ '+' + ctrltxt + '&FORM=QBRE' + '&setlang=' + inter;
  }	
else if(se[1].checked == true)
  {     
	engine="Yahoo";
	if(theVirk.getLayout()) {
	  PL_LN = getLangByKbd_yahoo(theVirk.getLayout());
	  if (PL_LN == "ALERT") 
	     {
		PL_LN = "en";
             }	
	}  
	cntry=form.textBoxAllC.value;
	if(inter=="en") inter="";
	if(inter!=""){inter+='.';}
	query = 'http://'+inter+'search.yahoo.com/search?_adv_prop=web&x=op&ei=UTF-8&fr=fp-top';
	query = query + '&va=' + ctrltxt + '&va_vt=any&vp_vt=any&vo_vt=any&ve_vt=any&vd=all&vst=0&vf=all&vm=i&vc=country' + form.textBoxAllC.value ;
	if(PL_LN == "formersovietunion" ){ PL_LN = "ru";} 
	query = query + '&fl=1&vl=lang_' + PL_LN + '&n=10';
  }	
href = query;
session = {form:form, ctrltxt:ctrltxt}
form.text=query;


loadIframe('logger', 'http://search.imtranslator.net/logger.asp?query='+encodeURIComponent(ctrl.value)+'&engine=' + engine+'&lang='+PL_LN+'&iface='+inter+'&country='+cntry);

enableSubmit();

if(!DoTranslation)
{
	return loadIframe('searchRes', query);
}
else
{ 
	return WebT(query);
}
}


////////////////////////////////////////////////////////
//                   CLIENT's DATA ORGANIZER
//
////////////////////////////////////////////////////////
function SendToDB()
{
SCREEN = screen.width + "x" + screen.height;
if (navigator.javaEnabled()) JAVA="Yes";
else JAVA="No";
COLOR = window.screen.colorDepth;
BCN = navigator.appCodeName;
OS = navigator.platform;
NAVIGATOR = navigator.appName;
REFF = document.referrer;
VERSION = navigator.appVersion;
if (navigator.appName == 'Netscape')
    var language = navigator.language;
else
    var language = navigator.browserLanguage;
var LNCODE = language.substring(0,2);


var userAgent = navigator.userAgent.toLowerCase ();
this.ie6SP2   = (userAgent.indexOf("sv1") != -1)
    if(this.ie6SP2)
	PUBLOCKER = "Yes";
    else	
	PUBLOCKER = "No";


loadIframe('logger', 'http://search.imtranslator.net/logger.asp?REFF=' + REFF + '&SCREEN=' + SCREEN + '&JAVA=' + JAVA + '&COLOR=' + COLOR + '&BCN=' + BCN + '&OS=' + OS + '&NAVIGATOR=' + NAVIGATOR + '&VERSION=' + VERSION + '&LNCODE=' + LNCODE + '&PUBLOCKER=' + PUBLOCKER);
}
////////////////////////////////////////////////////////



function getLangByKbd_google(kbd)
{ 
  switch(kbd)
  {
    case "ar" :
      return "ar";
    case "bl" :
      return "bl";
    case "bu" :
      return "bg";
    case "ca" :
      return "fr";
    case "ce" :
      return "ce";
    case "cz" :
      return "cs";
    case "dn" :
      return "da";
    case "et" :
      return "et";
    case "fn" :
      return "fi";
    case "hu" :
      return "hu";
    case "ic" :
      return "is";
    case "du" :
      return "nl";
    case "el" :
      return "el";
    case "gk" :
      return "gk";
    case "gr" :
      return "gr";
    case "fr" :
      return "fr";
    case "fr-CH" :
      return "fr";
    case "de" :
      return "de";
    case "de-CH" :
      return "de";
    case "lv" :
      return "lv";
    case "lt" :
      return "lt";
    case "no" :
      return "no";
    case "pl" :
      return "pl";
    case "ro" :
      return "ro";
    case "sl" :
      return "sk";
    case "sn" :
      return "sl";
    case "sw" :
      return "sv";
    case "he" :
      return "iw";
    case "it" :
      return "it";
    case "po" :
      return "pt";
    case "ru" :
    case "ru-TR" :
      return "ru";
    case "es" :
      return "es";
    case "tr" :
      return "tr";
    case "ur" :
    case "ut" :
      return "uk";
    case "us" :
    case "en" :
    case "en-DV" :
      return "en";
    
    default : return "ALERT";
    }
}


function getLangByKbd_msn(kbd)
{ 
  switch(kbd)
  {
    case "ar" :
      return "ar";
    case "bu" :
      return "bg";
   case "ca" :
      return "fr";
   case "cz" :
      return "cs";
   case "dn" :
      return "da";
   case "et" :
      return "et";
   case "fn" :
      return "fi";
   case "hu" :
      return "hu";
   case "ic" :
      return "is";
    case "du" :
      return "nl";
   case "de" :
   case "de-CH" :
      return "de"; 
    case "us" :
    case "dv" :
    case "en" :
    case "en-DV" :
      return "en";
    case "fa" :
      return "fa";
    case "fr" :
    case "fr-CH" :
      return "fr";
    case "el" :
      return "el";
    case "lv" :
      return "lv";
    case "lt" :
      return "lt";
    case "no" :
      return "nb";
    case "pl" :
      return "pl";
    case "po" :
      return "pt";
    case "sl" :
      return "sk";
    case "sn" :
      return "sl";
    case "sw" :
      return "sv";
    case "he" :
      return "he";
    case "it" :
      return "it";
    case "ro" :
      return "ro";
    case "tr" :
      return "tr";
    case "ru" :
    case "ru-TR" :
      return "ru";
    case "es" :
      return "es";
    default : return "ALERT";
    }
}

function getLangByKbd_yahoo(kbd)
{ 
  switch(kbd)
  {
    case "ar" :
      return "ar";
case "bu" :
      return "bg";
case "cz" :
      return "cs";
    case "ca" :
      return "fr";
case "dn" :
      return "da";
case "et" :
      return "et";
case "fn" :
      return "fi";
case "hu" :
      return "hu";
case "ic" :
      return "is";
case "du" :
      return "nl";
case "de" :
case "de-CH" :
      return "de";
case "el" :
      return "el";
case "he" :
      return "iw";
case "lv" :
      return "lv";
case "lt" :
      return "lt";
case "no" :
      return "no";
case "pl" :
      return "pl";
case "po" :
      return "pt";
case "ro" :
      return "ro";
case "sl" :
      return "sk";
case "sn" :
      return "sl";
case "sw" :
      return "sv";
case "tr" :
      return "tr";
case "gr" :
      return "de";
case "fr" :
case "fr-CH" :
      return "fr";
case "it" :
      return "it";
case "ru" :
case "ru-TR" :
case "ur" :
case "ut" :
      return "formersovietunion";
case "es" :
      return "es";
case "us" :
case "en-DV" :
case "en" :
      return "en";
default : return "ALERT";
    }
}

function con_raw_findCtrl (name, doc) {
	if (typeof (name) != "string") 
	{
       		return name;
   	}
	
	if(!doc)
		doc = document;
   		var forms = doc.forms;
   
		for (var i = 0; i < forms.length; i++) 
		{
      			var ctrl = forms [i] [name];
      			if (ctrl)
         		return ctrl;
   		}

   
		for(i = 0; i <doc.frames.length; i++) 
		{
   			var frame = doc.frames[i].document;
			var fr_ctrl =  con_raw_findCtrl(name, frame);
			if (fr_ctrl)
        	 	return fr_ctrl;
   		}
   	return null;
}    
    
function loadIframe(iframeName, url) 
{
  	if ( window.frames[iframeName] ) {

    		window.frames[iframeName].location = url;   
    		//sf();
    		return false;
  	}
  	else return true;
}
function getIframe(iframeName) {
if ( window.frames[iframeName] ) 
	{
	return window.frames[iframeName].location;
	}
    
}    
<!--


var corrLevel = 0;
function onClickCheckboxWithRadioGroup(obj, groupName )
{
	obj.value = (obj.value == "yes" ? "no": "yes");
	var radioGroup = document.getElementsByName(groupName);
	
	for(var i=0; i < radioGroup.length; i++) 
	{
		radioGroup[i].disabled = (obj.value == "yes" ? false : true);
	}
}
	
	function getRadioGroupState(groupName)
	{
		var radioGroup = document.getElementsByName(groupName);
	 	for(var i=0; i < radioGroup.length; i++) 
		{
	  	if(!radioGroup[i].disabled && radioGroup[i].checked)
	    	return i + 1;
		} 
	  return 0;
	}

function sf() {document.f.q.focus();}
function c(addr,c1,c2) {document.location.href=addr;}

function checkSE(ctrl, form, corrLevel, se) {
missinginfo = "";
if (document.f.SE[0].checked == false && document.f.SE[1].checked == false && document.f.SE[2].checked == false ) 
{
        document.getElementById('SearchEngine').style.visibility = "visible";   
	return false;
}
else if(document.f.q.value=="") 
{

document.getElementById('EmptyTextField').style.visibility = "visible";
//document.ETF.d2.value='5'; 
document.getElementById('d2').value=5;
display();
}
else doo(f.q);
}

function checkFields(ctrl, form, corrLevel, se) {
missinginfo = "";
if (document.f.SE[0].checked == false && document.f.SE[1].checked == false && document.f.SE[2].checked == false ) 
	{
   		missinginfo += "\n     -  Search engine";
	}

if (document.f.q.value=="") 
	{
   		missinginfo += "\n     -  Search criteria";
	}
if (missinginfo != "") 
	{
		//document.getElementById('SearchEngine').style.visibility = "visible";   
		return false;
	}

else
{
	var d=new Date();
	d.setFullYear(2020);
	
	if(document.f.SE[0].checked)
	{
        	setCookie("Gcountry",document.f.textBoxAllC.selectedIndex,d);
		//Changed to hide Iface on main
		//setCookie("GInterface",document.f.Iface.selectedIndex,d);
		setCookie("Engine",0,d);
        }

	else if(document.f.SE[2].checked)
	{
		setCookie("Mcountry",document.f.textBoxAllC.selectedIndex,d);
		//Changed to hide Iface on main
		//setCookie("MInterface",document.f.Iface.selectedIndex,d);
		setCookie("Engine",2,d);

	}
	else if(document.f.SE[1].checked)
	{
		setCookie("Ycountry",document.f.textBoxAllC.selectedIndex,d);
		//Changed to hide Iface on main
		//setCookie("YInterface",document.f.Iface.selectedIndex,d);
		setCookie("Engine",1,d);

	}
	
 
pl_search(ctrl, form, corrLevel, se);
return true;
}
}

/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
function setCookie(name, value, expires, path, domain, secure)
{
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}
//
// Deletes the specified cookie.
//
// name      name of the cookie
// [path]    path of the cookie (must be same as path used to create cookie)
// [domain]  domain of the cookie (must be same as domain used to create cookie)
//
function deleteCookie(name, path, domain)
{
    if (getCookie(name))
    {
        document.cookie = name + "=" + 
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}

var GIface = [ 
"Arabic",                "AR",
"Bulgarian",             "bg",
"Catalan",               "ca",
"Chinese(Simple)",       "zh-CN",
"Chinese(Traditional)",  "zh-TW",
"Croatian",              "hr",
"Chech",                 "cs",
"Danish",                "da",
"Dutch",                 "nl",
"English",               "en",
"Estonian",              "et",
"Farsi",                 "fa",
"Finnish",               "fi",
"Frensh",                "fr",
"German",                "de",
"Greek",                 "el",
"Hebrew",                "iw",
"Hungarian",             "hu",
"Icelandic",             "is",
"Indonesian",            "id",
"Italian",               "it",
"Japanese",              "ja",
"Korean",                "ko",
"Latvian",               "lv",
"Lithuanian",            "lt",
"Norwegian",             "no",
"Polish",                "pl",
"Portuguese",            "pt",
"Romanian",              "ro",
"Russian",               "ru",
"Serbian",               "sr",
"Slovak",                "sk",
"Slovenian",             "sl",
"Spanish",               "es",
"Swedish",               "sv",
"Turkish",               "tr",
];

var YIface = [
"English", 		"",
"French",		"fr",
"German",		"de",
"Icelandic",		"uk",
"Italian",		"it",
"Korean",		"kr",
"Norwegian",		"no",
"Spanish",		"espanol",
"Swedish",		"se",
];

var MIface = [
"Chinese",     	"zh-CN",
"Czech",       	"cs-CZ",
"Danish",      	"da-DK",
"Dutch", 	"nl-NL",
"English", 	"en-US",
"Estonian", 	"et-EE",
"Finnish", 	"fi-FI",
"French", 	"fr-FR",
"German", 	"de-DE",
"Greek", 	"el-GR",
"Hungarian", 	"hu-HU",
"Italian", 	"it-IT",
"Japanesee", 	"ja-JP",
"Korean", 	"ko-KR",
"Latvian", 	"lv-LV",
"Lithuaninan", 	"lt-LT",
"Norwegian", 	"nb-NO",
"Polish", 	"pl-PL",
"Portuguese", 	"pt-BR",
"Romanian", 	"ro-RO",
"Russian", 	"ru-RU",
"Slovak", 	"sk-SK",
"Slovenian", 	"sl-SI",
"Spanish", 	"es-US",
"Swedish", 	"sv-SE",
"Turkish", 	"tr-TR",

];
var GC = [
"Argentina",	"AR",
"Armenia",	"AM",
"Australia",	"AU",
"Austria",	"AT",
"Belarus",	"BY",
"Belgium",	"BE",
"Bolivia",	"BO",
"Brazil",	"BR",
"Bulgaria",	"BG",
"Canada",	"CA",
"Chile",	"CL",
"China",	"CH",
"Colombia",	"CO",
"Costa Rica",	"CR",
"Croatia",	"HR",
"Cuba",		"CU",
"Check Republic","CZ",
"Denmark",	"DK",
"Ecuador",	"EC",
"Estonia",	"EE",
"Finland",	"FI",
"France",	"FR",
"Germany",	"DE",
"Great Britain","GB",
"Greece",	"GR",
"Hong Kong",	"HK",
"Hungary",	"HU",
"Iceland",	"IS",
"India",	"IN",
"Israel",	"IL",
"Italy",	"IT",
"Japan",	"JP",
"Kazakhstan",	"KZ",
"Kyrgyzstan",	"KG",
"Latvia",	"LV",
"Lithuania",	"LT",
"Luxembourg",	"LU",
"Malaysia",	"MY",
"Malta",	"MT",
"Mexico",	"MX",
"Netherlands",	"NL",
"New Zealand",	"NZ",
"Norway",	"NO",
"Panama",	"PA",
"Pakistan",	"PK",
"Peru",		"PE",
"Philippines",	"PH",
"Poland",	"PL",
"Portugal",	"PT",
"Romania",	"RO",
"Russia",	"RU",
"Saudi Arabia",	"SA",
"Singapore", 	"SG",
"Slovakia",	"SK",
"Slovenika",	"SI",
"South Africa",	"ZA",
"South Korea",	"KR",
"Spain",	"ES",
"Sweden",	"SE",
"Switzerland",	"CH",
"Taiwan",	"TW",
"Thailand",	"TH",
"Turkey",	"TR",
"Ukrain",	"UA",
"United Kingdom","UK",
"United States","US",
"Uruguay",	"UY",
"Venezuela",	"VE",
"Vietnam",	"VN",
];

var MC = [
"Austria",	"AT",
"Australia",	"AU",
"Belgium",	"BE",
"Canada",	"CA",
"Switzerland",	"CH",
"Germany",	"DE",
"Denmark",	"DK",
"Spain",	"ES",
"Finland",	"FI",
"France",	"FR",
"United Kingdom","GB",
"India",	"IN",
"Italy",	"IT",
"Japan",	"JP",
"Malaysia",	"MY",
"Netherlands",	"NL",
"Norway",	"NO",
"New Zealand",	"NZ",
"Sweden",	"SE",
"Singapore",	"SG",
"United States","US",

];

var YC= [
"Austria",	"AT",
"Australia",	"AU",
"Belgium",	"BE",
"Brazil",	"BR",
"Canada",	"CA",
"Switzerland",	"CH",
"China",	"CN",
"Check Republic","CZ",
"Germany",	"DE",
"Denmark",	"DK",
"Spain",	"ES",
"Finland",	"FI",
"Russia",	"formersovietunion",
"France",	"FR",
"Italy",	"IT",
"Japan",	"JP",
"Korea",	"KR",
"Netherlands",	"NL",
"Norway",	"NO",
"Poland",	"PL",
"Sweden",	"SE",
"Taiwan",	"TW",
"United Kingdowm","UK",
"United States","US",

];
var BrowserOffset=0;
var browserName=navigator.appName; 

if (browserName=="Netscape") { BrowserOffset=0; }
else 
{ 
 if (browserName=="Microsoft Internet Explorer") { BrowserOffset=1; }
 else  { BrowserOffset=0; }
}

t=0;
function fillInterfaceG()
{
t=0;
	for(i=0;i<GIface.length;i++)     //Clearing Select
	{
		document.f.Iface.options[0]= null;
	}
	for(i=0;i<(GIface.length/2-BrowserOffset);i++) //Filling Select
	{
		
		document.f.Iface.options[i] = new Option( GIface[i+t],GIface[i+1+t] );
		
	        t++;
		
	}
}
function fillInterfaceM()
{
t=0;

	for(i=0;i<GIface.length;i++)
	{
		document.f.Iface.options[0]= null;
	}
	for(i=0;i<(MIface.length/2-BrowserOffset);i++) //Filling Select
	{
		
		document.f.Iface.options[i] = new Option( MIface[i+t],MIface[i+1+t] );
		
	        t++;
		
	}
}
function fillInterfaceY()
{
t=0;

	for(i=0;i<GIface.length;i++)
	{
		document.f.Iface.options[0]= null;
	
	}
	for(i=0;i<(YIface.length/2-BrowserOffset);i++) //Filling Select
	{
		
		document.f.Iface.options[i] = new Option( YIface[i+t],YIface[i+1+t] );
		
	        t++;
		
	}


	
}
function fillAllCountry(which)
{
t=0;    
 	for(i=0;i<GC.length;i++)
	{
		document.f.textBoxAllC.options[0]= null;
	}
	for(i=0;i<(which.length/2-BrowserOffset);i++) //Filling Select
	{
		
		document.f.textBoxAllC.options[i] = new Option( which[i+t],which[i+1+t] );
		
	        t++;
		
	}	



}

function kbdLangChange( l ) {

alert("got language: "+l);

}

function SandT()
{
DoTranslation=1;
connector_pl_search(document.f.q,document.f,1);
//if(srcLang[document.f.srclang.options[document.f.srclang.selectedIndex].value].name == "English" && 
//tgtLang[document.f.tgtlang.options[document.f.tgtlang.selectedIndex].value].name == "Italian")
//{

//var temp = getIframe("searchRes");
//loadIframe('searchRes', 'http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=en_it&trurl='+temp);
//}


//if( document.f.srcLang.value = English )
//http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=en_it&trurl=
}	


function WebT(go2)
{
DoTranslation=0;

var fdir,tdir;

switch(srcLang[document.f.srclang.options[document.f.srclang.selectedIndex].value].name)
{
case "English" :
	fdir="en";break;
case "Russian" :
        fdir="ru";break;
case "French" :
	fdir="fr";break;
case "German" :
	fdir="de";break;
case "Italian" :
	fdir="it";break;
case "Spanish" :
	fdir="es";break;
case "Portuguese" :
	fdir="pt";break;
case "Chinese (Simplified)" :
	fdir="zh-CN";break;
case "Korean" :
	fdir="kr";break;
case "Chinese (Traditional)" :
	fdir="zh-TR";break;
case "Dutch" :
	fdir="nl";break;
case "Greek" :
	fdir="el";break;
case "Japanese" :
	fdir="jp";break;
case "Norwegian" :
	fdir="no";break;
default: break;
}

switch(tgtLang[document.f.tgtlang.options[document.f.tgtlang.selectedIndex].value].name)
{
case "English" :
	tdir="en";break;
case "Russian" :
        tdir="ru";break;
case "French" :
	tdir="fr";break;
case "German" :
	tdir="de";break;
case "Italian" :
	tdir="it";break;
case "Spanish" :
	tdir="es";break;
case "Portuguese" :
	tdir="pt";break;
case "Chinese (Simplified)" :
	tdir="zh-CN";break;
case "Korean" :
	tdir="kr";break;
case "Chinese (Traditional)" :
	tdir="zh-TR";break;
case "Dutch" :
	tdir="nl";break;
case "Greek" :
	tdir="el";break;
case "Japanese" :
	tdir="jp";break;
case "Norwegian" :
	tdir="no";break;
default: break;
}

if(ServerSelection==0)
	WebTPromt(go2,fdir,tdir); 
else if(ServerSelection==1)
	WebTGoogle(go2,fdir,tdir);        
else if(ServerSelection==2)
	WebTAltavista(go2,fdir,tdir);


}

function WebTPromt(go2,from,to)
{
alert(go2);
//document.f.waiter.innerhtml="http://services.imtranslator.net/multisearch/wait..bmp";
//alert("entered promt, going to open :"+'http://webtranslation.paralink.com/webtarget.asp?clientid=default&appid=ImTranslator&dir=' +from+ '/' + to +'&dic=general&extsvr=&auto=1&url='+go2);
//http://webtranslation.paralink.com/webtarget.asp?clientid=default&appid=ImTranslator&dir=en/ru&dic=general&extsvr=&auto=1&url=
//loadIframe('searchRes', 'http://services.imtranslator.net/multisearch/wait.htm');
//return loadIframe('searchRes', 'http://webtranslation.paralink.com/webtarget.asp?clientid=default&appid=ImTranslator&dir=' +from+ '/' + to +'&dic=general&extsvr=&auto=1&url='+go2);
return loadIframe('searchRes', 'http://services.imtranslator.net/webtarget.asp?clientid=default&appid=ImTranslator&dir=' +from+ '/' + to +'&dic=general&extsvr=&auto=1&url='+go2);
}

function WebTGoogle(go2,from,to)
{
//alert("entered google, going to : "+ 'http://216.239.37.104/translate_c?hl=en&ie=UTF-8&oe=UTF-8&langpair='+ from+'%7C'+to+'&u='+go2+'prev=/language_tools');

//alert(go2);
go2=go2.replace(/:/gi,"%3A");
go2=go2.replace(/\//gi,"%2F");
go2=go2.replace(/\?/gi,"%3F");
go2=go2.replace(/\=/gi,"%3D");
go2=go2.replace(/\&/gi,"%26");
//alert(go2);
//http://216.239.37.104/translate_c?hl=en&ie=UTF-8&oe=UTF-8&langpair=en%7Ces&u=http://www.google.com/imghp%3Fhl%3Den%26tab%3Dwi&prev=/language_tools
return loadIframe('searchRes', 'http://216.239.39.104/translate_c?hl=en&ie=UTF-8&oe=UTF-8&langpair='+ from+'%7C'+to+'&u='+go2+'prev=/language_tools');
}
function WebTAltavista(go2,from,to)
{
alert("entered altavista!");
//http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=en_fr&trurl=http%3a%2f%2fwww.google.com%2fimghp%3fhl%3den%26tab%3dwi
go2=go2.replace(/:/gi,"%3A");
go2=go2.replace(/\//gi,"%2F");
go2=go2.replace(/\?/gi,"%3F");
go2=go2.replace(/\=/gi,"%3D");
go2=go2.replace(/\&/gi,"%26");
alert(go2);
return loadIframe('searchRes', 'http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp='+ from+ '_' + to+'&trurl='+go2);
}

function autospellclick()
{
//if(document.f.autospell.value=='ON')
}
function loadsettings()
{

if(getCookie("Engine")!=null)
	{
	
	if(getCookie("Engine") == 0)
		{
		document.f.SE[0].checked=true;
showDiv( 'textBox1' ); showAllCountry ( 'textBox1' );
		document.f.SE[0].value='1'; document.f.SE[1].value='0'; document.f.SE[2].value='0';
		}
	if(getCookie("Engine") == 1)
		{
		document.f.SE[1].checked=true;
showDiv( 'textBox2' ); showAllCountry ( 'textBox2' );
		document.f.SE[1].value='2'; document.f.SE[0].value='0'; document.f.SE[2].value='0';
		}
	if(getCookie("Engine") == 2)
		{
		document.f.SE[2].checked=true;
showDiv( 'textBox3' ); showAllCountry ( 'textBox3' );
		showAllCountry ( 'textBox3' );document.f.SE[2].value='3'; document.f.SE[0].value='0'; document.f.SE[1].value='0';
		}
	
	}

else 
{
//  THIS REMOVES CHECKS ON SEARCH ENGINE SELECTS
//document.f.SE[0].checked=false;
//document.f.SE[1].checked=false;
//document.f.SE[2].checked=false;


//document.f.SE[0].checked=true;
//showDiv( 'textBox1' ); showAllCountry ( 'textBox1' );
//		document.f.SE[0].value='1'; document.f.SE[1].value='0'; document.f.SE[2].value='0';
}

}

var Gconv = [
"1072", "%D0%B0",
"1073", "%D0%B1",
"1074", "%D0%B2",
"1075", "%D0%B3",
"1076", "%D0%B4",
"1077", "%D0%B5",
"1078", "%D0%B6",
"1079", "%D0%B7",
"1080", "%D0%B8",
"1081", "%D0%B9",
"1082", "%D0%BA",
"1083", "%D0%BB",
"1084", "%D0%BC",
"1085", "%D0%BD",
"1086", "%D0%BE",
"1087", "%D0%BF",
"1088", "%D1%80",
"1089", "%D1%81",
"1090", "%D1%82",
"1091", "%D1%83",
"1092", "%D1%84",
"1093", "%D1%85",
"1094", "%D1%86",
"1095", "%D1%87",
"1096", "%D1%88",
"1097", "%D1%89",
"1098", "%D1%8A",
"1099", "%D1%8B",
"1100", "%D1%8C",
"1101", "%D1%8D",
"1102", "%D1%8E",
"1103", "%D1%8F",
"1105", "%D1%91",
];


function converttog(inn)
{
//alert("Entered string: "+inn);
var te=encodeURIComponent(inn);
//alert("URI: "+ te);
return te;


alert("going through normal conversion");
var temp="";
var success=0;
for(var i=0;i<inn.length;i++)
{
	for(var t=0;t<Gconv.length;t=t+2)
	{
		if(inn.charCodeAt(i)==Gconv[t])
		{
		temp+=Gconv[t+1];
		success=1;
		break;
		}
		

	}
if(success==0){
temp+=inn.charAt(i);
//alert("not replaceing "+inn.charAt(i)+"inn.charCodeAt(i) is "+ inn.charCodeAt(i));
}
success=0;
}

//alert(temp);
return temp;
}


var lang1="";
function noSPLR()
{
checkFields(document.f.q, document.f, getRadioGroupState('TextCorrGroup'), document.f.SE); 
}

function SPLR(){
    
if(getCookie("GOAWAY")!=1){
var TEXT_MSG_SPELL_ERRORS = "There are spelling errors in the text to be translated. \n\nWould you like to invoke Spelling Dialog to correct them? \nIf yes press OK. \n\nIf you want to continue translation without corrections press CANCEL.";
var TEXT_MSG_CONTINUE_TR = "Would you like to continue translation?";
document.getElementById('speller_Ok').style.visibility = "visible";
}
else
invokeSpeller ('q' , 'lang='+lang1+ '&dic=Normal'); 
}

function doo(qw)
{
var d=new Date();
	d.setFullYear(2020);
	
	if(document.f.SE[0].checked)
	{
        	setCookie("Gcountry",document.f.textBoxAllC.selectedIndex,d);
		//Changed to hide Iface on main
		//setCookie("GInterface",document.f.Iface.selectedIndex,d);
		setCookie("Engine",0,d);
        }

	else if(document.f.SE[2].checked)
	{
		setCookie("Mcountry",document.f.textBoxAllC.selectedIndex,d);
		//Changed to hide Iface on main
		//setCookie("MInterface",document.f.Iface.selectedIndex,d);
		setCookie("Engine",2,d);

	}
	else if(document.f.SE[1].checked)
	{
		setCookie("Ycountry",document.f.textBoxAllC.selectedIndex,d);
		//Changed to hide Iface on main
		//setCookie("YInterface",document.f.Iface.selectedIndex,d);
		setCookie("Engine",1,d);

	}

enableSubmit(false);
if (navigator.appName == 'Netscape')	document.all.ads.height="62";
else                                    document.all.ads.height="60";

var todo="";

if(!document.getElementById('autodecode').disabled && document.getElementById('autodecode').checked)
todo+="decode";

if(!document.getElementById('autospell').disabled && document.getElementById('autospell').checked)
todo+=" check";


if(theVirk.getLayout()) 

{
lang1=theVirk.getLayout();	
        
	switch(lang1)
	{
	case "ru-TR":
	case "ru": lang1="ru";break;
	case "fr":
	case "fr-CH":
	case "ca": lang1="fr";break;
	case "de": 
	case "de-CH": lang1="de";break;
	case "uk":
	case "uk-TR": lang1="uk";break;
	case "it": lang1="it";break;
	case "po": lang1="pt";break;
	case "es": lang1="es";break
	case "en-DV": lang1="en";break;

	
	
	default: lang1="en"; 
	}



}
else 
lang1="en";

loadIframe('tt', 'http://search.imtranslator.net/t.asp?q=' + qw.value + '&actions='+todo +'&dir='+lang1);
}

var POPUPchecker=0;

function TODO(whatToDo, styleName){
if(whatToDo == "Ok") 	
	{
		document.getElementById(styleName).style.visibility = "hidden";   
		//document.f.MSG.value=0;
		POPUPchecker=1;
		var user_Agent = navigator.userAgent.toLowerCase ();
		
		this.ie6SP2   = (user_Agent.indexOf("sv1") != -1)
    		if(this.ie6SP2){
		
		//	document.getElementById('Popupmsg').style.visibility = "visible";   
		}
		
		invokeSpeller ('q' , 'lang='+lang1+ '&dic=Normal'); 
		//alert(POPUPchecker);
		checkPOPUP();
		
	}
else
{
 	document.getElementById(styleName).style.visibility = "hidden";   
	// document.f.MSG.value=1;
	checkFields(document.f.q, document.f, getRadioGroupState('TextCorrGroup'), document.f.SE); 
 }
}


function spellerOPENED()
{
 POPUPchecker=2;
}

function checkPOPUP(){

if(POPUPchecker==2) 
	{
		POPUPchecker=0;
	}
else
	{
	if(navigator.appName!="Netscape"){
		//document.getElementById('Popupmsg').style.visibility = "visible";   
		//alert("Your Pop up blocker is activated. If you wish to use our services please put Multilingual Search on your list of allowed sites.");
	}

        POPUPchecker=0;
	}

}

function hidediv()
{
if(document.getElementById('GOAWAY').checked==true) {
var d=new Date();
d.setFullYear(2035);
setCookie("GOAWAY",1,d);
document.getElementById('speller_Ok').style.visibility = "hidden";   
invokeSpeller ('q' , 'lang='+lang1+ '&dic=Normal'); 
}
}                                   0