//BOTONES DE FORMULARIO HECHOS CON IMAGENES
function MM_findObj(n, d) 
{ //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

	 d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}


function flevSubmitForm()
{//v2.0

// Copyright 2002-2004, FlevOOware (www.flevooware.nl/dreamweaver/)

var v1=arguments,v2=MM_findObj(v1[0]),v3=(v1.length>1)?v1[1]:"",v4=(v1.length>2)?v1[2]:"";if (v2){if (v3!=""){v2.action=v3;}if (v4!=""){v2.target=v4;}v2.submit();document.MM_returnValue=false;}
}

function aniadir_al_pedido (nombre_producto,cantidad)
{

   
   cantidad_final = document.getElementById(cantidad).value;
   if (cantidad_final!=0)
   {
	   anterior=document.pedido.pedido_t.value;
	   document.pedido.pedido_t.value = anterior + "\n" +  cantidad_final + " " + nombre_producto;
	   document.getElementById(cantidad).value=0;
   }
   else
   {
	 alert ("Debe introducir una cantidad distinta de 0");
   }
}


