// JavaScript Document
var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;

function checkcontactusform(){
	var email = document.getElementById('email').value;
	
	if(document.getElementById('cusname').value == ''){
		alert('Please fill in your name.');
		return false;
	}//end if	
	else if(email.search(emailRegEx) == -1){
		 alert('Please fill in your valid e-mail address.');
		return false;
	}//end else if
	else if(document.getElementById('comment').value == ''){
		alert('Please fill in your comment.');
		return false;	
	}
	return true;
}//end function

function checkbookingform(){
	var email = document.getElementById('email').value;
	if(document.getElementById('bookname').value == ''){
		alert('Please fill in your name on the booking.');
		return false;
	}//end if	
	else if(email.search(emailRegEx) == -1){
		 alert('Please fill in your valid e-mail address.');
		return false;
	}//end else if
	else if(document.getElementById('bookperson').value == ''){
		alert('Please fill in person amount.');
		return false;
	}//end if
	else if(document.getElementById('booktimehour').value == ''){
		alert('Please specify your preferred reservation time.');
		return false;
	}//end if	
	else if(document.getElementById('date_picker').value == ''){
		alert('Please fill in booking date.');
		return false;
	}//end if
	return true;
}//end function
