if(typeof TSCM == "undefined") { TSCM = {}; } if(typeof TSCM.cfg == "undefined") { TSCM.cfg = {}; } TSCM.cfg.contextRoot="http://www.thestreet.com"; var supersleight=function(){var root=false;var applyPositioning=false;var shim="http://i.thestreet.com/files/tsc/v2008/images/x.gif";shim.toString;var shim_pattern=/x\.gif$/i;var fnLoadPngs=function(){if(root){root=document.getElementById(root);}else{root=document;} for(var i=root.all.length-1,obj=null;(obj=root.all[i]);i--){if(obj.currentStyle.backgroundImage.match(/\.png/i)!==null){bg_fnFixPng(obj);} if(obj.tagName=='IMG'&&obj.src.match(/\.png$/i)!==null){el_fnFixPng(obj);} if(applyPositioning&&(obj.tagName=='A'||obj.tagName=='INPUT')&&obj.style.position===''){obj.style.position='relative';}}};var bg_fnFixPng=function(obj){var mode='scale';var bg=obj.currentStyle.backgroundImage;var src=bg.substring(5,bg.length-2);if(obj.currentStyle.backgroundRepeat=='no-repeat'){mode='crop';} obj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='"+mode+"')";obj.style.backgroundImage='url('+shim+')';};var el_fnFixPng=function(img){if(img.src!="http://i.thestreet.com/files/tsc/v2008/css/images/downArrowBtn.png"&&img.src!="http://i.thestreet.com/files/tsc/v2008/css/images/advanceSearch.png"&&img.src!="http://i.thestreet.com/files/tsc/v2008/css/images/standardSearch.png"&&img.src!="http://i.thestreet.com/files/tsc/v2008/css/images/leftEnabled.png"&&img.src!="http://i.thestreet.com/files/tsc/v2008/css/images/leftDisabled.png"&&img.src!="http://i.thestreet.com/files/tsc/v2008/css/images/rightEnabled.png"&&img.src!="http://i.thestreet.com/files/tsc/v2008/css/images/rightDisabled.png"){var src=img.src;img.style.width=img.width+"px";img.style.height=img.height+"px";img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale')";img.src=shim;}};var addLoadEvent=function(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){if(oldonload){oldonload();} func();};}};return{init:function(){addLoadEvent(fnLoadPngs);},limitTo:function(el){root=el;},run:function(){fnLoadPngs();}};}();supersleight.limitTo('bd');if(YAHOO.env.ua.ie<7&&YAHOO.env.ua.ie!=0){supersleight.init();} function registerNS(ns){var nsParts=ns.split(".");var root=window;for(var i=0;i-1){cookieSelectedFormat=GetCookie(";",cookieName);if((cookieSelectedFormat!=null)&&(cookieSelectedFormat=="formatSelectedWMA")){url="http://www.thestreet.com/radio/"+wmaplayer+"?clip="+clip;window.open(url,"clip","WIDTH=400,HEIGHT=490,top=50,left=50,status=yes,toolbar=no,menubar=no,location=no,resizable=yes");}else{var url="http://www.thestreet.com/radio/"+mp3player+"?clip="+clip;window.open(url,"clip","WIDTH=400,HEIGHT=490,top=50,left=50,status=yes,toolbar=no,menubar=no,location=no,resizable=yes");}}else{var url="http://www.thestreet.com/radio/"+mp3player+"?clip="+clip;window.open(url,"clip","WIDTH=400,HEIGHT=490,top=50,left=50,status=yes,toolbar=no,menubar=no,location=no,resizable=yes");}} function numOrdA(a,b){return(a-b);} function numOrdD(a,b){return(b-a);} function properCase(theLabel){return theLabel.toLowerCase().replace(/\b\w/g,function(p){return p.toUpperCase()});} function DLListNode(elem){this.elem=elem;this.prev=this.next=null;} DLListNode.prototype.extract=function(){if(this.prev){this.prev.next=this.next;} if(this.next){this.next.prev=this.prev;} this.prev=this.next=null;} DLListNode.prototype.insertAfter=function(newNode){if(this==newNode){return;} newNode.extract();newNode.prev=this;if(this.next){newNode.next=this.next;this.next.prev=newNode;} this.next=newNode;} function DLList(){this.prev=this.next=this;} DLList.prototype.insertAfter=DLListNode.prototype.insertAfter;DLList.prototype.getFirst=function(){return(this.next==this)?null:this.next;};DLList.prototype.getLast=function(){return(this.prev==this)?null:this.prev;};DLList.prototype.add=function(elem,afterNode){var newNode=new DLListNode(elem);if(!afterNode){if(this.prev){afterNode=this.prev;}else{afterNode=this;}} afterNode.insertAfter(newNode);return newNode;};DLList.prototype.foreach=function(func){for(var node=this.next;node!=this;node=node.next){func(node.elem);}};DLList.prototype.count=function(){var i=0;for(var node=this.next;node!=this;node=node.next){i++;} return i;};DLList.prototype.find=function(func,startNode){if(!startNode){startNode=this;} for(var node=startNode.next;node!=this;node=node.next){if(node&&func(node.elem)){return node;}}};function updateFlashVar(flash,varName,varVal){YAHOO.util.Dom.get(flash).SetVariable(varName,varVal);} function log(msg){if(typeof console!="undefined"){console.log(msg);}else{var el=document.getElementById("consoleelement");if(el){el.innerHTML+="

"+msg+"

";}}} function debug(msg){try{h=document.getElementById("debug").innerHTML;document.getElementById("debug").innerHTML=msg+"
"+h;}catch(e){}} String.prototype.chop=function(n){if(isNaN(n)){n=this.length-1;}return(this.substring(0,n));};registerNS("TSCM.util");TSCM.util.isDefined=function(v){if(typeof v=='undefined'||v==null||v==''||v=='undefined'){return false}else{return true};} TSCM.util.GetCookie=function(splitby,name){var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i|\?|\\|\/|\~|\`/g,"");}catch(e){return;}} TSCM.util.attachScript=function(id,url){var scr=document.createElement("script");scr.type="text/javascript";scr.defer=true;scr.id=id;scr.src=url;var s=document.getElementById(id);var head=document.getElementsByTagName('head')[0];try{if(s){head.removeChild(s);}}catch(e){} head.appendChild(scr);return;} TSCM.util.getEl=function(id){return YAHOO.util.Dom.get(id);} TSCM.util.Quote=function(callback,symb){this.server="http://custom.marketwatch.com";this.path="/custom/thestreet-com/xml-quote.asp?";this.params={output:"json",symb:null,callback:null} this.params.callback=callback;this.params.symb=symb;this.getParams=function(){var s='';for(var i in this.params){var o=this.params[i];if(o instanceof Array){var str=i;for(var j=0;j1?'.'+x[1]:'';var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,'$1'+','+'$2');} return x1+x2;} var req,imagepath,imgEl,replacementImg;TSCM.util.loadimage=function(_imagepath,_imgEl,_replacementImg){TSCM.util.imagepath=_imagepath;TSCM.util.imgEl=Ext.get(_imgEl);TSCM.util.replacementImg=_replacementImg;TSCM.util.req=TSCM.util.getreq();TSCM.util.req.onreadystatechange=TSCM.util.imagexists;TSCM.util.req.open("get",TSCM.util.imagepath,true);TSCM.util.req.send(null);} TSCM.util.imagexists=function(){if(TSCM.util.req.readyState==4){if(TSCM.util.req.status==200){TSCM.util.imgEl.src=TSCM.util.imagepath;}else{TSCM.util.imgEl.src=TSCM.util.replacementImg;}}} TSCM.util.getreq=function(){if(window.XMLHttpRequest) return new XMLHttpRequest();else if(window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");} registerNS("YAHOO.ext.util");YAHOO.ext.util.JSON=new function(){var useHasOwn={}.hasOwnProperty?true:false;var pad=function(n){return n<10?'0'+n:n;};var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};var encodeString=function(s){if(/["\\\x00-\x1f]/.test(s)){return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c;} c=b.charCodeAt();return'\\u00'+ Math.floor(c/16).toString(16)+ (c%16).toString(16);})+'"';} return'"'+s+'"';};var encodeArray=function(o){var a=['['],b,i,l=o.length,v;for(i=0;i=20){o.shift();} for(i=0;i9?"":"0")+x} TSCM.util.formatDate=function(date,format){format=format+"";var result="";var i_format=0;var c="";var token="";var y=date.getYear()+"";var M=date.getMonth()+1;var d=date.getDate();var E=date.getDay();var H=date.getHours();var m=date.getMinutes();var s=date.getSeconds();var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;var value=new Object();if(y.length<4){y=""+(y-0+1900);} value["y"]=""+y;value["yyyy"]=y;value["yy"]=y.substring(2,4);value["M"]=M;value["MM"]=TSCM.util.LZ(M);value["MMM"]=TSCM.util.MONTH_NAMES[M-1];value["NNN"]=TSCM.util.MONTH_NAMES[M+11];value["d"]=d;value["dd"]=TSCM.util.LZ(d);value["E"]=TSCM.util.DAY_NAMES[E+7];value["EE"]=TSCM.util.DAY_NAMES[E];value["H"]=H;value["HH"]=TSCM.util.LZ(H);if(H==0){value["h"]=12;} else if(H>12){value["h"]=H-12;} else{value["h"]=H;} value["hh"]=TSCM.util.LZ(value["h"]);if(H>11){value["K"]=H-12;}else{value["K"]=H;} value["k"]=H+1;value["KK"]=TSCM.util.LZ(value["K"]);value["kk"]=TSCM.util.LZ(value["k"]);if(H>11){value["a"]="PM";} else{value["a"]="AM";} value["m"]=m;value["mm"]=TSCM.util.LZ(m);value["s"]=s;value["ss"]=TSCM.util.LZ(s);while(i_format";}} TSCM.util.Rss=new function(){return{latestVid:function(lineupid){var callback={success:function(o){var url;try{url=TSCM.cfg.contextRoot+"/video/index.html?bctid="+id;var xml=o.responseXML;var links=xml.getElementsByTagName("link");var link=links[1];url=link.firstChild.nodeValue;}catch(e){url=TSCM.cfg.contextRoot+"/video/index.html";} document.location.href=url;},failure:function(){log('connection failed');var url=TSCM.cfg.contextRoot+"/video/index.html";document.location.href=url;},scope:this,argument:null} var rssurl=TSCM.cfg.contextRoot+"/util/videoRSSProxy.jsp?id="+lineupid;log(rssurl);var conn=YAHOO.util.Connect.asyncRequest('GET',rssurl,callback,null);}}} {var objects=document.getElementsByTagName("object");for(var i=0;i7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; function registerNS(ns){var nsp=ns.split(".");var rt=window;for(var i=0;i0){var cs=document.cookie.indexOf(cn+"=");if(cs!=-1){cs=cs+cn.length+1;var ce=document.cookie.indexOf(";",cs);if(ce==-1)ce=document.cookie.length;return unescape(document.cookie.substring(cs,ce));}}return"";} function clean(str){var s=str.toString();s=s.toLowerCase();s=s.replace(/ /g,"-");s=s.replace(/\|\.|\[|\]|\*|\!|\@|#|$|\%|\^|\&|\(|\)|\:|\'|\"|\<|\>|\?|\\|\/|\~|\`/g,"");return s;} var mainbuckets=["tsc-headlines-and-perspectives","tsc-thestreet-picks","tsc-investing-a-z","tsc-life-and-money","tsc-portfolio","tsc-quote","tsc-peps","tsc-audio","tsc-search","tsc-tools-quotes","tsc-search","tsc-business-news","remnant.thestreet.com"];var uvals=new Array();var targets={};var DS="/";var SC=";";var EQ="=";var AMP="&";var AD_COOKIE_NAME="ad_cookie";var TILE_PARAM="tile";var PTILE_PARAM="ptile";var KVAL_KEY="kval";var ORD_PARAM="ord";var SZ_PARAM="sz";var UVALUE_PARAM="u";var UVALUE_EQ="-";var UVALUE_SEP="|";var siteoverride=false;return{autotarget:true,protocol:"http://",server:"ad.doubleclick.net",calltype:"adj",default_calltype:"adj",site:"thestreet.com",defaultsite:"tsc-thestreet.com",zone:"index",sz:"",type:"adj",ord:Math.floor(Math.random()*1000000000000000),includeUvalues:false,autotile:true,tile:1,includeDcopt:true,usePtile:false,includeOrd:true,setSite:function(site){if(typeof site!="undefined"){this.site=site;siteoverride=true;}},parseMeta:function(){var meta=TSCM.metadata;var metastr="";metastr=SC+"";try{var sitezone=TSCM.metadata.Ads.site;if(isDefined(sitezone)){if(sitezone.indexOf('/')!=-1){var parts=sitezone.split('/');if(!siteoverride){this.site=parts[0];} this.zone=parts[1];this.zone=this.zone.replace(/tsc-/,"");}else{if(!siteoverride){this.site=this.defaultsite;} this.zone=this.defaultsite;}}else{if(!siteoverride){this.site=this.defaultsite;} this.zone=this.defaultsite;}}catch(e){this.site=this.defaultsite;this.zone=this.defaultsite;} try{var storymeta=TSCM.metadata.Story;for(var i in storymeta){var cs;var o=storymeta[i];if(o instanceof Array){if(i=="keyword"){try{for(var j=0;j1){this.site=loca[2];}}catch(e){}},getOrd:function(){return SC+this.makeParam(ORD_PARAM,this.getOrdNum());},getOrdNum:function(){if(this.includeOrd==true){if(this.autotile==true){return this.ord;}else{return Math.floor(Math.random()*100000000000);}}else{return this.ord;}},makeParam:function(key,value){if(key=='remove'){return;} return key+EQ+value;},getUVals:function(){var u=this.getTargetingString();var n=u.length;if(u.charAt(n-1)==SC) u=u.slice(0,n-1);u=u.split(EQ).join(UVALUE_EQ).split(SC).join(UVALUE_SEP);u=u+SC;return u;},getParameter:function(name){var qs=window.location.search;var param=name+EQ;try{var loc=qs.indexOf(param);if(loc!=-1){var start=loc+param.length;var ss=qs.substring(start);var end=ss.indexOf(AMP);if(end!=-1){return ss.substring(0,end);}else{return ss.substring(0);}}}catch(e){return"";}},addScript:function(parent){while(parent.hasChildNodes()==true){parent.removeChild(parent.childNodes[0]);} var s=document.createElement('script');s.setAttribute("type","text/javascript");s.setAttribute("src",this.geturl());parent.appendChild(s);},writeTag:function(id){document.write(new String(this.getScriptTag()));},getIframeName:function(){var name="iframe_ad"+this.sz+"t"+this.tile;return name;},getScriptTag:function(){if(!isDefined(this.calltype)){this.calltype=this.default_calltype;} if(this.calltype=="adj"){var it='<\/SCR'+'IPT>';} if(this.calltype=="adi"){var dims=this.sz.split('x');var w=dims[0];var h=dims[1];var it;var url=this.geturl();if(this.override=="blank"){url="http://i.thestreet.com/files/tsc/blank.html";} it="