
function ActualizarPrecio() {
  var error     = false;
  var precio    = 0.0;
	var cantidad = parseInt(document.getElementById("idde_can").value);
	var duracion  = 1;//parseInt(document.getElementById("idde_dur").value);
	var registros = parseInt(document.getElementById("idde_reg").value);

	
	if( isNaN(cantidad)==true )
		cantidad  = 1;
	if( isNaN(duracion)==true )
	  duracion  = 1;
	if( isNaN(registros)==true )
	  registros = 50;


		
	if( (cantidad!=Math.round(cantidad)) || (cantidad<1) || (cantidad>99) ) {
	alert(" ec "+registros+" "+duracion+" "+cantidad );
		error=true;
		cantidad=1;
	}
	
	if( (duracion!=Math.round(duracion)) || (duracion<1) || (duracion>3) ) {
	alert(" ed "+registros+" "+duracion+" "+cantidad );
		error=true;
		duracion=1;
	}

	
	switch(registros) {
		case 50: 
			precio = 59;
			break;
		case -1:
			precio = 199;
			break;
		default:
			error=true;
			precio = 50;
			break;
	}
	precio=Math.round(precio*100)/100;

  if(error==true) {
alert(" et "+registros+" "+duracion+" "+cantidad );
		document.getElementById("idde_can").value = cantidad;
		document.getElementById("idde_dur").value = duracion;
		document.getElementById("idde_reg").value = registros;
    document.getElementById("idde_precio").firstChild.nodeValue = "_";
  } else {
    precio=precio+29*(cantidad-1);
    if(duracion==2)
			precio=precio+(precio*50)/100;
    if(duracion==3)
			precio=precio+(precio*50)/100+(precio*50)/100;
	precio=Math.round(precio*100)/100;
 
  }

 	if(precio<1)
 	  error=true;
 	  
 	if(error==true)
     document.getElementById("idde_precio").firstChild.nodeValue = " __ € ";
 	else
     document.getElementById("idde_precio").firstChild.nodeValue = precio+" €";

}


function ActualizarSoloPrecio() {

  var error     = false;
  var precio    = 0.0;
	var cantidad  = parseInt(document.getElementById("idde_can").value);
	var duracion  = parseInt(document.getElementById("idde_dur").value);
	var registros = parseInt(document.getElementById("idde_reg").value);

	
	if( isNaN(cantidad)==true )
		cantidad  = 1;
	if( isNaN(duracion)==true )
	  duracion  = 1;
	if( isNaN(registros)==true )
	  registros = 10;


		
	if( (cantidad!=Math.round(cantidad)) || (cantidad<1) || (cantidad>99) ) {
	alert(" ec "+registros+" "+duracion+" "+cantidad );
		error=true;
		cantidad=1;
	}
	
	if( (duracion!=Math.round(duracion)) || (duracion<1) || (duracion>3) ) {
	alert(" ed "+registros+" "+duracion+" "+cantidad );
		error=true;
		duracion=1;
	}

	
	switch(registros) {
		case 50: 
			precio = 59;
			break;
		case -1:
			precio = 199;
			break;
		default:
			error=true;
			precio = 59;
			break;
	}
	precio=Math.round(precio*100)/100;

  if(error==true) {
    document.getElementById("idde_precio").firstChild.nodeValue = "_";
  } else {
    precio=precio+29*(cantidad-1);
    if(duracion==2)
			precio=precio+(precio*50)/100;
    if(duracion==3)
			precio=precio+(precio*50)/100+(precio*50)/100;
	precio=Math.round(precio*100)/100;
 
  }

 	if(precio<1)
 	  error=true;
 	  
 	if(error==true)
     document.getElementById("idde_precio").firstChild.nodeValue = " __ € ";
 	else
     document.getElementById("idde_precio").firstChild.nodeValue = precio+" €";


}
