function JSONscriptRequest(A,B){this.fullUrl=A;
this.headLoc=document.getElementsByTagName("head").item(0);
this.timeStamp=(new Date()).getTime();
this.scriptId="JscriptId"+this.timeStamp
}JSONscriptRequest.scriptCounter=1;
JSONscriptRequest.prototype.buildScriptTag=function(){this.scriptObj=document.createElement("script");
this.scriptObj.setAttribute("type","text/javascript");
this.scriptObj.setAttribute("charset","utf-8");
this.scriptObj.setAttribute("src",this.fullUrl+"&reqID="+this.scriptId);
this.scriptObj.setAttribute("id",this.scriptId);
return this.scriptId
};
JSONscriptRequest.prototype.removeScriptTag=function(){this.headLoc.removeChild(this.scriptObj)
};
JSONscriptRequest.removeScriptTagById=function(C){var B=document.getElementById(C);
var A=B.parentNode;
A.removeChild(B)
};
JSONscriptRequest.prototype.addScriptTag=function(){this.headLoc.appendChild(this.scriptObj)
};
function ISuggest(){var G="114";
var F=null;
var B=null;
var P=null;
var K=null;
var E=null;
var A=new function(){this.query=null;
this.response=null
};
var S=500;
var R=-1;
var J=null;
var T=null;
var L=null;
var O=function(W){var U=curtop=0;
try{if(W.offsetParent){do{U+=W.offsetLeft;
curtop+=W.offsetTop
}while(W=W.offsetParent);
return{left:U,top:curtop}
}}catch(V){}return null
};
var D=function(){for(var U=0;
U<B.length;
U++){B[U].value=G
}};
var M=function(){for(var U=0;
U<B.length;
U++){B[U].value=F
}};
var Q=function(){if(R>=0){T.childNodes[R].className="suggest_link"
}if(R==0||R==-1){R=T.childNodes.length-1
}else{R--
}T.childNodes[R].className="suggest_link_over";
if(R>-1){var U=T.childNodes[R].childNodes[0].nodeValue;
A.query=U;
A.response=null;
E.value=U;
J=U;
D()
}};
var H=function(){if(R>=0){T.childNodes[R].className="suggest_link"
}if(R==(T.childNodes.length-1)){R=0
}else{++R
}T.childNodes[R].className="suggest_link_over";
if(R>-1){var U=T.childNodes[R].childNodes[0].nodeValue;
A.query=U;
A.response=null;
E.value=U;
J=U;
D()
}};
var I=function(){T.style["display"]="block";
R=-1;
var U=O(K);
T.style["left"]=U.left+"px";
T.style["top"]=U.top+K.offsetHeight+"px";
T.style["width"]=K.offsetWidth+"px";
if(K.id=="icePage_SearchBoxBottom_qkw"){window.scrollBy(0,200)
}};
var N=function(){T.innerHTML="";
T.style["display"]="none"
};
this.insertScriptTag=function(){if(!E||E.value==A.query){return
}K=E;
var V=escape(E.value);
if(V==""){T.style["display"]="none";
return
}A.query=V;
var U="http://suggest.infospace.com/QuerySuggest/SuggestServlet?prefix="+V;
jsonClient=new JSONscriptRequest(U,V);
jsonClient.buildScriptTag();
jsonClient.addScriptTag()
};
var C=function(V){if(!V){var V=window.event
}var U;
if(V.keyCode){U=V.keyCode
}else{if(V.which){U=V.which
}}if(E.value==""){M()
}else{if(J!=null){if(J.indexOf(E.value)!=0){M()
}}}if(U!=27&&U!=40&&U!=38&&U!=13){window.setTimeout("iSuggest.insertScriptTag()",S)
}};
this.onKeyUp=function(V){if(T.style["display"]!="block"&&T.childNodes.length==0){return
}var U;
if(V.keyCode){U=V.keyCode
}else{if(V.which){U=V.which
}}switch(U){case 40:H();
break;
case 38:Q();
break;
case 27:N();
A.query=null;
A.response=null;
break
}};
this.PopulateResults=function(U,V){T.innerHTML="";
R=-1;
if(U){for(var W=0;
W<U.length;
W++){var X='<div onmouseover="javascript:iSuggest.suggestOver(this);" onmouseout="javascript:iSuggest.suggestOut(this);" onclick="javascript:iSuggest.setSearch(this.childNodes[0].nodeValue);" class="suggest_link" id="suggest_link_'+W+'">'+U[W]+"</div>";
T.innerHTML+=X
}}JSONscriptRequest.removeScriptTagById(V);
if(T.innerHTML==""||U==null){N()
}else{I()
}};
this.onMouseClick=function(){N();
A.query=null;
A.response=null
};
this.suggestOver=function(U){U.className="suggest_link_over"
};
this.suggestOut=function(U){U.className="suggest_link"
};
this.setSearch=function(U){A.query=U;
A.response=null;
N();
E.value=U;
D();
E.defaultButton.click();
return false
};
this.init=function(V,U){B=new Array();
for(var X=0;
X<U.length;
X++){B[X]=document.getElementById(U[X])
}F=B[0].value;
T=document.createElement("div");
T.className="suggestPanel";
T.id="suggestPanel";
document.body.insertBefore(T,document.body.firstChild);
for(var W=0;
W<V.length;
W++){this.addField(V[W].txt,V[W].btn)
}};
this.addField=function(W,V){var X=document.getElementById(W);
var Z=document.getElementById(V);
X.defaultButton=Z;
X.oldOnFocus=(X.onfocus)?X.onfocus:function(){};
function Y(b){E=this;
this.oldOnFocus()
}X.onfocus=Y;
X.oldOnBlur=(X.onblur)?X.onblur:function(){};
function a(b){if(T.style["display"]!="block"){E=null
}this.oldOnBlur()
}X.onblur=a;
X.oldEditKey=(X.onkeyup)?X.onkeyup:function(){};
function U(b){E=this;
this.oldEditKey();
if(!b){var b=window.event
}C(b)
}X.onkeyup=U
};
this.removeField=function(U){var V=document.getElementById(U);
V.onfocus=V.oldOnFocus;
V.onblur=V.oldOnBlur;
V.onkeyup=V.oldEditKey
}
}var iSuggest;
function Initialize(){iSuggest=new ISuggest();
iSuggest.init(txtElements,rfcIDElements);
var A=(document.onclick)?document.onclick:function(){};
function D(E){A();
if(!E){var E=window.event
}iSuggest.onMouseClick(E)
}document.onclick=D;
var B=(document.onkeyup)?document.onkeyup:function(){};
function C(E){B();
if(!E){var E=window.event
}iSuggest.onKeyUp(E)
}document.onkeyup=C
};