function is_email(email)
{
	if(!email.match(/^[A-Za-z0-9\._\-+]+@[A-Za-z0-9_\-+]+(\.[A-Za-z0-9_\-+]+)+$/))
		return false;
	return true;
}


function validateQuickContact()
{
    var obj = document.qcontact;	 
	if(obj.uname.value=='Name' || obj.uname.value==''){
		alert('please fill the name field');
		obj.uname.focus();
		return false;
	} 
	if(obj.email.value=='Email' || obj.email.value==''){
		alert('please fill the email field');
		obj.email.focus();
		return false;
	}
	if(!is_email(obj.email.value)){
		alert('please fill the proper email');
		obj.email.focus();
		return false;
	}
	if(obj.phone.value=='Phone' || obj.phone.value==''){
		alert('please fill the phone field');
		obj.phone.focus();
		return false;
	} 
	if(obj.description.value=='Comment' || obj.description.value==''){
		alert('please fill the comment field');
		obj.description.focus();
		return false;
	}
	if(obj.code_contactus.value==''){
		alert('please fill the captcha field');
		obj.code_contactus.focus();
		return false;
	}
	obj.submit();
}

function validateContactUs()
{
	var obj = document.ContactUs;	 
	if(obj.cname.value==''){
		alert('please fill the name field');
		obj.cname.focus();
		return false;
	} 
	if(obj.cemail.value==''){
		alert('please fill the email field');
		obj.cemail.focus();
		return false;
	}
	if(!is_email(obj.cemail.value)){
		alert('please fill the proper email');
		obj.cemail.focus();
		return false;
	}
	if(obj.cstate.value==''){
		alert('please select state.');
		obj.cstate.focus();
		return false;
	}
	if(obj.czip.value==''){
		alert('please fill the zip field.');
		obj.czip.focus();
		return false;
	}
	if(obj.cphone.value==''){
		alert('please fill the phone field');
		obj.cphone.focus();
		return false;
	}
	if(!document.getElementById('byemail').checked && !document.getElementById('byphone').checked){
		alert('please choose at least one Contact Preferences');
		return false;
	}
	if(obj.cdescription.value==''){
		alert('please fill the comment field');
		obj.cdescription.focus();
		return false;
	}
	if(obj.code_ccontactus.value==''){
		alert('please fill the captcha field');
		obj.code_ccontactus.focus();
		return false;
	}
	if(!document.getElementById('term_conditions').checked){
		alert('please read disclaimer');
		return false;
	}

	return true;
}
