var
dcha=izda="";
function fdp(value, precision)
{
        value = "" + value //convert value to string
        precision = parseInt(precision);

        var whole = "" + Math.round(value * Math.pow(10, precision));

        var decPoint = whole.length - precision;

        if(decPoint != 0)
        {
                result = whole.substring(0, decPoint);
                result += ".";
                result += whole.substring(decPoint, whole.length);
        }
        else
        {
                result = "0."+whole;
        }
        return result;
}
var agregando=0;
function ok()
{
	document.getElementById('agregando').style.visibility='hidden';
	agregando=0;
}

function precio(idproducto,precioactual,cant)
{
	//var cant=document.getElementById('cantidad').value;
	var nprecio=precioactual*cant;
	nprecio=fdp(nprecio,2)*1;
	if (!isNaN(nprecio))
		document.getElementById('precio'+idproducto).innerHTML=nprecio+" &euro;";
	else document.getElementById('precio'+idproducto).innerHTML="-----";
}

