registerNS("TSCM.pages.Quote");TSCM.pages.Quote=new function(){return{init:function(){if(YAHOO.util.Dom.get("stockQuoteRating")!==null){try{TSCM.ratings.loadQuoteRating(TSCM.ratings.ratingData)}catch(d){}}if(YAHOO.util.Dom.get("moreinfobutton")!==null){var c=document.createElement("span");c.id="relInfoHover";document.body.appendChild(c);var f=YAHOO.util.Dom.get("relInfoDropdown");if(YAHOO.util.Dom.get("relInfoSurround")==null){var a=document.createElement("img");a.id="relInfoSurround";a.src="http://i.thestreet.com/files/tsc/v2008/css/images/spacer.gif";document.body.appendChild(a)}else{var a=YAHOO.util.Dom.get("relInfoSurround");a.src="http://i.thestreet.com/files/tsc/v2008/css/images/spacer.gif"}var b=YAHOO.util.Dom.get("moreinfobutton");TSCM.pages.Quote.enhanceRelInfoLink(b,c,f,a)}},gotoTicker:function(){var a=YAHOO.util.Dom.get("bottomQuoteSearch").value;if(a!==null&&a!==""){document.location=TSCM.cfg.contextRoot+"/quote/"+a+".html"}},loadLazyIframes:function(a,f){try{var o=YAHOO.util.Dom.getElementsByClassName(f);var j=YAHOO.util.Dom.getElementsByClassName(a);for(i=0;i<j.length;i++){var b=j[i];var d=YAHOO.util.Dom.getElementsByClassName(f,"iframe");var c=d[0];var g=YAHOO.util.Dom.getAttribute(c,"id");var n;var k;switch(g){case"predictionLaunch":n=595;k=60;break;case"sentimentPage":n=607;k=1205;break;case"analystLaunch":n=240;k=121;break;default:break}var l=c.getAttribute("longdesc");var p='\n	<iframe src="'+l+'" frameborder="0" scrolling="no" width="'+n+'" height="'+k+'" marginwidth="0" marginheight="0"></iframe>';b.innerHTML=p}}catch(m){}},enhanceRelInfoLink:function(f,c,d,b){var e=new TSCM.util.PersistenceManager();e.id="tsc_recentquotes";var a=e.get();f.onmouseover=function(){f.pos=YAHOO.util.Dom.getXY(f);var k=navigator.userAgent.toLowerCase();var l=k.indexOf("msie");if(l!=-1){if(f.offsetLeft<10){var g=f.parentNode;var j=g.childNodes;if(f!=j.item(0)){f.pos[1]=f.pos[1]+f.offsetHeight}}}c.style.visibility="visible";var m=f.pos[0];var h=f.pos[1];c.style.left=m+"px";c.style.top=h+"px";d.style.visibility="visible";d.style.top=(h-260)+"px";d.style.left=(m-144)+"px";b.style.visibility="visible";b.style.width=(d.offsetWidth+200)+"px";b.style.height=(d.offsetHeight+200)+"px";b.style.top=(h-327)+"px";b.style.left=(m-120)+"px"};hideTickerHover=function(){try{c.style.visibility="hidden";d.style.visibility="hidden";b.style.visibility="hidden"}catch(g){}};b.onmouseover=hideTickerHover;YAHOO.util.Event.addListener(window,"unload",hideTickerHover)}}};registerNS("TSCM.ratings");TSCM.ratings.loadQuoteRating=function(d,f){var g=YAHOO.util.Dom;var c=YAHOO.lang;if(!c.isObject(d)){return}var a={BUY:g.get("buy"),HOLD:g.get("hold"),SELL:g.get("sell"),"A+":g.get("Aplus"),A:g.get("A"),"A-":g.get("Aminus"),"B+":g.get("Bplus"),B:g.get("B"),"B-":g.get("Bminus"),"C+":g.get("Cplus"),C:g.get("C"),"C-":g.get("Cminus"),"D+":g.get("Dplus"),D:g.get("D"),"D-":g.get("Dminus"),"E+":g.get("Eplus"),E:g.get("E"),"E-":g.get("Eminus"),F:g.get("F")};var b={BUY:"#009933",HOLD:"#ff9933",SELL:"#cc0000","A+":"#009933",A:"#009933","A-":"#009933","B+":"#009933",B:"#009933","B-":"#009933","C+":"#ff9933",C:"#ff9933","C-":"#ff9933","D+":"#cc0000",D:"#cc0000","D-":"#cc0000","E+":"#cc0000",E:"#cc0000","E-":"#cc0000",F:"#cc0000"};var e;var h;if(f==="ETF"){e=d.InvestmentRating.split(" ",1);h=d.recommendation.split(" ",1)}else{e=d.LetterGradeRating.split(" ",1);h=d.CurrentRating.split(" ",1)}h=h.toString().toUpperCase();function j(k){if(!c.isValue(a[k])&&!c.isValue(b[k])){return}a[k].style.backgroundColor=b[k]}j(e);j(h)};if(YAHOO.util.Dom.getElementsByClassName("pwsFrame")){YAHOO.util.Event.on(window,"load",function(){window.setTimeout(function(){TSCM.pages.Quote.loadLazyIframes("pwsFrameWrapper","pwsFrame")},100)})};
