/**
 * Tactical Paintball League Luxembourg Web Site
 *
 * By Laroche Fabrice (Anobis Network Web and Software Developer)
 * flaroche@anobis.com
 *
 * Version 1.0.0 - 2008-02-09 - 07:57:58
 * Copyright (C) 2008, Anobis Network - All rights reserved.
 *
 * Revision History:
 *
 * Comments:
 */

function setWebStats(sPath) {
	var sFile = "webstats.php";
	var sBrowser = "";
	var sPlugins = "";
	var iFlags = 0;

	if (window.opera) { sBrowser = "opera" }
	else if (window.__defineGetter__) { sBrowser = "gecko" }
	else if (navigator.userAgent.match("MSIE")) { sBrowser = "ie" }
	else if (navigator.userAgent.match("KHTML")) { sBrowser = "khtml" }
	else if (navigator.userAgent.match("Safari")) { sBrowser = "safari" }
	else if (navigator.userAgent.match("Konqueror")) { sBrowser = "khtml" }

	if (sBrowser == "ie")
	  document.write("<html xmlns:IE><style>@media all { IE\\:clientCaps { behavior: url(#default#clientCaps); }}</style><IE:clientCaps ID=\"oclientCaps\" />");

	if (navigator.cookieEnabled)
		iFlags |= 1;

	if (navigator.javaEnabled())
		iFlags |= 2;

	/*

	NS Only!

	for (var i = 0; i < navigator.plugins.length; i++) {
		sPlugins += navigator.plugins[i].name + ", ";
		sPlugins += navigator.plugins[i].description + ", ";
		sPlugins += navigator.plugins[i].filename + ",<br> ";
	}*/

	sFile += "?url=" + escape(document.URL);
	sFile += "&ref=" + escape(parent.document.referrer); //document.referrer
	sFile += "&width=" + screen.width;
	sFile += "&height=" + screen.height;
	sFile += "&depth=" + screen.colorDepth;
	sFile += "&platform=" + navigator.platform;
	sFile += "&ulang=" + (sBrowser == "ie" ? oclientCaps.userLanguage: navigator.language);
	sFile += "&slang=" + (sBrowser == "ie" ? oclientCaps.systemLanguage: "");
	sFile += "&ctype=" + (sBrowser == "ie" ? oclientCaps.connectionType: "");
	sFile += "&cpu=" + (sBrowser == "ie" ? oclientCaps.cpuClass: "");
	sFile += "&flags=" + iFlags;
	sFile += "&plugins=" + sPlugins;

	document.write("<img src=\"" + sPath + sFile + "\" style=\"width: 0px; height: 0px; border: 0px;\" />");
}