var selBGColor="#E1F5C0";var unselBGColor="#FFFFFF";var selFGColor="#3E3F41";var unselFGColor="#3E3F41";var isDOM=$;var isO=isO5=window.opera&&isDOM;var isIE=document.all&&document.all.item&&!isO;var fnListOnMouseover=new Function();var fnListOnMouseout=new Function();var fnListOnMousedown=new Function();var fnOnHintEnter=new Function();var fnOnHintTab=new Function();var fnOnHintDown=new Function();var fnOnHintUp=new Function();var iCount=0;var bPreSelectFirst=true;var hiddenVal=0;var hiddenStr="";function getHint(k,a,f,c,b){k.setAttribute("blockResponse","0");if(!a){var a=window.event}var l=k.id;var d=null;var r=k.getAttribute("cur_div");var p=false;var h="";var o=$(l+"_o");k.setAttribute("maxlength",255);k.setAttribute("autocomplete","off");if(o.style.width==null||o.style.width.stripAllWhite()==""){o.style.width=k.style.width}if(a.keyCode==8||a.keyCode==46){p=true}if(!p){h=String.fromCharCode(a.keyCode).toLowerCase()}switch(a.keyCode){case 17:return;break;case 18:return;break;case 9:if(bPreSelectFirst==true){if(r==""||r==null){k.setAttribute("cur_div","0");r="0"}}if((isIE&&typeof r=="number"&&r>=0)||(!isIE&&r!=""&&o.childNodes[r]!=null)||(isIE&&r!=""&&o.childNodes[r]!=null)){if(o.childNodes.length>0){$(k.id+"_key").value=o.childNodes[r].getAttribute("a").replace(/&amp;/gi,"&");k.value=o.childNodes[r].innerHTML;k.value=k.value.strip().replace(/&amp;/gi,"&");hiddenVal=$(k.id+"_key").value;hiddenStr=k.value;hideBoxHint(k);try{fnOnHintTab(k)}catch(n){}}}k.focus();bPreSelectFirst=true;return;break;case 13:if((isIE&&typeof r=="number"&&r>=0)||(!isIE&&r!=""&&o.childNodes[r]!=null)||(isIE&&r!=""&&o.childNodes[r]!=null)){if(o.childNodes.length==0){return true}$(k.id+"_key").value=o.childNodes[r].getAttribute("a").replace(/&amp;/gi,"&");k.value=o.childNodes[r].innerHTML;k.value=k.value.strip().replace(/&amp;/gi,"&");hiddenVal=$(k.id+"_key").value;hiddenStr=k.value;hideBoxHint(k);try{fnOnHintEnter(k)}catch(n){}}return;break;case 40:if(o.childNodes.length==0){return true}if((isIE&&typeof r=="number"&&r>=0)||(!isIE&&r!="")||(isIE&&r!="")){o.childNodes[r].style.background=unselBGColor;o.childNodes[r].style.color=unselFGColor;++r}if(r==""||r==null){k.setAttribute("cur_div",0);r=0}if(r>o.childNodes.length-1){r=0}o.childNodes[r].style.background=selBGColor;o.childNodes[r].style.color=selFGColor;k.setAttribute("cur_div",r);try{fnOnHintDown(k)}catch(n){}return;break;case 38:if(isNaN(r)||r==null||r==""){k.setAttribute("cur_div",0);r=0}if(o.childNodes.length==0){return true}o.childNodes[r].style.background=unselBGColor;o.childNodes[r--].style.color=unselFGColor;if(r<0){r=o.childNodes.length-1}o.childNodes[r].style.background=selBGColor;o.childNodes[r].style.color=selFGColor;k.setAttribute("cur_div",r);try{fnOnHintUp(k)}catch(n){}return;break}if(a.keyCode==27||a.keyCode==16||a.keyCode==35||a.keyCode==36||a.keyCode==37||a.keyCode==39){return true}var q=(k.value+h).strip();var j="";if(q.length>f){j=q.substr(f,q.length)}var m=false;if(q.length>=f+c){m=true}else{hideBoxHint(k)}if((p&&m)||(!p&&m)){try{d=newXMLobject();d.open("GET",b+encodeURIComponent(j),true);d.onreadystatechange=function(){if(d.readyState==4){if(d.status!=200){alert("Sorry we're unable to execute the search. Please try again later (2-"+d.status+").");return}if(k.getAttribute("blockResponse")=="1"){return}var s="";var e=d.responseXML.getElementsByTagName("hi");if(e.length>0){for(i=0;i<e.length;i++){if(e[i].nodeName!="#text"){s+="<div input_name='"+k.id+"' a='"+e[i].getAttribute("a")+"' onmousedown='fnHMouseClick(this,"+i+");' onmouseover='fnHMouseOver(this,"+i+")' onmouseout='fnHMouseOut(this,"+i+")'>"+e[i].getAttribute("d")+"</div>"}}}else{var e=d.responseXML.getElementsByTagName("i");for(i=0;i<e.length;i++){if(e[i].nodeName!="#text"){try{s+="<div input_name='"+k.id+"' a='"+e[i].nextSibling.nextSibling.nextSibling.firstChild.nodeValue+"' onmousedown='fnHMouseClick(this,"+i+");' onmouseover='fnHMouseOver(this,"+i+")' onmouseout='fnHMouseOut(this,"+i+")'>"+e[i].nextSibling.nextSibling.firstChild.nodeValue+"</div>"}catch(u){}}}}o.innerHTML=s;if(s!=""){o.showDiv();try{WCH.Apply(o)}catch(t){}$(k.id+"_key").value=0}else{$(k.id+"_key").value=0;hideBoxHint(k)}k.setAttribute("cur_div","");if(((b.split("?")[0]=="/waynflights.html")||bPreSelectFirst==true)&&(o.getElementsByTagName("div")[0])){fnHSelectFirst(o.getElementsByTagName("div")[0],0)}d=null}};d.send(null)}catch(g){alert("smartxml:"+g)}}else{if((p&&j.length==1)||(!p&&j.length==0)){hideBoxHint(o.id,k)}}}function fnHMouseOut(d,a){var c=$(d.getAttribute("input_name"));d.style.background=unselBGColor;d.style.color=unselFGColor;c.setAttribute("cur_div","");try{fnListOnMouseout(c)}catch(b){}}function fnHMouseOver(f,a){var d=$(f.getAttribute("input_name"));if(d.getAttribute("cur_div")!=null&&!isNaN(d.getAttribute("cur_div"))&&d.getAttribute("cur_div")!=""){f.parentNode.childNodes[d.getAttribute("cur_div")].style.background=unselBGColor;f.parentNode.childNodes[d.getAttribute("cur_div")].style.color=unselFGColor}f.style.background=selBGColor;f.style.color=selFGColor;d.setAttribute("cur_div",a);var b=f.parentNode;$(f.getAttribute("input_name")+"_key").value=b.childNodes[a].getAttribute("a").replace(/&amp;/gi,"&");d.value=b.childNodes[a].innerHTML.replace(/&amp;/gi,"&");d.value=d.value.strip();hiddenVal=$(f.getAttribute("input_name")+"_key").value;hiddenStr=d.value;try{fnListOnMouseover(d)}catch(c){}}function fnHMouseClick(f,a){var b=f.parentNode;var d=$(f.getAttribute("input_name"));$(f.getAttribute("input_name")+"_key").value=b.childNodes[a].getAttribute("a").replace(/&amp;/gi,"&");d.value=b.childNodes[a].innerHTML.replace(/&amp;/gi,"&");d.value=d.value.strip();hideBoxHint(d);hiddenVal=$(f.getAttribute("input_name")+"_key").value;hiddenStr=d.value;try{fnListOnMousedown(d)}catch(c){}}function hideBoxHint(f){try{f.setAttribute("blockResponse","1")}catch(d){}var c=f.id+"_o";if($(c)!=null){var a=$(c);a.hideDiv();try{WCH.Discard(a)}catch(b){}a.innerHTML=""}}function fnHSelectFirst(f,a){var d=$(f.getAttribute("input_name"));if(d.getAttribute("cur_div")!=null&&!isNaN(d.getAttribute("cur_div"))&&d.getAttribute("cur_div")!=""){f.parentNode.childNodes[d.getAttribute("cur_div")].style.background=unselBGColor;f.parentNode.childNodes[d.getAttribute("cur_div")].style.color=unselFGColor}f.style.background=selBGColor;f.style.color=selFGColor;d.setAttribute("cur_div",a);var b=f.parentNode;$(f.getAttribute("input_name")+"_key").value=b.childNodes[a].getAttribute("a").replace(/&amp;/gi,"&");try{fnListOnMouseover(d)}catch(c){}}function hintOnBlur(c){if(c.id==undefined){c=c.inputObject}var a=c.getAttribute("cur_div");var b=$(c.id+"_o");if(bPreSelectFirst==true){if(a==""||a==null){c.setAttribute("cur_div","0");a="0"}}if((isIE&&typeof a=="number"&&a>=0)||(!isIE&&a!=""&&b.childNodes[a]!=null)||(isIE&&a!=""&&b.childNodes[a]!=null)){if(b.childNodes.length>0){$(c.id+"_key").value=b.childNodes[a].getAttribute("a").replace(/&amp;/gi,"&");c.value=b.childNodes[a].innerHTML;c.value=c.value.strip().replace(/&amp;/gi,"&");hiddenVal=$(c.id+"_key").value;hiddenStr=c.value;hideBoxHint(c)}}};
