function sureUygula(sure) {
if(sure==2) { 
document.getElementById('inDiv').style.display='none';
kd=Math.round(tFiyat*1.18);
document.getElementById('tu').value=tFiyat;
document.getElementById('gt').value=kd;
} else if(sure==4) {
sure=2;
document.getElementById('inDiv').style.display='';
t=Math.round(document.getElementById('tu').value);
i0=t*sure;
i1=(i0*20)/100;
kh=Math.round(i0-i1);
kd=Math.round(kh*1.18);
document.getElementById('tu').value=kh;
document.getElementById('gt').value=kd;
}
}

function aKontrol() {
if(document.getElementById('alan').value!='') { document.getElementById('aSonuc').innerHTML='Kontrol ediliyor, lütfen bekleyiniz...'; document.getElementById('aSonuc').style.display=''; xajax_alanAjax(document.getElementById('alan').value+'.'+document.getElementById('tld').value); }
}

function epostaKontrol(sField) {
if(sField.value!='') {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(sField.value)){
return (true)
}
alert("E-posta adresiniz hatalı görünüyor, lütfen kontrol ediniz.  "); sField.focus();
return (false)
} else { return(true); }
}

function listeKontrol(sList,sField)
{
if (sList.value==0) { alert(sField+ ' listesinde bir seçim yapmanız gerekmektedir. '); sList.focus(); return false; } else { return true; }
}

function onayVer(soru,url)
{
if (confirm(soru)) { location.href=url; }
}

function sifreKontrol(sText1,sText2)
{
sText1.style.backgroundColor=""; sText1.style.color="#000000";
sText2.style.backgroundColor=""; sText2.style.color="#000000";
if (sText1.value!=sText2.value) { alert('Şifre ve şifre tekrarı alanları uyuşmuyor. ');  sText1.style.backgroundColor="#FF0000"; sText1.style.color="#666"; sText2.style.backgroundColor="#FF0000"; sText2.style.color="#666"; sText1.focus(); return false; } else { return true; }
}

function bosKontrol(sText,sField)
{
sText.style.backgroundColor=""; sText.style.color="#000000";
if (sText.value.length==0) { alert(sField+ ' alanı boş bırakılamaz. '); if (sText.type!="hidden") { sText.style.backgroundColor="#FF0000"; sText.style.color="#666"; sText.focus(); } return false; } else { return true; }
}

function sayiKontrol(sText,sField)
{
sText.style.backgroundColor=""; sText.style.color="#000000";
var ValidChars = " 0123456789";
var IsNumber=true;
var Char;
   for (i = 0; i < sText.value.length && IsNumber == true  && sText.value.length!=0; i++) 
      { 
      Char = sText.value.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         alert(sField+ ' alanı yalnızca rakam olabilir. ');
		 sText.style.backgroundColor="#FF0000"; sText.style.color="#666";
		 sText.focus();
         }
      }
   return IsNumber;  
}