function pchange(obj, myevent){
if ( myevent == 1 ) {obj.style.background = '#d7ffb0';}
if ( myevent == 0 ) {obj.style.background = '#ffffff';
prevVal = obj.value;}}
function numara(deger) {var yaz = new String();
var numaralar = " 0123456789";
var chars = deger.value.split("");
for (i = 0; i < chars.length; i++) {
if (numaralar.indexOf(chars[i]) != -1) yaz += chars[i];
}if (deger.value != yaz) deger.value = yaz;}
function formkontrol()
{var mailadres = document.form2.mail.value;
var mailadresRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
if (document.form2.bayiad.value==''){alert("Bayi Adını Yazınız !...");document.form2.bayiad.focus();}
else if (document.form2.unvan.value==''){alert("Firma Ünvanı !...");document.form2.unvan.focus();}
else if (document.form2.ad.value==''){alert("Yetkili Adı !...");document.form2.ad.focus();}
else if (document.form2.soyad.value==''){alert("Yetkili Soyadı !...");document.form2.soyad.focus();}
else if (document.form2.mail.value==''){alert("E-Mail Adresi Giriniz !...");document.form2.mail.focus();}
else if(!mailadres.match(mailadresRegex)) {alert("Geçerli E-Mail Adresi Giriniz !...");document.form2.mail.focus();}
else if (document.form2.sifre.value==''){alert("Şifrenizi Giriniz !...");document.form2.sifre.focus();}
else if (document.form2.sifre.value.length<6){alert("Şifreniz En Az 6 Karakter Olmalı !...");document.form2.sifre.focus();}
else if (document.form2.sifre2.value==''){alert("Şifrenizi Doğrulayınız!...");document.form2.sifre2.focus();}
else if (document.form2.sifre.value!=document.form2.sifre2.value){alert("Şifreleriniz Birbirini Tutmuyor");document.form2.sifre2.focus();}
else if (document.form2.ulke.value==''){alert("Ülke Seçiniz !...");document.form2.ulke.focus();}
else if (document.form2.adres.value==''){alert("Adres !...");document.form2.adres.focus();}
else if (document.form2.sehir.value==''){alert("Şehir Yazınız !...");document.form2.sehir.focus();}
else if (document.getElementById('ilce').value==''){alert("İlçe Yazınız !...");document.form2.ilce.focus();}
else if (document.getElementById('cep').value==''){alert("Cep Telefonu Yazınız !...");document.form2.cep.focus();}
else if (document.getElementById('tel').value==''){alert("İş Telefonu Yazınız !...");document.form2.tel.focus();}
else if (document.getElementById('vergino').value==''){alert("Vergi Numarası !...");document.form2.vergino.focus();}
else if (document.getElementById('vergidaire').value==''){alert("Vergi Dairesi !...");document.form2.vergidaire.focus();}
else if (document.getElementById('gkod').value==''){alert("Güvenlik Kodunu Yazınız...");document.form2.gkod.focus();}
else if (document.getElementById('gkodum').value!=document.getElementById('gkod').value){alert("Güvenlik Kodunu Yanlış Yazdınız");document.form2.gkod.focus();}
else if (form2.kural.checked==''){alert("Sözleşmeyi Okuyup Kabul Ediyormusunuz ?");}

else {document.form2.submit();}return false;}

function ajax1(mail){
$("#formaciklama1").html('<img src="/images/Loading.gif" />');
	$.ajax({
			type: 'POST', 
			url: '/BayiKontrol.Asp', 
			data:'mail='+mail,	 
			success: function(ajaxCevap) { 
				$('#formaciklama1').html(ajaxCevap); 
			}
		});	
}

