var div1;
var dv1;
var dv2;
var dv3;
var dv4;
var dv5;
var regTag=/^[0-9a-zA-Z_]+$/;
//var regSrch=/^[0-9a-zA-Z_()-:!/]+$/;
function isNull(aStr)
{
	var index;		
	for (index=0; index < aStr.length; index++)
		if (aStr.charAt(index) != ' ')
			return false;
	return true;
}
function trim(str)
{
    s = str.replace(/^(\s)*/, '');
    s = s.replace(/(\s)*$/, '');
    return s;
}
//For checking invalid E-Mail address
function isEmail(aStr)
{
	var reEmail=/^[0-9a-zA-Z_'\.-]+\@[0-9a-zA-Z_\.-]+\.[0-9a-zA-Z_\.-]+$/;
	if(!reEmail.test(aStr))
	{
		return false;
	}
	return true;
}
function isNumeric(value)
{
	var regNumeric=/^[0-9]+$/;
	if(!regNumeric.test(value))
	{
		return false;
	}
	return true;
}
 
function validate_contact_form()
{
	 
	var url; 
	var contact_firstname = document.getElementById("contact_firstname").value;
  	var contact_emailid = document.getElementById("contact_emailid").value;
	 
 	if(isNull(trim(contact_firstname)))
	{
      alert("Please enter your name");
	  document.getElementById("contact_firstname").focus();
	  return false;
	}
 	if(isNull(trim(contact_emailid)))
	{
      alert("Please enter a email address");
	  document.getElementById("contact_emailid").focus();
	  return false;
	}
	if(!isEmail(contact_emailid))
	{
      alert("Please enter a valid email address");
	  document.getElementById("contact_emailid").focus();
	  return false;
	}
	else
	{   
	 	return true;
	 
 	}

}
 
 