var listem= new Array();
var yabgu=0;
listem[0]="anasayfa";
listem[1]="iptal";
var islem=0;


if (window.XMLHttpRequest){
http = new XMLHttpRequest();
}
else
{
try {
  http = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   http = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   http = false;
  }
 }
} // else..


function handleHttpResponse_Sayfa() {       if (http.readyState == 4) {

           dk =document.getElementById("ana_cerceve");
            dk.innerHTML=http.responseText;
                      
         }
}

function yabgu_kontrol()
{
 if (yabgu==0) {resim_geri.src="resimler/site/geri2.gif";} else  {resim_geri.src="resimler/site/geri.gif";}
 if (listem[yabgu+1]=="iptal") {resim_ileri.src="resimler/site/ileri2.gif";} else {resim_ileri.src="resimler/site/ileri.gif";}
 }
 
function Geri ()
{
		if (yabgu>0)
		{
		yabgu=yabgu-1;
		islem=1;Sayfa_Ac(listem[yabgu]);islem=0;
		
		
		}
/*////////////////////////////////////////
lis=document.getElementById("listemiza");	
listr="";
i=0;
	for (i=0;i<(listem.length);++i)
	{
	 listr=listr+"<br>"+listem[i];

	 }
	lis.innerHTML=yabgu+"<br>"+listr;
/////////////////////////////////////////*/

yabgu_kontrol()
	
}

function Ileri ()
{
 if (yabgu<listem.length)
		{
		yabgu=yabgu+1;
		if (!(listem[yabgu]=="iptal"))
			{islem=1;Sayfa_Ac(listem[yabgu]);}
			else 
			{
			islem=0;yabgu=yabgu-1;
			}
		
		
		}
yabgu_kontrol()		
/*////////////////////////////////////////
lis=document.getElementById("listemiza");	
listr="";
i=0;
	for (i=0;i<(listem.length);++i)
	{
	 listr=listr+"<br>"+listem[i];

	 }
	lis.innerHTML=yabgu+"<br>"+listr;
/////////////////////////////////////////*/
}





function hover1 (degisken,degisken2){  abc=degisken2;degisken.style.background="#FF6200";  document.getElementById(degisken2).style.color="#FFFFFF"; }
function hover2 (degisken,degisken2){  abc=degisken2;degisken.style.background="#0B07A1";  document.getElementById(degisken2).style.color="#FFFFFF"; }
function hover_off (degisken) 		{ degisken.style.background=""; document.getElementById(abc).style.color="#000000";}
function sola()
{

yazi.direction="left";
yazi.scrollAmount="20";
resim_sol.src="resimler/site/sol2.gif"

}


function handleHttpResponse_Foto() {       if (http.readyState == 4) {

           dk =document.getElementById("fotom");
            dk.innerHTML=http.responseText;
            
  
           
         }
}
function secim(a,b)
{if (b=="1") {document.getElementById(a).style.display="block"; }
 if (b=="0") {document.getElementById(a).style.display="none";} }
 
function Foto_Goster(resim)
{
document.body.scroll="no";
kayma();
myRand=parseInt(Math.random()*99999999);
http.open("GET", "foto_goster.php?rand="+myRand+"&resim="+resim+"&yuk="+available_height, true);
http.onreadystatechange = handleHttpResponse_Foto;
http.send(null);
acilirkutular(0); 
secim("fon",1);
secim("fotom",1);
}

function Foto_Kapat()
{
acilirkutular(1); 
secim("fon",0);
secim("fotom",0);
document.body.scroll="yes"; 
 }
function acilirkutular(durum) {
	var selectbox = document.getElementsByTagName("SELECT")
	for(i=0;i<selectbox.length;i++) 
	{
 	if (durum==0){selectbox[i].style.visibility='hidden'; }
 	if (durum==1){selectbox[i].style.visibility='visible'; }
	}
}
function saga()
{

yazi.direction="right";
yazi.scrollAmount="20";
resim_sag.src="resimler/site/sag2.gif"
}

function normal()
{
yazi.scrollAmount="1";
resim_sag.src="resimler/site/sag.gif"
resim_sol.src="resimler/site/sol.gif"

}

 function Is() {
var agent = navigator.userAgent.toLowerCase();
this.major = parseInt(navigator.appVersion);
this.minor = parseFloat(navigator.appVersion);
this.ns = ((agent.indexOf('mozilla') != -1) &&
(agent.indexOf('spoofer') == -1) &&
(agent.indexOf('compatible') == -1) &&
(agent.indexOf('opera') == -1) &&
(agent.indexOf('webtv') == -1));
this.ns4 = (this.ns && (this.major == 4));
this.ns6 = (this.ns && (this.major >= 5));
this.ie = (agent.indexOf("msie") != -1);
this.ie3 = (this.ie && (this.major < 4));
this.ie4 = (this.ie && (this.major >= 4));
this.ie5 = (this.ie && (this.major == 4) &&
(agent.indexOf("msie 5.0") != -1));
this.ieX = (this.ie && !this.ie3 && !this.ie4);
}

var is = new Is();


function layerObject(id,left,top,height,width) {

if (is.ie5||is.ns6){
this.obj = document.getElementById(id).style;
this.obj.left = left;
this.obj.top = top;
this.obj.height = height;
this.obj.width = width;
return this.obj;
} else if(is.ie4) {
this.obj = document.all[id].style;
this.obj.left = left;
this.obj.top = top;
this.obj.height = height;
this.obj.width = width;
return this.obj;
} else if(is.ns4) {
this.obj = document.layers[id] ;
this.obj.left = left;
this.obj.top = top;
this.obj.height = height;
this.obj.width = width;
return this.obj;
}
}


function init() {
if(is.ns4 ||is.ns6) {
available_width=innerWidth;
available_height=innerHeight;
layerSetup();
} else if(is.ie4 || is.ie5) {
available_width=document.body.clientWidth;
available_height=document.body.clientHeight;
layerSetup();
}
}

function resizePage() {
if(is.ns4 ||is.ns6||is.ie4||is.ie5) {
var a=document.getElementById("ust_menu_");if (a) delete a;
var b=document.getElementById("pencere_");if (b) delete b;
var c=document.getElementById("fon");if (c) delete c;
var d=document.getElementById("fotom");if (d) delete d;

init();
}

}


function layerSetup() {
centerLyr = new layerObject('ust_menu_',(available_width-820)/2, 0,0, 820);
centerLyr = new layerObject('pencere_',(available_width-820)/2, 29,0, 820);
centerLyr = new layerObject('fon',0, 0,available_height+20, available_width+30);
centerLyr = new layerObject('fotom',40, 0,(available_height),(available_width-80));
kayma();
document.getElementById("ust_menu_").style.visibility="visible";
document.getElementById("pencere_").style.visibility="visible";
}



function kayma()
{
  if (document.getElementById("fon").style.display=="block")
 {	document.body.scroll="no";}
	document.getElementById("fon").style.top=document.body.scrollTop;
	document.getElementById("fotom").style.top=document.body.scrollTop;
	document.getElementById("ust_menu_").style.top=document.body.scrollTop;
	document.getElementById("ust_menu_").style.left=(available_width-820)/2;

 
}



