/*************/
function ValidateEmail(email, formName){
		var atCharPresent = false;
		var dotPresent = false;
		
		for ( var Idx = 0; Idx < email.value.length; Idx++ ){
			if ( email.value.charAt ( Idx ) == '@' )
				atCharPresent = true;
			if ( email.value.charAt ( Idx ) == '.' )
				dotPresent = true;
		}
		if ( !atCharPresent || !dotPresent ){
			alert( formName + "Please provide a valid email address !");
			email.focus();
			return false;
			}
	return true;
}
function isNumbers(stryear){
	var validdate = "1234567890-";
	var strlength = stryear.length;
	for(var i=0; i<=strlength; i++){
		var unitstr = stryear.substr(i,1);
		if (validdate.indexOf(unitstr)==-1){
			return false;
		}
	}
	return true;
}

function validateForm(){
	check = document.order;
	if((check.author.value.replace(/\s/g, "") == "")||(check.author.value.replace(/\s/g, "") == "Name*")){
		alert("Please enter your name !");
		check.author.focus();
		return false;
	}
	if((check.email.value.replace(/\s/g, "") == "")||(check.email.value.replace(/\s/g, "") == "Email*")){
		alert("Please provide a valid email address !");
		check.email.focus();
		return false;
	}
	if(! ValidateEmail(check.email, ''))
		return false;

	//alert (check.enquiry.value.replace(/\s/g, ""));
	if((check.recaptcha_response_field.value.replace(/\s/g, "") == "")||(check.recaptcha_response_field.value.replace(/\s/g, "") == "")){
		alert("Please fill in your Captcha !");
		check.recaptcha_response_field.focus();
		return false;
	}
	if((check.comment.value.replace(/\s/g, "") == "")||(check.comment.value.replace(/\s/g, "") == "EnterComments*")){
		alert("Please fill in your comment !");
		check.comment.focus();
		return false;
	}	
flag = false;
}
