		//	=========================================================================
		//	default.js 
		//	version 	: 1.0.0.1
		//	Author	: AH.
		//	=========================================================================

		//set a value in form field, and create it it if it doesn't exists
		
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.postModule == "function")){	
		//function to post information
		function postModule(postbackmoduleid, handlemoduleid){
		  	if (post_active == 0){
				document.getElementById("form1").method = "post";
				document.getElementById("form1").target = "ipost";
				setFormField("form1", "hidden", "domid", handlemoduleid);
				setFormField("form1", "hidden", "pbmid", postbackmoduleid);
				setFormField("form1", "hidden", "pbtid", "");
				setFormField("form1", "hidden", "dopb", "yes");
				setFormField("form1", "hidden", "dataonly", "yes");

			    document.getElementById("form1").submit();
				
				var pDiv = document.getElementById("maindiv");
				pDiv.style.filter='alpha(sytle=0,opacity=40)';
				pDiv.style.opacity='0.4';
								
				pDiv = document.getElementById("busydiv");
				if (pDiv){
					pDiv.style.display= "block";
				}
			}

		    post_active = post_active + 1;
			
			if (post_active >= 4){
			  	alert("Een ogenblik geduld a.u.b. De gegevens worden verwerkt.")
			}
		}
}
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){
		  	if (post_active == 0){
			    document.getElementById("form1").method = "post";
			    document.getElementById("form1").target = "ipost";
			    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");
			    document.getElementById("form1").submit();
				
				var pDiv = document.getElementById("maindiv");
				pDiv.style.filter='alpha(sytle=0,opacity=40)';
				pDiv.style.opacity='0.4';
	
				pDiv = document.getElementById("busydiv");
				if (pDiv){
					pDiv.style.display= "block";
				}

			}

		    post_active = post_active + 1;
			
			if (post_active >= 4){
			  	alert("Een ogenblik geduld a.u.b. De gegevens worden verwerkt.")
			}
		}
}
else alert("Error on including JS-Function 'postModuleAdvanced'. Function already exists an may not be defined twice!");


if (!(typeof document.postNow == "function")){
	//function to post information
	function postNow(my){
		var tag = "container_";
		
		while(my.parentNode.nodeName.toLowerCase() != 'div' && my.parentNode.id.substr(0, tag.length) != tag){
			my = my.parentNode;
		}
		parentId = my.parentNode.id;
		setFormField("form1", "hidden", "containerId", parentId);
		
		moduleId = parentId.split("_")[1];
		postModule(moduleId, moduleId);
	}
}
else alert("Error on including JS-Function 'postNow'. Function already exists an may not be defined twice!");