function validRequired(formField,fieldLabel)
{
	var result = true;
	
	if (formField.value == "")
	{
		alert(fieldLabel);
		formField.focus();
		result = false;
	}
	
	return result;
}
// Email Validation
function checkEmail(myForm,mess)
{
 if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.value))
 {
	return (true)
 }
	alert(mess);
	myForm.focus();
	return (false)
}

function isNotNumeric(str){
		for (var i = 0; i < str.length; i++)
		{
				var ch = str.substring(i, i + 1);
				if((ch < '0' || '9' < ch)) 
				{
					if(ch == "+" || ch == "-" || ch == "." || ch == ")" || ch == "("  || ch == " ") continue;
					return true;
				}
		}
		return false;
}
function isNotAlphabets(str){
		for (var i = 0; i < str.length; i++)
		{
				re = / /gi				//Replace the space between words with no space
				str = str.replace(re,"");
			
				var ch = str.substring(i, i + 1);
				
				if((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) 
				{
					return true;
				}
		}
		return false;
}



// For Contact Us form
function check_ContactForm(nForm) {
	
		if(!validRequired(document.contact_frm.txtName,"Please enter your Name"))
			return false;
		 if(isNotAlphabets(document.contact_frm.txtName.value))
		 {
			alert("Invalid characters in Name.");
			document.contact_frm.txtName.focus();
			return false;
		 }

	
		if (!checkEmail(document.contact_frm.txtEmail,"Please enter valid Email"))
			return false;

	
			   
		if (!validRequired(document.contact_frm.txtMessage,"Please enter your Comments"))
			return false;
			
			
return true;
}

