function Resizefoto(imgy){
	if(!imgy){ 
		var imgy = window.event.srcElement; 
	}   
	width = imgy.width; 
	height = imgy.height;
	if( width > 250 ){
		imgy.width  = 250 ;
		imgy.height = Math.ceil( 250 * ( height / width ) );
	}
}
function Resizefotos(image)
{
	Resizefoto(image); 
}

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 Submit(sAction,sForm) { 
	document.getElementById(sForm).action = sAction; 
	document.getElementById(sForm).submit(); 
} 

function Conf_Submit(sAction,sForm,sMsg) { 
	if (confirm(sMsg) == true){
		document.getElementById(sForm).action = sAction; 
		document.getElementById(sForm).submit(); 
	}
} 

function Conf_Act(sForm,sAction){
	if (confirm('Weet u zeker dat u deze selectie wilt verwijderen?') == true){
		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 = "hand";

	if (Div.style.display == "none"){
		Div.style.display = "";
		Hide_Select();
	}else{
		Div.style.display = "none";
		Show_Select();
	}
}

function MouseOver(sName) {
	sName.style.cursor = 'hand';
	sName.style.backgroundColor = '#F2F2F2';
}
function MouseOut(sName) {
	sName.style.cursor = 'hand';
	sName.style.backgroundColor = '';
}

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 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){
		return false;
	}else{
		return true;
	}
}

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/Kruisje.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/Vinkje.gif')"; 
	document.getElementById(veld).style.backgroundPosition 	= "right center"; 
	document.getElementById(veld).style.backgroundRepeat 	= "no-repeat"; 
}
