function createRequestObject(){

	var request_o; //declare the variable to hold the object
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}

/* The variable http will hold our new XMLHttpRequest object. */
var http = createRequestObject(); 

<!--Activate Cloaking cookie
function getCookieVal (offset) 
   {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1)
      endstr = document.cookie.length;
   return unescape(document.cookie.substring(offset, endstr));
   }

function GetCookie (name) 
   {
   var arg = name + "=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while (i < clen) 
      {
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg)
         return getCookieVal (j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) break; 
      }
   return null;
   }

function SetCookie (name, value) 
   {
   var argv = SetCookie.arguments;
   var argc = SetCookie.arguments.length;
   var expires = (argc > 2) ? argv[2] : null;
   var path = (argc > 3) ? argv[3] : null;
   var domain = (argc > 4) ? argv[4] : null;
   var secure = (argc > 5) ? argv[5] : false;
   document.cookie = name + "=" + escape (value) +
        ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
        ((path == null) ? "" : ("; path=" + path)) +
        ((domain == null) ? "" : ("; domain=" + domain)) +
        ((secure == true) ? "; secure" : "");
   }

function DeleteCookie () 
   {
   var exp = new Date();
   exp.setTime (exp.getTime() - 1000000000);  // This cookie is history (changed -1 to make it previous time)
   var cval = GetCookie ('DemoName');
   document.cookie ='DemoName' + "=" + cval + "; expires=" + exp.toGMTString();
   alert("The cookie has been deleted.");
   }
//Deactivate Cloaking-->

/* gets variables from query string */

// From Shayne-Michael.COM
// This script allows you to call any variable
// passed to the query string.
// For instance suppose your query string is
// .php?userName=Shayne&Age=34
// 
// Use the following code to call those variables
//
// var userName = findvar("userName")
// var Age = findvar("Age")
function findVar(varName)
	{
	temp = "";
	searchString = varName.toLowerCase() + "=";
	testString = window.location.search.toLowerCase();
	testStart = testString.indexOf(searchString)
	if(testStart != -1)
		{
		testEnd = testString.indexOf("&", testStart)
		if(testEnd != -1)
			temp = testString.substring(testStart + varName.length + 1, testEnd);
		else if(testEnd == -1)
			temp = testString.substring(testStart + varName.length + 1, testString.length);
		}
	return unescape(temp);
	}
var id = findVar("sid");

/* sets session variable when blank */
if (id == null || id == ""){	
	  var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
		var string_length = 10;
		var randomstring = '';
		for (var i=0; i<string_length; i++) {
			var rnum = Math.floor(Math.random() * chars.length);
			randomstring += chars.substring(rnum,rnum+1);
		}
		var id = randomstring;
}

/* gets variables from placed ads */
var p = document.location.href /* name of file going to */
/*collects ad data*/	
function setBadge(l, u) {
 /* sets cookie*/
 	  var expdate = new Date (); 
      expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); 
	  var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
	  var string_length = 8;
	  var randomstring = '';
	  for (var i=0; i<string_length; i++) {
		var rnum = Math.floor(Math.random() * chars.length);
		randomstring += chars.substring(rnum,rnum+1);
	}
	  
	  if(GetCookie(l) == null){
	  
	  	SetCookie(l, randomstring, expdate);  
	  	var ses = GetCookie(l);
	  } else {
	  	var ses = GetCookie(l);
	  }
	  
	window.location.href = 'http://www.imagemkrs.com/listserver/clmgm/ad.php?l=' + l + '&p=' + p + '&u=' + u + '&ses=' + ses;
}

/* variables for usage */
var ref = document.referrer; /* name of url coming from */
var srch = window.location.search;
/*gets page from within site that is being clicked to */		
var q = window.location.pathname; 		
/* gets page usage statistics */
function setUsage(l, ss) {
	  /* sets cookie*/
 	  var expdate = new Date (); 
      expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));  
	  
	  if(GetCookie(l) == null){
	  	SetCookie(l, ss, expdate);  
	  	var ses = GetCookie(l);
	  	} else {
	  	var ses = GetCookie(l);
	  }
	 
	  /* writes to database */
document.write('<img width="1" height="1" border="0" src="http://www.imagemkrs.com/listserver/clmgm/usage.php?l=' + l + '&p=' + q +'&ref=' + ref + '&ses=' + ses + '&srch=' + srch + '">');
}