function popBigV2(strURL, objImg, strName, options) {
	var win = window.open('showimg.asp?imgsrc='+strURL+'&alt='+objImg.alt, (strName!='')?strName:'',(options)?options:'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');
	}

// form checker
function checkFormRequired( oForm )
{
	/*
		Select box always selects the first option, when no default selected item is present.
		This function checks if selected option is 0 (first one).
		If so, no option was selected.
		
		For this to work correctly, place a dummy option in select object.
	*/
	//var oForm=document.thisForm; // the form object
	var strReturn=''; // string used to store error msg in
	// loop every element in form
	for (var intCounter=0; intCounter<oForm.length;intCounter++)
	{
		var oFormItem = oForm.elements[intCounter] ;
		// check if element is required
		if (oFormItem.name.substring(0,9)=='required_'){
			// if element is 'text','textarea','select' check it
			if (((oFormItem.type=="text"||oFormItem.type=="textarea")&&oFormItem.value=='')||((oFormItem.type.toString().charAt(0)=="s")&&(oFormItem.selectedIndex==0)))
			{
				if (strReturn==''){strReturn='De volgende velden zijn niet ingevoerd:\n\n';}
				var strName = oFormItem.name.substring(9,oFormItem.name.length)
				var strFName = oFormItem.type.toString().charAt(0);
				strReturn += strName+' is niet '+(strFName=='t'?'ingevuld':'geselecteerd')+'.\n' ;
			}
		}
	}
	if (strReturn!='')
	{
		alert(strReturn);
	} else {
		//remove required tag from names, this way the reciever (asp-script?) doesn't need to remove them
		for (var intCounter=0; intCounter<oForm.length;intCounter++)
		{
			var oFormItem = oForm.elements[intCounter] ;
			// check if element is required
			if (oFormItem.name.substring(0,9)=='required_'){
				oFormItem.name = oFormItem.name.substring(9,oFormItem.name.length);
			}
		}
		//post this form
		oForm.submit();
	}
}
// common functions
function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function ShowHideMenu(whichone) {
	for (i=0; i<1; i++) {
		 NavMenu = new getObj('Layer'+(i+3));
		 if (((i+3)==whichone) && (whichone!=0)) {
		 	NavMenu.style.visibility="visible"
			 } else {
	 		NavMenu.style.visibility="hidden"
			}
		}
}


/***] CMS xmlhttp functionality [***/

	function apgf_getXMLHTTP() {
		var obj = null;
		
	    if (window.XMLHttpRequest) {
	        obj = new XMLHttpRequest();
	    } else if (window.ActiveXObject) {
	        obj = new ActiveXObject("Microsoft.XMLHTTP");
	    } else {
			obj = null;
		}	
		
		return obj;
	}
	
	function apgf_submitForm(objForm, objResult) {
		xmlhttp = apgf_getXMLHTTP(); 
		
		if (xmlhttp) {
			var strVars = apgf_buildURIString(objForm).substr(1);
			xmlhttp.open("POST", objForm.action, false);
			xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			xmlhttp.send(strVars);
			
			objResult.innerHTML = xmlhttp.responseText;
		}
	}
	
	function apgf_getObject(elementName) {
		return (document.all) ? document.all[elementName] : document.getElementByID(elementName);
	}
		
	function apgf_togglePane(showEl, arrHideEl, fnFunction) {
		var obj = document.getElementById(showEl);
		
		if (obj) {
			obj.style.display = '';
			
			obj = document.getElementById("img_" + showEl);
			if (obj) {
				obj.src = obj.src.replace(/_over.gif/gi, '.gif');
				obj.src = obj.src.replace(/.gif/gi, '_over.gif');
			}
			
			fnFunction();
		}
		
		for (var i = 0; i < arrHideEl.length; i++) {
			obj = document.getElementById(arrHideEl[i]);
			
			if (obj) {
				obj.style.display = 'none';

				obj = document.getElementById("img_" + arrHideEl[i]);
				if (obj) {
					obj.src = obj.src.replace(/_over.gif/gi, '.gif');
				}
			}
		}
		
		return false;
	}
	
	function apgf_buildURIString(objThis) {
		var strText = '';
		
		var obj = objThis;
		
		while (obj) {
			if (obj.hasChildNodes())
				strText = strText + apgf_buildURIString(obj.firstChild);
			
			if (obj.tagName)
				switch (obj.tagName.toLowerCase()) {
					case 'input':
						switch(obj.type.toLowerCase()) {
							case 'radio':
								if (obj.checked)
									strText += '&' + obj.name + '=' + apgf_encodeURI(obj.value);
								break;
								
							case 'checkbox':
								if (obj.checked)
									strText += '&' + obj.name + '=on';
								break;
								
							case 'submit':
								break;
									
							default:
								strText += '&' + obj.name + '=' + apgf_encodeURI(obj.value);
								break;
						}
						break;
						
					case 'select':
						strText += '&' + obj.name + '=' + apgf_encodeURI(obj.options[obj.selectedIndex].value);
						break;
						
					case 'textarea':
						strText += '&' + obj.name + '=' + apgf_encodeURI(obj.value);
						break;
				}
			
			obj = obj.nextSibling;
		}
		
		return strText;
	}
	
	function apgf_encodeURI(strString) {
		return encodeURIComponent(strString)
	}
	

/***] END CMS xmlhttp functionality [***/
