<!--
// Modified 4/14/2003
// icontact Request NetRep
// WIT v2.2
// Kevin Klawon
//
var webServer = "http://palace.intersighttechnologies.com/wia";
var binPath ="http://palace.intersighttechnologies.com/bin/icx.dll";
var bin_sslPath ="http://palace.intersighttechnologies.com/bin/icx.dll";
var c_dllPath;
if (location.protocol == "http:") c_dllPath = binPath;
else if (location.protocol == "https:") c_dllPath = bin_sslPath;


var thisPage = escape(document.location);
//var thisTitle = escape(document.title);
var thisTitle = escape(document.location);
// This will show up as the "Zone" column 
// You can either hard code for each site; uncomment this
var thisZone = escape("Pistons");
var icName = escape("Pistons");
// or use the host name in the URL
//var thisZone = escape(document.location.host);

var randomNumber = 1000000 + Math.round(Math.random()*9999999);
var beatVal = 0;
var c_beatRate = 7;


//
//  iMatter stuff
//

var iRandomNumber = 1000000 + Math.round(Math.random()*9999999); 
//
// Send click through to the Page Tracker
//
var curDomain = document.domain;
var istReferrer = " ";
//alert(document.domain + " ref " + document.referrer );
if (document.referrer.indexOf(curDomain) < 0) {istReferrer = document.referrer;}

var istURL = escape(document.location);
var istTitle = escape(document.title);
var istZone = escape(thisZone);

var trackerData;
trackerData="istURL="       + istURL +
	        "&istTitle="    + istTitle + 
	        "&istZone="     + istZone + 
	        "&istReferrer=" + istReferrer; 

var webTracker = new Image(1,1);
webTracker.src = webServer + "/WebTracker.asp?" + trackerData + "&random=" +iRandomNumber 



// CPAC stuff
if (navigator.appVersion.indexOf("Safari") < 0)
{           
	// Not Safari - So continue
	if(isIncluded()){
		var ic_initCookie = new Image(1,1);
		var surferID = 0;  // If 0, chat system create userID (ICID)
		ic_initCookie.onerror = makeRemainingCalls;
		ic_initCookie.onload = makeRemainingCalls;
		ic_initCookie.src = c_dllPath + "?initcookie?" + surferID;
	}
}

// Uppage creates the user object, so now we can tell the server more info
function makeRemainingCalls()
{
	var ic_uppage    = new Image(1,1);
    var ic_pnotify   = new Image(1,1);
    var ic_zoneinfo  = new Image(1,1);
    
    ic_uppage.src = c_dllPath + "?uppage?" + thisPage + "&" + randomNumber;
    ic_pnotify.src = c_dllPath + "?pnotify?" + thisTitle + "&" + randomNumber;
    ic_zoneinfo.src = c_dllPath + "?zoneinfo?" + thisZone + "&" + randomNumber;
    
    setTimeout("makeTimerCalls()", 1000);
}

function makeTimerCalls()
{
    var ic_uppage    = new Image(1,1);
    var ic_pnotify   = new Image(1,1);
    var ic_zoneinfo  = new Image(1,1);
    var ic_sinfo     = new Image(1,1);

    
    ic_uppage.src = c_dllPath + "?uppage?" + thisPage + "&" + randomNumber;
    ic_pnotify.src = c_dllPath + "?pnotify?" + thisTitle + "&" + randomNumber;
    ic_zoneinfo.src = c_dllPath + "?zoneinfo?" + thisZone + "&" + randomNumber;
    // This will show up in the name column
    //ic_sinfo.src = c_dllPath + "?sinfo?" + theName;
    
    if (self.name != "content")
    { 
        ic_beatGraphic = new Image(1,1);
        ic_beatGraphic.onload = beatSuccess;
        ic_beatGraphic.onerror = beatError;
        ic_beatGraphic.src = c_dllPath + "?beat?" + beatVal + "&" + getRandom();
    } else {
    	if (window.onload) oldOnLoadFcn = window.onload;
    	else oldOnLoadFcn = new Function();
    	window.onload = doOnLoad;
    }
}

function doOnLoad()
{
	oldOnLoadFcn();
	changeTargets();
}

function changeTargets()
{
	for (i = 0; i < document.links.length; i++)
	{
		if (document.links[i].protocol == "http:") c2_dllPath = binPath;
		else if (document.links[i].protocol == "https:") c2_dllPath = bin_sslPath;
		if (document.links[i].protocol == "http:" || document.links[i].protocol == "https:")
		{
			if (location.protocol != document.links[i].protocol)
			{
				if ((document.links[i].target != "_new") && (document.links[i].target != "_blank"))
				{
					document.links[i].target = "_top";
					document.links[i].href = c2_dllPath + "?pushpage?" + escape(document.links[i].href);
				}
			}
		}
	}
}


function getRandom()
{
	var max_random = 32000;
 	return Math.floor(max_random * Math.random());
}

function doBeat()
{
    ic_beatGraphic = new Image(1,1);
    ic_beatGraphic.onload = beatSuccess;
    ic_beatGraphic.onerror = beatError;
    ic_beatGraphic.src = c_dllPath + "?beat?" + beatVal + "&" + getRandom();
}

function beatError()
{
    setTimeout("doBeat()", c_beatRate * 1000);
}

function beatSuccess()
{
	self.moveTo(0,0);
	window.resizeTo(screen.width,screen.height);
	top.location = c_dllPath+"?cap?"+escape(document.location);
}



function isIncluded(){
 
var validurls = new Array(); 
validurls[0] = "\/pistons\/news\/chat_test.html";
validurls[1] = "\/pistons\/dance\/automotion.html";
validurls[2] = "\/pistons\/history\/$";
validurls[3] = "\/pistons\/multimedia\/pistonsweekly.html";
validurls[4] = "\/pistons\/multimedia\/video.html";
validurls[5] = "\/pistons\/news\/injuryreport.html";
validurls[6] = "\/pistons\/news\/media_central.html";
validurls[7] = "\/pistons\/news\/notes.html";
validurls[8] = "\/pistons\/roster\/$";
validurls[9] = "\/pistons\/schedule\/$";
validurls[10] = "\/pistons\/schedule\/download_0708.html";
validurls[11] = "\/pistons\/stats\/$";
validurls[12] = "\/pistons\/tickets\/*";
validurls[13] = "\/pistons\/tv.html";
validurls[14] = "\/pistons\/youthcamp.html";
validurls[15] = "\/pistons\/news\/chat_test2.html";
    var retresult=false ;
    for (i=0;i<validurls.length;i++){
        var patt = new RegExp(validurls[i],"i");
        if (patt.test(document.location)){
             
            retresult=true;
        }
    }      
    if (self.name == "content"){
		retresult=true;
    }
    
    return retresult;  
    //return true;
}
 

 

//-->