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 FrontPage_Form1_Validator(theForm)
{

    if (theForm.firmaadi.value == "")
  {
    alert("Lütfen  \"Firma Adinizi\"  yaziniz.");
    theForm.firmaadi.focus();
    return (false);
  }
 
 { 
ToCheck = document.FrontPage_Form1.firmatanitimi.value;
Checked = Del(ToCheck);
document.FrontPage_Form1.firmatanitimi.value = Checked;

}

    if (theForm.ad.value == "")
  {
    alert("Lütfen  \"Ad Alanini\"  doldurmayi unutmayiniz.");
    theForm.ad.focus();
    return (false);
  }

  if (theForm.soyad.value == "")
  {
    alert("Lütfen  \"Soyadiniz\" Alanini doldurmayi unutmayiniz.");
    theForm.soyad.focus();
    return (false);
  }



  if (theForm.adres.value == "")
  {
    alert("Lütfen  \"Adres\" Alanini doldurmayi unutmayiniz.");
    theForm.adres.focus();
    return (false);
  }
  
    if (theForm.sehir.value == "")
  {
    alert("Lütfen  \"Sehir\" Alanini doldurmayi unutmayiniz.");
    theForm.sehir.focus();
    return (false);
  }
  
    if (theForm.tel1.value == "")
  {
    alert("Lütfen  \"Telefon\" Alanini doldurmayi unutmayiniz.");
    theForm.tel1.focus();
    return (false);
  }
  
      if (theForm.url.value == "")
  {
    alert("Lütfen  \"Websitenizin Adresinizi \" yazmayi unutmayiniz.");
    theForm.url.focus();
    return (false);
  }
  
       if (theForm.url.value == "http://")
  {
    alert("Lütfen  \"Websitenizin Adresinizi \" yazmayi unutmayiniz.");
    theForm.url.focus();
    return (false);
  }
  
  
  
    var checkOK = "0123456789-,";
  var checkStr = theForm.tel1.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ",")
    {
      allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Lütfen bu alana sadece sayi karakterleri giriniz\"Telefon\" Örnek: 021255555555");
    theForm.tel1.focus();
    return (false);
  }



  
    if (theForm.email.value == "")
  {
    alert("Lütfen  \"Email\" Alanini doldurmayi unutmayiniz.");
    theForm.email.focus();
    return (false);
  }
  


  
 
  var emailID=document.FrontPage_Form1.email
  

  if (echeck(emailID.value)==false){
    emailID.value=""
    emailID.focus()
    return false
  }
  
    if (FrontPage_Form1.email.value != FrontPage_Form1.email2.value)
 {
   alert("Emailler Birbiri ile ayni degil!");
   return (false);
    }
  
      if (theForm.sifre.value == "")
  {
    alert("Lütfen  \"Sifre\" Alanini doldurmayi unutmayiniz.");
    theForm.sifre.focus();
    return (false);
  }
  
   
      if (theForm.sifre2.value == "")
  {
    alert("Lütfen  \"Sifre Tekrar\" Alanini doldurmayi unutmayiniz.");
    theForm.sifre2.focus();
    return (false);
  }
  
  
if (FrontPage_Form1.sifre.value != FrontPage_Form1.sifre2.value)
 {
   alert("Sifreler Birbiri ile ayni degil!");
   return (false);
    }


      if (theForm.sozlesme.checked == false )
  {
    alert("Lütfen Kullanım Şartlarını okuyup kabul ediniz!.");
    theForm.sozlesme.focus();
    return (false);
  }


  return (true);
}



