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);
//12-07-05 apl added this code becuase a clopay referrer with the string servlet/Con in it was cuasing errors;
pref = pref.replace("servlet","xservlet");
//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('');
//var url = 'http://azul.insitemetrics.com/v2/uRMJ/logtest.php?skey='+skey+'&inFrame='+inFrame+'&cookiesOff='+cookiesOff+'&purl='+purl+'&pref='+pref+'&topurl='+topurl+'&topref='+topref;
//loc = window.location.href;
//h = loc.indexOf('https') >= 0 ? 'https' : 'http';
if (action_key) {
var insite_metrics_url = 'http://www.topfloortech.com/insitemetrics/uRMJ/imgv2.php?imcustid='+imcustid+'&inFrame='+inFrame+'&cookiesEnabled='+cookiesEnabled+'&purl='+purl+'&pref='+pref+'&topurl='+topurl+'&topref='+topref+'&actk='+action_key;
}
else {
var insite_metrics_url = 'http://www.topfloortech.com/insitemetrics/uRMJ/imgv2.php?imcustid='+imcustid+'&inFrame='+inFrame+'&cookiesEnabled='+cookiesEnabled+'&purl='+purl+'&pref='+pref+'&topurl='+topurl+'&topref='+topref;
}
//prompt('test',url);
//if (imcustid != '') {
// prompt('test',url);
//}
//use an image to call the url
img = new Image(0,0);
img.src = insite_metrics_url;
//document.writeln('');