// JavaScript Document
var anahtar=true;
function regKontrol(pattern, value)
{
   r = new RegExp(pattern, "g");
   return r.test(value);
} 



function sifreDegKontrol(form)
{

 	patternEposta   = "^"+"([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9_\.\-]+)"+"@"+"([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9_\.\-]+)"+"[\.]"+"([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9_\.\-]+)"+"$";	
	if(form.email.value==""){document.getElementById('emailKontrol').innerHTML="Lütfen Bir E-posta Adresi Giriniz.";anahtar=false;document.getElementById('emailKontrol').focus();}else{document.getElementById('emailKontrol').innerHTML='*';}
	if ( !regKontrol(patternEposta,form.email.value))
	{
         form.email.focus();
		 document.getElementById('emailKontrol').innerHTML="Lütfen Doğru Bir E-posta Adresi Giriniz.";
	     anahtar=false;
     }
if (anahtar==true){return true;}else {return false;}

}

function formKontrol(form)
{

	
 	patternEposta   = "^"+"([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9_\.\-]+)"+"@"+"([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9_\.\-]+)"+"[\.]"+"([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9_\.\-]+)"+"$";	
 

	if(form.sifre.value.length<5){document.getElementById('sifreKontrol').innerHTML=("şifre 5 yada daha fazla karakter olmalı");anahtar=false;document.getElementById('sifreKontrol').focus();}else{document.getElementById('sifreKontrol').innerHTML='*';}
	
	if(form.email.value==""){document.getElementById('emailKontrol').innerHTML="Lütfen Bir E-posta Adresi Giriniz.";anahtar=false;document.getElementById('emailKontrol').focus();}else{document.getElementById('emailKontrol').innerHTML='*';}
	if ( !regKontrol(patternEposta,form.email.value))
	{
         form.email.focus();
		 document.getElementById('emailKontrol').innerHTML="Lütfen Doğru Bir E-posta Adresi Giriniz.";
	     anahtar=false;
     }
	if(document.getElementById('soyad').value==""){document.getElementById('soyadKontrol').innerHTML=("Soyad girmediniz");anahtar=false;document.getElementById('soyad').focus();}	else{document.getElementById('soyadKontrol').innerHTML='*';}
 	if(document.getElementById('ad').value==""){document.getElementById('adKontrol').innerHTML=("İsim girmediniz!");anahtar=false;document.getElementById('ad').focus();}else{document.getElementById('adKontrol').innerHTML='*';}
		if(document.getElementById('takmaAd').value==""){document.getElementById('takmaAdKontrol').innerHTML=("Takma İsim girmediniz!");anahtar=false;document.getElementById('takmaAd').focus();}else{document.getElementById('takmaAdKontrol').innerHTML='*';}	
if (anahtar==true){return true;}else {return false;}

}


function formDegisimKontrol(form)
{
		var anahtar=true;
		if(document.getElementById('sifre').value==""){document.getElementById('sifreKontrol').innerHTML=("Şifre girmediniz");anahtar=false;document.getElementById('sifreKontrol').focus();}else{document.getElementById('sifreKontrol').innerHTML='*';}
		
		if(document.getElementById('sifre').value.length<5){document.getElementById('sifreKontrol').innerHTML=("şifre 5 yada daha fazla karakter olmalı");anahtar=false;document.getElementById('sifreKontrol').focus();}else{document.getElementById('sifreKontrol').innerHTML='*';}
		if(document.getElementById('soyad').value==""){document.getElementById('soyadKontrol').innerHTML=("Soyad girmediniz");anahtar=false;document.getElementById('soyad').focus();}	else{document.getElementById('soyadKontrol').innerHTML='*';}
		
		if(document.getElementById('ad').value==""){document.getElementById('adKontrol').innerHTML=("İsim girmediniz!");anahtar=false;document.getElementById('ad').focus();}else{document.getElementById('adKontrol').innerHTML='*';}
		
		
	if (anahtar==true){return true;}else {return false;}
}

function yorumFormKontrol(form){
	var anahtar=true;
	if(document.getElementById('yorum').value==""){document.getElementById('yorumKontrol').innerHTML=("Yorum girmediniz!");anahtar=false;document.getElementById('yorum').focus();}else{document.getElementById('yorumKontrol').innerHTML='*';}
	if(document.getElementById('ad').value==""){document.getElementById('adKontrol').innerHTML=("Ad girmediniz!");anahtar=false;document.getElementById('ad').focus();}else{document.getElementById('adKontrol').innerHTML='*';}
		
		
	if (anahtar==true){return true;}else {return false;}
}

function urunEkleFormKontrol(form){
	anahtar=true;
	if(document.getElementById('ad').value==""){document.getElementById('adKontrol').innerHTML=("Başlık girmediniz!");anahtar=false;document.getElementById('ad').focus();}else{document.getElementById('adKontrol').innerHTML='*';}
		
		
	if (anahtar==true){form.submit();}else {return false;}
}
