function gonder(kat, id) {
	var url;
	if (kat=="haber") {
		url="http://www.kedigen.com/haber/" + id;
	} else if (kat.indexOf("yarisma") != -1) {
		url="http://www.kedigen.com/" + kat + "/" + id;
	} else {
		url="http://www.kedigen.com/konu/"+kat+"/" + id;
	}
	window.location=url;
}

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 kedi_say() {
	if (document.kayit.frm_kedi_bes.value=="1") {
		document.kayit.frm_kedi_adet.disabled=false;
	} else {
		document.kayit.frm_kedi_adet.value="";
		document.kayit.frm_kedi_adet.disabled=true;
	}
}

function denetle(){
	var mesaj;
	mesaj="";
	
	if (document.kayit.frm_kullanici.value=="") {
		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=="") {
		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";
		}
	}
	
	pos=document.kayit.frm_email.value.indexOf("@kedigen.com")
	if (pos>=0){
		mesaj+="Kedigen.com email adresi giremezsiniz.\n";
	}
	
	pos=document.kayit.frm_email.value.indexOf("@kedigen.net")
	if (pos>=0){
		mesaj+="Kedigen.net email adresi giremezsiniz.\n";
	}
	
	pos=document.kayit.frm_email.value.indexOf("@kedi.gen.tr")
	if (pos>=0){
		mesaj+="Kedi.gen.tr email adresi giremezsiniz.\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 sayfaac(adres, gn, yk){
	window.open(adres,'new','width='+gn+',height='+yk+', status=0, resizable=0, location=0, scrollbars=1');
}

function bilgi_denetle(){
	var mesaj;
	mesaj="";

	if (document.kayit.frm_sifre1.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 (mesaj!="") {
		mesaj="Hatalar:                                       \n\n"+mesaj;
		alert (mesaj);
		return false;
	}
	return true;
}

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; 
	}
}