<!--
// Modified 4/14/2003
// icontact Request NetRep
// WIT v2.2
// Kevin Klawon
//

var webServer = "http://palace.intersighttechnologies.com/wia";
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;
}
//alert("c_dllPath=" + c_dllPath);
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("Palace");
var icName = escape("Palace");
// 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 = 5;


//
//  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 istTitle = escape(document.location);
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
	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()
{
	//alert("doing beat from prnf url:" + c_dllPath + "?beat?" + beatVal + "&" + getRandom());
    ic_beatGraphic = new Image(1,1);
    ic_beatGraphic.onload = beatSuccess;
    ic_beatGraphic.onerror = beatError;
    ic_beatGraphic.src = c_dllPath + "?beat?" + beatVal + "&" + getRandom();
}

function beatError()
{
	//alert("beatError prnf");
    setTimeout("doBeat()", c_beatRate * 1000);
}

function beatSuccess()
{
	//alert("beatSuccess prnf");
	self.moveTo(0,0);
    window.resizeTo(screen.width,screen.height);
    top.location = c_dllPath+"?cap?"+escape(document.location);
}
//alert("wit-palace-prnf.js");


//-->