function RegistreerActie(id1,id2,id3,id4,freetext) {
	var tag="/inc/SaveCounter.asp";
	var agt=navigator.userAgent.toLowerCase();
	var major = parseInt(navigator.appVersion);
	var minor = parseFloat(navigator.appVersion);
	var ie   = (agt.indexOf("msie") != -1);
	var ie3=(ie && (major == 2));
	var win=((agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1));

	tag+=("?id1="+id1);
	if (id2) {tag+=("&id2="+id2)}
	if (id3) {tag+=("&id3="+id3)}
	if (id4) {tag+=("&id4="+id4)}
	if (freetext) {tag+=("&freetext="+freetext)}

//	SetCookie("TestSession","Renault");
//	if (GetCookie("TestSession")=="Renault") {
//		tag+=("&SesCookie="+1);
//		var ExpDate = new Date ();
//		ExpDate.setTime(ExpDate.getTime()+100);
//		SetCookie("TestCook","Renault",ExpDate)
//		if (GetCookie("TestCook")=="Renault") {
//			tag+=("&Cookie="+1);
//			DelCookie("TestCook");
//		}
//		else {
//			tag+=("&Cookie="+0);
//		}
//	}
//	else {
//		tag+=("&SesCookie="+0+"&Cookie="+0 );
//		//tag+=("&Cookie="+navigator.cookieEnabled );
//	}

	if( TestSessionCookie() ){
		tag += ("&SesCookie=1");
		
		if( TestCookie() ){
			tag += ("&Cookie=1");
		}else{
			tag += ("&Cookie=0");
		}
	}else{
		tag += ("&SesCookie=0");
		
		if( TestCookie() ){
			tag += ("&Cookie=1");
		}else{
			tag += ("&Cookie=0");
		}
	}

	// Mozilla/4.0 (compatible; MSIE 5.01; Windows 98)

	agt  = agt.replace("mozilla/4.0 ","");
	agt  = agt.replace("compatible; ","");
	tag +=("&userAgent=" + URLEncode(agt) );

	//tag+=("&userAgent="+navigator.userAgent )

	if (ie) {
	 var splitvalue=navigator.appVersion.split(";");
	 var version=splitvalue[1].split(" ");
	 tag+=("&Browser=" + URLEncode(version[1])  );
	 tag+=("&Version=" + version[2]  );
	} else {
	  appl=navigator.appName.toLowerCase();
	  if (appl.indexOf("netscape") != -1) {
	     var splitvalue=navigator.appVersion.split(" ");
	     tag+=("&Browser=" + URLEncode(appl) );
	     tag+=("&Version=" + splitvalue[0]  );
	  } else {
	     tag+=("&Browser=" + URLEncode(navigator.appName));
	     tag+=("&Version=" + navigator.appVersion  );
	  }
	}
	 if(parseInt(navigator.appVersion)>3) {
	    if(screen.availWidth>0) {
	      tag+=("&screen="+screen.width+"x"+screen.height);
	      tag+=("&colordepth="+screen.colorDepth);
	    }
	}
	
	// Append a parameter with random value, this one is not used in savecounter.asp, it's to prevent
	// Netscape from "showing" a cached version of the "tag" image source
	tag += "&bogus=" + Math.random() * 10000;
	
	var statImage = new Image();
	statImage.src = tag;

//	if( document.counterImage ) {
//		document.counterImage.src = tag;
//	} else {
//		//document.write("<img name='counterImage' id='counterImage' src='/images/renault.gif' border='0' width='1' height='1' align='right'>");
//		document.write("<img src='"+tag+"' width='1' height='1' align='right'>")
//	}
}

function URLEncode(plaintext) {
	// The Javascript escape and unescape functions do not correspond
	// with what browsers actually do...
	var SAFECHARS = "0123456789" +					// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetci
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
	var HEX = "0123456789ABCDEF";

	var encoded = "";
	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";				// x-www-urlencoded, rather than %20
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
				encoded += "+";
			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	} // for
	return encoded;
};

var myDomain=null;
function getCookieVal(offset){var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr));}
function GetCookie(name) {var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) {var j = i + alen;if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0)break;} return null;}
function SetCookie(name,value){var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");}
function DelCookie(name){var ExpDate = new Date ();ExpDate.setTime(ExpDate.getTime()-1);SetCookie(name,"",ExpDate,myDomain);return;}


function TestSessionCookie(){
	if( GetCookie("TestSession") == "Renault" ){
		return true;
	}
	
	SetCookie("TestSession", "Renault");
	
	if( GetCookie("TestSession") == "Renault" ){
		return true;
	}else{
		return false;
	}
}

function TestCookie(){
	if( GetCookie("TestCook") == "Renault" ){
		return true;
	}
	
	var ExpDate = new Date();
	ExpDate.setTime(ExpDate.getTime());
	ExpDate.setDate(ExpDate.getDate() + 1);
	
	SetCookie("TestCook", "Renault", ExpDate)
	
	if ( GetCookie("TestCook") == "Renault" ){
		return true;
	}else{
		return false;
	}
}

