//Validating the index Form

function validate_indexform ()
{
    valid = true;
	var emailPat=/^(.+)@(.+)\.(.+)$/;

    if ( document.index.fname.value == "Name*" )
    {
        alert ( "Please enter your Name" );
        valid = false;
    }
	
    else if ( document.index.email.value == "email*" )
    {
        alert ( "Please enter your Email Address" );
        valid = false;
    }
	else if (document.index.email.value.search(emailPat)==-1)
  	{
    	alert ( "Please enter a valid Email Address" );
        valid = false;
 	}
      
	
   else if ( document.index.phone.value == "Phone*")
    {
        alert ( "Please enter your Phone Number" );
        valid = false;
    }
	else if (document.index.textarea.value == "Question")
    {
        alert ( "Please enter your Questions" );
        valid = false;
    }
	else{
	alert("Thank you for your contacting us, one of our patient coordinator will contact you shortly.");
	}
    return valid;
   
}

//Validating the Contact Us Form

function validate_contactform(){
    valid = true;
	var emailPat=/^(.+)@(.+)\.(.+)$/;

     if ( document.contact_us.name.value == "" )
    {
        alert ( "Please enter your Name" );
        valid = false;
    }
	 
	else if ( document.contact_us.phone.value == "" )
    {
        alert ( "Please enter your Phone number" );
        valid = false;
    }
		

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

	/*else if ( document.contact_us.address.value == "" )
    {
        alert ( "Please your address" );
        valid = false;
    }
	else if ( document.contact_us.city.value == "" )
    {
        alert ( "Please enter your City" );
        valid = false;
    }
	else if ( document.contact_us.state.value == "" )
    {
        alert ( "Please enter your State" );
        valid = false;
       }
		
   	*/
	
	else{
	alert("Thank you for contacting us, one of our patient coordinator will contact you shortly.");
	}
    return valid;
   
}
