// JavaScript Document



//function add_exop(){}
var gobal_talla;
global_talla=0;


function add_exop(prod,cant){
//alert("ADD_exop");
	if (cant!=0){

		document.frmExopCompra.referencia.value=prod;
		//alert("prod");
		document.frmExopCompra.unidades.value=cant;
		//alert("cant");
		document.frmExopCompra.ValTalla.value=global_talla;
		document.frmExopCompra.submit();
		//alert("adddd");
		

	}else{

		eval("document.frmExop." + "Exop" + prod +".value=1");

		eval("document.frmExop." + "Exop" + prod +".setFocus");

	}

}



function mod_exop(prod,cant,acc,talla){

	if (cant!=0){

		document.frmExopCompra.referencia.value=prod;

		document.frmExopCompra.unidades.value=cant;

		document.frmExopCompra.accion.value=acc;
		
		document.frmExopCompra.ValTalla.value=talla;
		//alert(document.frmExopCompra.ValTalla.value);

		document.frmExopCompra.submit();

	}else{

		eval("document.frmExop." + "Exop" + prod +".value=1");

		eval("document.frmExop." + "Exop" + prod +".setFocus");

	}

}



function del_exop(prod,talla){

	document.frmExopCompra.referencia.value=prod;

	document.frmExopCompra.unidades.value=0;

	document.frmExopCompra.accion.value='quitar';
	
	document.frmExopCompra.ValTalla.value=talla;

	document.frmExopCompra.submit();

}





function test_unitats(camp){

	if (event.keyCode<48||event.keyCode>57){

		return false;

	}

}


function preu_talla(preu, talla){
	//alert(talla);
	document.getElementById("precio_talla").innerHTML="<b>"+preu+"</b>";
	document.frmExopCompra.ValTalla.value=talla;
	global_talla=talla;
	//alert(document.frmExopCompra.ValTalla.value);
}