<!--
// Modified 05.25.2003
// Kevin Klawon
// icontact Request NetRep
// WIT v2.3
var appCodeName = navigator.appCodeName;

// 4.5.4 server
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);
// This will show up as the "Name" column in the Reactive column
// You can either hard code for each site and use this
var icName = escape("Pistons");
var thisZone = escape("Pistons");

var thisPage = escape(document.location);
//var thisTitle = escape(document.title);
var thisTitle = escape(document.location);

if (isIncluded()){
if (self.name == "content")
{ 
	//alert(thisZone);
	// We are engaged in chat, so make the remaining calls to the server	
    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 + "&" + getRandom();
    ic_pnotify.src = c_dllPath + "?pnotify?" + thisTitle + "&" + getRandom();
    ic_zoneinfo.src = c_dllPath + "?zoneinfo?" + thisZone + "&" + getRandom();
   
}
}
function getRandom()
{
        var max_random = 32000;
        return Math.floor(max_random * Math.random());
}

function requestNetRep()
{
 
	// Validate that cookies are on               
	document.cookie="verifyCookie=test; path=/;"; 
	
	if (document.cookie.length > 0) 
	{
		var ic_initCookie = new Image(1,1);
		ic_initCookie.src = c_dllPath + "?initcookie?0";
		
	    if(self.name != "content") 
		{
		    // validate the chatsever is up - KTK
		    var ic_uppage = new Image(1,1);
		    ic_uppage.onload = callTimer;
		    ic_uppage.onerror = callNetworkError;  
		    ic_uppage.src = c_dllPath + "?uppage?" + thisPage + "&" + getRandom();  
		 }
	        
	} else {
	    alert("You have cookies disable.\n\nIn order to use live chat, cookies must be enabled"); 
	}              
}

function callNetworkError()
{
    alert("Please accept our apologies, we can not manage your chat request at this time.\n\nPlease try again later.");
}

function callTimer()
{   
    var ic_uppage    = new Image(1,1);
    var ic_pnotify   = new Image(1,1);
    ic_uppage.src = c_dllPath + "?uppage?" + thisPage + "&" + getRandom();
    ic_pnotify.src = c_dllPath + "?pnotify?" + thisTitle + "&" + getRandom();
    var ic_zoneinfo     = new Image(1,1); 
    ic_zoneinfo.src = c_dllPath + "?zoneinfo?" + icName;
    
    //  call sinfo so chat server gets the user name
    var ic_sinfo     = new Image(1,1); 
    ic_sinfo.src = c_dllPath + "?sinfo?" + icName;
    
    
    // Netscape ver 7 is async, so make sure the chat system gets the name field - KTK
    setTimeout("callNetRep()", 1500);
}

function callNetRep()
{
    if (navigator.appVersion.indexOf("Safari") < 0)
	{
	    // this opens the frameset
	    self.moveTo(0,0);
	    window.resizeTo(screen.width,screen.height);
	    top.location = c_dllPath + "?request_netrep?" + thisPage;
	    //top.location = c_dllPath + "?request_netrep?https://" + document.location.host + document.location.pathname + document.location.search;
	} else {
		alert("Please accept our apologies, but there is currently a problem with the Safari browser and our chat program.\n\nYour chat request can be handled if you use another brower(Like IE for the MAC).\n\nWe are working on resolving the problem.");
	}
}
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(thisPage)){
            retresult=true;
        }
    }      
    if (self.name == "content"){
		retresult=true;
    }
    return retresult;  
 
    return true;
}

//-->