function YorumFormKontrol(form) {
document.getElementById("dikkat0").style.color='';
document.getElementById("dikkat0").style.fontWeight='';
document.getElementById("dikkat1").style.color='';
document.getElementById("dikkat1").style.fontWeight='';
document.getElementById("dikkat2").style.color='';
document.getElementById("dikkat2").style.fontWeight='';
document.getElementById("dikkat3").style.color='';
document.getElementById("dikkat3").style.fontWeight='';

if (form.isim.value=='') {
document.getElementById("uyarialani").innerHTML = '<font color="#CC0000"><b>Lütfen Adınızı Giriniz!</b></font>'
form.isim.focus();
document.getElementById("dikkat0").style.color='#D35456';
document.getElementById("dikkat0").style.fontWeight='bold';
return false;
}
if (form.isim.value.length<3) {
document.getElementById("uyarialani").innerHTML = '<font color="#CC0000"><b>Adınız 3 Karakterden Az Olamaz!</b></font>'
form.isim.focus();
document.getElementById("dikkat0").style.color='#D35456';
document.getElementById("dikkat0").style.fontWeight='bold';
return false;
}
if (form.isim.value.length>20) {
document.getElementById("uyarialani").innerHTML = '<font color="#CC0000"><b>Adınız 20 Karakterden Fazla Olamaz!</b></font>'
form.isim.focus();
document.getElementById("dikkat0").style.color='#D35456';
document.getElementById("dikkat0").style.fontWeight='bold';
return false;
}
if (KarakterKont(form.isim.value,0)==false) {
document.getElementById("uyarialani").innerHTML = '<font color="#CC0000"><b>Adınız</font></b> !")(&+/?\':\\;%= <b><font color="#CC0000">Karakterlerini İçeremez!</b></font>'
form.isim.focus();
document.getElementById("dikkat0").style.color='#D35456';
document.getElementById("dikkat0").style.fontWeight='bold';
return false;
}
if (form.eposta.value=='') {
document.getElementById("uyarialani").innerHTML = '<font color="#CC0000"><b>Lütfen E-Posta Adresinizi Giriniz!</b></font>'
form.eposta.focus();
document.getElementById("dikkat1").style.color='#D35456';
document.getElementById("dikkat1").style.fontWeight='bold';
return false;
}
if (form.eposta.value.length>150) {
document.getElementById("uyarialani").innerHTML = '<font color="#CC0000"><b>E-Posta Adresiniz 150 Karakterden Fazla Olamaz!</b></font>'
form.eposta.focus();
document.getElementById("dikkat1").style.color='#D35456';
document.getElementById("dikkat1").style.fontWeight='bold';
return false;
}
if (echeck(form.eposta.value)==false) {
document.getElementById("uyarialani").innerHTML = '<font color="#CC0000"><b>Lütfen E-Posta Adresinizi Kontrol Ediniz!</b></font>'
form.eposta.focus();
document.getElementById("dikkat1").style.color='#D35456';
document.getElementById("dikkat1").style.fontWeight='bold';
return false;
}
if (form.yorum.value=='') {
document.getElementById("uyarialani").innerHTML = '<font color="#CC0000"><b>Lütfen Yorumunuzu Yazınız!</b></font>'
form.yorum.focus();
document.getElementById("dikkat2").style.color='#D35456';
document.getElementById("dikkat2").style.fontWeight='bold';
return false;
}
if (form.yorum.value.length>750) {
document.getElementById("uyarialani").innerHTML = '<font color="#CC0000"><b>Yorumunuz 750 Karakterden Fazla Olamaz!</b></font>'
form.yorum.focus();
document.getElementById("dikkat2").style.color='#D35456';
document.getElementById("dikkat2").style.fontWeight='bold';
return false;
}
if (form.yorum.value.length<3) {
document.getElementById("uyarialani").innerHTML = '<font color="#CC0000"><b>Yorumunuz 3 Karakterden Az Olamaz!</b></font>'
form.yorum.focus();
document.getElementById("dikkat2").style.color='#D35456';
document.getElementById("dikkat2").style.fontWeight='bold';
return false;
}
if (form.gkodu.value=='') {
uyarialani.innerHTML = '<font color="#CC0000"><b>5 Haneli Güvenlik Kodunu Girmediniz!</b></font>'
form.gkodu.focus();
document.getElementById("dikkat3").style.color='#D35456';
document.getElementById("dikkat3").style.fontWeight='bold';
return false;
}
if (form.gkodu.value.length!=5) {
uyarialani.innerHTML = '<font color="#CC0000"><b>Güvenlik Kodu 5 Karakterden Oluşmalıdır!</b></font>'
form.gkodu.focus();
document.getElementById("dikkat3").style.color='#D35456';
document.getElementById("dikkat3").style.fontWeight='bold';
return false;
}
else{return true;}
}


function KarakterKont(x,y){
izinsizler = new Array("'","(",")","\&","\"","+","%","?",";","\\","\/","!","=",":");
if(y==1){if (x.indexOf("İ")>-1){return false;}if (x.indexOf("ı")>-1){return false;}}
for (i=0;i<=13;i++){if (x.indexOf(izinsizler[i])>-1){return false;}} 
}

		function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
		
		for (i=0; i<invalidChars.length; i++) {
   			if (str.indexOf(invalidChars.charAt(i),0) > -1) {
      			return false;
   				}
			}
		for (i=0; i<str.length; i++) {
   			if (str.charCodeAt(i)>127) {
      			return false;
   				}
			}
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true					
	}

function YorumGotur(y,z,t){
if (document.getElementById("yorumyazi_"+t+"").style.fontWeight=='bold'){
for(i=1;i<3;i++){document.getElementById("yorumyazi_"+i+"").style.fontWeight='normal';}
document.getElementById("yorumyazi_"+t+"").style.fontWeight='bold';

var YorumBaglantisi;
YorumBaglantisi=DizAjaxBaglantisiOlustur();
if (YorumBaglantisi==null){
  alert ("Tarayıcınız AJAX Desteklemiyor! Sen O Bilgisayarı Çöpe Atınız...");
  return false;
  }
var gidecek = "isim="+escape(document.yorumyazbakem.isim.value)+"&eposta="+escape(document.yorumyazbakem.eposta.value)+"&yorum="+escape(document.yorumyazbakem.yorum.value)+"&gkodu="+escape(document.yorumyazbakem.gkodu.value);
var url="ajaxgetir.asp?bolum=yrmyzdr&tur="+z+"&iid="+y+"&sid="+Math.random();
YorumBaglantisi.onreadystatechange=function() {
		if (YorumBaglantisi.readyState==4){ 
   		document.getElementById("yorum_listesi").innerHTML=YorumBaglantisi.responseText;
   		}else{
		document.getElementById("yorum_listesi").innerHTML='<br><br><center><img src="immages/yukleniyor.gif" boder="0" height="18" width="18" align="absmiddle"> Yorumlar Yükleniyor!';
		}
	}
YorumBaglantisi.open("POST",url,true);
YorumBaglantisi.setRequestHeader('Content-length', gidecek.length);
YorumBaglantisi.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=iso-8859-9');
YorumBaglantisi.setRequestHeader('Connection', 'close');
YorumBaglantisi.send(gidecek);
}
}

var supportsKeys = false
var maxLength

function textKey(f)
{
		supportsKeys = true
		calcCharLeft(f)
}

function calcCharLeft(f)
{
		maxLength = 750;
        if (f.yorum.value.length > maxLength){
	        f.yorum.value = f.yorum.value.substring(0,maxLength)
		    charleft = 0
        } else {
			charleft = maxLength - f.yorum.value.length
		}
        f.harf.value = charleft
}
