/****************************************************************************   
*   BrowserCheck function
*   Copyright (C) 2002 Trèfic
***************************************************************************/
function bwcheck() {
    this.agt = navigator.userAgent.toLowerCase()  
    this.major = parseInt(navigator.appVersion) 
    this.minor = parseFloat(navigator.appVersion) 
    this.ns  = ((this.agt.indexOf('mozilla')!=-1) && (this.agt.indexOf('spoofer')==-1) && (this.agt.indexOf('compatible') == -1) && (this.agt.indexOf('opera')==-1) && (this.agt.indexOf('webtv')==-1) && (this.agt.indexOf('hotjava')==-1)) 
    this.ns2 = (this.ns && (this.major == 2)) 
    this.ns3 = (this.ns && (this.major == 3)) 
    this.ns4 = (this.ns && (this.major == 4)) 
    this.ns4up = (this.ns && (this.major >= 4)) 
    this.nsonly = (this.ns && ((this.agt.indexOf(";nav") != -1) || (this.agt.indexOf("; nav") != -1)) ) 
    this.ns6 = (this.ns && (this.major == 5)) 
    this.ns6up = (this.ns && (this.major >= 5)) 
    this.gecko = (this.agt.indexOf('gecko') != -1) 
    this.ie     = ((this.agt.indexOf("msie") != -1) && (this.agt.indexOf("opera") == -1)) 
    this.ie3    = (this.ie && (this.major < 4)) 
    this.ie4    = (this.ie && (this.major == 4) && (this.agt.indexOf("msie 5")==-1) && (this.agt.indexOf("msie 6")==-1)) 
    this.ie4up  = (this.ie && (this.major >= 4)) 
    this.ie5    = (this.ie && (this.major == 4) && (this.agt.indexOf("msie 5.0")!=-1) ) 
    this.ie5_5  = (this.ie && (this.major == 4) && (this.agt.indexOf("msie 5.5") !=-1)) 
    this.ie5up  = (this.ie && !this.ie3 && !this.ie4) 
    this.ie5_5up =(this.ie && !this.ie3 && !this.ie4 && !this.ie5)     
    this.ie6    = (this.ie && (this.major == 4) && (this.agt.indexOf("msie 6.0")!=-1) ) 
    this.opera = (this.agt.indexOf("opera") != -1) 
    this.opera2 = (this.agt.indexOf("opera 2") != -1 || this.agt.indexOf("opera/2") != -1) 
    this.opera3 = (this.agt.indexOf("opera 3") != -1 || this.agt.indexOf("opera/3") != -1) 
    this.opera4 = (this.agt.indexOf("opera 4") != -1 || this.agt.indexOf("opera/4") != -1) 
    this.opera5 = (this.agt.indexOf("opera 5") != -1 || this.agt.indexOf("opera/5") != -1) 
    this.opera5up = (this.opera && !this.opera2 && !this.opera3 && !this.opera4)   
	//
	this.site = (this.ie4up || this.ns6up || this.gecko || this.opera5up)
	return this
}
bw=new bwcheck() //BrowserCheck object

/****************************************************************************   
*   Cookie functions
***************************************************************************/
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, defval) {
	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 defval;
}

function setCookie(name, value) {
	var argv = setCookie.arguments;
	var argc = setCookie.arguments.length;
	var expires = (2 < argc) ? argv[2] : null;
	var path = (3 < argc) ? argv[3] : null;
	var domain = (4 < argc) ? argv[4] : null;
	var secure = (5 < argc) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		((path == null) ? "" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
}

/****************************************************************************   
*   voorbeeld
*
*	var expdate = new Date();
*	expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
*	setCookie("visit", visit, expdate, "/", null, false);
***************************************************************************/

