try{var dialogcontainer = document.getElementById('datacontainer');}catch(e) {} // Data Container for AJAX purposes
function switchBlock(id){document.getElementById(id).style.display="block";}
function switchNone(id){document.getElementById(id).style.display="none";}
function switchDisplay(id){
	if(document.getElementById(id).style.display=="none"){
		document.getElementById(id).style.display="block";
	}else{
		document.getElementById(id).style.display="none";
	}
}
function refreshQ(){
val=document.getElementById('q').value;

document.getElementById('qsub').innerHTML+=val+"<br />";
}
function dialog(dlg,qs){
	document.getElementById('datacontainer').innerHTML = "<img src='"+loc+"lib/images/loading.gif' style=\"position:absolute;margin-top:15px;\" />";
	document.getElementById('datacontainer').style.visibility = "visible";
	setTimeout("render_dialog('"+dlg+"','"+qs+"')",1);
}
function render_dialog(dlg,qs){
	switch(dlg)	{
		case "site":var page=loc+"";var width=312;break;
	}
	var dialogInnerHTML = "";
	dialogInnerHTML += "<div class=\"dialog-container\" style=\"width:"+width+"px;\">";
	dialogInnerHTML += "";
	dialogInnerHTML += "<span class=\"d-close\"><a href=\"javascript:void(0);\" onclick=\"document.getElementById('datacontainer').style.visibility = 'hidden';\" onmouseover=\"document.getElementById('dclose').src='"+loc+"lib/images/dialog/btn_close_hi.gif'\" onmouseout=\"document.getElementById('dclose').src='"+loc+"lib/images/dialog/btn_close.gif'\"><img id=\"dclose\" src=\""+loc+"lib/images/dialog/btn_close.gif\" border=\"0\" /></a></span>";
	dialogInnerHTML += xmlHTTPRequest(page+qs, "GET", null);
	dialogInnerHTML += "</div>";

	document.getElementById('datacontainer').innerHTML = dialogInnerHTML;
}
if(document.getElementById("cnav")!=null){
	startList = function() {
	if (document.all&&document.getElementById) {
	navRoot = document.getElementById("cnav");
	for (i=0; i<navRoot.childNodes.length; i++) {
	node = navRoot.childNodes[i];
	if (node.nodeName=="LI") {
	node.onmouseover=function() {
	this.className+=" over";
	  }
	  node.onmouseout=function() {
	  this.className=this.className.replace(" over", "");
	   }
	   }
	  }
	 }
	}
	window.onload=startList;
}
function submitForm(frm){
	sMsg="";
	switch(frm){
		case "login":
			var sUsername=document.getElementById('sUsername');
			var sPassword=document.getElementById('sPassword');
			if(sUsername.value==""){alert('Er is geen gebruikersnaam ingevuld.');sUsername.select();return false;}
			if(sPassword.value==""){alert('Er is geen wachtwoord ingevuld.');sPassword.select();return false;}
			document.getElementById("frm").action="submit.php?form=login";
			document.getElementById("frm").submit();
			return false;
			sSubmit="&name="+sUsername.value+"&pass="+sPassword.value;
			break;
	}
	if(sSubmit != "") xmlHTTPRequest('xmlhttp.php', 'POST', "form=" + frm + sSubmit);
	if(sMsg != "") alert(sMsg);
}
function Get_Cookie(name){
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
}
function Set_Cookie(name,value,expires,path,domain,secure){
    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") + 
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}
function Delete_Cookie(name,path,domain){
    if (Get_Cookie(name)) document.cookie = name + "=" +
       ( (path) ? ";path=" + path : "") +
       ( (domain) ? ";domain=" + domain : "") +
       ";expires=Thu, 01-Jan-70 00:00:01 GMT";
}
function popUp(sPage, iWidth, iHeight, bCenter){
	if(bCenter == true){
		if(navigator.appName == "Microsoft Internet Explorer"){
			iY = document.body.offsetHeight;
			iX = window.screen.availWidth;
		}
		else{
			iY = window.outerHeight
			iX = window.outerWidth
		}
		iX = (iX / 2) - (iWidth / 2);
		iY = (iY / 2) - (iHeight / 2);
	}else{
		iX = 300;
		iY = 100;
	}
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(sPage, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=" + iWidth + ",height=" + iHeight + ",left = " + iX + ",top = " + iY + "');");
}
function xmlHTTPRequest(url, method, data){
  if (!method) method = "GET";
  if (!data) data = null;
  req = xmlHTTPRequestObject();

  if (req) {
   req.open (method, url, false);
   if(method=="POST") req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
   req.send (data);
   return req.responseText;
  }
  return false;
}
function xmlHTTPAsyncRequest(url, method, data, callbackr){
  if (!method) method = "GET";
  if (!data) data = null;
  req = xmlHTTPRequestObject();
  if (req) {
   eval ('req.onreadystatechange = ' + callbackr + ';');
 req.open (method, url, true);
 req.send (data);
 return req
  }
}
function xmlHTTPRequestObject(){
 var obj = false;
 var objectIDs = new Array(
  "Microsoft.XMLHTTP",
  "Msxml2.XMLHTTP",
  "MSXML2.XMLHTTP.3.0",
  "MSXML2.XMLHTTP.4.0");
 var success = false;
 for (i=0; !success && i < objectIDs.length; i++){
  try {
   obj = new ActiveXObject(objectIDs[i]);
   success = true;
  } catch (e) { obj = false; }
 }
 if (!obj)
  obj = new XMLHttpRequest();
 return obj;
}
function isXMLHTTPRequestSupported(){
 return xmlHTTPRequestObject != null;
}