registerNS("TSCM.Error.Search");TSCM.Error.Search=new function(){var b;var a;var c;return{init:function(){b=new YAHOO.widget.DS_XHR(TSCM.cfg.contextRoot+"/ticker/search.ajaxaction",["tickers","symbol"]);b.scriptQueryParam="tickerName";b.queryMatchContains=false;b.queryMatchSubset=true;a=new YAHOO.widget.AutoComplete("quoteSearchError","quoteContainerError",b);a.useShadow=true;a.autoHighlight=false;a.typeAhead=true;a.forceSelection=true;a.formatResult=function(d,e){return"<span style='font-weight:bold;'>"+d[0]+"</span>"+d[1].companyName};a.doBeforeExpandContainer=function(d,e,h,g){var f=YAHOO.util.Dom.getXY(d);f[0]+=-1;f[1]+=YAHOO.util.Dom.get(d).offsetHeight;YAHOO.util.Dom.setXY(e,f);return true};c=new TSCM.util.PersistenceManager();c.id="tsc_recentquotes";c.expiry_days=365},gotoTicker:function(){var g=document.getElementById("quoteSearchError").value;var e=TSCM.cfg.contextRoot+"/quote/"+g+".html";var f=c.get();var d=false;if(f!==null){if(f.length>20){f.shift()}for(i=0;i<f.length;i++){if(f[i]==g.toUpperCase()){d=true;break}}if(!d){f.push(g.toUpperCase())}}else{f=new Array(g.toUpperCase())}c.save(f);if(g!==null&&g!==""){document.location=e}},submitenter:function(g,f){var d;if(window.event){d=window.event.keyCode}else{if(f){d=f.which}else{return true}}if(d==13){TSCM.Error.Search.gotoTicker();return false}else{return true}}}};
