
var cls=null;var exclude=null;var http=null;var se="yahoo";var tbpin=null;var reg="";function linguasearch()
{exclude=null;if(wList!=null)
wList.fulltext(1);page2(document.forms[0].keylang.value,0,tbpin.value,"false",document.forms[0].searchset.value);return false;}
function utf8encode(str){var utftext="";for(var n=0;n<str.length;n++){var c=str.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}
else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}
else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}
return utftext;}
function utf8decode(s){var u="";var i=0;var c=c1=c2=0;while(i<s.length){c=s.charCodeAt(i);if(c<128){u+=String.fromCharCode(c);i++;}
else if((c>191)&&(c<224)){c2=s.charCodeAt(i+1);u+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}
else{c2=s.charCodeAt(i+1);c3=s.charCodeAt(i+2);u+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
return u;}
function getExclusionList()
{var s="";if(exclude!=null&&exclude.length>0)
{var i;for(i=0;i<exclude.length;i++)
s=s+"&x="+escape(exclude[i]);}
return s;}
function getExclusionList2()
{var s="";if(exclude!=null&&exclude.length>0)
{var i;for(i=0;i<exclude.length;i++)
s=s+"&x="+escape(utf8encode(exclude[i]));}
return s;}
function page2(l,p,q,en,set)
{var exlist=getExclusionList();var loc=loc=window.location.pathname+"?c="+cls+"&l="+l+"&incEN="+en+"&q="+escape(utf8encode(q))+"&s="+p+"&set="+set;if(wList!=null)
loc=loc+"&rq="+escape(utf8encode(wList.fulltext(2)));loc=loc+exlist;window.location.href=loc;return false;}
function page(l,p,q,en,set)
{var exlist=getExclusionList2();loadURL("/LSearch/Search?s="+p+"&l="+l+reg+"&se="+se+"&incEN="+en+"&q="+escape(utf8encode(q))+"&set="+set+""+exlist,showResults);return false;}
function incl(s)
{if(exclude!=null)
{var i;for(i=0;i<exclude.length;i++)
if(exclude[i]==s)
break;if(i<exclude.length)
{exclude.splice(i,1);page2(document.forms[0].keylang.value,0,tbpin.value,"false",document.forms[0].searchset.value);}}
return false;}
function excl(s)
{var i;if(exclude==null)
exclude=new Array();for(i=0;i<exclude.length;i++)
if(exclude[i]==s)
break;if(i>=exclude.length)
{exclude.push(s);page2(document.forms[0].keylang.value,0,tbpin.value,"false",document.forms[0].searchset.value);}
return false;}
function loadURL(url,handler)
{var elm=document.getElementById('lsresults');if(elm!=null)
{elm.innerHTML="<br/><b>...Searching...</b>";}
http=null;if(window.XMLHttpRequest)
{http=new XMLHttpRequest();}
else if(window.ActiveXObject)
{http=new ActiveXObject("Microsoft.XMLHTTP");}
if(http!=null)
{http.onreadystatechange=handler;http.open("GET",url,true);http.send(null);}
else
{alert("Your browser does not support XMLHTTP.");}}
function showResults()
{if(http.readyState==4)
{var elm=document.getElementById('lsresults');if(http.status==200)
{elm.innerHTML=http.responseText;}
else
{elm.innerHTML="Problem reading data";}}}
function setTab(l)
{var e=document.getElementById(l);if(e!=null)
{e.className="sl";}}
function setSearchTab(l)
{var e=document.getElementById(l);if(e!=null)
{e.className="ss";}}
function init(tb,tbtype)
{var hr=window.location.href;var def="Hindi";var q=null;var s=null;var en="false";var set="web";var rq=null;tbpin=tb;cls='cIndic';if(hr.indexOf("?")>-1){var qs=hr.substr(hr.indexOf("?")+1);var pa;if(qs.charAt(qs.length-1)=='#')
{qs=qs.substring(0,qs.length-1);}
var qa=qs.split("&");if(qa!=null&&qa.length>0){var i;for(i=0;i<qa.length;i++)
{pa=qa[i].split("=");if(pa!=null&&pa.length>1&&pa[1]!=null&&pa[1].length>0)
{if(pa[0]=="l")
{document.forms[0].keylang.value=pa[1];def=pa[1];}
else if(pa[0]=="c")
{cls=pa[1];}
else if(pa[0]=="incEN")
{en=pa[1];}
else if(pa[0]=="q")
{q=unescape(utf8decode(unescape(pa[1])));tbpin.value=q;}
else if(pa[0]=="rq"&&pa[1]!=null)
{rq=unescape(utf8decode(unescape(pa[1])));}
else if(pa[0]=="x")
{if(exclude==null)
exclude=new Array();exclude.push(unescape(pa[1]));}
else if(pa[0]=="s")
{s=pa[1];}
else if(pa[0]=="set")
{document.forms[0].searchset.value=pa[1];set=pa[1];}}}}}
clp(cls);setTab(def);tbpin.focus();checktrans(tbtype,def,tbpin);if(rq!=null&&wList!=null)
wList.init(rq,q);if(q!=null&&q.length>0)
{if(s==null)
s="0";if(set==null)
set="web";page(def,s,q,en,set)}
return true;}
function clp(l)
{var e=document.getElementById(l);var e2=document.getElementById(cls);if(e!=null)
{e2.className="ns";e.className="sl";}
var d=document.getElementById('c'+l);if(d!=null)
{var d2=document.getElementById('c'+cls);if(d2!=null)
d2.style.display='none';d.style.display='block';}
cls=l;return false;}
function lp(l)
{if(tbpin.value.length>0)
{var q=escape(tbpin.value);q=q.replace(/\+/g,"%20");window.location.href=window.location.pathname+"?c="+cls+"&l="+l+"&q="+escape(utf8encode(q));}
else
window.location.href=window.location.pathname+"?c="+cls+"&l="+l;return false;}
function pg(p,md)
{var q="";if(md==2&&wList!=null)
q=wList.fulltext(2);else
q=tbpin.value;window.location.href=p+"?c="+cls+"&l="+document.forms[0].keylang.value+"&q="+escape(utf8encode(q));return false;}
function m1(obj)
{obj.style.borderSize="1px";obj.style.borderColor="black";obj.style.backgroundColor="red";}
function m2(obj)
{obj.style.borderSize="0px";obj.style.backgroundColor="grey";}
function showLangMenu(ev)
{if(ev==undefined||ev=='undefined'||ev==null)ev=window.event;var elm=document.getElementById("morelang");elm.style.position="absolute";elm.style.visibility="visible";elm.style.display="block";elm.style.left=ev.clientX+"px";elm.style.top=ev.clientY+"px";return false;}
function hideLangMenu(ev)
{var elm=document.getElementById("morelang");elm.style.display="none";return false;}