﻿//-------------------New Function  linkstat()---------

function linkstat(link_url) {

// this function triggers logging statistics for exit links from the site

if(document.images){ 

	(new Image()).src="/linkoutlog.php?link="+link_url;

	 }

return true;

} 
//-------------------New Function  linkin()---------
function linkin(){
// this function triggers logging statistics for entry links to a page
if(document.images){ 
	// now create timestamp
	docloc = document.location;
	docref = document.referrer;
	(new Image()).src="/linkoutlog.php?docloc="+docloc+"&docref="+docref;

	 }

return true;
}
//-------------------New Function  xmlLog()---------
function xmlLog(log_data, log_url){
//this function will send an Http Request Post to trigger logging of information
//log_data is the data to be logged. it should take the form of a query string
//log_url is the url used to process the log information on the server
// this function will also log the document location and the document referrer calling the function
var docloc = escape(document.location);
var docref = escape(document.referrer);
var xmlhttp = null;
var send_message = "docloc="+docloc+"&docref="+docref;
//var send_message = null;
if(log_data != null)
	{send_message = send_message + log_data;
//	alert(send_message);
	}
//code for mozilla, etc
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
if (xmlhttp!=null)
  {
  log_url = log_url + "?" + send_message;
  //alert(log_url);
  xmlhttp.open("POST",log_url,true);
  xmlhttp.send(null);
  }
return true;
}


//EOF
