 



function numchar(str, x)
{
 var count;
 count=0;
   for(i=0; i<=(str.length -1); i++)
     {
       if (str.charAt(i)==x)
       {
         count++;
       }
      }
        return count;
}

 
 
 
function message_validate(f)
{
   if (f.message.value=="Type your message here"  )
    { 
     f.message.value="";
     }
}
 


function submit_form()
 {
   //alert("Help prevent Spam. Please type in your correct email address");

 
if (feedback_form.name.value.length<2)
   {
    alert("Please, type your name");
    
    return false;
    }


 if ( feedback_form.email.value!="" &&( (feedback_form.email.value.length<5) || (numchar(feedback_form.email.value," ") >0) || (numchar(feedback_form.email.value, "@")!=1)||(numchar(feedback_form.email.value, ".")==0) ) )
   {
      
      alert("Your email address is not correct");
     return false; //wrong email address
  } 

 

 
 

if ( (feedback_form.message.value=="") || (feedback_form.message.value=="Type your message here") )
 {

     alert("Please, type your message");
     return false;
        
    }            
  
     
   
       
} 
 
     
 




