﻿//window.onerror=reportError;function reportError(msg,url,line){return true;};

function $E(id){ return document.getElementById(id);};

String.prototype.trim = function(){return this.replace(new RegExp("(^[\\s]*)|([\\s]*$)", "g"), "");};

function addMark(name,url)
{
	if(document.all)
	{
		window.external.AddFavorite(url,name);
	}else if (window.sidebar){
		window.sidebar.addPanel(name,url, "");
	}
}

function setHomepage(url)
{
	if (document.all)
	{
		document.body.style.behavior = 'url(#default#homepage)';document.body.setHomePage(url);
	}else if (window.sidebar){
		if(window.netscape)
		{
			try{
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			}catch(e){
				window.alert("该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");
			}
		}
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);prefs.setCharPref('browser.startup.homepage',url);
	}
}

function zm_out()
{
	var html=[];
	html.push('<li><a href="/bin/results.php?s=sm:a|0" target="_blank" rel="nofollow">A</a></li><li><a href="/bin/results.php?s=sm:b|0" target="_blank" rel="nofollow">B</a></li><li><a href="/bin/results.php?s=sm:c|0" target="_blank" rel="nofollow">C</a></li><li><a href="/bin/results.php?s=sm:d|0" target="_blank" rel="nofollow">D</a></li><li><a href="/bin/results.php?s=sm:e|0" target="_blank" rel="nofollow">E</a></li><li><a href="/bin/results.php?s=sm:f|0" target="_blank" rel="nofollow">F</a></li><li><a href="/bin/results.php?s=sm:g|0" target="_blank" rel="nofollow">G</a></li><li><a href="/bin/results.php?s=sm:h|0" target="_blank" rel="nofollow">H</a></li><li><a href="/bin/results.php?s=sm:i|0" target="_blank" rel="nofollow">I</a></li><li><a href="/bin/results.php?s=sm:j|0" target="_blank" rel="nofollow">J</a></li><li><a href="/bin/results.php?s=sm:k|0" target="_blank" rel="nofollow">K</a></li><li><a href="/bin/results.php?s=sm:l|0" target="_blank" rel="nofollow">L</a></li><li><a href="/bin/results.php?s=sm:m|0" target="_blank" rel="nofollow">M</a></li><li><a href="/bin/results.php?s=sm:n|0" target="_blank" rel="nofollow">N</a></li><li><a href="/bin/results.php?s=sm:o|0" target="_blank" rel="nofollow">O</a></li><li><a href="/bin/results.php?s=sm:p|0" target="_blank" rel="nofollow">P</a></li><li><a href="/bin/results.php?s=sm:q|0" target="_blank" rel="nofollow">Q</a></li><li><a href="/bin/results.php?s=sm:r|0" target="_blank" rel="nofollow">R</a></li><li><a href="/bin/results.php?s=sm:s|0" target="_blank" rel="nofollow">S</a></li><li><a href="/bin/results.php?s=sm:t|0" target="_blank" rel="nofollow">T</a></li><li><a href="/bin/results.php?s=sm:u|0" target="_blank" rel="nofollow">U</a></li><li><a href="/bin/results.php?s=sm:v|0" target="_blank" rel="nofollow">V</a></li><li><a href="/bin/results.php?s=sm:w|0" target="_blank" rel="nofollow">W</a></li><li><a href="/bin/results.php?s=sm:x|0" target="_blank" rel="nofollow">X</a></li><li><a href="/bin/results.php?s=sm:y|0" target="_blank" rel="nofollow">Y</a></li><li><a href="/bin/results.php?s=sm:z|0" target="_blank" rel="nofollow">Z</a></li><li><a href="/bin/results.php?s=sm:0|0" target="_blank" rel="nofollow">0-9</a></li>');
	return html.join('');
}

function markbook_out()
{
	var html=[];
	html.push('<a href=javascript:addMark("Coolba_Free_Games","http://www.coolba.com");>Add to Faves</a><a href=javascript:setHomepage("http://www.coolba.com");>Set as homepage</a>');
	return html.join('');
}

function about_out()
{
	var html=[];
	html.push('Copyright © 2011 Coolba.com All rights reserved. Copyright/IP Policy | Terms of Service | Guidelines | Feedback | Help<br />');
	html.push('NOTICE: We collect personal information on this site. To learn more about how we use your information, see our Privacy Policy | About Our Ads.');
	return html.join('');
}

function getSort(Id,Num,s)
{
	var fileurl="/bin/ajax_lib/index_new_arr.php";
	var obj='s';
	var spobj=obj+Num;
	var ajax=new ajax_class();
	ajax.resetFunctions();
	ajax.URLString=fileurl;
	var response='';
	ajax.onCompletion=function()
	{
		response=ajax.response;
		if(response!='')
		{
			$E("new_arr").innerHTML=response;
			for(i=0;i<=10;i++)
			{
				var odobj=obj+i;
				$E(odobj).style.background='#B31369';
				$E(odobj).style.cursor='pointer';
			}
			$E(spobj).style.background='#0382CF';
			$E(spobj).style.cursor='auto';
		}
	}
	ajax.Send("action=addnew&id="+Id+"&c="+s);
	ajax.Abort;
	ajax.Close;
}

function ajax_class()
{
     this.XMLHttpReq=null;
     this.method="POST"; 
     this.URLString="";
     this.response="";
     this.responseXML="";
     this.failed=false; 
     this.onLoading = function() { };
     this.onLoaded = function() { };
     this.onInteractive = function() { };
     this.onCompletion = function() { };
     this.onError = function() { };
     this.onFail = function() { };
     this.resetFunctions = function() {
         this.onLoading = function() { };
         this.onLoaded = function() { };
         this.onInteractive = function() { };
         this.onCompletion = function() { };
         this.onError = function() { };
         this.onFail = function() { };
     };
     this.Init = function()
     {
         if(window.XMLHttpRequest)
         {
             this.XMLHttpReq = new XMLHttpRequest();
			 if(this.XMLHttpReq.overrideMimeType)this.XMLHttpReq.overrideMimeType('text/xml');
         }
         else if (window.ActiveXObject)
         {
			 var versions = ['Microsoft.XMLHTTP', 'MSXML.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.7.0', 'Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP'];
			 for(var i=0; i<versions.length; i++) {
				try 
				{
					this.XMLHttpReq = new ActiveXObject(versions[i]);
					if(this.XMLHttpReq)break;
				}catch(e) 
				{
					//alert(e.message);
				}
			 }
			 if(!this.XMLHttpReq)this.failed=true;
         }
     };
     this.Send=function(data)
     {
         var self=this;
         if(self.method=="POST")
         {
             self.XMLHttpReq.open(self.method,self.URLString,true);
         }
         else
         {
             self.XMLHttpReq.open(self.method,self.URLString+"?"+encodeURI(data),true);
         }
         self.XMLHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");
         self.XMLHttpReq.onreadystatechange = function()
         {
             if (self.failed) {
                 self.onFail();
                 return;
             }
             switch (self.XMLHttpReq.readyState) {
                 case 1:
                 {
                     self.onLoading();
                     break;
                 }
                 case 2:
                 {
                     self.onLoaded();
                     break;
                 }
                 case 3:
                 {
                     self.onInteractive();
                     break;
                 }
                 case 4:
                 {
                     if(self.XMLHttpReq.status==200) { 
                         self.response = self.XMLHttpReq.responseText;
                         self.responseXML = self.XMLHttpReq.responseXML;
                         self.onCompletion();
                     }
                     else 
                     { 
                         self.onError();
                     }
                     break;
                 }
             }
         };
         if(this.method=="POST")
         {
         this.XMLHttpReq.send(encodeURI(data));
         }
         else
         {
             this.XMLHttpReq.send();
         }
     };
     this.Abort=function()
     {
         this.XMLHttpReq.abort();
     }
     this.Close=function()
     {
         this.XMLHttpReq=null;
     }
     this.Init();
}

String.prototype.UrlEncode = function(){var str = this;str = str.replace(/./g,function(sHex){window.EnCodeStr = "";window.sHex = sHex;window.execScript('window.EnCodeStr=Hex(Asc(window.sHex))',"vbscript");return window.EnCodeStr.replace(/../g,"%$&");});return str;};function check(){var w = $E("s").value.trim().UrlEncode();var n = $E("n").value;if(w.length > 0){if(n=='1'){window.open('/bin/results.php?s='+w,'_blank');}else{top.location = '/bin/results.php?s='+w;}}};function enterHandler(eventTag) { var event = eventTag||window.event;var keyCode = event.charCode||event.keyCode; if (keyCode == 13){$E('btn1').focus(); }return false;}var u=60,I="";var gInputQuery=null,gBtnSearch=null;var gInputQueryFocused=false,gInputQueryBlured=false,gInputQueryValue=null,gInputQueryKeycode="";var gKeyword="",gKeywordPre="",gKeywordToDisplayCompStrings="";var gCompDiv=null,gCompIFrame=null;var gCompDivBorderLeftWidth=1,gCompDivBorderTopWidth=1;var gCompleteStrings={};var gNotResponsedResquestNum=0;var gTimerHideCompDiv=null;var gDivTagName="div";var gSpanTagName="span";var gCompStringDivNum=5;var gCompStringDivNumber= -1;var gCompStringDivs=null;var gSelectedCompStringDiv=null,gSelectedCompStringDivIndex= -1;var gSelectionValue=null,gSelectionStart=null,gSelectionLength=null;var gMousePositionX= -1,gMousePositionY= -1;var gDocumentKeycode= -1;var gSubmitting=false;var gTimeFactor=1;function JSONscriptRequest(fullUrl){this.fullUrl=fullUrl;this.noCacheIE='&noCacheIE='+(new Date()).getTime();this.headLoc=document.getElementsByTagName("head").item(0);this.scriptId='JscriptId'+JSONscriptRequest.scriptCounter++;};JSONscriptRequest.scriptCounter=1;JSONscriptRequest.prototype.buildScriptTag=function(){this.scriptObj=document.createElement("script");this.scriptObj.setAttribute("type","text/javascript");this.scriptObj.setAttribute("src",this.fullUrl);};JSONscriptRequest.prototype.removeScriptTag=function(){this.headLoc.removeChild(this.scriptObj);};JSONscriptRequest.prototype.addScriptTag=function(){this.headLoc.appendChild(this.scriptObj);};function addCompleteStrings(keyword,completeStrings,displayStrings){gCompleteStrings[keyword]=new Array(completeStrings,displayStrings);};setupAC=function(inputQuery,btnSearch){gInputQuery=inputQuery;gBtnSearch=btnSearch;initAC();};function initAC(){gInputQuery.autocomplete="off";gInputQuery.onblur=inputQueryOnblur;gInputQuery.onfocus=inputQueryOnfocus;if(gInputQuery.createTextRange)gInputQuery.onkeyup=new Function("return inputQueryOnkeyup(event); ");else gInputQuery.onkeyup=inputQueryOnkeyup;gInputQuery.onsubmit=inputQueryOnsubmit;gKeyword=gInputQuery.value;gKeywordPre=gKeyword;gCompDiv=document.createElement("DIV");gCompDiv.id="completeDiv";gCompDivBorderLeftWidth=1;gCompDivBorderTopWidth=1;gCompDiv.style.borderRight="black "+gCompDivBorderLeftWidth+"px solid";gCompDiv.style.borderLeft="black "+gCompDivBorderLeftWidth+"px solid";gCompDiv.style.borderTop="black "+gCompDivBorderTopWidth+"px solid";gCompDiv.style.borderBottom="black "+gCompDivBorderTopWidth+"px solid";gCompDiv.style.zIndex="2";gCompDiv.style.paddingRight="0";gCompDiv.style.paddingLeft="0";gCompDiv.style.paddingTop="0";gCompDiv.style.paddingBottom="0";gCompDiv.style.visibility="hidden";gCompDiv.style.position="absolute";gCompDiv.style.backgroundColor="white";gCompIFrame=document.createElement("IFRAME");gCompIFrame.id="completeIFrame";gCompIFrame.style.zIndex="1";gCompIFrame.style.position="absolute";gCompIFrame.style.display="block";gCompIFrame.style.visibility="hidden";gCompIFrame.style.borderRightWidth="0";gCompIFrame.style.borderLeftWidth="0";gCompIFrame.style.borderTopWidth="0";gCompIFrame.style.borderBottomWidth="0";setCompDivPosition();document.body.appendChild(gCompDiv);document.body.appendChild(gCompIFrame);addCompleteStrings("",[],[]);ua();setStyle(gCompDiv,"mAutoComplete");window.onresize=windowOnresize;document.onkeydown=documentOnkeydown;gb();setTimeout("inputQueryValueChange()",10*gTimeFactor);};function inputQueryTemporaryBlur(){gInputQueryBlured=true;gInputQuery.blur();setTimeout("inputQueryFocus();",10*gTimeFactor)};function gb(){if(document.createEventObject){var a=document.createEventObject();a.ctrlKey=true;a.keyCode=70;document.fireEvent("onkeydown",a)}};function documentOnkeydown(keydownEvent){if(!keydownEvent&&window.event)keydownEvent=window.event;if(keydownEvent)gDocumentKeycode=keydownEvent.keyCode;if(keydownEvent&&keydownEvent.keyCode==8){}};function windowOnresize(){setCompDivPosition()};function setCompDivPosition(){if(gCompDiv){gCompDiv.style.left=absoluteLocation(gInputQuery,"offsetLeft")+"px";gCompDiv.style.top=absoluteLocation(gInputQuery,"offsetTop")+gInputQuery.offsetHeight-1+"px";gCompDiv.style.width=adjustOffsetWidth()+"px";if(gCompIFrame){gCompIFrame.style.left=gCompDiv.style.left;gCompIFrame.style.top=gCompDiv.style.top;gCompIFrame.style.width=gCompDiv.style.width;gCompIFrame.style.height=gCompDiv.style.height}}};function adjustOffsetWidth(){return gInputQuery.offsetWidth-gCompDivBorderLeftWidth*2};function inputQueryOnfocus(a){gInputQueryFocused=true};function inputQueryOnblur(blurEvent){gInputQueryFocused=false;if(!blurEvent&&window.event){blurEvent=window.event;}if(!gInputQueryBlured){hideCompleteDiv();if(gDocumentKeycode==9){gBtnSearch.focus();gDocumentKeycode= -1}}gInputQueryBlured=false};inputQueryOnkeyup=function(keyEvent){gInputQueryKeycode=keyEvent.keyCode;gInputQueryValue=gInputQuery.value;processUserInput()};inputQueryFocus=function(){gInputQuery.focus()};function trimStr(str){for(var i=0,trimedStr="",crlf="\n\r";i<str.length;i++)if(crlf.indexOf(str.charAt(i))== -1)trimedStr+=str.charAt(i);else trimedStr+=" ";return trimedStr};function separateCompStringDiv(compStringDiv,styleClassName){var compStringSpan=compStringDiv.getElementsByTagName(gSpanTagName);if(compStringSpan){for(var i=0;i<compStringSpan.length;++i){if(compStringSpan[i].className==styleClassName){var f=compStringSpan[i].innerHTML;if(f=="&nbsp;")return "";else{var str=trimStr(f);return str}}}}else{return ""}};function separateCompStringDivC(compStringDiv){if(!compStringDiv)return null;return separateCompStringDiv(compStringDiv,"cAutoComplete")};function separateCompStringDivD(compStringDiv){if(!compStringDiv)return null;return separateCompStringDiv(compStringDiv,"dAutoComplete")};function hideCompleteDiv(){$E("completeDiv").style.visibility="hidden";$E("completeIFrame").style.visibility="hidden"};function showCompleteDiv(){$E("completeDiv").style.visibility="visible";$E("completeIFrame").style.visibility="visible";setCompDivPosition()};compRequest=function(){if(gKeywordPre!=gKeyword){if(!gSubmitting){var escaped_keyword=encodeAndEscape(gKeyword),completeStrings=gCompleteStrings[gKeyword];if(completeStrings){compResp(gKeyword,completeStrings[0],completeStrings[1])}else{gNotResponsedResquestNum++;var req='/bin/results_action.php?k='+escaped_keyword;var jsonReq=new JSONscriptRequest(req);jsonReq.buildScriptTag();jsonReq.addScriptTag();}gInputQuery.focus()}gSubmitting=false}gKeywordPre=gKeyword;setTimeout("compRequest()",calcNextTimeoutInterval(gNotResponsedResquestNum));return true};compResp=function(keyword,completeStrings,displayStrings){if(gNotResponsedResquestNum>0)gNotResponsedResquestNum--;addCompleteStrings(keyword,completeStrings,displayStrings);if(keyword==gKeyword){if(gTimerHideCompDiv){clearTimeout(gTimerHideCompDiv);gTimerHideCompDiv=null;}gKeywordToDisplayCompStrings=keyword;}var completeDiv=gCompDiv;completeDiv.completeStrings=completeStrings;completeDiv.displayStrings=displayStrings;fillCompDiv(completeDiv,completeDiv.completeStrings,completeDiv.displayStrings);displayCompDiv(completeDiv,separateCompStringDivC);if(gCompStringDivNum>0){completeDiv.height=16*gCompStringDivNum+4;gCompIFrame.height=completeDiv.height-4}else{hideCompleteDiv()}};hideCompDiv=function(){hideCompleteDiv();gTimerHideCompDiv=null};function processUserInput(){if(gInputQueryKeycode==40||gInputQueryKeycode==38)inputQueryTemporaryBlur();var length=selectionLength(gInputQuery),start=selectionStart(gInputQuery),inputValue=gInputQuery.value;if(gInputQueryKeycode!=9&&gInputQueryKeycode!=13&& !(gInputQueryKeycode>=16&&gInputQueryKeycode<=20)&&gInputQueryKeycode!=27&& !(gInputQueryKeycode>=33&&gInputQueryKeycode<=38)&&gInputQueryKeycode!=40&&gInputQueryKeycode!=44&& !(gInputQueryKeycode>=112&&gInputQueryKeycode<=123)){gKeyword=inputValue;if(gInputQueryKeycode!=39){ia=inputValue}}if(notCompStringDivsNavigation(gInputQueryKeycode)&&gInputQueryKeycode!=0&&gKeywordToDisplayCompStrings==gKeyword){displayCompDiv(gCompDiv,separateCompStringDivC);}if(gKeywordToDisplayCompStrings!=gKeyword&& !gTimerHideCompDiv){gTimerHideCompDiv=setTimeout("hideCompDiv()",500*gTimeFactor)}};function inputQueryOnsubmit(){gSubmitting=true;hideCompleteDiv();check();return true};inputQueryValueChange=function(a){if(gInputQueryFocused){getSelectionInfo()}var curValue=gInputQuery.value;if(curValue!=gInputQueryValue){gInputQueryKeycode=0;processUserInput()}gInputQueryValue=curValue;setTimeout("inputQueryValueChange()",10*gTimeFactor)};function encodeAndEscape(a){if(encodeURIComponent)return encodeURIComponent(a);if(escape)return escape(a)};function calcNextTimeoutInterval(notResponsedResquestNum){var interval=100*gTimeFactor;for(var i=1;i<=(notResponsedResquestNum-2)/2;i++){interval=interval*2}interval=interval+50*gTimeFactor;return interval};setTimeout("compRequest()",10*gTimeFactor);var compStringDivOnmousedown=function(){setInputQueryValue(separateCompStringDivC(this));inputQueryOnsubmit()};var compStringDivOnmousemove=function(){if(window.event){var x=window.event.x,y=window.event.y;if(x==gMousePositionX&&y==gMousePositionY){return}gMousePositionX=x;gMousePositionY=y}if(gSelectedCompStringDiv)setStyle(gSelectedCompStringDiv,"aAutoComplete");setStyle(this,"bAutoComplete");gSelectedCompStringDiv=this;for(var i=0;i<gCompStringDivNumber;i++){if(gCompStringDivs[i]==gSelectedCompStringDiv){gSelectedCompStringDivIndex=i;break}}};var compStringDivOnmouseout=function(){setStyle(this,"aAutoComplete")};function hilightCompStringDiv(compStringDivIndex){gKeyword=I;setInputQueryValue(I);if(!gCompStringDivs||gCompStringDivNumber<=0)return;showCompleteDiv();if(compStringDivIndex>=gCompStringDivNumber){compStringDivIndex=gCompStringDivNumber-1}if(gSelectedCompStringDivIndex!= -1&&compStringDivIndex!=gSelectedCompStringDivIndex){setStyle(gSelectedCompStringDiv,"aAutoComplete");gSelectedCompStringDivIndex= -1}if(compStringDivIndex<0){gSelectedCompStringDivIndex= -1;gInputQuery.focus();return}gSelectedCompStringDivIndex=compStringDivIndex;gSelectedCompStringDiv=gCompStringDivs.item(compStringDivIndex);setStyle(gSelectedCompStringDiv,"bAutoComplete");gKeyword=I;setInputQueryValue(separateCompStringDivC(gSelectedCompStringDiv))};function notCompStringDivsNavigation(keycode){if(keycode==40){hilightCompStringDiv(gSelectedCompStringDivIndex+1);return false}else if(keycode==38){hilightCompStringDiv(gSelectedCompStringDivIndex-1);return false}else if(keycode==13||keycode==3){if(window.navigator.userAgent.toLowerCase().indexOf("firefox")!=-1) inputQueryOnsubmit(); return false}return true};function displayCompDiv(completeDiv,separateCompString){var c=gInputQuery,hasStringToSelect=false;gSelectedCompStringDivIndex= -1;var compStringDivs=completeDiv.getElementsByTagName(gDivTagName),compStringDivNum=compStringDivs.length;gCompStringDivNumber=compStringDivNum;gCompStringDivs=compStringDivs;gCompStringDivNum=compStringDivNum;I=gKeyword;if(gKeyword==""||compStringDivNum==0){hideCompleteDiv()}else{showCompleteDiv()}for(var i=0;i<compStringDivNum;i++){setStyle(compStringDivs.item(i),"aAutoComplete");}gSelectedCompStringDivIndex= -1;gSelectedCompStringDiv=null};function absoluteLocation(element,offset){var c=0;while(element){c+=element[offset];element=element.offsetParent}return c};function selectionLength(inputQuery){var length= -1;if(inputQuery.createTextRange){}else if(inputQuery.setSelectionRange){length=inputQuery.selectionEnd-inputQuery.selectionStart}return length};function selectionStart(inputQuery){var start=0;if(inputQuery.createTextRange){}else if(inputQuery.setSelectionRange){start=inputQuery.selectionStart}else{start= -1}return start};function selectionEnd(inputQuery){if(inputQuery.createTextRange){var textRange=inputQuery.createTextRange();textRange.moveStart("character",inputQuery.value.length);textRange.select()}else if(inputQuery.setSelectionRange){inputQuery.setSelectionRange(inputQuery.value.length,inputQuery.value.length)}};function setStyle(element,styleClassName){ua();element.className=styleClassName;switch(styleClassName.charAt(0)){case "m":element.style.fontSize="13px";element.style.fontFamily="arial,sans-serif";element.style.wordWrap="break-word";element.style.zIndex="99";break;case "l":element.style.display="block";element.style.paddingLeft="3";element.style.paddingRight="3";element.style.height="16px";element.style.overflow="hidden";break;case "a":element.style.backgroundColor="white";element.style.color="black";if(element.displaySpan){element.displaySpan.style.color="green"}break;case "b":element.style.backgroundColor="#3366cc";element.style.color="white";if(element.displaySpan){element.displaySpan.style.color="white"}break;case "c":element.style.width=u+"%";if(window.navigator.userAgent.toLowerCase().indexOf("firefox")!= -1)element.style.cssFloat="left";else element.style.styleFloat="left";element.style.whiteSpace="nowrap";element.style.overflow="hidden";element.style.textOverflow="ellipsis";element.style.fontSize="12px";break;case "d":if(window.navigator.userAgent.toLowerCase().indexOf("firefox")!= -1)element.style.cssFloat="right";else element.style.styleFloat="right";element.style.width=100-u+"%";element.style.fontSize="10px";element.style.textAlign="right";element.style.color="green";element.style.paddingTop="3px";break}};function ua(){u=65;var a=110,b=adjustOffsetWidth(),c=(b-a)/b*100;u=c};function fillCompDiv(completeDiv,completeStrings,displayStrings){while(completeDiv.childNodes.length>0)completeDiv.removeChild(completeDiv.childNodes[0]);for(var e=0;e<completeStrings.length;++e){var f=document.createElement("DIV");setStyle(f,"aAutoComplete");f.onmousedown=compStringDivOnmousedown;f.onmousemove=compStringDivOnmousemove;f.onmouseout=compStringDivOnmouseout;var i=document.createElement("SPAN");setStyle(i,"lAutoComplete");i.style.height=gInputQuery.offsetHeight-4;var h=document.createElement("SPAN");h.innerHTML=completeStrings[e];var l=document.createElement("SPAN");setStyle(l,"dAutoComplete");setStyle(h,"cAutoComplete");f.displaySpan=l;l.innerHTML=displayStrings[e];i.appendChild(h);i.appendChild(l);f.appendChild(i);completeDiv.appendChild(f)}};function setInputQueryValue(value){gInputQuery.value=value;gInputQueryValue=value;};function selectionNotChanged(){var value=gInputQuery.value,start=selectionStart(gInputQuery),length=selectionLength(gInputQuery);return length==gSelectionStart&&c==gSelectionLength&&value==gSelectionValue};function getSelectionInfo(){gSelectionValue=gInputQuery.value;gSelectionStart=selectionStart(gInputQuery);gSelectionLength=selectionLength(gInputQuery)};
