// SEZGUN JS
function ajax()
{
	var xmlHttp=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();

	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
		}
	}
	return xmlHttp;
}

function getY( oElement )
{
var top = 0;
while( oElement != null ) {
top += oElement.offsetTop;
oElement = oElement.offsetParent;
}
return top;
}

function getX( oElement )
{

var left = 0;
while( oElement != null ) {
left += oElement.offsetLeft;
oElement = oElement.offsetParent;
}
return left;
}

function Sayfa(no,tur,bolum) {
	xmlHttpSayfa=ajax(); 
	if (xmlHttpSayfa==null) 
	{
		alert ('Tarayıcınız Ajax Desteklemiyor!');
		return;
	}
	
	if (tur == "makale") {
	var url='makale_listele.php';
	}else if (tur == "program") {
	var url='program_listele.php';
	}else if (tur == "haber") {
	var url='haber_listele.php';
	}else if (tur == "sizeozel") {
	var url='sizeozel_program.php';		
	}

	var sc ='komut=listele&sayfa='+no+'&liste_tur='+bolum;
	
    xmlHttpSayfa.open('POST', url, true); 
	xmlHttpSayfa.setRequestHeader('If-Modified-Since', 'Sat, 1 Jan 2000 00:00:00 GMT');
    xmlHttpSayfa.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');
    xmlHttpSayfa.setRequestHeader('Content-length', sc.length);
    xmlHttpSayfa.setRequestHeader('Connection', 'close');
    xmlHttpSayfa.onreadystatechange=Sayfa_Kayit_Listele;
    xmlHttpSayfa.send(sc);
	
}

function Sayfa_Kayit_Listele ()
{
    if (xmlHttpSayfa.readyState==4 && xmlHttpSayfa.status == 200)
    {
		document.getElementById("loading").style.display = 'none';        
		document.getElementById("veri_liste").innerHTML = xmlHttpSayfa.responseText;
		
    }else{
		document.getElementById("loading").style.display = '';
	}
}



function Bolum_Degistir(tur) {
	xmlHttpBolum=ajax(); 
	if (xmlHttpBolum==null) 
	{
		alert ('Tarayıcınız Ajax Desteklemiyor!');
		return;
	}
	

	var url='sizeozel_program.php';
	var sc ='komut=listele&liste_tur='+tur;
	
    xmlHttpBolum.open('POST', url, true); 
	xmlHttpBolum.setRequestHeader('If-Modified-Since', 'Sat, 1 Jan 2000 00:00:00 GMT');
    xmlHttpBolum.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');
    xmlHttpBolum.setRequestHeader('Content-length', sc.length);
    xmlHttpBolum.setRequestHeader('Connection', 'close');
    xmlHttpBolum.onreadystatechange=function () {
	
	if (xmlHttpBolum.readyState==4 && xmlHttpBolum.status == 200)
    {	
		document.getElementById("loading").style.display = 'none';
document.getElementById("veri_liste").innerHTML = xmlHttpBolum.responseText;		
}else{
		document.getElementById("loading").style.display = '';
	}
	
	}
    xmlHttpBolum.send(sc);
	
}

function mail_list (islem) {
var posta = document.getElementById('Email').value;
var nesne = document.getElementById('Email');
var sol = getX(nesne);
var ust = getY(nesne);
	xmlHttpMail=ajax(); 
	if (xmlHttpMail==null) 
	{
		alert ('Tarayıcınız Ajax Desteklemiyor!');
		return;
	}
	

	var url='maillist.php';
	var sc ='islem='+islem+'&Email='+posta;
	
    xmlHttpMail.open('POST', url, true); 
	xmlHttpMail.setRequestHeader('If-Modified-Since', 'Sat, 1 Jan 2000 00:00:00 GMT');
    xmlHttpMail.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');
    xmlHttpMail.setRequestHeader('Content-length', sc.length);
    xmlHttpMail.setRequestHeader('Connection', 'close');
	xmlHttpMail.onreadystatechange=function () {
	
	if (xmlHttpMail.readyState==4 && xmlHttpMail.status == 200)
    {	
document.getElementById("tasiyici").style.display = '';
document.getElementById("sonuc").style.display = '';
document.getElementById("tasiyici").style.backgroundColor = '#A4D9FA';
document.getElementById("tasiyici").style.left = sol+270+'px';
document.getElementById("tasiyici").style.top = ust-50+'px';
document.getElementById("loading").style.display = 'none';
document.getElementById("sonuc").innerHTML = xmlHttpMail.responseText;		
	}else{
		document.getElementById("loading").style.display = '';
	}

}
    xmlHttpMail.send(sc);
}

function Sonuc_Kapat () {
document.getElementById("sonuc").style.display = 'none';
document.getElementById("tasiyici").style.display = 'none';
document.getElementById("tasiyici").style.left = '-500px';
}