//Validating the Contact Us Form

function validate_contactform()
{
    valid = true;
	var emailPat=/^[_a-zA-Z0-9.]+@[a-zA-Z0-9.]+\.[a-zA-Z0-9]+$/;

    if ( document.comment.fname.value == "Name*" )
    {
        alert ( "Please enter your Name" );
		document.comment.fname.focus();
        valid = false;
    }
		
	else if ( document.comment.email.value == "E-mail*" )
    {
        alert ( "Please enter your Email Address" );
		document.comment.email.focus();
        valid = false;
    }
	
	else if (document.comment.email.value.search(emailPat)==-1)
  	{
    alert ( "Please enter a valid Email Address" );
	document.comment.email.focus();
        valid = false;
 	}	
	
	
	else if ( document.comment.phone.value == "Phone*" )
    {
        alert ( "Please enter Phone Number" );
		document.comment.phone.focus();
        valid = false;
    }
	
    return valid;
   
}



//Validating the Contact Us Form

function validate_contact()
{
    valid = true;
	var emailPat=/^[_a-zA-Z0-9.]+@[a-zA-Z0-9.]+\.[a-zA-Z0-9]+$/;

    if ( document.contact_us.fname.value == "" )
    {
        alert ( "Please enter your Name" );
		document.contact_us.fname.focus();
        valid = false;
    }

	else if ( document.contact_us.email.value == "" )
    {
        alert ( "Please enter your Email Address" );
		document.contact_us.email.focus();
        valid = false;
    }

	else if (document.contact_us.email.value.search(emailPat)==-1)
  	{
    alert ( "Please enter a valid Email Address" );
	document.contact_us.email.focus();
        valid = false;
 	}	
		
	else if ( document.contact_us.phone.value == "" )
    {
        alert ( "Please enter Phone Number" );
		document.contact_us.phone.focus();
        valid = false;
    }		

	else if ( document.contact_us.referal.value == "-Select-" )
    {
        alert ( "Please Select How did you hear About us!" );
		document.contact_us.referal.focus();
        valid = false;
    }
	
    return valid;
   
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
