function icerik_yukle(sayfa, icerik_id, gelenform, metod, yukleme){
	var http_request = false;
	document.getElementById(icerik_id).style.display = '';
	if(yukleme==1)document.getElementById(icerik_id).innerHTML = '<img src="img/yukleniyor.gif">';
	if(gelenform != null )var form = document.getElementById(gelenform);
	if (window.XMLHttpRequest) {
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType)http_request.overrideMimeType('text/xml; charset=windows-1254');
	}else if (window.ActiveXObject){
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try {
   				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e){}
		}
	}
	if(!http_request) {
		alert('Tarayıcınız AJAX yapıyı desteklemiyor');
		return false;
	}
	http_request.onreadystatechange = alertContents;
	http_request.open(metod, sayfa, true);
	http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http_request.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");	  
	http_request.setRequestHeader("Connection", "close");
	if(metod == 'GET')http_request.send(null); else http_request.send(createQuery(form));
	function alertContents() {
		if (http_request.readyState == 4) {
			if (http_request.status == 200)document.getElementById(icerik_id).innerHTML=http_request.responseText;
			else document.getElementById(icerik_id).innerHTML = 'Yüklenmeye çalışılan sayfada zaman aşımı meydana geldi .. içeriği tekrar yüklemek için buraya <a href="#" onclick="icerik_yukle(\''+sayfa+'\', \''+icerik_id+'\', \''+gelenform+'\', \''+metod+'\');"> tıklayın</a>';
		}
	}
}

var eposta_str = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;

function createQuery(form){
    var elements = form.elements;
    var pairs = new Array();
    for (var i = 0; i < elements.length; i++) {
        if ((name = elements[i].name) && (value = elements[i].value))pairs.push(name + "=" + encodeURIComponent(value));
    }
    return pairs.join("&");
}



function formu_gonder(sayfa, icerik_id, form_id, yukleme){
	icerik_yukle(sayfa, icerik_id, form_id, 'POST', yukleme);
	return false;
}

function linki_gonder(sayfa, icerik_id, yukleme){
	icerik_yukle(sayfa, icerik_id, '', 'GET', yukleme);
}

function s_onay(sayfa, kayit_no,  icerik_id){
	if(window.confirm(kayit_no + ' No \' lu kayıt silinecek. Onaylıyor musunuz ?'))icerik_yukle(sayfa, icerik_id, '', 'GET')
}

function sil_onay(sayfa){
	if(window.confirm('Kayıt silinecek. Onaylıyor musunuz ?'))window.location.href=sayfa;
}


function hata_yaz(hata){
	document.getElementById('hata_goster').style.display = '';
	document.getElementById('hata_goster').className = 'text';
	document.getElementById('hata_goster').style.color = '#990000';
	document.getElementById('hata_goster').style.backgroundColor = '#FFFFFF';
	document.getElementById('hata_goster').style.padding = '10px';
	document.getElementById('hata_goster').style.border = '1px solid #990000';
	document.getElementById('hata_goster').innerHTML = 'Aşağıdaki Bilgiler Eksik yada Hatalı. Kontrol Ediniz<hr size="1" style="color:#990000"> <ul>' + hata + ' </ul>' ;
	
	
}


function flash_yaz(flas_dosya, dosya_en, dosya_boy, dosya_id){
	 document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	 document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
	 document.write(' ID="'+dosya_id+'" WIDTH="'+dosya_en+'" HEIGHT="'+dosya_boy+'" ALIGN="">');
	 document.write(' <PARAM NAME=movie VALUE="'+flas_dosya+'"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>  <PARAM NAME=wmode VALUE=opaque> '); 
	 document.write(' <EMBED src="'+flas_dosya+'" quality="high" wmode=opaque bgcolor=#FFFFFF');
	 document.write(' swLiveConnect=FALSE WIDTH="'+dosya_en+'" HEIGHT="'+dosya_boy+'" NAME="'+dosya_id+'" ALIGN=""');
	 document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
	 document.write(' </EMBED>');
	 document.write(' </OBJECT>');
}

function pop_up(sayfa, x, y){
	if(sayfa=="")return false;
	var sayfa_adi = Math.floor(Math.random()*100)
	pencere=window.open(sayfa,"yenisayfa"+sayfa_adi ,"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizeable=no, width=" + x + ",height=" + y +  ", screenX=5, screenY=5, top=5, left=5")
}

function pencere(sayfa, cx, cy){

	var w = document.body.clientWidth;
	var h = document.body.clientHeight;
	var px, py, rw, rh;
	px = Math.floor(w/2)-(cx/2);
	py = Math.floor(h/2)-(cy/2);
	
	document.getElementById("ajax_pencere").style.left=px+'px';
	document.getElementById("ajax_pencere").style.top=py+'px';
	document.getElementById("ajax_pencere2").style.display='none';
	
	document.getElementById("ajax_pencere1").innerHTML = '<iframe src="'+sayfa+'" frameborder="0" height="'+(Math.floor(cy)-30)+'" width="'+(Math.floor(cx)-30)+'" scrolling="auto" id="pencere_frame" ></iframe>' ;

	document.getElementById("ajax_pencere").style.width = cx+'px';
	document.getElementById("ajax_pencere").style.height = cy+'px';
	document.getElementById("ajax_pencere").style.display='';


}