// CometZone Cut-and-Paste Code 
// $Revision: 9 $
// $Date: 7/01/02 1:21p $

var netscapeConsent;
var URLsSet=false;
var Loaded=false;
var Flag=false;

window.onerror=isError;        
function isError(msg) {
	return true;
}

// Generic browser sniffer function
function Is () {      
	var agt=navigator.userAgent.toLowerCase();           
	this.major = parseInt(navigator.appVersion);
	this.nav = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)));
	this.nav3 = (this.nav && (this.major == 3)); 
	this.nav4 = (this.nav && (this.major == 4));
	this.nav6 = (this.nav && (this.major >= 5)); 
	this.win95 =((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));  
	this.ie = ( agt.indexOf("aol")!=-1 && agt.indexOf("c-aol")==-1 )|| (agt.indexOf("msie")!=-1); 
	this.ie3 =(this.ie && (this.major == 2)); 
	this.ie4 = (this.ie && ((agt.indexOf('4')!=-1) && agt.indexOf('5.')==-1));
	this.ie5 = (this.ie && (agt.indexOf('5.')!=-1));
	this.win98 =((agt.indexOf("win98")!=-1)||(agt.indexOf("windows 98")!=-1)); 
	this.winnt =((agt.indexOf("winnt")!=-1)||(agt.indexOf("windows nt")!=-1)); 
	this.win32 = this.win95 || this.winnt || this.win98 ||((this.major >= 4) && (navigator.platform == "Win32")) || (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1);
	this.compatibleIE = ( this.win32 && (this.ie4 || this.ie3 || this.ie5)); 
	this.compatibleNS = ( this.win32 && (this.nav3||this.nav4));
	this.compatible = (this.compatibleIE || this.compatibleNS); 
}
var is = new Is();
if(is.compatible) Flag=true;

function WriteNetscapeEmbedTag(cursorTag, mode, script) {
	if (is.compatibleNS) {
		if (navigator.mimeTypes["application/x-comet"]) {
			var hasMime=GetNetscapeMimeTypes();
			if(hasMime==true) {
				document.write('<embed name="CurNS" type="application/x-comet" width=2 height=1 ');
				document.write(cursorTag);
				document.writeln('></embed>');
			}
			else {
				if(!GetPreference("RejectedCursor")) ShowUpgradeConsentBox();
			}
		}
		else if(!GetPreference("RejectedCursor")) ShowDownloadConsentBox(21);
	}
}  
        
function GetNetscapeMimeTypes() {
	var mime=navigator.mimeTypes;
	var i;
	for (i=0;i<mime.length;i++) {
		if (mime[i].type.indexOf("x-comet#") >=0) {
			return true;
		}
	}
	return false;
}
        
function ShowUpgradeConsentBox() {
	var msg="This site uses CometZone Cursors!\nYou must upgrade your CometCursor software to view this content\n\Upgrade Now?";
	if(confirm(msg)) {
		if (is.ie3 ) window.location="http://download.cometsystems.com"; 
		else ShowDownloadConsentBox(22);
	}
	else SetPreference(0);
}        
        
function ShowDownloadConsentBox(code) {
	netscapeConsent="http://download.cometsystems.com/popupsplash.asp?RejectDuration=0&RefererUserCode="+code+"&RefererSite=popup&Referer=" + escape(document.location);
	consentWindow=window.open(netscapeConsent,"consent","resizable=yes,location=no,toolbar=no,scrollbars=no,height=300,width=300");
}
        
function GetPreference(name) {
	var arg = name+"=";
	var arglength=arg.length;
	var cookielength=document.cookie.length;
	var i=0;
	while(i<cookielength) {
		var valStart=i+arglength;
		if(document.cookie.substring(i,valStart)==arg) {
			var end=document.cookie.indexOf (";",valStart);
			if(end==-1) end=document.cookie.length;
			return unescape(document.cookie.substring(valStart,end));
		}
		i=document.cookie.indexOf(" ",i)+1;
		if(i==0) break;
	}
	return null;
}
        
function SetPreference(days) {document.cookie = "RejectedCursor=true";}

var globalCometPackageName;

function TheCometCursor(packageName, sponsorNum, bdid)
{
	if (sponsorNum > 0) {return;}

	var LicenseKey, cpfURL, packageURL;
	bdid = 626;
	LicenseKey = "022098a57a7b8a2530c2951038ccfc00a7ed25162b0bef-00029d-cometsystems.com;cometzone.com;akamaitech.net";
	cpfURL = "http://content.cometsystems.com/czcontent/cpfs/" + packageName + ".cpf";
	globalCometPackageName = packageName;
      
	if (is.compatibleIE)
	{
		//CC 2.+ support
		if (!is.ie3)
		{
			document.write("<META ID='CometSRC' 	 comet_src=\"http://files.cometsystems.com/javascript/cz_license.html\" >");
			document.write("<META ID='CometSCRIPT' comet_script=\"http://files.cometsystems.com/javascript/cz_license.js\" >");
		}
	
		//CC 1.X support OBJECT
		document.write("<");
		document.write("object id='CurIE' width=1 height=1 classid='CLSID:1678F7E1-C422-11D0-AD7D-00400515CAAA' CODEBASE='http://files.cometsystems.com/cometcursor/cobrand/comet.cab#Version=1,5,0,0'>");
      
	  	//WRITE Cursor package value
		document.write("<");
		document.write('param name="Pkg" value="<Name=pkg Url=');
		document.write(cpfURL);
		document.write('>">');
	  
	  	//WRITE Cursor license key
		document.write("<");
		document.write('param name="Key" value="');
		document.write(LicenseKey);
		document.write('">');
        
      //WRITE distributor tag
		document.write("<");
		document.write('param name="Distributor" value="');
		document.write(bdid);
		document.write('">');

		//End OBJECT tag
		document.write('</object>');
	}
    
	if (is.compatibleNS)
	{
		if (is.compatible&&!is.ie3) 
		{ 
			WriteNetscapeEmbedTag('Pkg="<Name=pkg Url='+cpfURL+'>"  ' , 'auto' , 'region' ); 
		}
	}
}

var Loaded=true;
