// Woedend! Traffic

var TrafficDomain = "http://traffic.woedend.nl";

function TrafficTrack (directory, trackID)
{
	var dateObject = new Date ();
	var imageObject = new Image ();

	imageObject.src = TrafficDomain + '/' + directory + '/index.php?type=track&trackID=' + trackID + '&timestamp=' + dateObject.getTime ();
}

function TrafficClick ()
{

}

function TrafficMail ()
{

}

function TrafficPageFlash (directory)
{
	var dateObject = new Date ();
	var source = TrafficDomain + '/' + directory + '/index.php?type=page';
	for (var i = 1; i < arguments.length; i ++)
	{
		source += '&name[]=' + escape (arguments[i]);
	}
	source += '&timestamp=' + dateObject.getTime ();
	source += '&host=' + location.hostname;
	if (typeof (top.document) == 'object' && top.document.referrer != top.document.location)
	{
		source += '&referrer=' + escape (top.document.referrer);
	}
	if (window.screen.width && window.screen.height && window.screen.colorDepth)
	{
		source += ('&screen=' + parseInt (window.screen.width) + 'x' + parseInt (window.screen.height) + 'x' + parseInt (window.screen.colorDepth));
	}

	return source;
}

function TrafficPage (directory)
{
	var dateObject = new Date ();
	var source = TrafficDomain + '/' + directory + '/index.php?type=page';
	for (var i = 1; i < arguments.length; i ++)
	{
		source += '&name[]=' + escape (arguments[i]);
	}
	source += '&timestamp=' + dateObject.getTime ();
	source += '&host=' + location.hostname;
	if (typeof (top.document) == 'object' && top.document.referrer != top.document.location && top.document.referrer.substring (7, location.hostname.length + 7) != location.hostname)
	{
		source += '&referrer=' + escape (top.document.referrer);
	}
	if (window.screen.width && window.screen.height && window.screen.colorDepth)
	{
		source += ('&screen=' + parseInt (window.screen.width) + 'x' + parseInt (window.screen.height) + 'x' + parseInt (window.screen.colorDepth));
	}

	var imageObject = new Image ();
	imageObject.src = source;
}
