function checkForm(){
	
	var msg = "";	
	
	String(document.forms['winactie'].z_firstname.value)=="" ? msg += "Voornaam, " : "";
	String(document.forms['winactie'].z_lastname.value)=="" ? msg += "Achternaam, " : "";
	String(document.forms['winactie'].z_birth_date_day.value)==0 ? msg += "Dag, " : "";
	String(document.forms['winactie'].z_birth_date_month.value)==0 ? msg += "Maand, " : "";
	String(document.forms['winactie'].z_birth_date_year.value)==0 ? msg += "Jaar, " : "";	

	if(checkRadio(document.forms['winactie'].z_client) == false){	
		msg +="Bent u klant van Zwitserleven?, ";	
	}

	checkEmail(document.forms['winactie'].z_email)==false ? msg += "E-mail adres, " : "";	
	String(document.forms['winactie'].z_filmtitel.value)=="" ? msg += "Filmtitel, " : "";
	String(document.forms['winactie'].z_filmomschrijving.value)=="" ? msg += "Filmomschrijving, " : "";
	String(document.forms['winactie'].z_filmbestand.value)=="" ? msg += "Filmbestand, " : "";

	if(TestFileType(document.forms['winactie'].z_filmbestand.value, ['wmv', 'mpeg', 'avi', 'mpeg4', '3gpp', '3gp', 'mov', 'mpegps', 'flv', 'mp4']) == false && document.forms['winactie'].z_filmbestand.value != '') {
		msg += "<br /><br />Het type filmbestand wordt niet geaccepteerd, uw filmpje moet een van de volgende extensies bevatten:<br />.wmv, .mpeg, .avi, .mpeg4, .3gpp, .3gp, .mov, .mpegps, .flv, .mp4  ";
	}

	msg = msg.substring(0,msg.length-2);
		
	if (msg != ""){
		document.getElementById('error-msg').innerHTML = '<strong>Let op:</strong> U heeft de volgende velden onjuist ingevoerd:<br />'+msg; 
		document.getElementById('error-msg').style.display = 'block';		
	}
	else{
		//document.getElementById('error-msg').style.display = 'none;';		
		document.forms['winactie'].submit();
	}
}

function checkEmail(objectInputText){
	
	if(objectInputText.value == ''){
		return false;
	}else if(objectInputText.value.indexOf('@') == -1){
		return false;
	}else{
		return true;
	}
}

function checkRadio(objectRadio)
{	
	var found = 0;
	
	for(var i=0;i<objectRadio.length && found==0;i++)
	{
		if(objectRadio[i].checked)
		{
			found = 1;
		}
	}

	return found;
}

function TestFileType( fileName, fileTypes ) {
	
	if (!fileName) {
		return false;	
	} else {
	
		dots = fileName.split(".")
		//get the part AFTER the LAST period.
		fileType = "." + dots[dots.length-1];
		
		if(fileTypes.join(".").indexOf(fileType) != -1) {
			return true;
		} else {
			return false;
		}
	}
}