var f_event = document.getElementById("frm_event") ;
if (f_event) f_event.onsubmit = event_validation ;

var f_place = document.getElementById("frm_place") ;
if (f_place) f_place.onsubmit = place_validation ;

var f_webmas= document.getElementById("frm_webmaster") ;
if (f_webmas) f_webmas.onsubmit = webmaster_validation ;


function place_validation(){
	var f = this ;
	
	if (Trim(f.fullname.value)==''){
		alert("Enter your name") ;
		f.fullname.focus() ;
		return false ;
	}
	
	if (!isMail(f.email.value)){
		alert("Enter your e-mail") ;
		f.email.focus() ;
		return false ;
	}
	
	if (Trim(f.recommend.value)==''){
		alert("Recommend this place because ?") ;
		f.recommend.focus() ;
		return false ;
	}
	
	if (Trim(f.nom.value)==''){
		alert("Enter the name of place") ;
		f.nom.focus();
		return false ;
	}
	
	if (Trim(f.description.value)==''){
		alert("Enter the description") ;
		f.description.focus() ;
		return false ;
	}
	
	if (Trim(f.address.value)==''){
		alert("Enter the address") ;
		f.address.focus() ;
		return false ;
	}
	
	if (Trim(f.telf1.value)==''){
		alert("Enter the phone number") ;
		f.telf1.focus() ;
		return false ;
	}
	
	return true ;
}

function event_validation(){
	var f = this ;
	
	if (Trim(f.nom.value)==''){
		alert("Enter your name") ; 
		f.nom.focus();
		return false ;
	}
	
	if (!isMail(f.email.value)){
		alert("Enter your email") ;
		f.email.focus() ;
		return false ;
	}
	
	if (Trim(f.event.value)==''){
		alert("Enter event name") ;
		f.event.focus() ;
		return false ;
	}
	
	if (Trim(f.msg.value)==''){
		alert("Enter description") ;
		f.msg.focus() ;
		return false ;
	}
	
	return true ;
}

function webmaster_validation(){
	var f = this ;
	
	if (Trim(f.nom.value)==''){
		alert("Enter your name") ; 
		f.nom.focus();
		return false ;
	}
	
	if (!isMail(f.email.value)){
		alert("Enter your email") ;
		f.email.focus() ;
		return false ;
	}
	
	if (Trim(f.msg.value)==''){
		alert("Enter description") ;
		f.msg.focus() ;
		return false ;
	}
}

