// Ajax ile sorgu gönderme fonksiyonum
function get_icerik(kutu,sorgu) {
	if (window.XMLHttpRequest) { ajax=new XMLHttpRequest(); } else { ajax=new ActiveXObject("Microsoft.XMLHTTP"); }
	ajax.onreadystatechange=function() { if (ajax.readyState==4 && ajax.status==200) { document.getElementById(kutu).innerHTML=ajax.responseText; } }
	ajax.open("GET",sorgu,true);
	ajax.send();
}

/*********************************** İşlem Onay Alma   http://nursinsasmaz.com/wordpress/?p=43   */
function islem_onay(mesaj,url) { if (confirm(mesaj)) { document.location = url; } }
/*********************************** İnput Ekleyici Javascript  http://nursinsasmaz.com/wordpress/?p=47   */
function inputadder() {
	document.getElementById("inputs").innerHTML += '<input style="display:block;margin:2px 0;" type="file" name="file[]" />';
}
function goster_gizle(kutu) {
	durum=document.getElementById(kutu).style.display;
	if(durum=='none') {
		document.getElementById(kutu).style.display="block";	
	} else {
		document.getElementById(kutu).style.display="none";
	}
}
function boyutlandir(image, maxwidth, maxheight){
	if (image.className == "listalbumresim") {
		w = image.width;
		h = image.height;
		if( w == 0 || h == 0 ) {
			image.width = maxwidth;
			image.height = maxheight;
		} else if (w > h) {
			if (w > maxwidth) image.width = maxwidth;
		} else {
			if (h > maxheight) image.height = maxheight;
		} 
		image.className = "ScaledThumbnail";
	}
}
function bunugoster (id) {
	var birim_sayisi=document.getElementById('birim_sayi').value;
	for(i=1;i<=birim_sayisi;i++) {
		document.getElementById('birim'+i).style.display='none';
	}
	document.getElementById(id).style.display='block';
}
function duur() {
	if(navigator.appName == "Microsoft Internet Explorer") {
		window.document.execCommand('Stop');
	} else {
		window.stop();
	}
}
function regKontrol(pattern, value) { r = new RegExp(pattern, "g"); return r.test(value); }
function formKontrol(form) {
	patternEposta   = "^"+"([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9_\.\-]+)"+"@"+"([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9_\.\-]+)"+"[\.]"+"([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9_\.\-]+)"+"$";
	if ( !regKontrol(patternEposta,form.email.value)) {
		alert("Lütfen Doğru Bir E-posta Adresi Giriniz.");
		form.email.value="";
		form.email.focus();
		return false;
	}
	return true;
}
function confirmdel(delUrl) {
	if (confirm("Silmek istediğinizden eminmisiniz?")) {
		document.location = delUrl;
	}
}
function evethayir(id,deger) {
	document.getElementById(id).style.display=deger;
}
function hatakontrol(deger,pencere) {
	if(deger=='') {
		document.getElementById(pencere).style.display='inline-block';
	} else {
		document.getElementById(pencere).style.display='none';
	}
}
	
