// CometZone Cut-and-Paste Code 
// $Revision: 5 $
// $Date: 10/19/01 11:40a $

var popupURL;
var URLsSet=false;
var Loaded=false;
var Flag=false;


window.onerror=isError;        
function isError(msg) {
    //alert("ERROR");
    return true;
}

function Is () {       // Browser Sniffer
    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 NSEmbed(cursorTag, mode, script) {
    if (is.compatibleNS) {
        if (navigator.mimeTypes["application/x-comet"]) {
            var hasMime=GetMime();
            if(hasMime==true) {
                document.write('<embed name="CurNS" type="application/x-comet" width=2 height=1 ');
                document.write(cursorTag);
                document.writeln('></embed>');
            }
            else {
                if(!GetCookie("RejectedCursor")) OfferUpgrade();
            }
        }
        else if(!GetCookie("RejectedCursor")) showPopUp(21);
    }
}  
        
function GetMime() {
    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 OfferUpgrade() {
    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 showPopUp(22);
    }
    else setReject(0);
}        
        
function showPopUp(code) {
    //var gifURL="http%3A//content.cometsystems.com/users/"+userid+"/pop"+acctnum+".gif";
    popupURL="http://download.cometsystems.com/popupsplash.asp?RejectDuration=0&RefererUserCode="+code+"&RefererSite=popup&Referer=" + escape(document.location);
    popupWin=window.open(popupURL,"popupwindow","resizable=yes,location=no,toolbar=no,scrollbars=no,height=300,width=300");
}
        
function GetCookie(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 setReject(days) {document.cookie = "RejectedCursor=true";}

var globalCometPackageName;

function TheCometCursor(packageName, sponsorNum, bdid)
{
  if (sponsorNum > 0) {return;}
  if (bdid == null) {bdid = 626;}
  
  var LicenseKey, cpfURL, packageURL;
  
  if (bdid == 626)
    {LicenseKey = "022098a57a7b8a2530c2951038ccfc00a7ed25162b0bef-00029d-cometsystems.com;cometzone.com;akamaitech.net";}

  	//LUKE
  else if (bdid == 686)
    {LicenseKey = "0220cfb4f8ea072dd5fde036e9a1258cb49f1c1d2b0fef-0002ae-cometsystems.com;cometzone.com;akamaitech.net;lh";}

  	//NICOLE
  else if (bdid == 687)
    {LicenseKey = "022027a8a98b5778b4911344d6983775bb001c1d2b0fef-0002af-cometsystems.com;cometzone.com;akamaitech.net;nk";}

  	//LYNNETTE
  else if (bdid == 688)
    {LicenseKey = "02204afd0cc08ad4a309bdd8d9641e16eedc1c1d2b0fef-0002b0-cometsystems.com;cometzone.com;akamaitech.net;lm";}

  	//MATT GILLIS
  else if (bdid == 689)
    {LicenseKey = "02200ada27a637ef7cad08eee7e8d89861b01c1d2b0fef-0002b1-cometsystems.com;cometzone.com;akamaitech.net;mg";}

  	//EVERYONE ELSE (SAME AS 626)
  else
    {LicenseKey = "022098a57a7b8a2530c2951038ccfc00a7ed25162b0bef-00029d-cometsystems.com;cometzone.com;akamaitech.net";}
	
  //alert("bdid = " + bdid + "\n\nLicenseKey = " + LicenseKey);

  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
      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 Pkg
	  document.write("<");
      document.write('param name="Pkg" value="<Name=pkg Url=');
      document.write(cpfURL)
      document.write('>">');
	  
	  	//WRITE Key
	  document.write("<");
      document.write('param name="Key" value="');
      document.write(LicenseKey)
      document.write('">');
        
      	//WRITE Distributor
	  document.write("<");
      document.write('param name="Distributor" value="');
      document.write(bdid)
      document.write('">');
                
      document.write('</object>');
    }
    
  if (is.compatibleNS)
    {
	  if (is.compatible&&!is.ie3) 
        { 
          NSEmbed('Pkg="<Name=pkg Url='+cpfURL+'>"  ' , 'auto' , 'region' ); 
        }
    }
}

var Loaded=true;

