//---AJAX -----------------------------------------
function GetXmlHttpObject() { 
	var objXMLHttp=null
	if (window.XMLHttpRequest) {
		objXMLHttp=new XMLHttpRequest()
	} else if (window.ActiveXObject) {
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}
//-------------------------------------------------
//---POP-UP----------------------------------------
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-------------------------------------------------
//---SWAP IMAGE------------------------------------
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-------------------------------------------------
//---Animasyon-------------------------------------
function Animasyon(m) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="995" height="385" id="ZB" align="middle">');
		document.write('<param name="allowScriptAccess" value="sameDomain">');
		document.write('<param name="movie" value="images/ZB.swf?m='+m+'">');
		document.write('<param name="loop" value="false">');
		document.write('<param name="menu" value="false">');
		document.write('<param name="quality" value="best">');
		document.write('<param name="bgcolor" value="#eff0e7">');
		document.write('<param name="wmode" value="transparent">');
		document.write('<embed src="images/ZB.swf?m='+m+'" loop="false" menu="false" quality="best" wmode="transparent" bgcolor="#eff0e7" width="995" height="385" name="ZB" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
	document.write('</object>');
}
//-------------------------------------------------
//----Kayan Duyuru---------------------------------
var zaman;
	baslaP=0;
	ustP=0;
	function basla() {
		yukseklik = document.getElementById("dinamik").offsetHeight+65;
		if (document.getElementById("yon").value==1) {
			if (baslaP!=yukseklik) {
				baslaP=baslaP+1;
				ustP=ustP-1;
				document.getElementById('divIcerik').style.position="relative";
				document.getElementById('divIcerik').style.top=ustP;
				zaman=setTimeout("basla()",document.getElementById("hiz").value);
			} else {
				baslaP=0;
				ustP=0;
				zaman=setTimeout("basla()",document.getElementById("hiz").value)
			}
		} else {
			if (baslaP!=0) {
				baslaP=baslaP-1;
				ustP=ustP+1;
				document.getElementById('divIcerik').style.position="relative";
				document.getElementById('divIcerik').style.top=ustP;
				zaman=setTimeout("basla()",document.getElementById("hiz").value);
			} else {
				baslaP=yukseklik;
				ustP=0-yukseklik;
				zaman=setTimeout("basla()",document.getElementById("hiz").value)
			}
		}
	}
	function zamandur() {
		clearTimeout(zaman);
	}
//-------------------------------------------------
//---BÜYÜK FOTOĞRAF GÖSTER-------------------------
var en;
var boy;
var browser = navigator.appName;
function EkranEnBoy() {
	switch(browser) {
		case "Microsoft Internet Explorer":
			en = document.getElementById("AnaTable").offsetWidth;
			boy = document.getElementById("AnaTable").offsetHeight;
			break;
		case "Netscape":
			en = document.getElementById("AnaTable").offsetWidth;
			boy = document.getElementById("AnaTable").offsetHeight;
			break;
		case "Opera":
			en = document.getElementById("AnaTable").offsetWidth;
			boy = document.getElementById("AnaTable").offsetHeight;
			break;
	}
}
function Ekran() {
	document.getElementById("EkranDiv").style.width = en+'px';
	document.getElementById("EkranDiv").style.height = boy+'px';
	var tut = document.getElementById("EkranDiv").style;
		tut.opacity = 0.5; 
		tut.MozOpacity = 0.5; 
		tut.KhtmlOpacity = 0.5; 
		tut.filter = "alpha(opacity=50)"; 
}
function Resim(Galeri,Foto) {
	Ekran();
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Kullandığınız browser kayıt işlemlerini desteklemiyor.");
		return;
	}
	var url="uygulama_foto.asp";
		url=url+"?Galeri="+Galeri;
		url=url+"&Foto="+Foto;
		url=url+"&rnd="+Math.random();
		xmlHttp.onreadystatechange=GelenResim;
		xmlHttp.open("POST",url,true);
		xmlHttp.send(null);
}
function GelenResim() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		TopHegith = document.body.scrollTop + 80 + 'px';
		document.getElementById("ResimDiv").style.top = TopHegith;
		document.getElementById("ResimDiv").style.width = en+'px';
		document.getElementById("ResimDiv").innerHTML = xmlHttp.responseText;
		document.getElementById("EkranDiv").style.display = '';
		document.getElementById("ResimDiv").style.display = '';
	} 
}
function EkranGizle() {
	document.getElementById("EkranDiv").style.display = 'none';
	document.getElementById("ResimDiv").style.display = 'none';
	document.getElementById("EkranDiv").innerHTML = '';
	document.getElementById("ResimDiv").innerHTML = '';
}
function ResimDegis(Resim) {
	document.getElementById("ResimAlan").innerHTML = "<img src="+Resim+" border=0>";
}


//-------------------------------------------------
function Resim2(Dosya,Foto) {
	Ekran();
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Kullandığınız browser kayıt işlemlerini desteklemiyor.");
		return;
	}
	var url=Dosya;
		url=url+"?Foto="+Foto;
		url=url+"&rnd="+Math.random();
		xmlHttp.onreadystatechange=GelenResim2;
		xmlHttp.open("POST",url,true);
		xmlHttp.send(null);
}
function GelenResim2() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		TopHegith = document.body.scrollTop + 80 + 'px';
		document.getElementById("ResimDiv").style.top = TopHegith;
		document.getElementById("ResimDiv").style.width = en+'px';
		document.getElementById("ResimDiv").innerHTML = xmlHttp.responseText;
		document.getElementById("EkranDiv").style.display = '';
		document.getElementById("ResimDiv").style.display = '';
	} 
}
//-------------------------------------------------
//---VİDEO GÖSTER----------------------------------
function Video(Dosya) {
	Ekran();
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Kullandığınız browser kayıt işlemlerini desteklemiyor.");
		return;
	}
	var url="inc_video.asp";
		url=url+"?Dosya="+Dosya;
		url=url+"&rnd="+Math.random();
		xmlHttp.onreadystatechange=GelenVideo;
		xmlHttp.open("POST",url,true);
		xmlHttp.send(null);
}
function GelenVideo() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		TopHegith = document.body.scrollTop + 80 + 'px';
		document.getElementById("VideoDiv").style.top = TopHegith;
		document.getElementById("VideoDiv").style.width = en+'px';
		document.getElementById("VideoDiv").innerHTML = xmlHttp.responseText;
		document.getElementById("EkranDiv").style.display = '';
		document.getElementById("VideoDiv").style.display = '';
	} 
}
function VideoGizle() {
	document.getElementById("EkranDiv").style.display = 'none';
	document.getElementById("VideoDiv").style.display = 'none';
	document.getElementById("EkranDiv").innerHTML = '';
	document.getElementById("VideoDiv").innerHTML = '';
}
//-------------------------------------------------
//-------------------------------------------------
function TextClear(Gelen) {
	if (Gelen == 'e-posta adresinizi yazınız.') {
		document.getElementById("EMail").value = '';
	}
}
function TextWrite(Gelen) {
	if ((Gelen == '') || (Gelen == 'e-posta adresinizi yazınız.')) {
		document.getElementById("EMail").value = 'e-posta adresinizi yazınız.';
	}
}
//------------------------------------------------

