//---AJAX -----------------------------------------
function GetXmlHttpObject() { 
	var objXMLHttp=null
	if (window.XMLHttpRequest) {
		objXMLHttp=new XMLHttpRequest()
	} else if (window.ActiveXObject) {
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}
//-------------------------------------------------
//---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];}
}
//-------------------------------------------------
//---POP-UP----------------------------------------
function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}
//-------------------------------------------------
//---ALFABE KAPAT----------------------------------
function AlfabeKapat(e) {
	var keynum;
	var keychar;
	var numcheck;
	if (window.event) {
		keynum = e.keyCode;
	} else if (e.which) {
		keynum = e.which;
	}
	keychar = String.fromCharCode(keynum);
	numcheck = /\d/
	return numcheck.test(keychar);
}
//-------------------------------------------------
//---ANİMASYON-------------------------------------
function Animasyon(Dil,Gelen) {
	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="902" height="314" id="animasyon" align="middle">');
		document.write('<param name="allowScriptAccess" value="sameDomain">');
		document.write('<param name="movie" value="images/samet.swf?d='+Dil+'&a='+Gelen+'">');
		document.write('<param name="loop" value="false">');
		document.write('<param name="menu" value="false">');
		document.write('<param name="wmode" value="transparent">');
		document.write('<param name="quality" value="best">');
		document.write('<param name="bgcolor" value="#faf9fa">');
		document.write('<embed src="images/samet.swf?d='+Dil+'&a='+Gelen+'" loop="false" menu="false" quality="best" wmode="transparent" bgcolor="#faf9fa" width="902" height="314" name="animasyon" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
	document.write('</object>');
}
//-------------------------------------------------
//---EBulten TextBox-------------------------------
function TextClear(Gelen) {
	if ((Gelen == 'e-posta adresiniz.') || (Gelen == 'type your e-mail.')) {
		document.getElementById("EMail").value = '';
	}
}
function TextWrite(Gelen) {
	if ((Gelen == '')|| (Gelen == 'e-posta adresiniz.') || (Gelen == 'type your e-mail.')) {
		if (document.getElementById("d").value == 2) {
			document.getElementById("EMail").value = 'type your e-mail.';
		} else {
			document.getElementById("EMail").value = 'e-posta adresiniz.';
		}
	}
}
//-------------------------------------------------
//---Dil Seçim-------------------------------------
function DilSec(Adres,d){
	var Frm = document.DilFrm;
		Frm.d.value = d;
		Frm.method = "post";
		Frm.action = Adres;
		Frm.submit();
}
//-------------------------------------------------
//---DUYURU TICKER----------------------------------
	var HarfSay = 0;
	var DuyuruSay = 1;
	function DuyuruTicker() {
		DuyuruIcerik = document.getElementById("Duyuru"+DuyuruSay).innerHTML;
		document.getElementById("Duyuru"+DuyuruSay).innerHTML = '';
		document.getElementById("Duyuru"+DuyuruSay).style.display = '';
		DuyuruHarf();
	}
	function DuyuruHarf() {
		document.getElementById("Duyuru"+DuyuruSay).innerHTML = document.getElementById("Duyuru"+DuyuruSay).innerHTML + DuyuruIcerik.charAt(HarfSay);
		if (HarfSay<DuyuruIcerik.length){
			HarfSay++;
			setTimeout("DuyuruHarf()",25);
		} else {
			setTimeout("DuyuruBekle()",3000);
		}
	}
	function DuyuruBekle() {
		document.getElementById("Duyuru"+DuyuruSay).style.display = 'none';
		if (DuyuruSay<document.getElementById("DuyuruAdet").value) {
			DuyuruSay++;
		} else {
			DuyuruSay=1;
		}
		HarfSay = 0;
		DuyuruTicker();
	}
//-------------------------------------------------
//---EKRAN ÖLÇÜ------------------------------------
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)"; 
}
//-------------------------------------------------
//---BÜYÜK FOTOĞRAF GÖSTER-------------------------
var FotoDil;
var HtmlUst = '';
var HtmlAlt = '';
function HtmlOlus() {
	HtmlUst = '';
	HtmlAlt = '';
	HtmlUst = HtmlUst + '<table cellpadding="0" cellspacing="0" align="center">';
		HtmlUst = HtmlUst + '<tr>';
			HtmlUst = HtmlUst + '<td colspan="3" height="3" bgcolor="#c2c2c2"></td>';
		HtmlUst = HtmlUst + '</tr>';
		HtmlUst = HtmlUst + '<tr>';
			HtmlUst = HtmlUst + '<td width="3" bgcolor="#c2c2c2"></td>';
			HtmlUst = HtmlUst + '<td bgcolor="#c2c2c2" align="right"><a href="Javascript:void(0);" onClick="FotoGizle();"><img src="images/genel/kapat'+FotoDil+'.gif" name="kapat" border="0" id="kapat"></a></td>';
			HtmlUst = HtmlUst + '<td width="3" bgcolor="#c2c2c2"></td>';
		HtmlUst = HtmlUst + '</tr>';
		HtmlUst = HtmlUst + '<tr>';
			HtmlUst = HtmlUst + '<td height="3" colspan="6" bgcolor="#c2c2c2"></td>';
		HtmlUst = HtmlUst + '</tr>';
		HtmlUst = HtmlUst + '<tr>';
			HtmlUst = HtmlUst + '<td width="3" bgcolor="#c2c2c2"></td>';
			HtmlUst = HtmlUst + '<td align="center" valign="top" bgcolor="#ffffff">';
				HtmlUst = HtmlUst + '<table cellpadding="0" cellspacing="0">';
					HtmlUst = HtmlUst + '<tr>';
						HtmlUst = HtmlUst + '<td>';
	
						HtmlAlt = HtmlAlt + '</td>';
					HtmlAlt = HtmlAlt + '</tr>';
				HtmlAlt = HtmlAlt + '</table>';
			HtmlAlt = HtmlAlt + '</td>';
			HtmlAlt = HtmlAlt + '<td width="3" bgcolor="#c2c2c2"></td>';
		HtmlAlt = HtmlAlt + '</tr>';
		HtmlAlt = HtmlAlt + '<tr>';
			HtmlAlt = HtmlAlt + '<td height="3" colspan="3" bgcolor="#c2c2c2"></td>';
		HtmlAlt = HtmlAlt + '</tr>';
	HtmlAlt = HtmlAlt + '</table>';
}
function Foto(Dosya,Klasor,Foto,Toplam,d) {
	document.getElementById("FotoDiv").innerHTML = '';
	FotoDil = d;
	HtmlOlus();
	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+"&Klasor="+Klasor;
		url=url+"&Toplam="+Toplam;
		url=url+"&d="+d;
		url=url+"&rnd="+Math.random();
		xmlHttp.onreadystatechange=GelenFoto;
		xmlHttp.open("POST",url,true);
		xmlHttp.send(null);
}
function GelenFoto() {
	TopHegith = document.body.scrollTop + 5 + 'px';
	document.getElementById("FotoDiv").style.top = TopHegith;
	document.getElementById("FotoDiv").style.width = en+'px';
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		document.getElementById("FotoDiv").innerHTML = HtmlUst + xmlHttp.responseText + HtmlAlt;
	} else {
		document.getElementById("FotoDiv").innerHTML = HtmlUst + '<img src="images/genel/Yukleniyor'+FotoDil+'.gif" border="0">' + HtmlAlt;
	}
	document.getElementById("EkranDiv").style.display = '';
	document.getElementById("FotoDiv").style.display = '';
}


function Resim(FotografId,DuyuruId,Klasor,Dil) {
	document.getElementById("FotoDiv").innerHTML = '';
	FotoDil = Dil;
	HtmlOlus();
	Ekran();
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Kullandığınız browser kayıt işlemlerini desteklemiyor.");
		return;
	}
	var url="duyuru_foto.asp";
		url=url+"?FotografId="+FotografId;
		url=url+"&DuyuruId="+DuyuruId;
		url=url+"&Klasor="+Klasor;
		url=url+"&d="+Dil;
		url=url+"&rnd="+Math.random();
		xmlHttp.onreadystatechange=GelenResim;
		xmlHttp.open("POST",url,true);
		xmlHttp.send(null);
}
function GelenResim() {
	TopHegith = document.body.scrollTop + 5 + 'px';
	document.getElementById("FotoDiv").style.top = TopHegith;
	document.getElementById("FotoDiv").style.width = en+'px';
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		document.getElementById("FotoDiv").innerHTML = HtmlUst + xmlHttp.responseText + HtmlAlt;
	} else {
		document.getElementById("FotoDiv").innerHTML = HtmlUst + '<img src="images/genel/Yukleniyor'+FotoDil+'.gif" border="0">' + HtmlAlt;
	}
	document.getElementById("EkranDiv").style.display = '';
	document.getElementById("FotoDiv").style.display = '';
}

function FotoGizle() {
	document.getElementById("EkranDiv").style.display = 'none';
	document.getElementById("FotoDiv").style.display = 'none';
	document.getElementById("EkranDiv").innerHTML = '';
	document.getElementById("FotoDiv").innerHTML = '';
}
function ResimDegis(Foto) {
	document.getElementById("FotoAlan").innerHTML = "<img src="+Foto+" border=0>";
}
function SonrakiGoster() {
	document.getElementById("SonrakiDiv").style.width = document.getElementById("FotoAlan").offsetWidth + 'px';
	document.getElementById("SonrakiDiv").style.top = '150px';
	document.getElementById("SonrakiDiv").style.display = '';
}
function SonrakiGizle() {
	document.getElementById("SonrakiDiv").style.display = 'none';
}
//-------------------------------------------------
//---VİDEO GÖSTER----------------------------------
function Video(Dosya,d) {
	Ekran();
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Kullandığınız browser kayıt işlemlerini desteklemiyor.");
		return;
	}
	var url="video.asp";
		url=url+"?Dosya="+Dosya;
		url=url+"&d="+d;
		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 + 10 + '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 = '';
}
//-------------------------------------------------