		//	=========================================================================
		//	default.js 
		//	version 	: 1.0.0.1
		//	Author	: AH.
		//	=========================================================================

		//set a value in form field, and create it it if it doesn't exists
		
		var xmlhttp;

	function goToUrlNow(url){
		window.location = url;
	}

    var goToBusy = false;
	function goToUrl(url, timeout){
	    if (goToBusy) return false;
       
		if (timeout>0)
			setTimeout ("goToUrlNow('"+url+"')", timeout)
		else
			goToUrlNow(url);
			
        goToBusy = true;
        
		return true;
	}	
		
if (!(typeof document.setFormFieldInFrame == "function")){
	function limitText(limitField, limitNum){
		if (limitNum < 1) limitNum = 255;

		if (limitField.value.length > limitNum){
			limitField.value = limitField.value.substring(0, limitNum);
		}

		return limitField.value.length;
	}	
}
		
if (!(typeof document.setFormFieldInFrame == "function")){
	function limitText(limitField, limitNum){
		if (limitNum < 1) limitNum = 255;

		if (limitField.value.length > limitNum){
			limitField.value = limitField.value.substring(0, limitNum);
		}

		return limitField.value.length;
	}	
}
		
if (!(typeof document.setFormFieldInFrame == "function")){
		function setFormFieldInFrame(frame, formid, type, varname, value){
			var command = "frame.document.getElementById('" + formid + "')." + varname;
			var result;

			command = command .replace('\n',"\\\n");
			command = command .replace('\r',"\\\r");
			result = eval(command);


			if ((result==undefined))
			{
				var newElem = document.createElement("INPUT");
				newElem.setAttribute("type",type);
				newElem.setAttribute("name",varname);
				newElem.setAttribute("id",varname);
				newElem.setAttribute("value",value);
				
				frame.document.getElementById(formid).appendChild(newElem);
			}
			else{
				command = "frame.document.getElementById('" + formid + "')." + varname + ".value = '" + value + "'";
				command = command .replace('\n',"\\\n");
				command = command .replace('\r',"\\\r");
				eval(command);
			}
		}
}
else alert("Error on including JS-Function 'setFormFieldInFrame'. Function already exists an may not be defined twice!");
	
	
if (!(typeof document.setFormField == "function")){
		//set a value in form field, and create it it if it doesn't exists
		function setFormField(formid, type, varname, value){
			var command = "document.getElementById('" + formid + "')." + varname;
			var result 

			command = command .replace('\n',"\\\n");
			command = command .replace('\r',"\\\r");
			result = eval(command);

			if ((result==undefined))
			{
				var newElem = document.createElement("INPUT");
				newElem.setAttribute("type",type);
				newElem.setAttribute("name",varname);
				newElem.setAttribute("id",varname);
				newElem.setAttribute("value", value);
				document.getElementById(formid).appendChild(newElem);
			}
			else{
				command = "document.getElementById('" + formid + "')." + varname + ".value = '" + value + "'";
				command = command .replace('\n',"\\\n");
				command = command .replace('\r',"\\\r");
				eval(command);
			}
		}
}
else alert("Error on including JS-Function 'setFormField'. Function already exists an may not be defined twice!");
		
if (!(typeof document.createFormField == "function")){
		//set a value in form field, and create it it if it doesn't exists
		function createFormField(formid, type, varname, value){
			var newElem = document.createElement("INPUT");
			newElem.setAttribute("type",type);
			newElem.setAttribute("name",varname);
			newElem.setAttribute("id",varname);
			newElem.setAttribute("value", value);
			document.getElementById(formid).appendChild(newElem);
		}
}
else alert("Error on including JS-Function 'setFormField'. Function already exists an may not be defined twice!");


		var post_active = 0;

if (!(typeof document.resetPostActive == "function")){			
		function resetPostActive(){
			post_active = 0;
		}
}
else alert("Error on including JS-Function 'resetPostActive'. Function already exists an may not be defined twice!");
	
	
if (!(typeof document.postNow == "function")){
		//function to post information
		function postNow(my){	
			postContainer(my, false);
		}

		function postClick(my){	
			postContainer(my, true);
		}

		function postContainer(my, silent){	
			var tag = "container_";
			
            //find a container.
			while(
                    my.parentNode.nodeName.toLowerCase() != 'body' 
                    && 
                    !(
                        my.parentNode.nodeName.toLowerCase() == 'div' && 
                        my.parentNode.id.substr(0, tag.length) == tag)
                    )
            {
				my = my.parentNode;
			}
            
            if (my.parentNode.nodeName.toLowerCase() != 'body'){
    			parentId = my.parentNode.id;
	       		setFormField("form1", "hidden", "containerId", parentId);
			
    			moduleId = parentId.split("_")[1];
    			postModuleNow(moduleId, moduleId, silent);
            }
            else{
                postModuleNow(0, 0, silent);   
            }
		}
}
else alert("Error on including JS-Function 'postNow'. Function already exists an may not be defined twice!");
	
if (!(typeof document.postModule == "function")){	
		//function to post information
		function postModule(postbackmoduleid, handlemoduleid){
			postModuleNow(postbackmoduleid, handlemoduleid, false);
		}

		function postModuleSilent(postbackmoduleid, handlemoduleid){
			postModuleNow(postbackmoduleid, handlemoduleid, true);
		}
		
		function postModuleNow(postbackmoduleid, handlemoduleid, silent){
			setFormField("form1", "hidden", "domid", handlemoduleid);
			setFormField("form1", "hidden", "pbmid", postbackmoduleid);
			setFormField("form1", "hidden", "pbtid", "");
		
			if (silent){
				setFormField("form1", "hidden", "dopb", "yes");
			}
			else{
				setFormField("form1", "hidden", "dopb", "no");
			}

			setFormField("form1", "hidden", "dataonly", "yes");

			postAjax(silent);
		}
}
else alert("Error on including JS-Function 'postModule'. Function already exists an may not be defined twice!");

if (!(typeof document.postModuleAdvanced == "function")){		
		function postModuleAdvanced(postbackmoduleid, handlemoduleid, postbackpagetree, dopostback, handleparameters){
			setFormField("form1", "hidden", "domid", handlemoduleid);
			setFormField("form1", "hidden", "pbmid", postbackmoduleid);
		    setFormField("form1", "hidden", "pbtid", postbackpagetree);
		    setFormField("form1", "hidden", "pbprm", handleparameters);
		    setFormField("form1", "hidden", "dopb", dopostback);
			setFormField("form1", "hidden", "dataonly", "yes");
			
			if (dopostback)
				silent = false;
			else
				silent = true;
			
			postAjax(silent);
		}
}
else alert("Error on including JS-Function 'postModuleAdvanced'. Function already exists an may not be defined twice!");

if (!(typeof document.postAjax == "function")){		
	function postAjax(silent){		
        if (post_active > 2) alert("Een ogenblik geduld a.u.b.\nUw keuze/invoer wordt verwerkt."); 
       
		postUrl = "/index.php?";
		var elem = document.getElementById('form1').elements;
		for(var i = 0; i < elem.length; i++){
			if(elem[i].name != undefined && elem[i].value != undefined){
				var name = elem[i].name;
				if (name.substr(0,3) == "___") {
					name = name.replace("___","");
				}
				
				switch(elem[i].type){
					case "checkbox" : 
						if (elem[i].checked){
							if (elem[i].value) postUrl = postUrl+''+name+'='+elem[i].value+'&';
						}
						else{
							postUrl = postUrl+''+name+'=0&';
						}
						break;
					case "radio" : 
						if (elem[i].checked){
							if (elem[i].value) postUrl = postUrl+''+name+'='+elem[i].value+'&';
						}
						break;
					default: 
						if (elem[i].value) postUrl = postUrl+''+name+'='+elem[i].value+'&';
				}
			}
		}
		
		postUrl = postUrl + '&submit=true&postajax=yes';
		
		if (post_active == 0){
			ajaxUrl(postUrl, silent);
			showBusy();
		}

        post_active = post_active + 1;
	}
}
else alert("Error on including JS-Function 'postAjax'. Function already exists an may not be defined twice!");

	
if (!(typeof document.ajaxUrl == "function")){	
		//function to post information
		function ajaxUrl(url, silent){
			xmlhttp=null;
			if (window.ActiveXObject) {
				// code for IE6, IE5
				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			else if (window.XMLHttpRequest){
				// code for Firefox, Opera, IE7, etc.
				xmlhttp=new XMLHttpRequest();
			}
			
			if (xmlhttp!=null){
				if (silent) 
					xmlhttp.onreadystatechange=stateChangedSilent; 
				else
					xmlhttp.onreadystatechange=stateChanged; 
				xmlhttp.open("POST",url,true);
				xmlhttp.send(null);
			} else {
				alert("Your browser does not support XMLHTTP.");
			}
		}
}
else alert("Error on including JS-Function 'ajaxUrl'. Function already exists an may not be defined twice!");


if (!(typeof document.stateChanged == "function")){	
		//function to post information
		function stateChanged(){
			if (xmlhttp.readyState==4){
				// 4 = "loaded"
				if (xmlhttp.status==200){
					// 200 = "OK"
					resetPostActive();
					//alert(xmlhttp.responseText);

					document.location.href = xmlhttp.responseText;
				} else {
					alert("Problem retrieving data:" + xmlhttp.status + ":" + xmlhttp.statusText);
				}
			}
		}
}
else alert("Error on including JS-Function 'stateChanged'. Function already exists an may not be defined twice!");

if (!(typeof document.stateChangedSilent == "function")){	
		//function to post information
		function stateChangedSilent(){
			resetPostActive();
		}
}
else alert("Error on including JS-Function 'stateChanged'. Function already exists an may not be defined twice!");

if (!(typeof document.SetDivOpacity == "function")){	
	function SetDivOpacity (div, opacity){
		if (document.getElementById(div)){
			opacityDiv = document.getElementById(div);
			opacityDiv .style.filter = "alpha(opacity:" + opacity + ")";
			opacityDiv .style.opacity = 0.01*opacity;
			opacityDiv .style.MozOpacity = 0.01*opacity;
		}
	}
}
else alert("Error on including JS-Function 'SetDivOpacity'. Function already exists an may not be defined twice!");

if (!(typeof document.showBusy == "function")){	
	function showBusy(){
		if (document.getElementById('mainOverlay')){
			if (document.getElementById('mainOverlay').style.display){
				document.getElementById('mainOverlay').style.display = 'block';
			}
		}
	}
}
else alert("Error on including JS-Function 'showBusy'. Function already exists an may not be defined twice!");

if (!(typeof document.hideBusy == "function")){	
	function hideBusy(){
		if (document.getElementById('mainOverlay')){
			if (document.getElementById('mainOverlay').style.display){
				document.getElementById('mainOverlay').style.display = 'none';
			}
		}
	}
}
else alert("Error on including JS-Function 'showBusy'. Function already exists an may not be defined twice!");

if (!(typeof document.externalLinks == "function")){
	function externalLinks() {
		if (!document.getElementsByTagName) return;
		var anchors = document.getElementsByTagName("a");
		for (var i=0; i<anchors.length; i++) {
			var anchor = anchors[i];
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";
		}	
	}
}
else alert("Error on including JS-Function 'externalLinks'. Function already exists an may not be defined twice!");
