var maxChars = 255;

function checkArea(objTextArea,isPaste){
	curLength = objTextArea.value.length
	if (curLength < maxChars){
		if (isPaste)
			if (maxChars-curLength-clipboardData.getData('Text').length<0)
				return false;
			else
				return true;
		else
			return true;
	}
	else
		return false;
}

function CheckEmail(str)  
{
	var thestr=/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/ 
	if (str.search(thestr)==-1) 
	return false;
	return true;
}



function Check_Dira()
{
   if(!document.contact.Fname.value)
   {
      alert("חובה להכניס שם");
      document.contact.Fname.focus();
      return false;
   }

   if(!document.contact.Lname.value)
   {
      alert("חובה להכניס שם");
      document.contact.Lname.focus();
      return false;
   }

   
   if (!document.contact.Phone.value)
   {
    alert("!חובה למלא מספר טלפון");
      document.contact.Phone.focus();
      return false;
   }
   if (document.contact.Phone.value) 
        {   
         if ((document.contact.Phone.value.length < 7) || (isNaN(document.contact.Phone.value)))
               {
                  alert("יש למלא מספר בן 7 ספרות");
                  document.contact.Phone.focus();
                  return false;
               }
         } 

   if(!document.contact.city_name.value)
   {
      alert("חובה להכניס עיר");
      document.contact.city_name.focus();
      return false;
   }

   if (CheckEmail(document.contact.email.value)==false)
   {
      alert("דואר אלקטרוני לא תקין");
      document.contact.email.focus();
      return false;
   }


}



