/* Copyright 2008 - 2009 StockTradersPlace.com */var matAbc="#bcdbe0";var matBbc="#cde4e9";var entersl="#ffff40";var exitsl="#fffbf0";var targeturl="../ctabs/page.php?se=";var slshow_hwm=11;var idxcnt=-1;var emap={t:"tsx",n:"nasdaq",a:"amex",y:"nyse",T:"tsx",N:"nasdaq",A:"amex",Y:"nyse"};var findstr="";var collect=Array(),cs=Array(),ce=Array(),slhwm=-1;var slc,ostockinfo=Array(),stockinfo=Array();function slookup(A){var D,C,E,B;findstr=A;slhwm=-1;idxcnt=-1;if(findstr==""){update_display();return }for(C=0;C<stockinfo.length-1;C++){field=stockinfo[C].split(",");stockname=field[0];desc=field[1];exchange=field[2];if(stockname.indexOf(findstr)==0){++slhwm;collect[slhwm]=C;cs[slhwm]=stockname;ce[slhwm]=exchange}else{if(findstr.length>3&&desc.indexOf(findstr)!=-1){++slhwm;collect[slhwm]=C;cs[slhwm]=stockname;ce[slhwm]=exchange}}if(slhwm>=slshow_hwm){break}}update_display()}function update_display(){fstr=" onmouseover='reset_traversal(\"in\")' onmouseout='reset_traversal(\"out\")'";str="";nslhwm=(slhwm<slshow_hwm)?slhwm:slshow_hwm;for(i=0;i<=nslhwm;i++){field=ostockinfo[collect[i]].split(",");stockname=field[0];desc=field[1];exchange=field[2];if(idxcnt==i){mat='id="matSid"'}else{mat=(i%2==0)?'class="matA"':'class="matB"'}str+="<div "+mat+">";str+='<a href="'+targeturl+cs[i]+":"+emap[ce[i]]+'"'+fstr+">";str+="&nbsp;&nbsp;<b>"+stockname+"</b>&nbsp;&nbsp;"+desc;str+="&nbsp;&nbsp;("+emap[exchange].toUpperCase()+")";str+="</a></div>"}document.getElementById("display").innerHTML=str;if(nslhwm>=0){document.getElementById("display").style.visibility="visible"}else{document.getElementById("display").style.visibility="hidden"}}var slmouseisin=false;function reset_traversal(A){slmouseisin=(A=="in")?true:false;if(idxcnt<0||idxcnt>slhwm){return }if(slmouseisin){matbc=(idxcnt%2==0)?matAbc:matBbc}document.getElementById("matSid").style.backgroundColor=matbc;return false}function process(){if(idxcnt<0||idxcnt>slhwm){return }goctabs(cs[idxcnt]+":"+emap[ce[idxcnt]])}function goctabs(A){location.href=targeturl+A}function hkeyup(A){if(typeof (A)=="undefined"){A=window.event}key=A.keyCode;shift=A.shiftKey;ctrl=A.ctrlKey;alt=A.altKey;if(ctrl||alt){return true}if(key<48&&key!=13&&key!=46&&key!=8&&key!=27){return true}if(91<=key&&key<=93){return true}if(112<=key&&key<=145){return true}if(96<=key&&key<=105){key-=48}if(key==13){if(idxcnt==-1){goctabs(document.getElementById("slfield").value.toLowerCase())}else{process()}return false}if(key==27){document.getElementById("slfield").value=""}slookup(document.getElementById("slfield").value.toLowerCase());return false}function hkeydown(A){if(slmouseisin){return true}if(typeof (A)=="undefined"){A=window.event}key=A.keyCode;shift=A.shiftKey;ctrl=A.ctrlKey;alt=A.altKey;if(!shift&&!ctrl&&!alt){if(key==38||key==40){if(key==38){if(--idxcnt<-1){idxcnt=-1}}if(key==40){if(++idxcnt>slshow_hwm){idxcnt=slshow_hwm}}update_display();return false}}return true}var _slinitdone=false;function slinit(){if(_slinitdone){document.getElementById("slfield").style.backgroundColor=entersl;return }_slinitdone=true;document.getElementById("slimage").style.visibility="visible";gslcgo()}function gslcgo(){establishXMLHttpRequest();xmlHttp=new XMLHttpRequest();xmlHttp.open("GET","../slookup/gslc.php");xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4&&xmlHttp.status==200){slc=xmlHttp.responseText;ostockinfo=slc.split(";");stockinfo=slc.toLowerCase().split(";");document.getElementById("slfield").style.backgroundColor=entersl;document.getElementById("slimage").style.visibility="hidden"}};xmlHttp.send(null)}var cinslfield=false;function enterslfield(){cinslfield=true;slinit()}function exitslfield(){cinslfield=false;document.getElementById("slfield").style.backgroundColor=exitsl};