function Del(Word) {
a = Word.indexOf("<");
b = Word.indexOf(">");
len = Word.length;
c = Word.substring(0, a);
if(b == -1)
b = a;
d = Word.substring((b + 1), len);
Word = c + d;
tagCheck = Word.indexOf("<");
if(tagCheck != -1)
Word = Del(Word);
return Word;
}


function echeck(str) {
  var at="@"
  var dot="."
  var lat=str.indexOf(at)
  var lstr=str.length
  var ldot=str.indexOf(dot)
  if (str.indexOf(at)==-1){
     alert("Geçersiz Email Adresi")
     return false
  }
  if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
     alert("Geçersiz Email Adresi")
     return false
  }
  if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
      alert("Geçersiz Email Adresi")
      return false
  }
   if (str.indexOf(at,(lat+1))!=-1){
      alert("Geçersiz Email Adresi")
      return false
   }
   if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
      alert("Geçersiz Email Adresi")
      return false
   }
   if (str.indexOf(dot,(lat+2))==-1){
      alert("Geçersiz Email Adresi")
      return false
   }
   if (str.indexOf(" ")!=-1){
      alert("Geçersiz Email Adresi")
      return false
   }
   return true          
}



function mesaj_gonder_Validator(theForm)
{



  if (theForm.ad.value == "")
  {
    alert("Lütfen Adınızı yazınız.");
    theForm.ad.focus();
    return (false);
  }

  if (theForm.soyad.value == "")
  {
    alert("Lütfen Soyadınızı yazınız.");
    theForm.soyad.focus();
    return (false);
  }




    if (theForm.email.value == "")
  {
    alert("Lütfen E-mail adresinizi yazınız.");
    theForm.email.focus();
    return (false);
  }
  
  
 
  
 
  var emailID=document.mesaj_gonder.email
  

  if (echeck(emailID.value)==false){
    emailID.value=""
    emailID.focus()
    return false
  }
  
    if (mesaj_gonder.email.value != mesaj_gonder.email2.value)
 {
   alert("E-mailler Birbiri ile ayni degil!");
   return (false);
    }

  
  
    if (theForm.mesaj.value == "")
  {
    alert("Lütfen Mesajınızı yazınız.");
    theForm.mesaj.focus();
    return (false);
  }
  




  return (true);
}



