function registerNS(d){if(typeof d=="undefined"){return}var c=d.split(".");var a=window;for(var b=0;b<c.length;b++){if(typeof a[c[b]]=="undefined"){a[c[b]]=new Object()}a=a[c[b]]}}registerNS("TSCM.pages.PageInfo");registerNS("TSCM.metadata");registerNS("TSCM.cfg");registerNS("TSCM.util");registerNS("TSCM");TSCM.register=function(a){registerNS(a)};function audioPlayer(e,d){var f=null;var c=false;var j="selectedAudioFormat";var a="wma_player.html";var g="audio_player.html";if(d!=null){a=d+"_wma_player.html";g=d+"_audio_player.html"}if(document.cookie.indexOf(j)>-1){f=TSCM.util.GetCookie(";",j);if((f!=null)&&(f=="formatSelectedWMA")){b="http://www.thestreet.com/radio/"+a+"?clip="+e;window.open(b,"clip","WIDTH=400,HEIGHT=490,top=50,left=50,status=yes,toolbar=no,menubar=no,location=no,resizable=yes")}else{var b="http://www.thestreet.com/radio/"+g+"?clip="+e;window.open(b,"clip","WIDTH=400,HEIGHT=490,top=50,left=50,status=yes,toolbar=no,menubar=no,location=no,resizable=yes")}}else{var b="http://www.thestreet.com/radio/"+g+"?clip="+e;window.open(b,"clip","WIDTH=400,HEIGHT=490,top=50,left=50,status=yes,toolbar=no,menubar=no,location=no,resizable=yes")}}function log(b){if(typeof console!="undefined"){console.log(b)}else{var a=document.getElementById("consoleelement");if(a){a.innerHTML+="<p>"+b+"</p>"}}}function debug(b){try{h=document.getElementById("debug").innerHTML;document.getElementById("debug").innerHTML=b+"<br>"+h}catch(a){}}TSCM.util.isDefined=function(a){if(!YAHOO.lang.isUndefined(a)){return true}else{return false}};TSCM.util.GetCookie=function(f,d){var b=d+"=";var g=b.length;var a=document.cookie.length;var e=0;while(e<a){var c=e+g;if(document.cookie.substring(e,c)==b){return TSCM.util.getCookieVal(f,c)}e=document.cookie.indexOf(" ",e)+1;if(e==0){break}}return null};function GetCookie(b,a){return TSCM.util.GetCookie(b,a)}TSCM.util.getCookieVal=function(a,c){var b=document.cookie.indexOf(a,c);if(b==-1){b=document.cookie.length}return unescape(document.cookie.substring(c,b))};TSCM.util.PersistenceManager=function(ob){this.data=null;this.id="tscs_data";this.expiry_days=365;this.path="/";this.flashid=null;this.session_cookie=false;this.get=function(){var s=this.getCookie(this.id);try{var str="var o = "+s+"";eval(str);this.data=o}catch(e){return null}return this.data};this.getstr=function(){return this.data_str};this.getdata=function(){return this.data};this.setData=function(ob){if(typeof ob=="object"){this.data=ob;try{this.data_str=YAHOO.lang.JSON.stringify(ob)}catch(e){this.data_str=""}}else{if(typeof ob=="string"){this.data_str=ob;try{eval("var o = "+this.data_str);this.data=o}catch(e){this.data=e}}}};this.setDataStr=function(str){this.data_str=str};this.save=function(ob){if(typeof ob!="undefined"){this.setData(ob)}this.setCookie(this.id,this.data_str,this.expiry_days)};this.setCookie=function(cookieName,cookieValue,num_days){var today=new Date();var expiry=new Date();if(num_days==null||num_days==0){num_days=this.expiry_days}expiry.setTime(today.getTime()+3600000*24*num_days);try{var cs;if(this.session_cookie==true){cs=escape(cookieName)+"="+escape(cookieValue)+";path="+this.path}else{cs=escape(cookieName)+"="+escape(cookieValue)+";expires="+expiry.toGMTString()+";path="+this.path}document.cookie=cs}catch(e){}};this.getCookie=function(name){var prefix=name+"=";var begin=document.cookie.indexOf(prefix);if(begin==-1){begin=document.cookie.indexOf(prefix);if(begin!=0){return null}}else{}var end=document.cookie.indexOf(";",begin);if(end==-1){end=document.cookie.length}var t=unescape(document.cookie.substring(begin+prefix.length,end));return t};this.serialize=function(ob){window.status="flash-save not implemented";return;if(typeof ob!="undefined"){this.setData(ob)}if(this.flashid==null){throw"error-flash object not defined"}else{var fl=document.ElementById(this.flashid);fl.SetVariable("mtvi_yeti_data",this.data_str)}};this.setData(ob)};TSCM.util.getParameter=function(a){var k=window.location.search;if(top.location!=self.location){k=top.window.location.search}var f="=";var l="&";var c=a+f;try{var g=k.indexOf(c);if(g!=-1){var b=g+c.length;var m=k.substring(b);var d=m.indexOf(l);if(d!=-1){return m.substring(0,d)}else{return m.substring(0)}}}catch(j){return""}};TSCM.util.attachScript=function(g,a){var f=document.createElement("script");f.type="text/javascript";f.defer=true;f.id=g;f.src=a;var c=document.getElementById(g);var b=document.getElementsByTagName("head")[0];try{if(c){b.removeChild(c)}}catch(d){}b.appendChild(f);return};TSCM.util.getEl=function(a){return YAHOO.util.Dom.get(a)};TSCM.util.ImgError=function(a){a.width=0;a.height=0;a.src=TSCM.cfg.imagesBaseUrl+"/css/images/1x1.gif";a.style.margin=0;var b=document.getElementById(a.id);if(b){b.style.display="none"}};TSCM.util.Quote=function(b,a){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=b;this.params.symb=a;this.getParams=function(){var e="";for(var d in this.params){var g=this.params[d];if(g instanceof Array){var f=d;for(var c=0;c<g.length;c++){f+=g[c]}if(e!=""){e+="&"}e+=f}else{if(e!=""){e+="&"}f=d+"="+this.params[d];e+=f}}return e};this.url=this.server+this.path+this.getParams();this.get=function(){return attachScript(YAHOO.util.Dom.generateId(),this.url)};return this.url};TSCM.util.saveQuoteTickerToMiniBox=function(c){state=new TSCM.util.PersistenceManager();state.id="tsc_recentquotes";state.expiry_days=365;var b=state.get();var a=false;if(b!=null){if(b.length>20){b.shift()}for(i=0;i<b.length;i++){if(b[i]==c.toUpperCase()){a=true;break}}if(!a){b.push(c.toUpperCase())}}else{var b=new Array(c.toUpperCase())}state.save(b)};TSCM.util.positionToPlaceholder=function(a,f){var d=YAHOO.util.Dom;var c=d.get(a);var b=d.get(f);d.setXY(c,d.getXY(b));if(c.style.display==="none"){c.style.display="block"}if(c.style.visibility==="hidden"){c.style.visibility="visible"}};function log(a){if(typeof console!="undefined"){console.log(a)}}TSCM.util.getTrackingPixel=function(b){var a=Math.floor(Math.random()*100000000000);if(typeof b!="undefined"){if(b.indexOf("?")!=-1){b+="&"}else{b+="?"}b+="ord="+a;return"<img border='0' width='1' height='1' src='"+b+"'>"}};TSCM.util.Rss=new function(){return{latestVid:function(c){var d={success:function(m){var j;try{j=TSCM.cfg.contextRoot+"/video/index.html?bctid="+id;var g=m.responseXML;var f=g.getElementsByTagName("link");var k=f[1];j=k.firstChild.nodeValue}catch(l){j=TSCM.cfg.contextRoot+"/video/index.html"}document.location.href=j},failure:function(){log("connection failed");var e=TSCM.cfg.contextRoot+"/video/index.html";document.location.href=e},scope:this,argument:null};var a=TSCM.cfg.contextRoot+"/util/videoRSSProxy.jsp?id="+c;log(a);var b=YAHOO.util.Connect.asyncRequest("GET",a,d,null)}}};TSCM.util.loginLinks={loginId:"login",accountId:"account",bottomLoginId:"loginBottom",loginUrl:TSCM.cfg.contextRoot+"/k/community/login.html?targetUrl=",logoutUrl:TSCM.cfg.contextRoot+"/user/logoff.html?redirectTo="+TSCM.cfg.commerceBaseUrl+"%2fcap%2fuserLogoff.do%3furl%3dhttp%253a%252f%252fwww.thestreet.com%252findex.html%253flogoff%253dtrue",joinUrl:TSCM.cfg.contextRoot+"/k/community/register.html?targetUrl="+location.href,accountUrl:TSCM.cfg.commerceBaseUrl+"/cap/selfserve/SSMainMenu.jsp?site=tsc&url=http://www.thestreet.com/index.html",referringUrl:new String(window.location),updateLink:function(a){if(!YAHOO.lang.isUndefined(a)||!YAHOO.lang.isNull(a)){a.link.href=a.href;a.link.innerHTML=a.text}},handleAuthenticated:function(){TSCM.util.loginLinks.updateLink({link:YAHOO.util.Dom.get(this.loginId),href:this.logoutUrl,text:"Log Out"});TSCM.util.loginLinks.updateLink({link:YAHOO.util.Dom.get(this.accountId),href:this.accountUrl,text:"Your Account"});TSCM.util.loginLinks.updateLink({link:YAHOO.util.Dom.get(this.bottomLoginId),href:this.logoutUrl,text:"Log Out"})},handleUnathenticated:function(){TSCM.util.loginLinks.updateLink({link:YAHOO.util.Dom.get(this.loginId),href:this.loginUrl+this.referringUrl,text:"Log In"});TSCM.util.loginLinks.updateLink({link:YAHOO.util.Dom.get(this.accountId),href:this.accountUrl,text:"Your Account"});TSCM.util.loginLinks.updateLink({link:YAHOO.util.Dom.get(this.bottomLoginId),href:this.loginUrl+this.referringUrl,text:"Log In"})},init:function(){if(YAHOO.util.Cookie.get("RGIS")){var b=YAHOO.util.Cookie.get("RGIS");if(b.indexOf("|")!=-1){var a=YAHOO.util.Cookie.get("RGIS").split("|")[0]}else{var a=YAHOO.util.Cookie.get("RGIS").split(",")[0]}var c=a.replace('"',"");if(parseInt(c)>0){this.handleAuthenticated()}else{this.handleUnathenticated()}}else{this.handleUnathenticated()}}};YAHOO.util.Event.onDOMReady(TSCM.util.loginLinks.init,TSCM.util.loginLinks,true);if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(n,b,p,e,k,l,g,f,d,m){if(!document.getElementById){return}this.DETECT_KEY=m?m:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(n){this.setAttribute("swf",n)}if(b){this.setAttribute("id",b)}if(p){this.setAttribute("width",p)}if(e){this.setAttribute("height",e)}if(k){this.setAttribute("version",new deconcept.PlayerVersion(k.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(l){this.addParam("bgcolor",l)}var a=g?g:"high";this.addParam("quality",a);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var j=(f)?f:window.location;this.setAttribute("xiRedirectUrl",j);this.setAttribute("redirectUrl","");if(d){this.setAttribute("redirectUrl",d)}};deconcept.SWFObject.prototype={useExpressInstall:function(a){this.xiSWFPath=!a?"expressinstall.swf":a;this.setAttribute("useExpressInstall",true)},setAttribute:function(a,b){this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addParam:function(b,a){this.params[b]=a},getParams:function(){return this.params},addVariable:function(b,a){this.variables[b]=a},getVariable:function(a){return this.variables[a]},getVariables:function(){return this.variables},getVariablePairs:function(){var c=new Array();var b;var a=this.getVariables();for(b in a){c[c.length]=b+"="+a[b]}return c},getSWFHTML:function(){var b="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}b='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';b+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var f=this.getParams();for(var e in f){b+=[e]+'="'+f[e]+'" '}var d=this.getVariablePairs().join("&");if(d.length>0){b+='flashvars="'+d+'"'}b+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}b='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';b+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var c=this.getParams();for(var e in c){b+='<param name="'+e+'" value="'+c[e]+'" />'}var a=this.getVariablePairs().join("&");if(a.length>0){b+='<param name="flashvars" value="'+a+'" />'}b+="</object>"}return b},write:function(b){if(this.getAttribute("useExpressInstall")){var a=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(a)&&!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 c=(typeof b=="string")?document.getElementById(b):b;c.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var f=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];if(a&&a.description){f=new deconcept.PlayerVersion(a.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 b=1;var c=3;while(b){try{c++;b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+c);f=new deconcept.PlayerVersion([c,0,0])}catch(d){b=null}}}else{try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(d){try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");f=new deconcept.PlayerVersion([6,0,21]);b.AllowScriptAccess="always"}catch(d){if(f.major==6){return f}}try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(d){}}if(b!=null){f=new deconcept.PlayerVersion(b.GetVariable("$version").split(" ")[1].split(","))}}}return f};deconcept.PlayerVersion=function(a){this.major=a[0]!=null?parseInt(a[0]):0;this.minor=a[1]!=null?parseInt(a[1]):0;this.rev=a[2]!=null?parseInt(a[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(a){if(this.major<a.major){return false}if(this.major>a.major){return true}if(this.minor<a.minor){return false}if(this.minor>a.minor){return true}if(this.rev<a.rev){return false}return true};deconcept.util={getRequestParameter:function(c){var d=document.location.search||document.location.hash;if(c==null){return d}if(d){var b=d.substring(1).split("&");for(var a=0;a<b.length;a++){if(b[a].substring(0,b[a].indexOf("="))==c){return b[a].substring((b[a].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var b=document.getElementsByTagName("OBJECT");for(var c=b.length-1;c>=0;c--){b[c].style.display="none";for(var a in b[c]){if(typeof b[c][a]=="function"){b[c][a]=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(a){return document.all[a]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
