//This script gather's some of the information from the user through javascript
var a = document.getElementsByTagName("a");
for(var i = 0; i < a.length; i++)
	a[i].onclick = hopto;

	if(!id) id = 'NOID';

// get the color depth --------------------------------
color = 0;
if (navigator.appName != "Netscape") color = screen.colorDepth;
else color = screen.pixelDepth;

// get the document's title ---------------------------------
title = document.title;

//get the screen size
size = screen.width+","+screen.height;

if (document.referrer&&document.referrer!="")
	r = document.referrer;
else
	r = "unknown";

	try {
		r = top.document.referrer;
	}
	catch( e ) {
		
	}

if ((r == "") || (r == "[unknown origin]") || (r == "unknown") || (r == "undefined"))
	r = "unknown";
// escape the referral
r = escape(r);

end = "?id=" + id + "&r=" + r + "&color=" + color + "&title=" + title + "&size=" + size;
if(document.location != "" && document.location != "unknown" && document.location != "undefined") {
	end = end + "&url=" + document.location;
}

document.open();
document.write("<script type=\"text/javascript\" src=\"http://www.pageonetracking.com/track.php"+end+"\"></script>");
document.close();

function hopto(e) {
	if(!e)
		e = event;
	if(!e.target)
		obj = e.srcElement;
	else
		obj = e.target;
	if(obj.tagName.toLowerCase() == "a")
		theLink = obj.href;
	else
		theLink = obj.parentNode.href;
		
	if (theLink.indexOf("mailto:") != -1) {
		newend = "?id=" + id + "&r=" + r + "&color=" + color + "&title=Email+Link&size=" + size;
		newend = newend + "&url=" + theLink.substring(7, theLink.length);
		theWin = window.open("http://www.pageonetracking.com/track.php"+newend);
		theWin.close();
		document.location = theLink;
		return false;
	}
	return true;
}
