// Define the location of count.asp
// Using a path, you may use this code in any subfolder

// Get the querystring
var queryObj = parseQueryString( location.search );
var file='site_stats/count.asp';
var d=new Date(); 
var s=d.getSeconds(); 
var m=d.getMinutes();
var x=s*m;
var t=document.title;
var issue=queryObj.issue_id;
	if (issue == undefined) {issue=""; } ;
var cat=queryObj.category;
	if (cat == undefined) {	cat=""; } ;
var article=queryObj.article_id;
	if (article == undefined) {article=""; } ;

// alert("cat="+cat);

f='' + escape(document.referrer);
if (navigator.appName=='Netscape'){b='NS';} 
if (navigator.appName=='Microsoft Internet Explorer'){b='MSIE';} 
if (navigator.appVersion.indexOf('MSIE 3')>0) {b='MSIE';}
u='' + escape(document.URL); w=screen.width; h=screen.height; 
v=navigator.appName; 
fs = window.screen.fontSmoothingEnabled;
if (v != 'Netscape') {c=screen.colorDepth;}
else {c=screen.pixelDepth;}
j=navigator.javaEnabled();
// Changed the info line to put quotes around the url
// info='w=' + w + '&h=' + h + '&c=' + c + '&r=' + f + '&u='+ u + '&fs=' + fs + '&b=' + b + '&x=' + x + '&t=' + t + '&issue=' + issue + '&cat=' + cat + '&article=' + article ;
// alert("here");
info='w=' + w + '&h=' + h + '&c=' + c + '&r=' + f + '&fs=' + fs + '&b=' + b + '&x=' + x + '&t=' + t + '&issue=' + issue + '&cat=' + cat + '&article=' + article + '&u='+ u ;

document.write('<img src="' + file + '?'+info+ '" width=1 height=1 border=0>');
// document.write("<br>INFO=" + file + '?' + info + "<br>");
//alert('<img src="' + file + '?'+info+ '" width=1 height=1 border=0>');

//alert( queryObj.Issue_id ); // will alert the text: joe
//alert( queryObj.article_id ); // will alert the text: acme

function parseQueryString(queryString) {
  var queryObject = new Object();
  queryString = queryString.replace(/^.*\?(.+)$/,'$1');
  queryString = queryString.toLowerCase();

  while ((pair = queryString.match(/([^=]+)=\'?([^\&\']*)\'?\&?/)) && pair[0].length) {
    queryString = queryString.substring( pair[0].length );
	// alert("a=" + queryString);

    if (/^\-?\d+$/.test(pair[2])) pair[2] = parseInt(pair[2]);
    queryObject[pair[1]] = pair[2];
  }

  return queryObject;
}
