function CheckAll(theElement) {
	var theForm = theElement.form, z = 0;
	for(z=0; z<theForm.length;z++){
		if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
			theForm[z].checked = theElement.checked;
		}
	}
}

function Round(value){
	value = Math.round(value * 100) / 100;
	return value;
}

function CheckAll_Group(theElement)
{             
	var myID = theElement.id + '_[]';
	for( i=0; i<theElement.form.elements.length;i++){
		var e = theElement.form.elements[i];
		if(e.id == myID){
			e.checked = theElement.checked;
		}
	}
}

function CenterItem(item){
	sWidth = item.style.width;
	sHeight = item.style.height;
	
	sWidth = sWidth.replace("px","");
	sHeight = sHeight.replace("px","");
	
	sBodyHeight = document.body.offsetHeight;
	sBodyWidth = document.body.offsetWidth;
	sScrollTop = window.document.body.scrollTop;
	
	sLeft = (sBodyWidth / 2) - (sWidth / 2);
	sTop = (sBodyHeight / 2) - (sHeight / 2);
	if (sTop < sScrollTop){
		sTop = sScrollTop + 10;
	}else{
		sTop = sTop + sScrollTop;
	}
	
	item.style.top = sTop;
	item.style.left = sLeft	;	
}

function Submit(sAction,sForm) { 
	document.getElementById(sForm).action = sAction; 
	document.getElementById(sForm).submit(); 
} 

function Conf(sForm){
	if (confirm('Weet u zeker dat u deze selectie wilt verwijderen?') == true){
		document.getElementById(sForm).submit(); 
	}
}

function Conf_URL(url,msg){
	if (confirm(msg) == true){
		Go(url); 
	}
}

function GetDiv(sName){
	var Div = document.getElementById(sName);
	Div.style.cursor = "pointer";

	if (Div.style.display == "none"){
		Div.style.display = "";
	}else{
		Div.style.display = "none";
	}
}

function MouseOver(sName) {
	sName.style.cursor = "pointer";
	sName.style.backgroundColor = "#D3EDFF";
}
function MouseOut(sName) {
	sName.style.cursor = "pointer";
	sName.style.backgroundColor = "";
}

function Go(url) {
	location.href = url;
	return false;
}

function Num(evt){
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 46 && charCode != 44 && charCode != 45){
		return false;
	}else{
		return true;
	}
}

function Print(pdf) {
	var url = pdf
	var sHeight = 600;
	var sWidth	= 800;
	screen_left	=(screen.width)	?(screen.width - sWidth)	/2:100;
	screen_top	=(screen.height)?(screen.height - sHeight)	/2:100;
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=1,location=0,menubar=0,resizable=0,width=' + sWidth + ',height=' + sHeight + ',left='+ screen_left +',top='+ screen_top +'');");
}


function Valid(veld){
	if (document.getElementById(veld).value == ''){ 
		vFout(veld);
		return false
	}else{
		vGoed(veld);
		return true
	}
}

function vFout(veld){
	document.getElementById(veld).style.backgroundImage 	= "url('Icons/Meldingen/Fout.gif')"; 
	document.getElementById(veld).style.backgroundPosition	= "right center"; 
	document.getElementById(veld).style.backgroundRepeat 	= "no-repeat"; 
}

function vGoed(veld){
	document.getElementById(veld).style.backgroundImage 	= "url('Icons/Meldingen/Goed.gif')"; 
	document.getElementById(veld).style.backgroundPosition 	= "right center"; 
	document.getElementById(veld).style.backgroundRepeat 	= "no-repeat"; 
}


