function Ac(Sayac) {
	document.getElementById('AltMenuSpan'+Sayac).style.display="block";
}
function Kapat(Sayac) {
	document.getElementById('AltMenuSpan'+Sayac).style.display="none";
}

var crcon = document.createElement('div');
var crdiv = document.createElement('div');
var crpic = document.createElement('img');
var craspic = document.createElement('img');
var crkppic = document.createElement('img');
var wt;
var op;
function hazirla() {
	crcon.style.position="absolute";
	crcon.style.backgroundColor = "black";
	crcon.style.left="0px";
	crcon.style.top="0px";
	crcon.style.display="none";
	crcon.style.filter="alpha(opacity=70)";
	document.body.appendChild(crcon);
	crcon.id="CrCon";
	crdiv.style.backgroundColor="white";
	crdiv.style.position="absolute";
	crdiv.style.width="730px";
	crdiv.style.display="none";
	crdiv.align="center";
	crcon.id="CrDiv";
	crpic.src="./resim/loading.gif";
	document.body.appendChild(crdiv);
	crpic.style.margin="30 30 30 30";
	crdiv.appendChild(crpic);
	/*craspic.style.width="700px";
	craspic.style.height="650px";*/
	craspic.style.border="solid 5px white";
	craspic.style.display="none";
	crdiv.appendChild(craspic);
	crpic.align="center";
	crkppic.style.position="absolute";
	crkppic.style.display="none";
	crkppic.style.cursor="hand";
	crkppic.style.zIndex = 101;
	crkppic.onclick = function() { myLightboxend(); }
	crdiv.appendChild(crkppic);
	crkppic.src="./resim/closebox.png";
}
function buyut(gelen) {
	var arrayPageSize = getPageSize();
	var arrayScroll=getPageScroll();
	crcon.style.width=arrayPageSize[0]+"px";
	crcon.style.height=arrayPageSize[1]+"px";
	crdiv.style.top=arrayScroll[1]+100;
	crdiv.style.left=arrayPageSize[0]/2-350+"px";
	crkppic.style.top="-10px";
	crkppic.style.left="-10px";
	crcon.style.display="block";
	crdiv.style.height="100px";
	crdiv.style.display="block";
	crpic.style.display="block";
	craspic.src="./resim/ekranlar/"+ gelen + ".jpg";
	op=10;
	wt=setInterval("ac()",20)
}
function ac() {
	if(crdiv.style.height=='500px') {
		craspic.style.display="block";
		crpic.style.display="none";
		if(op==100) {
			clearInterval(wt);
			crkppic.style.display="block";
		} else {
			craspic.style.filter='alpha(opacity='+op+')';
			op+=10;
		}
	} else {
		crdiv.style.height=crdiv.clientHeight+10+"px";
	}
}

function myLightboxend() {
	crkppic.style.display="none";
	craspic.style.display="none";
	crdiv.style.display="none";
	crcon.style.display="none";
}

function getPageScroll(){

	var xScroll, yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;	
	}

	arrayPageScroll = new Array(xScroll,yScroll) 
	return arrayPageScroll;
}
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	
//	console.log(self.innerWidth);
//	console.log(document.documentElement.clientWidth);

	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// For small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// For small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = xScroll;		
	} else {
		pageWidth = windowWidth;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
function kontrol() {
	if (document.getElementById('txtUnvan').value=='') { Mesaj('Lütfen Ünvan Sahasını Doldurun'); return; }
	if (document.getElementById('txtAdSoyad').value=='') { Mesaj('Lütfen Ad Soyad Sahasını Doldurun'); return; }
	if (document.getElementById('txtMail').value=='') { Mesaj('Lütfen Mail Sahasını Doldurun'); return; }
	if (document.getElementById('txtTelefon').value=='') { Mesaj('Lütfen Telefon Sahasını Doldurun'); return; }
	if (document.getElementById('txtMail').value.indexOf ('@',0) == -1) { Mesaj('Lütfen geçerli bir mail adresi giriniz'); return; }
	document.getElementById('Kayit').value = "[!Kayit!]";
	var doc = document.forms[0];
	doc.submit();
	alert('Kaydınız Alınmıştır Teşekkürler');
}
function Mesaj(glMesaj) {
	var mscon;
	var msbas;
	var msgov;
	var mspic;
	var mskap;
	var msmes;
	if(!document.getElementById('dialog')) {
		mscon = document.createElement('div');
		mscon.id = "dialog";
		document.body.appendChild(mscon);

		msbas = document.createElement('div');
		msbas.id = "dialog_baslik";
		document.body.appendChild(msbas);

		msgov = document.createElement('div');
		msgov.id = "dialog_govde";
		document.body.appendChild(msgov);
		
		mspic = document.createElement('img');
		mspic.id = "dialog_resim";
		msgov.appendChild(mspic);

		mskap = document.createElement('img');
		mskap.id = "dialog_kapat";
		msbas.appendChild(mskap);
		
		msmes = document.createElement('div');
		msmes.id = "dialog_mesaj";
		msgov.appendChild(msmes);
		
	} else {
		mscon = document.getElementById('dialog');
		msbas = document.getElementById('dialog_baslik');
		msgov = document.getElementById('dialog_govde');
		mspic = document.getElementById('dialog_resim');
		mskap = document.getElementById('dialog_kapat');
		msmes = document.getElementById('dialog_mesaj');
	}	
	var arrayPageSize = getPageSize();
	var arrayScroll = getPageScroll();
	mscon.style.position="absolute";
	mscon.style.display="block";
	mscon.style.width=arrayPageSize[0]+"px";
	mscon.style.height=arrayPageSize[1]+"px";
	mscon.style.left="0px";
	mscon.style.top="0px";
	mscon.style.backgroundColor = "black";
	mscon.style.filter="alpha(opacity=70)";
	
	msbas.style.top=arrayScroll[1]+100;
	msbas.style.left=arrayPageSize[0]/2-250+"px";
	msbas.style.width="500px";
	msbas.style.height="30px";
	msbas.style.position="absolute";
	msbas.style.display="block";
	msbas.style.zindex="101";
	msbas.style.background="transparent url(./resim/warning_header.gif) repeat-x";
	
	msgov.style.top=arrayScroll[1]+128;;
	msgov.style.left=arrayPageSize[0]/2-250+"px";
	msgov.style.width="500px";
	msgov.style.position="absolute";
	msgov.style.display="block";
	msgov.style.zindex="101";
	msgov.style.border="solid 1px gold";
	msgov.style.backgroundColor="white";
	msgov.style.color="black";

	mspic.style.display="block";
	mspic.src="./resim/warning_bg.jpg";
	mspic.align="right";
	
	mskap.style.display="block";
	mskap.src="./resim/closebox.png";
	mskap.align="right";
	mskap.style.cursor="hand";
	mskap.onclick = function() { mymesajend(); }
	
	msmes.innerHTML = "<a style='padding-left:5px;color=gray;font-family:Arial TUR;font-size:13px;'>" + glMesaj + "</a>";
	msmes.style.display="block";
}
function mymesajend() {
	mscon = document.getElementById('dialog');
	msbas = document.getElementById('dialog_baslik');
	msgov = document.getElementById('dialog_govde');
	mspic = document.getElementById('dialog_resim');
	mskap = document.getElementById('dialog_kapat');
	msmes = document.getElementById('dialog_mesaj');
	msmes.style.display="none";
	mskap.style.display="none";
	mspic.style.display="none";
	msgov.style.display="none";
	msbas.style.display="none";
	mscon.style.display="none";
}