function activate_flash(i,e){
 i=document.getElementById(i)
 e=i.innerHTML.replace(/type="application\/x-shockwave-flash" data="[^"]*"/,'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"')
 e=e.replace(/<!\[endif\]-->|<!--\[if IE\]>/g,'')
 i.outerHTML=e
}

function zoom_photo(id, num) {
        var width = 200;
        var height = 20;
        var Win = window.open("zoom_photo.php?id=" + id + "&num=" + num,"_blank",'width=' + width + ',height=' + height + ',resizable=0,toolbar=no,location=no,menubar=no,scrollbars=yes');
}

function sizes_table(id) {
        var width = 400;
        var height = 400;
        var Win = window.open("sizes_table.php?id=" + id,"_blank",'width=' + width + ',height=' + height + ',resizable=0,toolbar=no,location=no,menubar=no,scrollbars=yes,status=no');
}

function show_map(id) {
        var width = 750;
        var height = 600;
        var Win = window.open("show_map.php","_blank",'width=' + width + ',height=' + height + ',resizable=0,toolbar=no,location=no,menubar=no,scrollbars=no,status=no');
}

function basket_delete(numer) {
 var alert;
 alert = window.confirm("Czy napewno chcesz usun±ć z koszyka pozycję nr " + numer + "?");
 if (alert) { window.location.href("?p=basket&action=del&n=" + numer); }
 else { }

}

function selecturl(s) {
	var gourl = s.options[s.selectedIndex].value;
	window.top.location.href = gourl;
}

function okno(url) {
        var width = 550;
        var height = 550;
        var Win = window.open(url,"_blank",'width=' + width + ',height=' + height + ',resizable=0,toolbar=no,location=no,menubar=no,scrollbars=yes');
}


function product_photo(id, action, num, all) {


  advAJAX.get({
    url : "product_photo.php?id=" + id + "&action=" + action + "&num=" + num + "&all=" + all,
    onSuccess : function(obj) { document.getElementById("div_prod_photo").innerHTML = obj.responseText; }

  });

}


function num_pieces(how) {
 var ile = document.getElementById("ilosc_ch").value;
 if (how == "1") { ile = ile-(-1); }
 if (how == "-1") { ile = ile-1; }
 if (ile == "0") { ile = 1; }
 document.getElementById("ilosc_ch").value = ile;
 return true;
} 
