var webDomain = "http://www.thestreet.com";
var secureDomain = "https://secure2.thestreet.com";
var imagesDomain = "http://images.thestreet.com";
var appsDomain = "http://apps.thestreet.com";
var searchDomain = "http://find.thestreet.com";
var toolsDomain = "http://tools.thestreet.com";
var currentHost = location.host;

if (currentHost == "dfind01.thestreet.com" || currentHost == "appsdev.thestreet.com" || currentHost == "dpub01.thestreet.com" || currentHost == "stools.thestreet.com" || currentHost == "cms01.thestreet.com") {
	webDomain = "http://cms01.thestreet.com";
	secureDomain = "https://commercestage.thestreet.com";
	imagesDomain = "http://cms01.thestreet.com";
	appsDomain = "http://appsstage.thestreet.com";
	searchDomain = "http://dfind01.thestreet.com";
	toolsDomain = "http://stools.thestreet.com";
}


// extract _puc for partner pages and ad tags
var path = document.location.pathname;
var partner = null;
var adpuc = null;
var puc = null;
var index = path.indexOf("/_");
if(index > -1) {
	start = path.substring(index+2);
	partner = start.substring(start,start.indexOf("/"));  // used on partner story page
	puc = partner; // used in ad tags
	if(puc != null) adpuc = ("adpuc=" + puc + ";");
}

<!-- called by rmp popup cookie scripts -->
function setCookieExpDate(noDays){
    var today = new Date();
    var expr = new Date(today.getTime() + noDays*24*60*60*1000);
    return  expr.toGMTString();
}

<!-- used for features nav -->
var title = document.title;
var titString = title.split("RMYPro ");
var page = titString[1];
if (page == "Merged Earnings Call") { page = "Earnings Calls"; }

<!-- common cookie parsing code (My StockWatch, User Status -->
function GetCookie (splitby,name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg)
            return getCookieVal(splitby,j);
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break;
    }

    return null;
}

function getCookieVal (splitby,offset) {
    var endstr = document.cookie.indexOf (splitby,offset);
    if (endstr == -1)
    endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
}


<!-- called by surveys -->
function showLiveSurvey(expiration, workFlowState, liveMode) {
	var now = Date.parse(new Date());
	var endDate = Date.parse(expiration);
 
	if(document.layers){ //  netscape version < 6
		if (endDate > now && workFlowState == liveMode) {
 			document.divId.visibility="show";
			document.divId.visibility="visible";
		}
	} else {
		if (endDate > now && workFlowState == liveMode) {
			document.getElementById("divId").style.visibility="visible";
 			document.getElementById("divTable").style.display="inline";
		}
	}
}



function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
			
		}
		return null;
}


// Browser detection for unsupported browser message
    document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='" + webDomain + "/tsc/common/javascript/unsupportedBrowserDetect.js' TYPE='text/javascript'><\/SCR" + "IPT>");

// flash detection script
	document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='" + webDomain + "/tsc/common/javascript/flash_sniff.js' TYPE='text/javascript'><\/SCR" + "IPT>");

//revenue science
	if (rsistring == null) var rsistring = "";
	if (segQS == null) var segQS = "";
	document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='" + webDomain + "/tsc/common/javascript/rsi.js' TYPE='text/javascript'><\/SCR" + "IPT>");
