// If you're using a frameset and are not getting correct
// referrers, please uncomment the following line:
// pp_frames = true;
var _cmgid = "";
var CMGproto = (window.location.protocol.indexOf("https:")==0) ? "https://" : "http://";
var CMGloc = CMGproto + "analytics.cmg.net/cmgtrax.php";
var CMGdlloc = CMGproto + "analytics.cmg.net/logclick.php";
var CMGvars = new Object();
// define some defaults
if (CMG_showme == null) { var CMG_showme = "n"; }
if (CMG_st == null) { var CMG_st = "img"; }
//if (CMG_st == null) { var CMG_st = "js"; }
// get the user agent name
CMG_v = navigator.appName;
// get the screen resolution
CMG_c = 0;
if (CMG_v != "Netscape") { CMG_c = screen.colorDepth; }
else { CMG_c = screen.pixelDepth; }
// get the screen size
CMG_s = screen.width + "x" + screen.height;
// get the document's title
CMG_t = escape(document.title);
// get the document's referrer
var CMG_f = "";
// if pp_frames is true then try getting the framed referral (without error checking)
if (typeof(pp_frames) != "undefined")
{
if (pp_frames) { CMG_f = top.document.referrer; }
}
// get the referral for non-multi-domained-framed sites using a Netscape browser
if ((CMG_f == "") || (CMG_f == "[unknown origin]") || (CMG_f == "unknown") || (CMG_f == "undefined"))
{
if (document["parent"] != null)
{
// ACCESS ERROR HERE!
if (parent["document"] != null)
{
if (parent.document["referrer"] != null)
{
if (typeof(parent.document) == "object") { CMG_f = parent.document.referrer; }
}
}
}
}
// get the referral for the current document if a framed referral wasn't found
if ((CMG_f == "") || (CMG_f == "[unknown origin]") || (CMG_f == "unknown") || (CMG_f == "undefined"))
{
if (document["referrer"] != null) { CMG_f = document.referrer; }
}
// convert all the unknown's into blank
if ((CMG_f == "") || (CMG_f == "[unknown origin]") || (CMG_f == "unknown") || (CMG_f == "undefined"))
{
CMG_f = "";
}
// escape the referral
CMG_f = escape(CMG_f);
function alturl (r)
{
document.pphLoggerImage.src = "http://analytics.cmg.net/images/pixel.gif" + r;
return false;
}
function altJs (r)
{
document.open();
document.write("");
document.close();
}
function pageValue (name, value)
{
CMGvars[name] = value;
}
function cmgTrax ()
{
// prepare data for logging
var rr = "?id=" + _cmgid + "&referer=" + CMG_f + "&r=" + CMG_s + "&c=" + CMG_c + "&showme=" + CMG_showme + "&st=" + CMG_st + "&title=" + CMG_t;
// adding logid if called by st='phpjs'
if (jslogid == null) { var jslogid = 0; }
else { rr = rr + "&jslogid=" + jslogid; }
// $HTTP_REFERER problem with NS,...
// Do it here before the CMGvars are added
//if (CMG_v != "Microsoft Internet Explorer") { r = r+"&url="+escape(document.URL); }
rr = rr + "&url=" +escape(document.URL);
// Send user defined values
for (C in CMGvars)
{
if (CMGvars[C]) { rr = rr + "&CMG_" + C + "=" + escape(CMGvars[C]); }
}
// calling logger by JavaScript-tag
if (CMG_st=='js')
{
document.open();
//document.write("");
//document.write('');
document.write('');
document.close();
}
// calling webtraxs by IMG-tag
else
{
rand = Math.round(1000*Math.random());
rr = rr + "&b=" + rand; //force the page to load the IMG
//alert(CMGloc+rr);
document.open();
//document.write("");
//document.write('');
document.write('');
document.close();
}
}
function cmgClix (link)
{
var Url = (typeof link=="string")?link:link.href;
// var r = "?id=" + _cmgid + "&url=" + escape(link.href) + "&r=" + CMG_s + "&c=" + CMG_c + "&showme=" + CMG_showme + "&st=" + CMG_st;
var r = "?id=" + _cmgid + "&url=" + escape(Url) + "&r=" + CMG_s + "&c=" + CMG_c + "&showme=" + CMG_showme + "&st=" + CMG_st;
// adding logid if called by st='phpjs'
if (jslogid == null) { var jslogid = 0; }
else { r = r + "&jslogid=" + jslogid; }
var bug = new Image();
bug.src = CMGdlloc + r;
}