
var imcustid = '';
//check if customer id is on the page
if (typeof cust_id != 'undefined') {
	if (cust_id) {
		imcustid = cust_id;
	}
}

//check if in frame and get the referrer for the top frame
var inFrame = '0';
var topref = "";
var topurl = "";
var action_key;
if (window.parent != window) {
	inFrame = '1';
	if (("" + window.parent.location) != "") {
		topref = escape(window.parent.document.referrer);
		topurl = escape(window.parent.document.location);
	}
}

//get the referrer for this page
var pref=escape(document.referrer);
//get the url for this page
var purl=escape(document.location);

//check for cookies enabled
//  method only checks for first party cookies we are only interested in third party cookies
//  can not check for third party cookies, first party will have to do
/*
var cookiesOff;
var cdate = new Date();
cdatestr = (cdate.getTime() + '');
document.cookie = "chkcookie=" + cdatestr + "; path=/";
if (document.cookie.indexOf(cdatestr,0) < 0) {
	cookiesEnabled = '0';
}
else {
	cookiesEnabled = '1';
}
*/
cookiesEnabled = '0';

//document.writeln('<img src="http://azul.insitemetrics.com/v2/uRMJ/logtest.php?st='+f+'&topf='+topf+'" width="0" height="0" >');

//var url = 'http://azul.insitemetrics.com/v2/uRMJ/logtest.php?skey='+skey+'&inFrame='+inFrame+'&cookiesOff='+cookiesOff+'&purl='+purl+'&pref='+pref+'&topurl='+topurl+'&topref='+topref;
if (action_key) {
	var url = '//www.insitemetrics.com/imv2/uRMJ/imgv2.php?imcustid='+imcustid+'&inFrame='+inFrame+'&cookiesEnabled='+cookiesEnabled+'&purl='+purl+'&pref='+pref+'&topurl='+topurl+'&topref='+topref+'&actk='+action_key;
}
else {
	var url = '//www.insitemetrics.com/imv2/uRMJ/imgv2.php?imcustid='+imcustid+'&inFrame='+inFrame+'&cookiesEnabled='+cookiesEnabled+'&purl='+purl+'&pref='+pref+'&topurl='+topurl+'&topref='+topref;
}

//prompt('test',url);
//use an image to call the url
img = new Image(0,0);
img.src = url;

//document.writeln('<img src="'+url+'" width="0" height="0" >');
