var http_request=new Array;var ajaxresponsefunc=new Array;var ajaxcomplete=new Array;var ajaxurls=new Array;function ajaxresponse(){try{var i;for(i=0;i<http_request.length;i++){if(!ajaxcomplete[i]){if(http_request[i].readyState==4){ajaxcomplete[i]=true;func=ajaxresponsefunc[i];func(http_request[i].responseText);return}}}}catch(e){}}function nullfunc(){return}function Ajax(url,val,func){assinc=!(func==null);sid=-1;for(i=0;i<http_request.length;i++){if(ajaxurls[i]==url){sid=i;http_request[sid].abort();break}}if(sid=-1){sid=http_request.length}ajaxcomplete[sid]=false;ajaxurls[sid]=url;http_request[sid]=false;ajaxresponsefunc[sid]=func;if(window.XMLHttpRequest){http_request[sid]=new XMLHttpRequest();if(http_request[sid].overrideMimeType){http_request[sid].overrideMimeType('text/xml')}}else if(window.ActiveXObject){try{http_request[sid]=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{http_request[sid]=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}}if(!http_request[sid]){alert('Giving up :( Cannot create an XMLHTTP instance');return false}if(assinc)http_request[sid].onreadystatechange=ajaxresponse;http_request[sid].open('POST',url,assinc);http_request[sid].send(""+val+"");if(!assinc){return http_request[sid].responseText}}function gete(id){try{return document.getElementById(id)}catch(ex){return false}}var dialogwindow;function showdialog(url,w,h,sb){if(dialogwindow&&!dialogwindow.closed){dialogwindow.focus()}else{sb=(sb)?"yes":"no";lp=(screen.width)?(screen.width-w)/2:0;tp=(screen.height)?(screen.height-h)/2:0;dialogwindow=window.open(url,'_blank','width='+w+',height='+h+',resizable=no,top='+tp+',left='+lp+',scrollbars='+sb+',status=no');setTimeout("dialogwindow.focus()",1000)}}IE=navigator.appName==="Microsoft Internet Explorer";Opera=navigator.appName==="Opera";function zoom(src,w,h){ww=w;wh=h;sb="no";if(ww>900){ww=900;sb='yes'}if(wh>700){wh=700;sb='yes'}lp=(screen.width)?(screen.width-ww)/2:0;tp=(screen.height)?(screen.height-wh)/2:0;html='<html><head><title>Zoom</title>'+'</head><body bgcolor=#FFFFFF leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 >'+'<a href="javascript:self.close()"><img src="'+src+'" border=0 title="" width='+w+' height='+h+'></a></body></html>';if(IE){ww=ww-2;wh=wh-2;win=window.open('','_blank','width='+ww+',height='+wh+',resizable=no'+',top='+tp+',left='+lp+',scrollbars='+sb+',status=no')}else{if(Opera)win=window.open(src,'_blank','width='+ww+',height='+wh+',resizable=no'+',top=100,left=100,scrollbars='+sb+',status=no');else win=window.open(src,'_blank','width='+ww+',height='+wh+',resizable=no'+',top='+tp+',left='+lp+',scrollbars='+sb+',status=no')}win.document.open();win.document.write(html);win.document.close();setTimeout("win.focus()",100)}function refr(id){obj=document.getElementById(id);obj.src=obj.src}function savecookie(name,value,expire){if(expire==undefined){expire=""}Ajax("/cms/js/savecookie.php?name="+name+"&expire="+expire,value)}function trim(str){s=str.replace(/^(\s)*/,'');s=s.replace(/(\s)*$/,'');return s}function findPos(obj){var obj2=obj;var curtop=0;var curleft=0;if(document.getElementById||document.all){do{curleft+=obj.offsetLeft-obj.scrollLeft;curtop+=obj.offsetTop-obj.scrollTop;obj=obj.offsetParent;obj2=obj2.parentNode;while(obj2!=obj){curleft-=obj2.scrollLeft;curtop-=obj2.scrollTop;obj2=obj2.parentNode}}while(obj.offsetParent)}else if(document.layers){curtop+=obj.y;curleft+=obj.x}return[curleft,curtop]}function showlang(o){l=document.getElementById("langs");o=document.getElementById("maintable");if(l.style.display=="block"){l.style.display="none"}else{p=findPos(o);l.style.left=p[0]-115;l.style.top=p[1]+18;l.style.display="block"}}

function getradio(radioGroupObj)
{
  //alert(radioGroupObj.length);
  for (var i=0; i < radioGroupObj.length; i++)
    if (radioGroupObj[i].checked) return radioGroupObj[i].value;

  return null;
}

function getspeclink(email){
	v=(email.match(/^[A-Za-z0-9\.\_\-]{1,32}\@[A-Za-z0-9\.\_\-]{1,32}\.[a-zA-Z]{2,6}$/));
	if(v!=null){

		tp=0;
		try{
			tp=getradio(document.forms("linkform").linktype);
		}catch(e){}
		
		//alert(tp);
		
		lnk=Ajax("/js/getspeclink.php?qnt=1&email="+v+"&lang="+curlang+"&tp="+tp);
		lnk=lnk.split("\t");
		
		if(tp==1){
			gete("speclink").value="<a href='"+lnk[1]+"'>Client for Google Translate - "+linktext+"</a>";	
		}else{
			if(tp==2){
				gete("speclink").value="[url="+lnk[1]+"]"+linktext+"[/url]";
			}else{
				gete("speclink").value=lnk[1];
			}
		}
		
		gete("lbn").innerHTML=lnk[0];
		gete("dspeclink").style.display="block";
		gete("dsee").style.display="none";
		gete("speclink").select();
		gete("speclink").focus()
	}else{
		alert("The address you entered is incorrect.\r\nPlease, enter correct email address!");
		gete("email").focus()
	}
}																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																														   
