function UseVoucher(Voucher,Total,Domain)
{
if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	
      {
      if(xmlHttp.readyState==4)
        {
	//	alert (xmlHttp.responseText)
		
if (xmlHttp.responseText=='AlreadyUsed') {alert ('Girmiş olduğunuz kupon numarası daha önce kullanılmıştır.');return false;}
if (xmlHttp.responseText=='InvalidVoucher') {alert ('Girmiş olduğunuz kupon numarası yanlıştır.');return false;}
if (xmlHttp.responseText=='Expired') {alert ('Girmiş olduğunuz kupon numarasının tarihi geçmiştir.');return false;}
if (xmlHttp.responseText=='Insufficient') {alert ('Sepetinizdeki ürünlerin tutarı bu kuponu kullanmak için yetersizdir.');return false;}

	    window.location.reload()

	         }
      }



    xmlHttp.open("GET","ajax/use_voucher.asp?Voucher=" + Voucher + '&Total=' + Total + '&Domain=' + Domain,true);
    xmlHttp.send(null);  


}




function KapidaOdeme()
{
if (document.all.KapidaOdemeSekli[0].checked==false && document.all.KapidaOdemeSekli[1].checked==false)
{
alert ('Lütfen, kapıda ödemeyi ne şekilde yapacağınızı belirtiniz.')
return false;
}

if (document.all.Kabul.checked==false)
{
alert ('Devam etmek için sözleşmeyi okuyup kabul etmeniz gerekmektedir.')
return false;
}



}

function SignupTrace()
{
if (document.all.Secenek)
{
SelOpt=document.all.Secenek.value
}
else
{
SelOpt='0'
}
window.location.href='uye_ol.asp?PTA=' + document.all.ProductToAdd.value + '&SelOpt=' + SelOpt
}

function HediyeAdresKaydet()
{

if (document.all.FaturaAdi.value=='') {alert ('Lütfen, adınızı giriniz.');document.all.FaturaAdi.focus();return false;}
if (document.all.FaturaSoyadi.value=='') {alert ('Lütfen, soyadınızı giriniz.');document.all.FaturaSoyadi.focus();return false;}

if (document.all.FaturaAdres.value=='') {alert ('Lütfen, adresinizi giriniz.');document.all.FaturaAdres.focus();return false;}
if (document.all.FaturaSehir.value=='') {alert ('Lütfen, şehrinizi seçiniz.');document.all.FaturaSehir.focus();return false;}
if (document.all.FaturaIlce.value=='') {alert ('Lütfen, ilçenizi seçiniz.');document.all.FaturaIlce.focus();return false;}



if (document.all.FaturaTipi[0].checked==true)
{
///if (document.all.KimlikNo.value=='') {alert ('Lütfen, TC kimlik numaranızı giriniz.');document.all.KimlikNo.focus();return false;}
if (document.all.SatinAlanEvTelefonu.value=='') {alert ('Lütfen, telefonunuzu giriniz.');document.all.SatinAlanEvTelefonu.focus();return false;}
if (document.all.SatinAlanEvTelefonu.value.length<9 || IsNumeric(document.all.SatinAlanEvTelefonu.value)==false) {alert ('Telefon numaranızda hata var. Lütfen, kontrol ediniz.');document.all.SatinAlanEvTelefonu.focus();return false;}



///if (document.all.SatinAlanGSM.value=='') {alert ('Lütfen, cep telefonunuzu giriniz.');document.all.SatinAlanGSM.focus();return false;}
}
else
{
if (document.all.FirmaAdi.value=='') {alert ('Lütfen, firma adını giriniz.');document.all.FirmaAdi.focus();return false;}
if (document.all.VergiDairesi.value=='') {alert ('Lütfen, vergi dairesini giriniz.');document.all.VergiDairesi.focus();return false;}
if (document.all.VergiNo.value=='') {alert ('Lütfen, vergi numarasını giriniz.');document.all.VergiNo.focus();return false;}
if (document.all.SatinAlanIsTelefonu.value=='') {alert ('Lütfen, telefonunuzu giriniz.');document.all.SatinAlanIsTelefonu.focus();return false;}
}


if (document.all.FaturaAdresAyni[1].checked==true)
{
if (document.all.TeslimatAd.value=='') {alert ('Lütfen, hediyenin gönderileceği kişinin adını giriniz.');document.all.TeslimatAd.focus();return false;}
if (document.all.TeslimatSoyad.value=='') {alert ('Lütfen, hediyenin gönderileceği kişinin soyadını giriniz.');document.all.TeslimatSoyad.focus();return false;}
if (document.all.TeslimatAdres.value=='') {alert ('Lütfen, hediyenin gönderileceği kişinin adresini giriniz.');document.all.TeslimatAdres.focus();return false;}
if (document.all.TeslimatSehir.value=='') {alert ('Lütfen, hediyenin gönderileceği kişinin şehrini seçiniz.');document.all.TeslimatSehir.focus();return false;}
if (document.all.TeslimatIlce.value=='') {alert ('Lütfen, hediyenin gönderileceği kişinin ilçesini seçiniz.');document.all.TeslimatIlce.focus();return false;}
if (document.all.EvTelefonu.value=='') {alert ('Lütfen, hediyenin gönderileceği kişinin telefonunu giriniz.');document.all.EvTelefonu.focus();return false;}

if (document.all.EvTelefonu.value.length<9 || IsNumeric(document.all.EvTelefonu.value)==false) {alert ('Telefon numarasında hata var. Lütfen, kontrol ediniz.');document.all.EvTelefonu.focus();return false;}


///if (document.all.GSM.value=='') {alert ('Lütfen, hediyenin gönderileceği kişinin cep telefonunu giriniz.');document.all.GSM.focus();return false;}

}




//if (document.all.AdresAyni[1].checked==true)
//{
//if (document.all.Adres.value=='') {alert ('Lütfen, adresinizi giriniz.');document.all.Adres.focus();return false;}
//if (document.all.Sehir.value=='') {alert ('Lütfen, adresinizin şehrini seçiniz.');document.all.Sehir.focus();return false;}
//if (document.all.Ilce.value=='') {alert ('Lütfen, adresinizin ilçesini seçiniz.');document.all.Ilce.focus();return false;}
//}






}




function HediyeAdresBilgi(Durum)
{
document.all.rowDeliverName.disabled=Durum
document.all.TeslimatAd.disabled=Durum

document.all.rowDeliverSurname.disabled=Durum
document.all.TeslimatSoyad.disabled=Durum

document.all.rowDeliverAddress.disabled=Durum
document.all.TeslimatAdres.disabled=Durum

document.all.rowDeliverPK.disabled=Durum
document.all.TeslimatPK.disabled=Durum

document.all.rowDeliverCity.disabled=Durum
document.all.TeslimatSehir.disabled=Durum

document.all.rowDeliverCounty.disabled=Durum
document.all.TeslimatIlce.disabled=Durum


document.all.rowDeliverHomePhone.disabled=Durum
document.all.EvTelefonu.disabled=Durum

document.all.Dahili.disabled=Durum

document.all.rowDeliverWorkPhone.disabled=Durum
document.all.IsTelefonu.disabled=Durum


//document.all.rowDeliverMobilePhone.disabled=Durum
//document.all.GSM.disabled=Durum

}



function FullSize(Resim,Aciklama)
{
document.all.Enlarged.src='Images/yukleniyor.gif'
document.all.Enlarged.src=Resim
document.all.Aciklama.innerText=''
document.all.Aciklama.textContent=''
document.all.Aciklama.innerText=Aciklama
document.all.Aciklama.textContent=Aciklama
}




function ShowProdTab(TabName) 
{

document.all.TabInfo.style.display='none'
if (document.all.TabPhoto)  {document.all.TabPhoto.style.display='none'}
if (document.all.TabInstallment) {document.all.TabInstallment.style.display='none'}
if (document.all.TabComment) {document.all.TabComment.style.display='none'}
if (document.all.TabRelated) {document.all.TabRelated.style.display='none'}


document.getElementById(TabName).style.display='block'	;

}






function ShowProdInfo (Page,ProdID,KDVDahil)
{
//alert (KDVDahil)
document.all.ProdInfo.src=Page + '.asp?UID=' + ProdID + '&KDV=' + KDVDahil
}


function ChangeSelectedPrice(Secenek,Urun)
{
if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	
      {
      if(xmlHttp.readyState==4)
        {
		//alert (xmlHttp.responseText)
		if (xmlHttp.responseText!='0')
		{
document.all.SelectedPrice.value=xmlHttp.responseText
}

	         }
      }



    xmlHttp.open("GET","ajax/urun_secenek_fiyat.asp?S=" + Secenek + '&U=' + Urun,true);
    xmlHttp.send(null);  


}



function Sozlesme()
{
if (document.all.Kabul)
{
if (document.all.Kabul.checked==false)
{
alert ('Devam etmek için sözleşmeyi okuyup kabul etmeniz gerekmektedir.')
return false;
}
else
{
document.all.btnOnayla[0].disabled=false
document.all.btnOnayla[1].disabled=false
document.all.btnOnayla[2].disabled=false
}
}

}

function KargoFirma()
{
if (document.all.Cargo.value=='')
{
alert ('Lütfen, kargo firmasını seçiniz.');
return false;
}
}

function IsNumeric(sText)
{
   var ValidChars = "0123456789.,";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

   
function KrediKarti()
{
if (document.all.KKIsim.value=='') {alert ('Lütfen, kredi kartının üzerindeki ismi giriniz.');document.all.KKIsim.focus();return false}
if (document.all.KKNo.value=='') {alert ('Lütfen, kredi kartı numarasını giriniz.');document.all.KKNo.focus();return false}
if (document.all.KKNo.value.length!=16 || IsNumeric(document.all.KKNo.value)==false) {alert ('Kredi kartınızın numarasında hata var. Lütfen, kontrol ediniz.');document.all.KKNo.focus();return false}
if (document.all.SKAy.value=='') {alert ('Lütfen, kredi kartının son kullanım tarihinin ayını seçiniz.');document.all.SKAy.focus();return false}
if (document.all.SKYil.value=='') {alert ('Lütfen, kredi kartının son kullanım tarihinin yılını seçiniz.');document.all.SKYil.focus();return false}
if (document.all.CVV2.value=='') {alert ('Lütfen, kredi kartının CVV2 numarasını giriniz.');document.all.CVV2.focus();return false}
if (document.all.CVV2.value.length<3 || IsNumeric(document.all.CVV2.value)==false) {alert ('CVV2 numarasında hata var. Lütfen, kontrol ediniz.');document.all.CVV2.focus();return false}
if (document.all.Banka.value=='') {alert ('Lütfen, bankayı seçiniz.');document.all.Banka.focus();return false}
if (document.all.Kabul)
{
if (document.all.Kabul.checked==false)
{
alert ('Devam etmek için sözleşmeyi okuyup kabul etmeniz gerekmektedir.')
return false
}
else
{
document.all.btnOnayla[0].disabled=false
document.all.btnOnayla[1].disabled=false
document.all.btnOnayla[2].disabled=false
}
}
}

function InvoiceType(Tip)
{

if (Tip=='0')
{

if (document.all.rowVendorHomePhone)
{
document.all.rowVendorHomePhone.disabled=false
document.all.SatinAlanEvTelefonu.disabled=false

document.all.rowVendorWorkPhone.disabled=false
document.all.SatinAlanIsTelefonu.disabled=false
document.all.SatinAlanDahili.disabled=false

document.all.rowVendorMobilePhone.disabled=false
document.all.SatinAlanGSM.disabled=false

}

//document.all.VergiNo.value=''
document.all.VergiNo.disabled=true
//document.all.VergiDairesi.value=''
document.all.VergiDairesi.disabled=true
///document.all.rowTCKimlik.disabled=false
document.all.rowVD.disabled=true
document.all.rowVN.disabled=true
//document.all.KimlikNo.disabled=false
document.all.rowName.disabled=false
document.all.rowSurname.disabled=false
document.all.FaturaAdi.disabled=false
document.all.FaturaSoyadi.disabled=false
//document.all.FaturaFirmaAdi.value=''
document.all.rowCompanyName.disabled=true
document.all.FaturaFirmaAdi.disabled=true
}
else
{
//document.all.KimlikNo.value=''



if (document.all.rowVendorHomePhone)
{
document.all.rowVendorHomePhone.disabled=true
document.all.SatinAlanEvTelefonu.disabled=true

document.all.rowVendorWorkPhone.disabled=false
document.all.SatinAlanIsTelefonu.disabled=false
document.all.SatinAlanDahili.disabled=false

document.all.rowVendorMobilePhone.disabled=true
document.all.SatinAlanGSM.disabled=true

}




//document.all.KimlikNo.disabled=true
document.all.VergiDairesi.disabled=false
document.all.VergiNo.disabled=false
//document.all.FaturaAdi.disabled=true
//document.all.FaturaSoyadi.disabled=true
//document.all.rowTCKimlik.disabled=true
document.all.rowVD.disabled=false
document.all.rowVN.disabled=false
//document.all.rowName.disabled=true
//document.all.rowSurname.disabled=true
document.all.rowCompanyName.disabled=false
//document.all.FaturaAdi.value=''
//document.all.FaturaSoyadi.value=''
document.all.FaturaFirmaAdi.disabled=false
}

}


function DoSendRecommendation()
{
if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	
      {
      if(xmlHttp.readyState==4)
        {
//		alert (xmlHttp.responseText)
       if (xmlHttp.responseText=='OK')  {alert ('Tavsiye gönderilmiştir.\rTeşekkür ederiz.') }
	   document.all.RecommendWindow.style.display='none'
	         }
      }


if (document.all.SenderName.value=='' || document.all.RecommendReceiver.value=='') {alert ('Lütfen, bütün bilgileri giriniz.');return false;}
    xmlHttp.open("GET","ajax/tavsiye_gonder.asp?R=" + document.all.RecommendReceiver.value + '&U=' + document.all.RecommendedProdID.value + '&N=' + document.all.SenderName.value + '&Alan=' + document.all.AlanID.value,true);
    xmlHttp.send(null);  


}


function ShowRecommend(valProdName,valProdID,valEmail,valName,valDomain)
{
document.all.SenderName.value=valName
document.all.AlanID.value=valDomain
document.all.RecommendedProdName.innerText=valProdName
document.all.RecommendedProdName.textContent=valProdName
document.all.RecommendedProdID.value=valProdID
document.all.RecommendWindow.style.top=document.body.scrollTop + (screen.availHeight/4)
document.all.RecommendWindow.style.left=(screen.width/2)-300
document.all.RecommendWindow.style.display='block'
}


function SifreHatirlat(Email,Alan)
{
if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	
      {
      if(xmlHttp.readyState==4)
        {
//		alert (xmlHttp.responseText)
       if (xmlHttp.responseText=='OK')
	   {
alert ('Şifreniz, email adresinize gönderilmiştir.')
btnRemind.disabled=true

	   }
	   else
	   {
alert ('Sistemde bu email adresine sahip bir üye bulunamadı.\rŞifreniz gönderilememiştir.')
	   }
	         }
      }

//document.all.UrunSepette.style.display='none'
    xmlHttp.open("GET","ajax/sifre_hatirlat.asp?E=" + Email + '&A=' + Alan,true);
    xmlHttp.send(null);  


}



function Enter() 
{

  if (window.event.keyCode == 13)
	{
LoginUser(document.all.WinEmail.value,document.all.WinPwd.value)

		}
}

function CheckAll()
{
len = document.forms("MessList").elements.length;
for( i=0 ; i<len ; i++) {
document.forms("MessList").elements[i].checked=document.all.CA.checked;
}

}

function SoruGonder()
{
if (document.all.Baslik.value==''){alert ('Lütfen, başlığı seçiniz.');document.all.Baslik.focus();return false;}
if (document.all.Soru.value==''){alert ('Lütfen, sorunuzu yazınız.');document.all.Soru.focus();return false;}
}


function SifreDegistir(Sifre,Yeni,YeniTekrar)
{

if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	
      {
      if(xmlHttp.readyState==4)
        {
//		alert (xmlHttp.responseText)
       if (xmlHttp.responseText=='OK')
	   {
alert ('Şifreniz değiştirilmiştir.')
document.all.Sifre.value=''
document.all.Yeni.value=''
document.all.YeniTekrar.value=''

	   }
	   else
	   {
	   alert ('Şifreniz değiştirilemedi.\rGirmiş olduğunuz şifre yanlıştır.')
	   }
	         }
      }

if (Sifre=='' || Yeni=='' || YeniTekrar==''){alert ('Lütfen, şifre değiştirme ile ilgili istenen tüm bilgileri giriniz.');return false;}
if (Yeni!=YeniTekrar){alert ('Girmiş olduğunuz iki şifre aynı değildir. Lütfen, kontrol ediniz.');return false;}

    xmlHttp.open("GET","ajax/sifre_degistir.asp?Sifre=" + Sifre + '&Yeni=' + Yeni  ,true);
    xmlHttp.send(null);  


}




function UyelikBilgi(Ad,Soyad,Adres,PK,Ilce,Sehir,VergiNo,EvTelefonu,VergiDairesi,FirmaAdi)
{
if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	
      {
      if(xmlHttp.readyState==4)
        {
//	alert (xmlHttp.responseText)
       if (xmlHttp.responseText=='OK')
	   {
alert ('Bilgileriniz güncellenmiştir.')

	   }
	         }
      }

if (Adres=='') {alert ('Lütfen, adresinizi giriniz.');document.all.Adres.focus();return false;}
if (Sehir=='') {alert ('Lütfen, şehrinizi seçiniz.');document.all.Sehir.focus();return false;}
if (Ilce=='') {alert ('Lütfen, ilçenizi seçiniz.');document.all.Ilce.focus();return false;}
    xmlHttp.open("GET","ajax/update_address.asp?Ad=" + Ad + "&Soyad=" + Soyad + "&Adres=" + Adres + '&PK=' + PK + '&Ilce=' + Ilce + '&Sehir=' + Sehir + '&VergiNo=' + VergiNo + '&EvTelefonu=' + EvTelefonu +  '&VD=' + VergiDairesi + '&FirmaAdi=' + FirmaAdi ,true);
    xmlHttp.send(null);  


}





function HediyePaketi(ID)
{
if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	
      {
      if(xmlHttp.readyState==4)
        {
//		alert (xmlHttp.responseText)
       if (xmlHttp.responseText=='OK')
	   {
alert ('Ürün için hediye paketi isteğiniz kaydedilmiştir.')

	   }
	         }
      }

if (confirm('Bu ürün için hediye paketi istediğinizden emin misiniz?'))
{
    xmlHttp.open("GET","ajax/hediye_paketi.asp?ID=" + ID ,true);
    xmlHttp.send(null);  
}
else
{
return false;
}

}




function PaymentOptions()
{
if (document.all.PaymentOption.value=='') {alert ('Lütfen, ödeme şeklini seçiniz.');return false;}


if (document.all.Bankalar && document.all.PaymentOption.value==1)
{
if (document.all.Bankalar.value=='') {alert ('Lütfen havale yapacağız bankayı seçiniz');return false;}
}


}


function LoginUser(Email,Pwd)
{
if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	
      {
      if(xmlHttp.readyState==4)
        {
//alert (xmlHttp.responseText)
       if (xmlHttp.responseText=='NO')
	   {
alert ('Giriş bilgilerinizde hata vardır.')

	   }
	   else
	   {
//	   document.all.LoginButton.src='Images/giris_bw.gif'
	   window.location.href=document.all.Page.value
	   }
	   
	         }
      }

//alert (document.all.ProductToAdd.value)
if (document.all.Secenek) {SelOpt=document.all.Secenek.value} else {SelOpt=0}
//    xmlHttp.open("GET","uye_kontrol.asp?Win=1&Email=" + Email + "&Sifre=" + Pwd  + '&PTA=' + document.all.ProductToAdd.value + '&HasOption=' + document.all.HasOption.value,true);
	xmlHttp.open("GET","uye_kontrol.asp?Win=1&Email=" + Email + "&Sifre=" + Pwd  + '&PTA=' + document.all.ProductToAdd.value + '&SelOpt=' + SelOpt,true);
	
//    xmlHttp.open("GET","uye_kontrol.asp?Win=1&Email=" + Email + '&Sifre=' & Pwd ,true); 
    xmlHttp.send(null);  


}

	
	
function ShowLogin(LastPage,MsgID,ProductToAddVal,HasOptionVal,CatName)
{
//alert (ProductToAddVal)
var Msg=''
//alert (MsgID)
document.all.WinEmail.value=''
document.all.WinPwd.value=''
document.all.HasOption.value=HasOptionVal
if (HasOptionVal==1 && document.all.Secenek.value=='') {alert ('Lütfen, ' + CatName + ' seçeneğini seçiniz.');document.all.Secenek.focus();return false}
document.all.ProductToAdd.value=ProductToAddVal
document.all.LoginWindow.style.top=document.body.scrollTop + (screen.availHeight/8)
document.all.LoginWindow.style.left=(screen.width/2)-225
document.all.LoginWindow.style.display='block'
document.all.Page.value=LastPage
//document.all.Page.value='sepet.asp'
document.all.WinEmail.focus()
if (MsgID==1) {Msg='Sepetinize ürün eklemek için üyelik hesabınıza girmeniz gerekmektedir.'}
document.all.LoginMess.innerText=Msg
document.all.LoginMess.textContent=Msg
}


function AddToFav(UrunID)
  {  
  
if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	
      {
      if(xmlHttp.readyState==4)
        {
	//	alert (xmlHttp.responseText)
       if (xmlHttp.responseText=='OK')
	   {
document.all.BegendiklerimeEkle.innerText=' Beğeni listenize eklendi!'
document.all.BegendiklerimeEkle.textContent=' Beğeni listenize eklendi!'

	   }
	   else
	   {
	   alert ('Bu ürünü beğendiğiniz ürünlere eklemek için üyelik hesabınıza girmeniz gerekmektedir.')
	   }
	   
	         }
      }

    xmlHttp.open("GET","ajax/add_to_fav.asp?U=" + UrunID ,true);
    xmlHttp.send(null);  
	
	}
	
function YorumGonder()
{
if (document.all.Baslik.value=='') {alert ('Lütfen, başlığı giriniz.');document.all.Baslik.focus();return false;}
if (document.all.Yorum.value=='') {alert ('Lütfen, yorumunuzu giriniz.');document.all.Yorum.focus();return false;}
document.all.btnSubmit.disabled=true
}

function Enlarge(PicLocation,Desc,ProdName)
{
document.all.BuyukResim.style.top=document.body.scrollTop + (screen.availHeight/6)
document.all.BuyukResim.style.left=(screen.width/2)-325
//alert ('Shops/' + DomainFolder +'Urun_' + PictID + '.jpg')

document.all.ProductPic.src=PicLocation
document.all.BuyukResim.style.display='block'
document.all.PicDesc.innerText=Desc
document.all.PicDesc.textContent=Desc

document.all.ProdNameCaption.innerText=ProdName
document.all.ProdNameCaption.textContent=ProdName
}

function AdresKaydet()
{
if (document.all.TeslimatAdres.value=='') {alert ('Lütfen, teslimat adresinizi giriniz.');document.all.TeslimatAdres.focus();return false;}
if (document.all.TeslimatSehir.value=='') {alert ('Lütfen, teslimat adresinizin şehrini seçiniz.');document.all.TeslimatSehir.focus();return false;}
if (document.all.TeslimatIlce.value=='') {alert ('Lütfen, teslimat adresinizin ilçesini seçiniz.');document.all.TeslimatIlce.focus();return false;}


if (document.all.FaturaAdresAyni[1].checked==true)
{
if (document.all.FaturaAdres.value=='') {alert ('Lütfen, fatura adresinizi giriniz.');document.all.FaturaAdres.focus();return false;}
if (document.all.FaturaSehir.value=='') {alert ('Lütfen, fatura adresinizin şehrini seçiniz.');document.all.FaturaSehir.focus();return false;}
if (document.all.FaturaIlce.value=='') {alert ('Lütfen, fatura adresinizin ilçesini seçiniz.');document.all.FaturaIlce.focus();return false;}
}

if (document.all.FaturaTipi[0].checked==false && document.all.FaturaTipi[1].checked==false) {alert ('Lütfen, fatura tipini seçiniz');document.all.FaturaTipi[0].focus();return false;}

if (document.all.FaturaAdi.value=='') {alert ('Lütfen, adınızı giriniz.');document.all.FaturaAdi.focus();return false;}
if (document.all.FaturaSoyadi.value=='') {alert ('Lütfen, soyadınızı giriniz.');document.all.FaturaSoyadi.focus();return false;}

if (document.all.FaturaTipi[0].checked==true)
{
//if (document.all.KimlikNo.value=='') {alert ('Lütfen, TC kimlik numaranızı giriniz.');document.all.KimlikNo.focus();return false;}
if (document.all.EvTelefonu.value=='') {alert ('Lütfen, telefonunuzu giriniz.');document.all.EvTelefonu.focus();return false;}
//if (document.all.GSM.value=='') {alert ('Lütfen, cep telefonunuzu giriniz.');document.all.GSM.focus();return false;}
if (document.all.EvTelefonu.value.length<9 || IsNumeric(document.all.EvTelefonu.value)==false) {alert ('Telefon numarasında hata var. Lütfen, kontrol ediniz.');document.all.EvTelefonu.focus();return false;}

}
else
{
if (document.all.FaturaFirmaAdi.value=='') {alert ('Lütfen, firma adını giriniz.');document.all.FaturaFirmaAdi.focus();return false;}
if (document.all.VergiDairesi.value=='') {alert ('Lütfen, vergi dairesini giriniz.');document.all.VergiDairesi.focus();return false;}
if (document.all.VergiNo.value=='') {alert ('Lütfen, vergi numarasını giriniz.');document.all.VergiNo.focus();return false;}
//if (document.all.IsTelefonu.value=='') {alert ('Lütfen, telefonunuzu giriniz.');document.all.IsTelefonu.focus();return false;}
}



}


function FaturaAdresBilgi(Durum)
{
document.all.FaturaAdres.disabled=Durum
document.all.FaturaPK.disabled=Durum
document.all.FaturaIlce.disabled=Durum
document.all.FaturaSehir.disabled=Durum
document.all.rowInvoiceAddress.disabled=Durum
document.all.rowInvoicePK.disabled=Durum
document.all.rowInvoiceCity.disabled=Durum
document.all.rowInvoiceCounty.disabled=Durum

if (Durum==true)
{
document.all.FaturaAdres.value=''
document.all.FaturaPK.value=''
document.all.FaturaIlce.value=''
document.all.FaturaSehir.value=''
}

}



function CheckAvail(Em)
  {  
  
if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	
      {
      if(xmlHttp.readyState==4)
        {
//		alert (xmlHttp.responseText)
       if (xmlHttp.responseText!='0')
	   {
alert ('\'' + Em  + '\' e-mail adresine sahip kullanıcı sistemde zaten tanımlıdır.')
document.all.UyeEmail.value=''
document.all.UyeEmail.focus()

	   }
	         }
      }

	  if (Em!='')
	  {
    xmlHttp.open("GET","ajax/check_avail.asp?E=" + Em ,true);
    xmlHttp.send(null);  
	}
	}


	
function UyeKaydet()
{
if (document.all.Ad.value=='') {alert ('Lütfen, adınızı giriniz.');document.all.Ad.focus();return false;}
if (document.all.Soyad.value=='') {alert ('Lütfen, soyadınızı giriniz.');document.all.Soyad.focus();return false;}
if (document.all.Cinsiyet[0].checked==false && document.all.Cinsiyet[1].checked==false) {alert ('Lütfen, cinsiyetinizi seçiniz.');return false;}

if (document.all.DogumGun.value=='') {alert ('Lütfen, doğum tarihinizi eksiksiz giriniz.');document.all.DogumGun.focus();return false;}
if (document.all.DogumAy.value=='') {alert ('Lütfen, doğum tarihinizi eksiksiz giriniz.');document.all.DogumAy.focus();return false;}
if (document.all.DogumYil.value=='') {alert ('Lütfen, doğum tarihinizi eksiksiz giriniz.');document.all.DogumYil.focus();return false;}

if (document.all.Adres.value=='') {alert ('Lütfen, adresinizi giriniz.');document.all.Adres.focus();return false;}
if (document.all.Sehir.value=='') {alert ('Lütfen, şehrinizi seçiniz.');document.all.Sehir.focus();return false;}
if (document.all.Ilce.value=='') {alert ('Lütfen, ilçenizi seçiniz.');document.all.Ilce.focus();return false;}


if (document.all.UyeEmail.value=='') {alert ('Lütfen, email adresinizi giriniz.');document.all.UyeEmail.focus();return false;}
if (document.all.UyeEmail.value.indexOf("@")==-1 ||document.all.UyeEmail.value.indexOf(".")==-1) {alert ('Email adresinizde hata var.\rLütfen, kontrol ediniz.');document.all.UyeEmail.focus();return false;}
if (document.all.UyeSifre.value=='') {alert ('Lütfen, şifrenizi giriniz.');document.all.UyeSifre.focus();return false;}
if (document.all.SifreTekrar.value=='') {alert ('Lütfen, şifrenizi tekrar giriniz.');document.all.SifreTekrar.focus();return false;}
if (document.all.UyeSifre.value!=document.all.SifreTekrar.value) {alert ('Girmiş olduğunu iki şifre aynı değil.\rLütfen, kontrol ediniz.');document.all.SifreTekrar.focus();return false;}

if (document.all.Kabul)
{
if (document.all.Kabul.checked==false)
{
alert ('Devam etmek için sözleşmeyi okuyup kabul etmeniz gerekmektedir.')
return false
}
}


document.all.btnSubmit.disabled=false
}

function UrunSil(r,UrunID)
{
if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	
      {
      if(xmlHttp.readyState==4)
        {
//		alert (xmlHttp.responseText)
       if (xmlHttp.responseText=='OK')
	   {
eval("document.all.ProdRow" + r + ".style.display='none'");

	   }
	         }
      }

//document.all.UrunSepette.style.display='none'
    xmlHttp.open("GET","ajax/del_from_cart.asp?U=" + UrunID ,true);
    xmlHttp.send(null);  


}



function AddToCart(UrunID,UrunAdi,Fiyat,ParaBirimi,RowInd,HavaleIndirimi,KDV,CatName,KDVDahil)
  {  

if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	
      {
      if(xmlHttp.readyState==4)
        {
//		alert ('alp')
	if (document.all.UrunSepette) {document.all.UrunSepette.style.display='none'}
  document.all.Sepet.style.top=document.body.scrollTop + (screen.availHeight*0.2)

document.all.Sepet.style.left=screen.width*0.1
document.all.Sepet.style.display='block'
//alert (xmlHttp.responseText)
       if (xmlHttp.responseText=='Exist')
	   {
if (document.all.UrunSepette){document.all.UrunSepette.style.display='block'}
	   }

       if (IsNumeric(xmlHttp.responseText))
	   {
	   
	  if (eval("document.all.ATCButton" + RowInd)) {eval("document.all.ATCButton" + RowInd + ".src='Images/cart_bw.gif'")}
      document.all.CartCount.className='CartCount'
  	  document.all.CartCount.innerText='(' + xmlHttp.responseText + ')'
  	  document.all.CartCount.textContent='(' + xmlHttp.responseText + ')'
	  
if (document.all.Secenek)   {document.all.Secenek.disabled=true}
if (document.all.CartStatus) {document.all.CartStatus.src='Images/sepette_bw1.gif'}

var tbl = document.getElementById('CartDisplay');
var lastRow = tbl.rows.length;

var x=document.getElementById('CartDisplay').insertRow(lastRow);
var ProductName=x.insertCell(0);
var Amount=x.insertCell(1);
var Price=x.insertCell(2);
var Remove=x.insertCell(3);

x.id='Yeni'
ProductName.innerHTML="<a href=urun.asp?UID=" + UrunID + ">"  + UrunAdi +  "</a>"
Amount.innerHTML="1"
if (KDVal==0)
{
Price.innerHTML=Fiyat + ' ' + ParaBirimi + ' + KDV'
}
else
{
Price.innerHTML=Fiyat + ' ' + ParaBirimi 
}
Remove.innerHTML="<a href=javascript:UrunSil(this," + UrunID + ")><img border=0 src=http://www.ticaretgaranti.com/shop/yonetim/images/sil.gif></a>";

	   }
	   else
	   {
//	   alert ('Alışveriş sepetinize ürün eklemek için üyelik hesabınıza girmeniz gerekmektedir.')
	//   document.all.Sepet.style.display='none'
	   }
	         }
      }

	  UrunSecenek='0'
	  
	  if (document.all.Secenek)
	  {
	  if (document.all.Secenek.value=='')
	  {
	  alert ('Lütfen, ' + CatName + ' seçeneğini seçiniz.')
	  document.all.Secenek.focus()
	  return false;
	  }
	  else
	  {
	  UrunSecenek=document.all.Secenek.value
	  }
	  }
//	  alert (Fiyat)
if (KDVDahil=='True') {KDVal=1} else {KDVal=0}

    xmlHttp.open("GET","ajax/add_to_cart.asp?UrunID=" + UrunID + '&Fiyat='+ Fiyat + '&ParaBirimi=' + ParaBirimi + '&HI=' + HavaleIndirimi + '&KDV=' + KDV +'&Secenek=' + UrunSecenek +'&KDVDahil=' + KDVal  ,true);
    xmlHttp.send(null);  

	}
	

	
	
	



function AnketCevapla(Ans,AnketID)
  {  

if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	
      {
      if(xmlHttp.readyState==4)
        {
//alert (xmlHttp.responseText)
       if (xmlHttp.responseText=='0')
	   {
alert ('Anket cevabınız gönderilmiştir.\rTeşekkür ederiz.')

	   }
	   else
	   {
	   alert ('Bu ankete daha önce cevap vermişsiniz.')
	   }
	         }
      }

	  if (Ans!='A' && Ans!='B' && Ans!='C' && Ans!='D' && Ans!='E')
	  {
	alert ('Lütfen, bir seçenek seçiniz.')  
	return false;
	  }
	  else
	  {
    xmlHttp.open("GET","ajax/anket_cevapla.asp?A=" + Ans + '&ID=' + AnketID ,true);
    xmlHttp.send(null);  
}
	}

