var fNetscape = navigator.appName == "Netscape";


function GetWindowWidth() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return myWidth;
}

function GetScreenWidth() {
  var myWidth = 0;
  if (window.screen)
    myWidth = window.screen.width;
  if (myWidth <= 0)
    myWidth = GetWindowWidth();
  return myWidth;
}

function GetWindowHeight() {
  var myHeight = 0;
  if( typeof( window.innerHeight ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientHeight || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientHeight || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return myHeight;
}

function splitself(s, delim)
{ // JavaScript 1.0
  var ss = s;
  var as = new Array();
  var i;
  var j = ss.indexOf(delim);
  for (i=0 ;j >=0; i++) {
    as[i] = ss.substring(0, j);
    ss = ss.substring(j+1, ss.length);
    j = ss.indexOf(delim);
  }
  as[i] = ss;
  return as;
}


function stats()
{
  document.writeln("<img src='http://www.kloosterwittem.nl/logger.php?page="+document.location+"' height=2 width=2 />");
}



function setCookie(name, value, expires, path) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "");
  document.cookie = curCookie;
}


function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}


function getid(id)
{
	return (
		(document.layers && typeof document.classes != "undefined") ? (document.layers[id] || null)
		: (navigator.userAgent.toLowerCase().indexOf("msie") != -1 && document.all && ((document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body? document.body : null) && !(!!(window.opera && document.getElementById))) ? (document.all[id] || null)
		: (document.getElementById(id) || null)
	);
}
