// JavaScript Document


function add_remove_quantity(action,id_label,unit_price,initial_cost)
{
	// Obtengo el valor de la caja de texto
	var quantity_label=parseInt(document.getElementById(id_label).value);
	var quantity_total=quantity_label;
	
	switch (action)
	{
		case 'remove':
			if(quantity_label>=2)
			{
				quantity_total=	quantity_total - 1;
				document.getElementById(id_label).value=quantity_total;
				document.getElementById(initial_cost).value="$ "+ (unit_price*quantity_total);
			}
			else
			{
				document.getElementById(id_label).value=1;
				document.getElementById(initial_cost).value="$ "+ unit_price;
			}
				
		break;
		case 'add':
		
				quantity_total=	quantity_total + 1;
				document.getElementById(id_label).value=quantity_total;
				document.getElementById(initial_cost).value="$ "+(unit_price*quantity_total);
			
		break;
	}

	
}

function submitform(form)
{
   document.forms[form].submit();
   /*document.form.submit();*/
}





