 var viewportwidth;
 var viewportheight;
function enboyver() {  
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
  
 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }
  
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
 
 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }
  
 // older versions of IE
  
 else
 {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }
}

var engine = null;
if (window.navigator.appName == "Microsoft Internet Explorer")
{
   // This is an IE browser. What mode is the engine in?
   if (document.documentMode) // IE8
	  engine = document.documentMode;
   else // IE 5-7
   {
	  engine = 5; // Assume quirks mode unless proven otherwise
	  if (document.compatMode)
	  {
		 if (document.compatMode == "CSS1Compat")
			engine = 7; // standards mode
	  }
   }
   // the engine variable now contains the document compatibility mode.
}			


var xmlhttpfirma=false;xmlhttpurun=false;
if (!xmlhttpfirma && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttpfirma = new XMLHttpRequest();xmlhttpurun = new XMLHttpRequest();
	} catch (e) {
		xmlhttpfirma=false;xmlhttpurun=false;
	}
}
if (!xmlhttpfirma && window.createRequest) {
	try {
		xmlhttpfirma = window.createRequest();xmlhttpurun = window.createRequest();
	} catch (e) {
		xmlhttpfirma=false;xmlhttpurun=false;
	}
}

var firma_onizlemeleri = [];
var firma_onizleme_iptal='';
function firma_onizle_goster(firma_anahtar) { 
	Xbpos=0;
	Ybpos=0;

	if(engine==8){
		if((document.documentElement.clientHeight) <= window.event.y+331){
			if(window.event.y<=document.documentElement.scrollTop+331){
				firma_onizleme.style.pixelTop = document.documentElement.scrollTop + 5;
			}else{
				firma_onizleme.style.pixelTop =  window.event.y - 331;					
			}
		}else{
			firma_onizleme.style.pixelTop = 5 + window.event.y;
		}
	
	}else{
		Xbpos = document.body.scrollLeft + document.documentElement.scrollLeft; 
		Ybpos = document.body.scrollTop + document.documentElement.scrollTop;  

		if((document.documentElement.clientHeight) <= window.event.y+361){
			if(window.event.y<=361){
				firma_onizleme.style.pixelTop = (Ybpos+5);
			}else{
				firma_onizleme.style.pixelTop = (Ybpos - 331) + window.event.y;					
			}
		}else{
			firma_onizleme.style.pixelTop = (Ybpos + 5) + window.event.y ;
		}
	}
	if((document.documentElement.clientWidth) <= window.event.x+320){
		firma_onizleme.style.pixelLeft = window.event.x - 300;
	}else{
		firma_onizleme.style.pixelLeft = (Xbpos + 5) + window.event.x;
	}			
	
	document.getElementById("firma_onizleme").innerHTML = '<img style="padding-left:120px;padding-top:114px;" src="'+site_adres+'resimler/yukleniyor.gif">';

	if(firma_onizlemeleri[firma_anahtar] == undefined){
		firma_onizleme_iptal='degil';
		 xmlhttpfirma.open("GET", site_adres+"firma_onizleme.php?firma_anahtar="+firma_anahtar,true);
		 xmlhttpfirma.onreadystatechange=function() {
		  if (xmlhttpfirma.readyState==4) {
			firma_onizlemeleri[firma_anahtar] = xmlhttpfirma.responseText;
			document.getElementById("firma_onizleme").innerHTML = firma_onizlemeleri[firma_anahtar];
			if(firma_onizleme_iptal=='degil'){
				document.getElementById("firma_onizleme").style.visibility = "visible";
			}
			}
		 }
		 xmlhttpfirma.send(null)
	}else{
		firma_onizleme.style.visibility = "visible";	
		document.getElementById("firma_onizleme").innerHTML = firma_onizlemeleri[firma_anahtar];

	}
		
}
function firma_onizle_gizle() { 
	firma_onizleme.style.visibility = "hidden";
	firma_onizleme_iptal='iptal';
}
function firma_onizle_doldur() { 
	document.getElementById("firma_onizleme").innerHTML = ""
}




var urun_onizlemeleri = [];
var urun_onizleme_iptal = '';
function urun_onizle_goster(resim_ad,eni_uzun) { 
	Xbpos=0;
	Ybpos=0;

	if(engine==8){
		if((document.documentElement.clientHeight) <= window.event.y+387){
			if(window.event.y<=document.documentElement.scrollTop+387){
				urun_onizleme.style.pixelTop = document.documentElement.scrollTop + 5;
			}else{
				urun_onizleme.style.pixelTop =  window.event.y - 387;					
			}
		}else{
			urun_onizleme.style.pixelTop = 5 + window.event.y;
		}
	
	}else{
		Xbpos = document.body.scrollLeft + document.documentElement.scrollLeft; 
		Ybpos = document.body.scrollTop + document.documentElement.scrollTop;  

		if((document.documentElement.clientHeight) <= window.event.y+387){
			if(window.event.y<=361){
				urun_onizleme.style.pixelTop = (Ybpos+5);
			}else{
				urun_onizleme.style.pixelTop = (Ybpos - 387) + window.event.y;					
			}
		}else{
			urun_onizleme.style.pixelTop = (Ybpos + 5) + window.event.y ;
		}
	}
	if((document.documentElement.clientWidth) <= window.event.x+320){
		urun_onizleme.style.pixelLeft = window.event.x - 300;
	}else{
		urun_onizleme.style.pixelLeft = (Xbpos + 5) + window.event.x;
	}


	document.getElementById("urun_onizleme").innerHTML = '<img style="padding-left:100px;padding-top:114px;" src="'+site_adres+'/resimler/yukleniyor.gif">';

	if(urun_onizlemeleri[resim_ad] == undefined){
		 urun_onizleme_iptal='degil';
		 xmlhttpurun.open("GET", site_adres+"urun_onizleme.php?resim_ad="+resim_ad+"&eni_uzun="+eni_uzun,true);
		 xmlhttpurun.onreadystatechange=function() {
		  if (xmlhttpurun.readyState==4) {
			urun_onizlemeleri[resim_ad] = xmlhttpurun.responseText;
			document.getElementById("urun_onizleme").innerHTML = urun_onizlemeleri[resim_ad];
			
			if(urun_onizleme_iptal=='degil'){
				document.getElementById("urun_onizleme").style.visibility = "visible";
			}

			}
		 }
		 xmlhttpurun.send(null)

	}else{
		urun_onizleme.style.visibility = "visible";
		document.getElementById("urun_onizleme").innerHTML = urun_onizlemeleri[resim_ad];
	}
		
}
function urun_onizle_gizle() { 
	urun_onizleme.style.visibility = "hidden";
	urun_onizleme_iptal='iptal';
}

function ekrani_kapla_urun(resim_ad){
	document.getElementById("tvicic").innerHTML='<img style="border:5px solid #f00;margin:25px;" src="'+resim_ad+'">';
	document.getElementById("tvic").style.height='';
	document.getElementById("tvic").style.visibility = "visible";
}

function tamboy_urun(){
	enboyver();
	document.getElementById("urun").style.width=urjswidth+'px';
	document.getElementById("urun").style.height=urjsheight+'px';
	document.getElementById("urun").style.position='absolute';
	document.getElementById("urun").style.top='90px';
	document.getElementById("urun").style.left=(viewportwidth-urjswidth)/2+'px';
}
function kucukboy_urun(){
	document.getElementById("urun").style.position='';		
	if(urjstt=="enine"){
		document.getElementById("urun").style.height='500px';			
		document.getElementById("urun").style.width='';
	}else{
		document.getElementById("urun").style.width='490px';	
		document.getElementById("urun").style.height='';	
	}
}

function tvkapat(){
	document.getElementById("tvicic").innerHTML='';
	document.getElementById("tvic").style.height='100%';
	document.getElementById("tvic").style.visibility = "hidden";
}


