﻿function pencere(name, url, width, height, resizable, scrollbars, titlebar)
{
	var mcx = null;
	mcx=window.open(url, name ,'width=' + width + ',height=' + height + ',status=no,toolbar=no,menubar=no,directories=no,location=no,resizable=' + resizable + ',scrollbars=' +  scrollbars + ',titlebar=' + titlebar + ',alwaysRaised=yes,screenX=0,screenY=0,left=75,top=100');
	mcx.focus();
}
function pencereImg(pic)
{
	var mcxUrun = null;
	mcxUrun = window.open(pic, 'Urun' ,'width=750,height=500,status=no,toolbar=no,menubar=no,directories=no,location=no,resizable=yes,scrollbars=yes,titlebar=yes,alwaysRaised=yes,screenX=0,screenY=0,left=75,top=100');
	mcxUrun.focus();
}
function pencereUrun(id)
{
	var mcxUrun = null;
	mcxUrun = window.open('urun_detay.aspx?id=' + id, 'Detay' ,'width=750,height=500,status=no,toolbar=no,menubar=no,directories=no,location=no,resizable=no,scrollbars=yes,titlebar=yes,alwaysRaised=yes,screenX=0,screenY=0,left=75,top=100');
	mcxUrun.focus();
}
function pencereTavsiye(id)
{
	var mcxUrun = null;
	mcxUrun = window.open('tavsiye.aspx?id=' + id, 'Tavsiye' ,'width=500,height=250,status=no,toolbar=noyes,menubar=no,directories=no,location=no,resizable=no,scrollbars=yes,titlebar=yes,alwaysRaised=yes,screenX=0,screenY=0,left=75,top=100');
	mcxUrun.focus();
}
function pencereSiparis(pros, id)
{
	var mcxSepet = null;
	mcxSepet=window.open('sepet.aspx?pros=' + pros + '&id=' + id, 'Siparis' ,'width=900,height=400,status=no,toolbar=no,menubar=no,directories=no,location=no,resizable=yes,scrollbars=yes,titlebar=yes,alwaysRaised=yes,screenX=0,screenY=0,left=75,top=100');
	mcxSepet.focus();
}
function deleteUrun(id)
{
    if(confirm("Ürün listenizden silinecek ?"))
        window.location = 'sepet.aspx?pros=delete&id=' + id;
}
function deleteAll()
{
    if(confirm("Listenizdeki tüm ürünler silinecek ?"))
        window.location = 'sepet.aspx?pros=deleteall';
}
function updateUrun(id, miktarOld)
{
    miktar = document.getElementById("miktar" + id);
    var miktarNew = miktar.value;
    if(miktarNew != miktarOld)
    { 
        if(miktarNew.length>0)
            window.location = 'sepet.aspx?pros=update&id=' + id + '&miktar=' + miktarNew;
        else
            window.location = 'sepet.aspx?pros=update&id=' + id + '&miktar=0';
    }
}
function send()
{
    document.getElementById("formSiparis").style.display = "";
}