var isNS = false;
var isIE = false;
var isW3C = false;

if (navigator.appName.indexOf('Netscape')>-1) {isNS=true; isIE=false; isW3C=false;}
if (document.getElementById) {isNS=false; isIE=false; isW3C=true;}
if (document.all) {isNS=false; isIE=true; isW3C=false;}

function zl_lref(l) {
if (isIE) return document.all[l];
if (isW3C) return document.getElementById(l);
}

function popUp(src,name,x,y,w,h)
	{
	window.open(src,name,"left="+x+",top="+y+",height="+h+",width="+w+",scrollbars=0,status=0,location=0,menubar=0,resizable=0");
	}

function popUpScroll(src,name,x,y,w,h)
	{
	window.open(src,name,"left="+x+",top="+y+",height="+h+",width="+w+",scrollbars=1,status=0,location=0,menubar=0,resizable=0");
	}

function inc_quantity(field) {
	val=parseInt(zl_lref(field).value);
	if(val+1>stock[currentStock]) alert("Stock insuffisant - Maximum stock reached");
	else zl_lref(field).value++;
}

function selectStock(selStock,field) {
	val=parseInt(zl_lref(field).value);
	currentStock=selStock;
	if(val>stock[currentStock]) {
		zl_lref(field).value=stock[currentStock];
	}
}

function dec_quantity(field) {
	if(zl_lref(field).value-1>0) zl_lref(field).value--;
}