function sehir_degistir() {
	if (document.kayit.frm_sehir.value=="Diğer") {
		document.kayit.frm_diger_sehir.disabled=false;
	} else {
		document.kayit.frm_diger_sehir.value="";
		document.kayit.frm_diger_sehir.disabled=true;
	}
}
	
function trim(inputString) {
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { 
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { 
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { 
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
   }
   return retValue; 
}
	
function denetle(){
	var mesaj;
	mesaj="";
	
	str=trim(document.kayit.frm_kullanici.value);
	if (str=="") {
		mesaj+="Kullanıcı adı boş geçilemez.\n";
	}
	
	if (document.kayit.frm_kullanici.value.length<3) {
		mesaj+="Kullanıcı adınız en az 3 karakter olmalıdır.\n";
	}
		
	if (document.kayit.frm_sifre1.value=="" || document.kayit.frm_sifre2.value=="") {
		mesaj+="Şifre boş geçilemez.\n";
	} else {
		if (document.kayit.frm_sifre1.value!=document.kayit.frm_sifre2.value) {
			mesaj+="Şifre onaylaması gerçekleşemedi.\n";
		}
	}
	
	if (document.kayit.frm_adi.value=="") {
		mesaj+="Adınız boş geçilemez.\n";
	}
	
	if (document.kayit.frm_soyadi.value=="") {
		mesaj+="Soyadınız boş geçilemez.\n";
	}
	
	
	if (document.kayit.frm_dogum_tarihi_gun.value || document.kayit.frm_dogum_tarihi_ay.value || document.kayit.frm_dogum_tarihi_yil.value) {
		if (document.kayit.frm_dogum_tarihi_gun.value && document.kayit.frm_dogum_tarihi_ay.value && document.kayit.frm_dogum_tarihi_yil.value) {
		} else {
			mesaj+="Doğum tarihiniz geçersiz.\n";
		}
	}

	if (document.kayit.frm_email.value == "") {
		mesaj+="Email boş geçilemez.\n";
	} else {
		if  (document.kayit.frm_email.value.search("@") == -1 || document.kayit.frm_email.value.search("[.*]") == -1){
			mesaj+="Geçerli bir email adresi giriniz.\n";
		}
	}
	
	if (document.kayit.frm_sehir.value=="") {
		mesaj+="Şehir boş geçilemez.\n";
	}
	
	if (document.kayit.frm_sehir.value=="Diğer" && document.kayit.frm_diger_sehir.value=="") {
		mesaj+="Şehir boş geçilemez.\n";
	}
	
	if (!document.kayit.frm_enc.value) {
		mesaj+="Formdaki güvenlik kodunu girmelisiniz.";
	}
	
	if (mesaj!="") {
		mesaj="Hatalar:                                       \n\n"+mesaj;
		alert (mesaj);
		return false;
	}
	return true;
}

function denetleuye(){
	var mesaj;
	mesaj="";
	
	if (document.kayit.frm_sifre1.value=="" || document.kayit.frm_sifre2.value=="") {
		mesaj+="Şifre boş geçilemez.\n";
	} else {
		if (document.kayit.frm_sifre1.value!=document.kayit.frm_sifre2.value) {
			mesaj+="Şifre onaylaması gerçekleşemedi.\n";
		}
	}
	
	if (document.kayit.frm_adi.value=="") {
		mesaj+="Adınız boş geçilemez.\n";
	}
	
	if (document.kayit.frm_soyadi.value=="") {
		mesaj+="Soyadınız boş geçilemez.\n";
	}
	
	
	if (document.kayit.frm_dogum_tarihi_gun.value || document.kayit.frm_dogum_tarihi_ay.value || document.kayit.frm_dogum_tarihi_yil.value) {
		if (document.kayit.frm_dogum_tarihi_gun.value && document.kayit.frm_dogum_tarihi_ay.value && document.kayit.frm_dogum_tarihi_yil.value) {
		} else {
			mesaj+="Doğum tarihiniz geçersiz.\n";
		}
	}

	if (document.kayit.frm_email.value == "") {
		mesaj+="Email boş geçilemez.\n";
	} else {
		if  (document.kayit.frm_email.value.search("@") == -1 || document.kayit.frm_email.value.search("[.*]") == -1){
			mesaj+="Geçerli bir email adresi giriniz.\n";
		}
	}
	
	if (document.kayit.frm_sehir.value=="") {
		mesaj+="Şehir boş geçilemez.\n";
	}
	
	if (document.kayit.frm_sehir.value=="Diğer" && document.kayit.frm_diger_sehir.value=="") {
		mesaj+="Şehir boş geçilemez.\n";
	}
	
	if (mesaj!="") {
		mesaj="Hatalar:                                       \n\n"+mesaj;
		alert (mesaj);
		return false;
	}
	return true;
}

function sayfaac(adres){
	window.open(adres,'new','width=500,height=400, status=0, resizable=0, location=0, scrollbars=1');
}

function chars_control(add){
	var c = String.fromCharCode(window.event.keyCode);
	c=c.toLowerCase();
	var chars;
	chars="abcdefghijklmnopqrstuvwxyz0123456789öçşiğüı_- "+add;
	if ( chars.indexOf(c)!= -1 ) {
		return;
   } else {
		alert("Lütfen kullanıcı adında geçerli karakterler kullanın.");
      window.event.returnValue = null; 
	}
}

function imzaCheck() {

 txt=document.kayit.frm_imza.value.length;
 txtd=document.kayit.frm_imza.value;

for (i=0;i<=txt;i++){

	if ((txtd.substring(i,3+i)=="com") || (txtd.substring(i,3+i)=="www")) {
		alert ("Lütfen web adresi uzatıları girmeyiniz!");
		document.kayit.frm_imza.value='';
		return txtd;
		break;
	}
}
return txtd;
}