function validator(contact)
{
	
	if ( document.contact.companyName.value == "")
	{
		alert("נא להזין את שם החברה");
		document.all.companyName.focus();
		return false;
	}
	
	//check if we have the name
	if(document.contact.clientName.value=="")
	{
		alert("נא להזין שם מלא")
		document.all.clientName.focus()
		return false
	}
	
	// check email address
	var mail
	mail=document.contact.Email.value
				
	//if we have the default its ok
			
	if (mail=="")
	{
		alert("נא להזין כתובת אי-מייל")
		document.all.Email.focus()
		return false
	}
	else
	{
			
		//check if we have the @ sign
			
		if (mail.indexOf("@")==-1)
		{
			alert("@ כתובת אי-מייל לא תקנית. בדוק להמצאות סימן")
			document.all.Email.focus()
			return false
		}	
		else
		{
				
			//check if we have dot in the second part of the form
				
			var dot
			dot=mail.split("@")[1]	
			if (dot.indexOf(".")==-1)
			{
				alert("כתובת אי-מייל לא תקנית")
				document.all.Email.focus()
				return false
			}
			else
			{
					
				//check if the address ends with 2 or 3 letters
					
				var end
				end=dot.split(".")[1]
				if (end.length<2 || end.length>3)
				{
					alert(".כתובת אי-מייל לא תקנית. בדוק את החלק השני של הכתובת")
					document.all.Email.focus()
					return false
				}
			}
		}
	}	

	document.contact.submit();
	return true;
}
