function closeContent (eid)
{
    document.getElementById(eid).style.display="none"
}

function openContent (eid)
{
    document.getElementById(eid).style.display="inline"
}
function changeType(value) {
    document.getElementById('DomainType').value=value;
}
function checkToolbar() {

if (navigator.appName=="Netscape") {
  winW = window.innerWidth;
  winH = window.innerHeight;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {
  winW = document.body.offsetWidth;
  winH = document.body.offsetHeight;
 }

if (winW < 918) {
	document.getElementById('toolbarContainer').style.left="0px";
	document.getElementById('toolbarContainer').style.marginLeft="0px";
	

}
}
function openNew() {
changeType('new');closeContent('radioHostingOn');openContent('radioNewOn');openContent('radioHostingOff');openContent('radioTransferOff');closeContent('radioNewOff');closeContent('radioTransferOn');
}
function openTransfer() {
changeType('transfer');closeContent('radioNewOn');openContent('radioTransferOn');openContent('radioHostingOff');openContent('radioNewOff');closeContent('radioTransferOff');closeContent('radioHostingOn');
}
function openHosting() {
changeType('hosting');closeContent('radioNewOn');openContent('radioHostingOn');openContent('radioTransferOff');openContent('radioNewOff');closeContent('radioHostingOff');closeContent('radioTransferOn');
}
function goBlue(eid) {
document.getElementById(eid).style.backgroundColor="#4c8bb9";
}
function goBlank(eid) {
document.getElementById(eid).style.backgroundColor="";

}
function showFree() {
closeContent('pitchSupport');
closeContent('pitchEverything');
closeContent('pitchDeveloper');
closeContent('pitchBasic');
openContent('pitchFree');
//goBlue('freeBoxLink');
//goBlank('everythingBoxLink');
//goBlank('unixBoxLink');
//goBlank('windowsBoxLink');
}
function showSupport() {
closeContent('pitchFree');
closeContent('pitchEverything');
closeContent('pitchDeveloper');
closeContent('pitchBasic');
openContent('pitchSupport');
//goBlue('freeBoxLink');
//goBlank('everythingBoxLink');
//goBlank('unixBoxLink');
//goBlank('windowsBoxLink');
}
function showEverything() {
closeContent('pitchSupport');
closeContent('pitchFree');
closeContent('pitchDeveloper');
closeContent('pitchBasic');
openContent('pitchEverything');
//goBlue('everythingBoxLink');
//goBlank('freeBoxLink');
//goBlank('unixBoxLink');
//goBlank('windowsBoxLink');

}
function showDeveloper() {
closeContent('pitchSupport');	
closeContent('pitchEverything');
closeContent('pitchFree');
closeContent('pitchBasic');
openContent('pitchDeveloper');
//goBlue('unixBoxLink');
//goBlank('freeBoxLink');
//goBlank('everythingBoxLink');
//goBlank('windowsBoxLink');

}
function showBasic() {
closeContent('pitchSupport');
closeContent('pitchEverything');
closeContent('pitchDeveloper');
closeContent('pitchFree');
openContent('pitchBasic');
//goBlue('windowsBoxLink');
//goBlank('freeBoxLink');
//goBlank('everythingBoxLink');
//goBlank('unixBoxLink');

}
function closeMenus() {
closeContent("menuWebHosting");
		closeContent("menuECommerce");
		closeContent("menuAffiliates");

}



//cj stuff START HERE
var cjaid;
var cjpid;
var cjsid;
var cjaidstart = window.location.search.indexOf("AID=");
var cjpidstart = window.location.search.indexOf("PID=");
var cjsidstart = window.location.search.indexOf("SID=");
var cjaidend = window.location.search.indexOf("&", cjaidstart);
if (cjaidend == -1) cjaidend = window.location.search.length;
var cjpidend = window.location.search.indexOf("&", cjpidstart);
if (cjpidend == -1) cjpidend = window.location.search.length;
var cjsidend = window.location.search.indexOf("&", cjsidstart);
if (cjsidend == -1) cjsidend = window.location.search.length;

var now = new Date();
fixDate(now);
// now.setTime(now.getTime() + 24 * 60 * 60 * 1000);
now.setTime(now.getTime() + 1080 * 60 * 60 * 1000);

if (cjaidstart != -1) {
        cjaid = window.location.search.substring(cjaidstart+4,cjaidend);
        setCookie("AID",cjaid,now,'/',".catalog.com")
}

if (cjpidstart != -1) {
        cjpid = window.location.search.substring(cjpidstart+4,cjpidend);
        setCookie("PID",cjpid,now,'/',".catalog.com")
}

if (cjsidstart != -1) {
        cjsid = window.location.search.substring(cjsidstart+4,cjsidend);
        setCookie("SID",cjsid,now,'/',".catalog.com")
}
//end cj stuff


var caution = false

function setCookie(name, value, expires, path, domain, secure) {
	var curCookie = name + "=" + escape(value) +
		((expires) ? "; expires=" + expires.toGMTString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");

	if (!caution || (name + "=" + escape(value)).length <= 4000){
		document.cookie = curCookie;
	}else{
		if (confirm("Cookie exceeds 4KB and will be cut!")){
			document.cookie = curCookie;
		}
	}
}

function fixDate(date) {
	var base = new Date(0);
	var skew = base.getTime();
	if (skew > 0){date.setTime(date.getTime() - skew);}
}

function getCookie(name) {
	var prefix = name + "=";
	var cookieStartIndex = document.cookie.indexOf(prefix);

	if (cookieStartIndex == -1){return null;}
	var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1){cookieEndIndex = document.cookie.length;}
	return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

var now = new Date();
fixDate(now);
now.setTime(now.getTime() + 24 * 60 * 60 * 1000 );
var current_cc_referrer = getCookie("cc_referrer");

if ((!(current_cc_referrer)) ||
    (current_cc_referrer=='no referrer') ||
    (current_cc_referrer=='bookmarked or typed') ||
    ((document.referrer) &&
        (document.referrer.substring(0,7)=='http://') &&
        (document.referrer.substring(7,23)!='www.webhero.com/') &&
        (document.referrer.substring(7,27)!='hosting.catalog.com/'))) {
	if (!(document.referrer)){
		setCookie("cc_referrer",'bookmarked or typed',now,'/',".webhero.com");
	}else{
		setCookie("cc_referrer",document.referrer,now,'/',".webhero.com");
	}
}


