// REQUIRES /includes/utils.js to be loaded before this file

/*  Loads the javascript file specified in script into the document
	Returns the new script element.
	Returns null if document.createElement is not supported or if the creation fails.
*/
function include(script)
{
	if(!document.createElement) return null;
	if (!document.appendChild) return null;
	var e=document.createElement('script');
	e.setAttribute('src',script);
	// Attach the script to the head element.  There is only one so use first one in list.
	document.getElementsByTagName("head")[0].appendChild(e); 
	return e;
}

// Hits Link tracking script
function callHitsLink()
{
	//<![CDATA[
	wa_account="serendip"; 
	wa_location=14;
	wa_pageName=location.pathname;  // you can customize the page name here
	document.cookie='__support_check=1';
	wa_hp='http';
	wa_rf=document.referrer;
	wa_sr=window.location.search;
	wa_tz=new Date();
	if(location.href.substr(0,6).toLowerCase()=='https:')
		wa_hp='https';wa_data='&an='+escape(navigator.appName)+ 
			  '&sr='+escape(wa_sr)+'&ck='+document.cookie.length+
			  '&rf='+escape(wa_rf)+'&sl='+escape(navigator.systemLanguage)+
			  '&av='+escape(navigator.appVersion)+'&l='+escape(navigator.language)+
			  '&pf='+escape(navigator.platform)+'&pg='+escape(wa_pageName);
	wa_data=wa_data+'&cd='+
			screen.colorDepth+'&rs='+escape(screen.width+ ' x '+screen.height)+
			'&tz='+wa_tz.getTimezoneOffset()+'&je='+ navigator.javaEnabled();
	wa_img=new Image();
	wa_img.src= wa_hp+'://counter.hitslink.com/statistics.asp'+
				'?v=1&s='+wa_location+'&acct='+wa_account+wa_data+'&tks='+wa_tz.getTime();
	// load track.js 
	var wa_u = include(wa_hp+'://counter.hitslink.com/track.js'); //]]>
}

/* Add callHitsLink to the list of scripts called when page loads */
addLoadListener(callHitsLink);