/**
 *
 * SetDiv( ID, height, width)
 *
 * Dynamically changes height and width of an object using the ID
 *
 **/

function SetDiv(id,h,w) {
	document.getElementById(id).style.height = h + "px";
	document.getElementById(id).style.width = w + "px";
}


/**
 *
 * SetBackground( ID, color)
 *
 * Dynamically changes backgroundcolor of an object using the ID
 *
 **/

function SetBackground(id,c) {
	document.getElementById(id).style.backgroundColor = c;
}


/**
 *
 * CheckForm( formname )
 *
 * Checks mandatory formfields 
 *
 **/


function CheckForm(formname) {
	var error = 0;
	if (document.forms[formname].name.value == "") {
		error = 1;
		alert('U heeft nog geen naam ingevoerd.');
	}
	else if (document.forms[formname].email.value == "" || (document.forms[formname].email.value.indexOf(".") == -1 || document.forms[formname].email.value.indexOf("@") == -1 )) {
		error = 1;
		alert('U heeft geen geldig e-mailadres ingevoerd.');
	}
	else if (document.forms[formname].message.value == "") {
		error = 1;
		alert('U heeft nog geen bericht ingevoerd.');
	}
	else if (document.forms[formname].captcha.value == "") {
		error = 1;
		alert('U heeft nog anti-spam (letter-/cijfercode) ingevoerd.');
	}
	
	if (error == 0) {
		return true;
	}
	else {
		return false;
	}
}
