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.style.backgroundColor="#FF0000"; sField.style.color="#FFFFFF"; 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(url)
{
if (confirm("Bu işlemi yapmak istiyor musunuz?")) { location.href=url }
}

function pencereAc(url,w,h)
{
	var newwindow;
	newwindow=window.open(url,'name','width='+w+',height='+h+',left=100,top=100');
	if (window.focus) {newwindow.focus()}
}

function pencereKapat()
{
self.close();
}

function sifreKontrol(sText1,sText2)
{
sText1.style.backgroundColor="#FFFFFF"; sText1.style.color="#000000";
sText2.style.backgroundColor="#FFFFFF"; sText2.style.color="#000000";
if (sText1.value!=sText2.value) { alert('Şifre ve şifre tekrarı alanları uyuşmuyor. ');  sText1.style.backgroundColor="#FF0000"; sText1.style.color="#FFFFFF"; sText2.style.backgroundColor="#FF0000"; sText2.style.color="#FFFFFF"; sText1.focus(); return false; } else { return true; }
}

function bosKontrol(sText,sField)
{
sText.style.backgroundColor="#FFFFFF"; 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="#FFFFFF"; sText.focus(); } return false; } else { return true; }
}

function haneKontrol(sDigit,sText,sField) {
sText.style.backgroundColor="#FFFFFF"; sText.style.color="#000000";
if (sText.value.length!=sDigit && sText.value.length!=0) { alert(sField+ ' alanı '+sDigit+' karakter olmalıdır.');  sText.style.backgroundColor="#FF0000"; sText.style.color="#FFFFFF"; sText.focus(); return false; } else { return true; }
}

function sayiKontrol(sText,sField)
{
sText.style.backgroundColor="#FFFFFF"; 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="#FFFFFF";
		 sText.focus();
         }
      }
   return IsNumber;  
}
