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")
}


var slideimages=new Array()
var slidelinks=new Array()

function slideshowimages(){
  for (i=0;i<slideshowimages.arguments.length;i++){
  slideimages[i]=new Image()
  slideimages[i].src=slideshowimages.arguments[i]
  }
}

function slideshowlinks(){
  for (i=0;i<slideshowlinks.arguments.length;i++)
  slidelinks[i]=slideshowlinks.arguments[i]
}

function gotoshow(){
  if (!window.winslide||winslide.closed)
    winslide=window.open(slidelinks[whichlink])
  else
    winslide.location=slidelinks[whichlink]
    winslide.focus() 
}

var s;

var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)

document.onmousemove = getMouseXY;

var tempX = 0
var tempY = 0
var cx = 0
var cy = 0

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  cx = tempX
  cy = tempY
  return true
}




function boyutla (){
	rw = document.getElementById("bbbb").clientWidth + 20;
	rh = document.getElementById("bbbb").clientHeight + 50 ;
	document.getElementById("koca_resim").style.width =rw+'px';
	document.getElementById("koca_resim").style.height =rh+'px';
	
}

function rsm(imaj){
	
	clearTimeout(s);
	var w = document.body.clientWidth;
	var h = document.body.clientHeight;
	var px, py, rw, rh;

	px = cx - 0;
	py = cy - 300;


	
	document.getElementById("koca_resim").style.left=px+'px';
	document.getElementById("koca_resim").style.top=py+'px';
	document.getElementById("resim_alani").innerHTML = '<img id = "bbbb" src="'+imaj+'">';
	rw = document.getElementById("bbbb").clientWidth + 20;
	rh = document.getElementById("bbbb").clientHeight + 50 ;
	document.getElementById("koca_resim").style.width =rw+'px';
	document.getElementById("koca_resim").style.height =rh+'px';
	document.getElementById("koca_resim").style.display='';

	s = setTimeout("boyutla()", 1000);
}


function yp(){

//	alert(cx+' , '+cy);
//	document.getElementById("yorum_penceresi").style.left=cx+'px';
//	document.getElementById("yorum_penceresi").style.top=cy+'px';
	document.getElementById("yorum_penceresi").style.display='block';

	
}

function yorum_gonder(){
	var h = 0;
	if(document.getElementById("yorum_ad").value=="" || document.getElementById("yorum_soyad").value==""){
		alert('Adınızı Soyadınızı Giriniz.');
		h = 1;return false;
		
	}
	if(!document.getElementById('yorum_email').value.match(eposta_str) ){
		alert('Geçerli Bir Mail Adresi Giriniz.');
		h = 1;return false;
	}

	if(document.getElementById("yorum_metin").value=="" ){
		alert('Yorumunuzu giriniz');
		h = 1;return false;
	}
	if(h==0){
		document.getElementById("yorum_ekran").style.display='none';
		document.getElementById("yorum_penceresi").style.display='';
		formu_gonder("yorum_kayit.php", "yorum_sonuc", "yorum_form", 2);

	}
	return false;
}
function pencere2(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("resim_alani").innerHTML = '<iframe src="'+sayfa+'" frameborder="0" height="'+(Math.floor(cy)-100)+'" width="'+(Math.floor(cx)-100)+'" scrolling="auto" id="pencere_frame" ></iframe>';

	document.getElementById("koca_resim").style.left=px+'px';
	document.getElementById("koca_resim").style.top=py+'px';

	document.getElementById("koca_resim").style.width =(cx-70)+'px';
	document.getElementById("koca_resim").style.height =(cx-70)+'px';
	document.getElementById("koca_resim").style.display='';
	disableDivs('anasayfa');


}