var border_active="incell activetext";
var border_passive="incell";
var textcolor_active="#000000";
var textcolor_passive="#1C4B8E";
var textcolor_disabled="#8494B8";

var urlAddress = "http://freetranslation.paralink.com"; 
var pageName = "The Best Online Translation"; 


function copyPasteMsg(){
	if(navigator.userAgent.indexOf("MSIE") == -1) {
		document.getElementById('divalert').style.display = "block";
		document.getElementById('divalert').style.left = (document.body.clientWidth-350)/2;
		document.getElementById('divalertcontent').innerHTML = "<span class='text'>Your browser does not allow access to your computer's clipboard. Instead, please use Ctrl-C for Copy, Ctrl-X for Cut and Ctrl-V for Paste, or use Edit menu above the browser toolbar.</span><br>";
	}	
}

function divAlertClose(){
var d = document.getElementById('divalert');
var dc = document.getElementById('divalertcontent');
dc.innerHTML="";
d.style.display="none";
}


function SRC_COOKIE(name, path, domain, secure){
	value = window.frames['source'].document.form.text.value;
	var SEC = 60; // The time to keep the source information in seconds.
	var expires = new Date();
	expires.setTime(expires.getTime() + (1000 * SEC));
	document.cookie= name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
}

function setCookie(name, value, expires, path, domain, secure)
{
if(!expires){
	var d=new Date();
	d.setFullYear(2020);
	expires = d;
}

    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

function addToFavorites() { 
  if (window.external) 
	{ window.external.AddFavorite(urlAddress,pageName) 
	} else { alert("Sorry! Your browser doesn't support this function."); } 
}

var urlAddress = "http://freetranslation.paralink.com"; 
var pageName = "The Best Online Translation"; 
function addToFavorites() { 
  if (window.external) 
	{ window.external.AddFavorite(urlAddress,pageName) 
	} else { alert("Sorry! Your browser doesn't support this function."); } 
}

function LINK(){
if(document.form.provider.value == "PROMT")
	lk = "http://www.e-promt.com"; 
else
	lk = "http://altavista.com";
var targetwindow = eval(window.open(lk));
if (!targetwindow) { alert(TEXT_MSG_POPUP); }
}


function Loader2(root,clientid,dimn,PX,z,m,form,dir,loc){
 document.location.href = root+"?loc="+loc+"&clientid="+clientid+"&dimn="+dimn+"&PX="+PX+"&z="+z+"&m="+m+"&text="+form+"&dir="+dir;
}


function StartRedir(){
 text = window.frames['source'].document.form.text.value;

 dir = document.go2.moredirs.options[document.go2.moredirs.selectedIndex].value;
 var submitForm = getNewSubmitForm();
 createNewFormElement(submitForm, "text", encodeURI(text));
 createNewFormElement(submitForm, "dir", dir);
 submitForm.action= "lowres.asp";
 submitForm.target= "_top";
 submitForm.submit();
}




function Loader(link,text,dir){
//  top.location = link + "&dir=" + dir + "&text=" + text;

 var submitForm = getNewSubmitForm();
 
 createNewFormElement(submitForm, "dir", dir);
 createNewFormElement(submitForm, "text", text);
 submitForm.action= link;

 submitForm.target= "_top";
 submitForm.submit();
}



function getNewSubmitForm(){
 var submitForm = document.createElement("FORM");
 document.body.appendChild(submitForm);
 submitForm.method = "POST";
 return submitForm;
}

function createNewFormElement(inputForm, elementName, elementValue){

try{
var newElement = document.createElement("<input name='"+elementName+"' type='hidden'>");
}catch(err){   
var newElement = document.createElement('input');
newElement.setAttribute('type','hidden');
newElement.setAttribute('name',elementName);

}
 
 inputForm.appendChild(newElement);
 newElement.value = elementValue;
 return newElement;
}
