/* #@@########################@@@@@@@@@@@@@@@@@#######################
@
  @ RVI-Media Statistika
  @ --------------------
  @
  @ Author: Ronald Vilbrandt <info@rvi-media.de>
  @ Website: http://www.rvi-media.de
  @ Copyright: 2006, Ronald Vilbrandt, RVI-Media
  @ Version: 1.0
@
 ###########################@@@@@@@@@@@@@@@@@########################## */



function statistika(dep) {

	var doc		= document;
	var loc		= doc.location;
	var ref		= doc.referrer;
	var host	= loc.hostname
	var path	= loc.pathname;
	var search	= loc.search;
	var cook	= document.cookie;
	var session = null;
	var java	= "no";
	var flash	= "no";

	// Generate new session and set cookie
	if(cook.indexOf("statistika") == -1) {

		session = Math.round(Math.random() * 15078117051982);

		var expire = new Date();
		var intTommorow = expire.getTime() + (24 * 60 * 60 * 1000);
		expire.setTime(intTommorow);
		document.cookie = "statistika=" + session + "; expires=" + expire.toGMTString() + "; path=/;";
		cook = document.cookie;

		if (navigator.javaEnabled()) {
			java = "yes";
		}

		if("undefined" == navigator.plugins["Shockwave Flash"]) {
			try	{
				new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
				flash = "yes";
			}catch(e) {}
		} else {
			flash = "yes";
		}
	}

	// Search for session
	try {
		var stc = cook.split("statistika=")[1];
		var stci = stc.indexOf(";");

		if(stci != -1) {
			stc = stc.substring(1, stci);
		}
	} catch(e) {
		stc = session;
	}

	// Set the picture source
	picSrc = "http://statistika.rvi-media.de/image_bridge.php?dep=" + dep + "&amp;http_host=" + host +
			"&http_referer=" + escape(ref) + "&request_uri=" + escape(path) +
			"&query_string=" + escape(search) +	"&session=" + stc + "&java=" + java + "&flash=" + flash;


	// Send a non visible image
	var i = new Image(1,1);
	i.src = picSrc;

	// Testing
	//document.writeln("<img src=\"" + picSrc + "\" style=\"visibility: hidden;\" />");


	return;
}