function isEmailAddr(email){
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}



function form1_Validator(theForm){
document.forms['Semail'].tttt.value = '';
document.forms['Semail'].tttt.style.display ="none"

  if (theForm.Name.value == "")  {
document.forms['Semail'].tttt.value = 'כתוב שם בבקשה';
document.forms['Semail'].tttt.style.display =""
    theForm.Name.focus();
    return (false);
  }
  if (theForm.Email.value == "")  {
document.forms['Semail'].tttt.value = 'נא הכנס דואר אלקטרוני';
document.forms['Semail'].tttt.style.display =""
    theForm.Email.focus();
    return (false);
  }

 if (!isEmailAddr(theForm.Email.value))  {
document.forms['Semail'].tttt.value = 'נא הכנס כתובת דואר אלקטרוני חוקית';
document.forms['Semail'].tttt.style.display =""
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length < 8)  {
document.forms['Semail'].tttt.value = 'כתובת דואר אלקטרוני לא חוקית';
document.forms['Semail'].tttt.style.display =""
    theForm.Email.focus();
    return (false);
  }
  if (theForm.Subject.value == "")  {
document.forms['Semail'].tttt.value = 'כתוב נושא בבקשה';
document.forms['Semail'].tttt.style.display =""
    theForm.Subject.focus();
    return (false);
  }
  if (theForm.Message.value == "")  {
document.forms['Semail'].tttt.value = 'כתוב הודעה בבקשה';
document.forms['Semail'].tttt.style.display =""
    theForm.Message.focus();
    return (false);
  }

  if (theForm.security_code.value == "")  {
document.forms['Semail'].tttt.value = 'קוד אימות שגוי';
document.forms['Semail'].tttt.style.display =""
    theForm.security_code.focus();
    return (false);
  }


  return openWin();
}
