	var debug = 0;
	var post_info = 1;
	var log_https = 0;

	//var my_logger = "http://stats.ashop.com.au/WebStats/default.aspx?";
	var my_logger = location.protocol + "//" + location.hostname + "/stats/Trial/WebStats/default.aspx?";
	var my_referer = "" + document.referrer;
	var my_domain = document.domain;
	var my_res = "" + screen.width + "x" + screen.height;
	var my_title = "" + document.title;
	var my_agent = navigator.appName+' '+navigator.appVersion;
	var my_CookieKey = "" + checkCookie("WebStats");
	var my_SessionKey = "" + checkSession("WebSession");
	if (document.location != "")
		var my_url = "" + document.location;
	else
		if (Current_page_URL != "")
			var my_url = "" + Current_page_URL;
		else
			var my_url = "";

	function getCookie(CookieName) {
		if (document.cookie.length>0) {
		  c_start = document.cookie.indexOf(CookieName + "=");
		  if (c_start != -1) {
		    c_start = c_start + CookieName.length + 1;
		    c_end = document.cookie.indexOf(";",c_start);
		    if (c_end == -1) c_end = document.cookie.length;
		    return unescape(document.cookie.substring(c_start,c_end));
			} 
		}
		return null;
	}
	
	function setCookie(CookieType, CookieName, CookieValue, ExpireHours) {
		var exdate = new Date();
		exdate.setTime (exdate.getTime() + (ExpireHours * 60 * 60 * 1000)); 
		switch (CookieType) {
			case 1: //Session Cookie
				document.cookie = CookieName + "=" + escape(CookieValue) + ";path=/";
				break;
			case 2: //Permanent Cookie
				document.cookie = CookieName + "=" + escape(CookieValue) + ";expires=" + exdate.toGMTString() + ";path=/";
				break;
		}
	}

	function deleteCookie(CookieName) {
		var exdate = new Date();
		exdate.setTime (exdate.getTime() - 10);
		document.cookie = CookieName + "=gone;expires=" + exdate.toGMTString() + ";path=/";
	}
	
	function checkCookie(CookieName) {
		var CookieKey = getCookie(CookieName);
		if (CookieKey == null) {
			CookieKey = GeneratePassword();
		}
		setCookie(2, CookieName, CookieKey, 6);
		return CookieKey;
	}

	function checkSession(CookieName) {
		var CookieKey = getCookie(CookieName);
		if (CookieKey == null) {
			CookieKey = GeneratePassword();
			setCookie(1, CookieName, CookieKey, 0);
		}
		return CookieKey;
	}

	function GeneratePassword() {
		var minsize, maxsize, count, actualsize;
		minsize = 16;
		maxsize = 16;
		var validchars = "";
		var startvalid = "";
		var password = "";

		validchars = "ABCDEFGHJKLMNPQRTUVWXY0123456789";
		startvalid = "ABCDEFGHJKLMNPQRTUVWXY0123456789";
		actualsize = Math.floor(Math.random() * (maxsize - minsize + 1)) + minsize;
		password = startvalid.charAt(Math.floor(Math.random() * startvalid.length));
		for (count = 1; count < actualsize; count++)
		  password += validchars.charAt(Math.floor(Math.random() * validchars.length));
		return password;
	}

	my_referer = my_referer.substring(0, 249);
	my_title = my_title.substring(0, 149);
	my_url = my_url.substring(0, 149);
	my_referer = escape(my_referer);
	my_title = escape(my_title);
	my_url = escape(my_url);
	my_agent = my_agent.toUpperCase();
	my_CookieKey = escape(my_CookieKey);
	my_SessionKey = escape(my_SessionKey);

	my_doc_loc = "" + document.location;
	myRE = new RegExp("^https", "i")

	if (window.log_https == 0) {
		if (my_doc_loc.match(myRE)) {
			post_info = 0;
		}
	}

	if (window.post_info == 1) {
		my_logger += "SiteID=" + mySiteID;
		my_logger += "&TimeZoneOffSet=" + TimeZone;
		my_logger += "&URLReferrer=" + my_referer;
		my_logger += "&Resolution=" + my_res;
		my_logger += "&MachineName=" + MachineCode;
		my_logger += "&Domain=" + my_domain;
		my_logger += "&RawURL=" + my_url;
		my_logger += "&DocumentTitle=" + my_title;
		my_logger += "&UserAgent=" + my_agent;
		my_logger += "&CookieKey=" + my_CookieKey;
		my_logger += "&SessionKey=" + my_SessionKey;
		my_logger += "&no-cache=" + Math.random();
		
		if (debug==1) {
			document.writeln(my_logger);
		} 
		else {
			my_img = new Image();
			my_img.src = my_logger;			
		}
	}

