//deschide o noua fereastra cu detalii despre produse
function openWin(nume,img,w,h) {
  delta=100;
  dx=parseInt(w)+50; if (dx<250) dx=250;
	  if (dx > screen.availWidth-delta)  { dx=screen.availWidth-delta;  pozx = delta/2; } else { pozx = (screen.availWidth -dx)/2; }
  dy=parseInt(h)+130;
	  if (dy > screen.availHeight-delta) { dy=screen.availHeight-delta; pozy = delta/2; } else { pozy = (screen.availHeight-dy)/2; }
  img=img.replace(" ","%2520");
  command="poze.php?nume="+nume+"&img="+img+"&w="+w+"&h="+h;
 //alert(img);
window.open(command,img.replace(" ","%2520"),"toolbar=no,hotkeys=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+dx+",height="+dy+",left=" + pozx + ",screenX=" + pozx + ",top=" + pozy + ",screenY=" + pozy);
}	

//deschide o noua fereastra pentru administrare
function openAdmin(pagina,categ,idprod) {
  dx=700; pozx = (screen.availWidth -dx)/2;
  dy=470; pozy = (screen.availHeight-dy)/2;
	ext = "";
	//if (pagina == "add") { ext = "3"; } else { ext = ""; }
  window.open("admin/"+pagina+".php"+ext+"?c="+categ+"&id="+idprod,idprod,"toolbar=no,hotkeys=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+dx+",height="+dy+",left=" + pozx + ",screenX=" + pozx + ",top=" + pozy + ",screenY=" + pozy);
}	

//stergere produsul din lista(care se afla in poz. specificata)
function stergeProd(nume,url) {
	if (confirm("Sunteti sigur ca doriti sa stergeti \nprodusul: "+nume+" ?")) {
		self.location.href=url;
	}
}