﻿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];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function PopupResim(Adres,Resim) { 
	window.open(Adres+Resim, "FotoGaleri", "resizable=0,HEIGHT=500,WIDTH=375"); 
} 

function CubukGoster(deger){
	document.getElementById("cubuk"+deger).style.display='';
}

function CubukGizle(deger){
	document.getElementById("cubuk"+deger).style.display='none';		
}

function GetXmlHttpObject() { 
	var objXMLHttp=null
	if (window.XMLHttpRequest) {
		objXMLHttp=new XMLHttpRequest()
	} else if (window.ActiveXObject) {
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
} 

function Onay(veri,veri2,veri3) {
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) {
		alert ("Kullandığınız browser kayıt işlemlerini desteklemiyor.")
		return
	} 
	var url="inc_onay.asp"
		url=url+"?m="+veri+"&ma="+veri2+"&d="+veri3
		url=url+"&rid="+Math.random()
		xmlHttp.onreadystatechange=GelenKod
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
} 
function GelenKod() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		document.getElementById("OnayAlan").innerHTML = xmlHttp.responseText;
	} 
}  

function SehirYukle(veri) {
	if (veri.length==0) {
		return;
	}
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) {
		alert ("Kullandığınız browser kayıt işlemlerini desteklemiyor.")
		return
	} 
	var url="inc_sehirler.asp"
		url=url+"?v="+veri
		url=url+"&rid="+Math.random()
		xmlHttp.onreadystatechange=GelenSehir
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
} 
function GelenSehir() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		document.getElementById("sehir").innerHTML = xmlHttp.responseText;
		var sehirid = xmlHttp.responseXML.getElementsByTagName("sehirid");
		var sehir = xmlHttp.responseXML.getElementsByTagName("sehir");
		var sehiri = document.UyeKayitFrm.sehiri.value;
		for (var i = 0; i < sehir.length; i++) {
			var satir = new Option(sehir[i].firstChild.data,sehirid[i].firstChild.data);
			document.getElementById("sehir").options[i] = satir;
			if (document.getElementById("sehir").options[i].value == sehiri) {
				document.getElementById("sehir").options[i].selected=true;	
			}
		}
	} 
}

function PopupIcerik(dil) {
	if (document.getElementById("PopupValue").value=="0") {
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null) {
			alert ("Kullandığınız browser kayıt işlemlerini desteklemiyor.");
			return;
		}
		var url="pp_anasayfa.asp";
			url=url+"?d="+dil;
			url=url+"&rnd="+Math.random();
			xmlHttp.onreadystatechange=GelenPopupIcerik;
			xmlHttp.open("POST",url,true);
			xmlHttp.send(null);
	}
}
function GelenPopupIcerik() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		Xcik = XPozisyon(document.getElementById("DivKonum"));
		Ycik = YPozisyon(document.getElementById("DivKonum"));
		document.getElementById("PopupDiv").style.left = Xcik+220;
		document.getElementById("PopupDiv").style.top = Ycik-280;
		document.getElementById("PopupDiv").innerHTML = xmlHttp.responseText;
		document.getElementById("PopupDiv").style.display = "";
	}
}
function PopupIcerikKapat() {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Kullandığınız browser kayıt işlemlerini desteklemiyor.");
		return;
	}
	var url="pp_anasayfa_kapat.asp";
		url=url+"?rnd="+Math.random();
		xmlHttp.onreadystatechange=GelenPopupIcerikKapat;
		xmlHttp.open("POST",url,true);
		xmlHttp.send(null);
}
function GelenPopupIcerikKapat() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		document.getElementById("PopupDiv").style.display = "none";
		document.getElementById("PopupDiv").innerHTML = '';
		document.getElementById("PopupValue").value = "1";
	}
}

//---Ürün Detay TAB--------------------------------
function UrunTab(uid,dil,tur) {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Kullandığınız browser kayıt işlemlerini desteklemiyor.");
		return;
	}
	var url="inc_UrunTab.asp";
		url=url+"?uid="+uid;
		url=url+"&d="+dil;
		url=url+"&t="+tur;
		url=url+"&rnd="+Math.random();
		xmlHttp.onreadystatechange=GelenUrunTab;
		xmlHttp.open("POST",url,true);
		xmlHttp.send(null);
}
function GelenUrunTab() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		document.getElementById("TabAlan").innerHTML = xmlHttp.responseText;
	}
}
//-------------------------------------------------
//---Ürün Görsel Ekran-----------------------------
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=80)"; 
}
//-------------------------------------------------
//---Ürün Görsel Ön İzleme-------------------------
function UrunGorselOnIzleme(Gorsel,gId,uId,d) {
	document.getElementById("UrunGorselAlan").innerHTML = "";
	document.getElementById("UrunGorselAlan").innerHTML = "<a href=javascript:void(0); onClick=Ekran();UrunGorselBuyuk('"+gId+"','"+uId+"','"+d+"');><img src=ftp/urunler/"+Gorsel+" border=0></a>";


	OUGorsel = document.getElementById("UGorsel").value;
	OUGorselId = document.getElementById("UGorselId").value;
	document.getElementById("UGKucukAlan"+OUGorselId).innerHTML = "";
	document.getElementById("UGKucukAlan"+OUGorselId).innerHTML = "<a href=javascript:void(0); onClick=UrunGorselOnIzleme('"+OUGorsel+"','"+OUGorselId+"','"+uId+"','"+d+"');><img src=images/icon/KKare.gif border=0 width=14 height=14 name=KKare"+OUGorselId+" id=KKare"+OUGorselId+" onMouseOver=MM_swapImage('KKare"+OUGorselId+"','','images/icon/KKare_ov.gif',1) onMouseOut=MM_swapImgRestore()></a>";
	
	document.getElementById("UGorsel").value = Gorsel;
	document.getElementById("UGorselId").value = gId;
	document.getElementById("UGKucukAlan"+gId).innerHTML = "";
	document.getElementById("UGKucukAlan"+gId).innerHTML = "<img src=images/icon/KKare_ov.gif border=0 width=14 height=14>";
}
//--------------------------------------------------
//---Ürün Görsel Büyük -----------------------------
function UrunGorselBuyuk(gId,uId,d) {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Kullandığınız browser kayıt işlemlerini desteklemiyor.");
		return;
	}
	var url="inc_UrunGorsel.asp";
		url=url+"?gId="+gId;
		url=url+"&uId="+uId;
		url=url+"&d="+d;
		url=url+"&rnd="+Math.random();
		xmlHttp.onreadystatechange=GelenUrunGorselBuyuk;
		xmlHttp.open("POST",url,true);
		xmlHttp.send(null);
}
function GelenUrunGorselBuyuk() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		TopHegith = 20 + 'px';
		document.getElementById("UrunGorselDiv").style.top = TopHegith;
		document.getElementById("UrunGorselDiv").style.width = en+'px';
		document.getElementById("UrunGorselDiv").innerHTML = xmlHttp.responseText;
		document.getElementById("EkranDiv").style.display = '';
		document.getElementById("UrunGorselDiv").style.display = '';
	} 
}
function EkranGizle() {
	document.getElementById("EkranDiv").style.display = 'none';
	document.getElementById("UrunGorselDiv").style.display = 'none';
	document.getElementById("EkranDiv").innerHTML = '';
	document.getElementById("UrunGorselDiv").innerHTML = '';
}
//--------------------------------------------------


