



function ValidaStepBuy1(){
var step1buy=document.getElementById("stepbuy1");
var step2buy=document.getElementById("stepbuy2");


var quantita=document.getElementById("quantita");
var valori500=document.getElementById("valori500")
var licenzadisable=document.getElementById("licenzadisable");
var txtdisable=document.getElementById("txtdisable")

var enterprise=document.getElementById("enterprise")
var professional=document.getElementById("professional")
    
    
var LicenzaEnterprise=document.getElementById("LicenzaEnterprise");
var LincenzaProfessional=document.getElementById("LincenzaProfessional");
    
var base=document.getElementById("baseradio");
var bronze=document.getElementById("bronzeradio");
var silver=document.getElementById("silverradio");
var gold=document.getElementById("goldradio");
    
var gostep2=true
    
  if (quantita.value==""){
    ColoraField(quantita);
	gostep2=false;
	 } else{NormalField(quantita);}  	
  
  if (quantita.value=="" || parseFloat(quantita.value)==0){
    ColoraField(quantita);
	gostep2=false;
	 } else{NormalField(quantita);}  	
  
  
  if (quantita.value.length>0 && isNumero(quantita.value) == 0){
    ColoraField(quantita);
    gostep2=false;
    
  }
  if (quantita.value>500){
    valori500.style.display="block";
    gostep2=false;
    
  }
    
 var indexformula;
 LicenzaEnterprise.style.display="block";
 LincenzaProfessional.style.display="block";
 var formulazio=document.actions_find.paylicenzamonth;
  if (enterprise.checked){
    
        if (parseFloat(quantita.value)<25){
            base.style.display="block";
            indexformula=0;        
        } 
        else if (parseFloat(quantita.value)>24 && parseFloat(quantita.value)<50)
        {
            bronze.style.display="block";
           indexformula=2;        
        }
        else if (parseFloat(quantita.value)>49 && parseFloat(quantita.value)<100)
        {
            silver.style.display="block";
           indexformula=4;
        }
        else if (parseFloat(quantita.value)>99 )
        {
            gold.style.display="block";
          indexformula=6;
          LincenzaProfessional.style.display="none";
         
        }
 
       
       formulazio[indexformula].checked=true;
        
        
    }
    else
    {
       
       if (parseFloat(quantita.value)<25){
            base.style.display="block";
       
        } 
        else if (parseFloat(quantita.value)>24 && parseFloat(quantita.value)<50)
        {
            bronze.style.display="block";
       
        }
        else if (parseFloat(quantita.value)>49 && parseFloat(quantita.value)<100)
        {
            silver.style.display="block";
       
        }
        else if (parseFloat(quantita.value)>99 )
        {
          gold.style.display="block";
          LincenzaProfessional.style.display="none";
          professional.checked=false;
          Deseleziona();
          enterprise.checked=true;
        }
           
     
     
    }
    
  if (gostep2==true)
  {
    var errore1=document.getElementById("errore1");
    errore1.style.display="none";
    
    step1buy.style.display="none"; 
	step2buy.style.display="block"; 
	    if (parseFloat(quantita.value)>99)
	        {
	        professional.disabled=true;
	        licenzadisable.disabled=true;
	        txtdisable.style.display="block";
	        }
  }
  
  
 //fine funzione  ***ValidaStep1****
}


 function ColoraField(campo)
    {
            var errore1=document.getElementById("errore1");
            errore1.style.display="block";
			
            campo.style.background="#B3D1FF";
            campo.style.border="solid";
            campo.style.borderColor="#7F9DB9";
            campo.style.borderWidth="2";
			
            //campo.focus();
            
    }
 function NormalField(campo)
    {
    campo.style.background="#fff";
    campo.style.border="solid";
    campo.style.borderColor="#7F9DB9";
    campo.style.borderWidth="1";
    }

	
function isNumero(string) 
	        {
             if (string.search(/^\d+$/) != -1)
                return 1;
	         else
                return 0;
	        }
	        	
 function isEmail(string) 
	        {
             if (string.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) != -1)
                return 1;
	         else
                return 0;
	        }
			
			
 function somma()
 	{
 var forniturahardware=document.getElementById("Fornitura_hardware")
 var serviziconsulenza=document.getElementById("Servizi_di_consulenza")
 var formazione=document.getElementById("Formazione")
 var soluzionisoftware=document.getElementById("Soluzioni_software")
 var svilupposoftware=document.getElementById("Sviluppo_software_personalizzati")
 var altro=document.getElementById("Altro")
 var ricavi=document.getElementById("Suddivisione_ricavi")
 
ricavi.value = parseFloat(altro.value) + parseFloat(svilupposoftware.value) + parseFloat(soluzionisoftware.value) + parseFloat(formazione.value) + parseFloat(serviziconsulenza.value) + parseFloat(forniturahardware.value)
 
 } 			
 
function ValidaStepBuy2(){
    var step1buy=document.getElementById("stepbuy1");
    var step2buy=document.getElementById("stepbuy2");
    var step3buy=document.getElementById("stepbuy3");
    var quantita=document.getElementById("quantita");
    var qtamin=document.getElementById("qtamin");
    var professional=document.getElementById("professional");
    var errore1=document.getElementById("errore1");
    
    gostep3=false
    var formulazio=document.actions_find.paylicenzamonth;
     for (var i=0; i<formulazio.length; i++){
     NormalField(formulazio[i]);
        if(formulazio[i].checked)
        {gostep3=true; 
        }else{
         ColoraField(formulazio[i]);
        }
    }
    
    if (parseFloat(quantita.value)<3 && formulazio[8].checked){
    
        gostep3=false
        qtamin.style.display="block"; 
        for (var i=0; i<formulazio.length; i++){NormalField(formulazio[i]);}
        errore1.style.display="none";
    }else {qtamin.style.display="none"; }
    
    if (gostep3==true)
    {  
        errore1.style.display="none";
       step1buy.style.display="none"; 
	    step2buy.style.display="none"; 
	    step3buy.style.display="block"; 
	  
    }
    else{
        //alert("Non si è scelto nessuna tipo di formula di pagamento")
    }
    
    
}
	
function ValidaStepBuy3(){
    var gostep4=true;
    var step1buy=document.getElementById("stepbuy1");
    var step2buy=document.getElementById("stepbuy2");
    var step3buy=document.getElementById("stepbuy3");
    var step4buy=document.getElementById("stepbuy4");
    
   /*inzio vaiabili da controllare*/
   var Nome=document.getElementById("Nome");
   var Cognome=document.getElementById("Cognome");
   var Societa=document.getElementById("Societa");
      
   var Paese=document.getElementById("Paese");
   var PaeseEsternoUE=document.getElementById("PaeseEsternoUE");
   var PartitaIva=document.getElementById("PartitaIva");
   var Indirizzo=document.getElementById("Indirizzo");
   var CAP=document.getElementById("CAP");
   var Citta=document.getElementById("Citta");
   var Provincia=document.getElementById("Provincia");
   var email=document.getElementById("email");
   var ConfermaLicenza=document.getElementById("ConfermaLicenza");
   var codice_identificativo=document.getElementById("codice_identificativo");
   var AltroPaese=document.getElementById("AltroPaese");
   
   
   
  if (Nome.value==""){
    ColoraField(Nome);
	gostep4=false;
	} else{NormalField(Nome);}
   
  if (Cognome.value==""){
    ColoraField(Cognome);
	gostep4=false;
	
  } else{NormalField(Cognome);}
   
  if (Societa.value==""){
    ColoraField(Societa);
	gostep4=false;
	
  } else{NormalField(Societa);}
    
  if (Paese.selectedIndex==0)
  {
    ColoraField(Paese);
	gostep4=false;
	//alert("Sceliere un Paese!")
  } else{NormalField(Paese);} 
  //altro verifico se si e scelto altro
  if (AltroPaese.style.display=="block"){
        if (PaeseEsternoUE.value==""){
        ColoraField(PaeseEsternoUE);
	    gostep4=false;
	    
            } else{NormalField(PaeseEsternoUE);}
    
  }
  //controllo partita iva
 if(Paese.options[Paese.selectedIndex].value.length<3){
    
        if (checkVATNumber (PartitaIva.value)) {
            NormalField(PartitaIva);
        }
        else{
        ColoraField(PartitaIva);
	    gostep4=false;
	    //alert("Partita IVA non valida!")
        }
 } 
 
 if (Indirizzo.value==""){
    ColoraField(Indirizzo);
	gostep4=false;
	
  } else{NormalField(Indirizzo);} 
  
   if (CAP.value==""){
    ColoraField(CAP);
	gostep4=false;
	
  } else{NormalField(CAP);} 
  
  if (Citta.value==""){
    ColoraField(Citta);
	gostep4=false;
	
  } else{NormalField(Citta);} 
  
  
   if (Provincia.value==""){
    ColoraField(Provincia);
	gostep4=false;
	
  } else{NormalField(Provincia);}
  
  
 //controllo mail 
   
  if (email.value=="" || isEmail(email.value) == 0){
    ColoraField(email);
	gostep4=false;
	//alert("mail non valida")
  } else{NormalField(email);} 
   
  if (codice_identificativo.value ==""){
    ColoraField(codice_identificativo);
	gostep4=false;
	
  } else{NormalField(codice_identificativo);} 
 
  //controllo accetare lincenza
   if(!ConfermaLicenza.checked){ 
    ColoraField(ConfermaLicenza);
	gostep4=false;
	alert("You must agree with service usage conditions")
  } else{NormalField(ConfermaLicenza);} 
 
   
    
    if (gostep4==true)
    {  
        step1buy.style.display="none"; 
	    step2buy.style.display="none"; 
	    step3buy.style.display="none"; 
	    step4buy.style.display="block"; 
	     var errore1=document.getElementById("errore1");
        errore1.style.display="none";
	    Tabella();
    }
    
}
/*
function ValidaStep4(){
    var conferma=document.getElementById("Conferma");
        if (conferma.checked){
        NormalField(conferma);

        return true
        }
        else
        {
        alert("Non hai dato in consenso al tratamento dei dati")
        ColoraField(conferma);
        return false
        }
    
    }
 */   
function Ritorna(step){

    var step1buy=document.getElementById("stepbuy1");
    var step2buy=document.getElementById("stepbuy2");
    var step3buy=document.getElementById("stepbuy3");
    var step4buy=document.getElementById("stepbuy4");
    var qtamin=document.getElementById("qtamin");
    
    step1buy.style.display="none"; 
	step2buy.style.display="none"; 
	step3buy.style.display="none"; 
	step4buy.style.display="none"; 
	qtamin.style.display="none"; 
	/*step5.style.display="none"; */
	
	
	 var errore1=document.getElementById("errore1");
        errore1.style.display="none";
    
	
	if (step=="step1"){
	step1buy.style.display="block"; 
	
	var professional=document.getElementById("professional");
    var licenzadisable=document.getElementById("licenzadisable");
    var txtdisable=document.getElementById("txtdisable")
    var LicenzaEnterprise=document.getElementById("LicenzaEnterprise");
    //var LincenzaProfessional=document.getElementById("LincenzaProfessional");
    var base=document.getElementById("baseradio");
    var bronze=document.getElementById("bronzeradio");
    var silver=document.getElementById("silverradio");
    var gold=document.getElementById("goldradio");
    var valori500=document.getElementById("valori500")
    
    professional.disabled=false;
	licenzadisable.disabled=false;
	txtdisable.style.display="none";
	LicenzaEnterprise.style.display="none"
	base.style.display="none";
	bronze.style.display="none";
	silver.style.display="none";
	gold.style.display="none";
	valori500.style.display="none";
    //LincenzaProfessional.style.display="none"
	}
	
	if (step=="step2"){
	    step2buy.style.display="block"; 
	    var formulazio=document.actions_find.paylicenzamonth;
        for (var i=0; i<formulazio.length; i++){
                NormalField(formulazio[i]);}
 	}
	
	if (step=="step3"){
	
    step3buy.style.display="block"; 
    
	}
   
   if (step=="step4"){
	
    step4.style.display="block"; 
    
	}
	
}    
    
 function Avanti(){
 
var hidebotoni=document.getElementsByTagName("input")
for(i=0;i<hidebotoni.length;i++){
    t=hidebotoni[i].getAttribute("type");
    
    if(t=="button"){hidebotoni[i].style.display="none"}

}

 
    var step1buy=document.getElementById("stepbuy1");
    var step2buy=document.getElementById("stepbuy2");
    var step3buy=document.getElementById("stepbuy3");
    /*var step4buy=document.getElementById("stepbuy4");
    var step5buy=document.getElementById("stepbuy5");*/
    
    
   
    step1buy.style.display="block"; 
    step2buy.style.display="block"; 
	step3buy.style.display="block"; 
	/*step4buy.style.display="block"; 
	step5buy.style.display="block"; */
	
	
	
	//errore1.style.display="none";
    
 
 } 
 
function Deseleziona(){

var bottone = document.actions_find.paylicenzamonth;
for(var i=0; i<bottone.length; i++) {
  bottone[i].checked=false
  }
  
}

function SelezionaLicenza(license1,license2){

var catlic1=document.getElementById(license1);
var catlic2=document.getElementById(license2);
 catlic1.checked=true;
 catlic2.checked=false;

  
}

function Tabella(){
/*varibile anagrafica azienda*/
var anariepilogo=document.getElementById("anariepilogo");
var Nome= document.getElementById("Nome");
var Cognome=document.getElementById("Cognome");
var Societa=document.getElementById("Societa");
var Paese=document.getElementById("Paese");
var PaeseEsternoUE=document.getElementById("PaeseEsternoUE");
var AltroPaese=document.getElementById("AltroPaese");
var PartitaIva=document.getElementById("PartitaIva");
var Indirizzo=document.getElementById("Indirizzo");
var CAP=document.getElementById("CAP");
var Citta=document.getElementById("Citta");
var Provincia=document.getElementById("Provincia");
var Telefono=document.getElementById("Telefono");
var Fax=document.getElementById("Fax");
var email=document.getElementById("email");
var codice_identificativo=document.getElementById("codice_identificativo");
var Dominio=document.getElementById("Dominio");
var azure=document.getElementById("azure");
/*----------FINE VARIABILI-------------*/

var tableriepilogo=document.getElementById("tableriepilogo");
var NomeLicenza;
var NomeFormula;
var datianagrafici;
var datilicenza;
var quantita=document.getElementById("quantita");
/*--AZURE--*/
var datihosting;
var costoazure=0;

/*--AZURE--*/

var licenzia=document.actions_find.licenze;
for (var i=0; i<licenzia.length; i++){
    if(licenzia[i].checked==true){
       NomeLicenza= licenzia[i].id;
     
    }
}

var formulazio=document.actions_find.paylicenzamonth;
for (var i=0; i<formulazio.length; i++){
    if(formulazio[i].checked==true){
       NomeFormula= formulazio[i].id;
    }
}
    datianagrafici ="<table width=\"650\"><tr><td>Name</td>";
    datianagrafici +="<td>" + Nome.value  + "</td></tr>";
    datianagrafici +="<td>Surname</td>";
    datianagrafici +="<td>" + Cognome.value + "</td></tr>";
    datianagrafici +="<td>Company Name</td>";
    datianagrafici +="<td>"+ Societa.value + "</td></tr>";
    datianagrafici +="<td>Country</td>";
            
      if (AltroPaese.style.display=="block"){
        datianagrafici +="<td>"+ PaeseEsternoUE.value + "</td></tr>";
      }
      else{
        datianagrafici +="<td>"+ Paese.options[Paese.selectedIndex].text + "</td></tr>";
      }      
    if(PartitaIva.value.length>0){
       datianagrafici +="<td>VAT</td>";
       datianagrafici +="<td>"+ PartitaIva.value + "</td></tr>";
    }
       datianagrafici +="<td>Address</td>";
       datianagrafici +="<td>"+ Indirizzo.value + " - " + CAP.value + " - "+ Citta.value +"</td></tr>";
    
      if(Provincia.value.length>0){   
       datianagrafici +="<td>State/Province</td>";
       datianagrafici +="<td>"+ Provincia.value + "</td></tr>";
     }
     
     if(Telefono.value.length>0){   
       datianagrafici +="<td>Phone</td>";
       datianagrafici +="<td>"+ Telefono.value + "</td></tr>";
     }  
     if(Fax.value.length>0){   
       datianagrafici +="<td>Fax</td>";
       datianagrafici +="<td>"+ Fax.value + "</td></tr>";
     } 
       datianagrafici +="<td>E-mail</td>";
       datianagrafici +="<td>"+ email.value + "</td></tr>";
     
       datianagrafici +="<td>Platform URL</td>";
       datianagrafici +="<td>"+ codice_identificativo.value + "."+Dominio.options[Dominio.selectedIndex].value+"</td></tr></table>";
       
       anariepilogo.innerHTML =datianagrafici
     
  
   datilicenza = "<table width=\"650\"><tr><th style=\"border:1px #C1C1C1 solid;\">Item</th>";
   datilicenza += "<th style=\"border:1px #C1C1C1 solid;\">Qty</th>";
   datilicenza += "<th style=\"border:1px #C1C1C1 solid;\">Price</th>";
   datilicenza += "<th style=\"border:1px #C1C1C1 solid;\">SubTotal</td></th>";
   
   datilicenza += "<tr><td>" + NomeLicenza.toUpperCase() + " (" + NomeFormula + ")</td>";
   datilicenza += "<td style=\"text-align:right\">" + quantita.value + "</td>";
   datilicenza += "<td style=\"text-align:right\">€  " + GetPrezzoUnitario(NomeFormula,false) + "</td>";
   datilicenza += "<td style=\"text-align:right\">€  " +  arrotonda(GetPrezzoUnitario(NomeFormula,true)* quantita.value,2) + "</td></tr>";
 
if  (Paese.options[Paese.selectedIndex].value=="IT") {


 datilicenza += "<tr><td>VAT</td>";
   datilicenza += "<td style=\"text-align:right\">" + quantita.value + "</td>";
   datilicenza += "<td style=\"text-align:right\">€ " + arrotonda(GetPrezzoUnitario(NomeFormula,false)*0.2,2) + "</td>";
   datilicenza += "<td style=\"text-align:right\">€  " +  arrotonda(GetPrezzoUnitario(NomeFormula,true)* quantita.value*0.2,2) + "</td></tr>";
   
   datilicenza += "<tr style=\"border-top:1px #C1C1C1 solid;\"><td>TOTAL (euro)</td>";
   datilicenza += "<td style=\"text-align:right;border-top:1px #C1C1C1 solid;\">" + quantita.value + "</td>";
   datilicenza += "<td style=\"text-align:right;border-top:1px #C1C1C1 solid;\">€ " + eval(GetPrezzoUnitario(NomeFormula,false) + arrotonda(GetPrezzoUnitario(NomeFormula,false)*0.2,2)) + "</td>";
   datilicenza += "<td style=\"text-align:right;border-top:1px #C1C1C1 solid;\">€  " +  eval(arrotonda(GetPrezzoUnitario(NomeFormula,true)* quantita.value,2) + arrotonda(GetPrezzoUnitario(NomeFormula,true)* quantita.value*0.2,2)) + "</td></tr>";
      
}   
else
{
datilicenza += "<tr><td>VAT is not applicable</td>";
   datilicenza += "<td style=\"text-align:center\">N.A.</td>";
   datilicenza += "<td style=\"text-align:right\">€ 0</td>";
   datilicenza += "<td style=\"text-align:right\">€ 0</td></tr>";
   
  datilicenza += "<tr><td style=\"border-top:1px #C1C1C1 solid;\">TOTAL (euro)</td>";
   datilicenza += "<td style=\"text-align:right;border-top:1px #C1C1C1 solid;\">" + quantita.value + "</td>";
   datilicenza += "<td style=\"text-align:right;border-top:1px #C1C1C1 solid;\">€ " + GetPrezzoUnitario(NomeFormula,false) + "</td>";
   datilicenza += "<td style=\"text-align:right;border-top:1px #C1C1C1 solid;\">€  " +  arrotonda(GetPrezzoUnitario(NomeFormula,true)* quantita.value,2) + "</td></tr>";
   }

 datilicenza +="</table>"
 
 tableriepilogo.innerHTML = datilicenza

 if (azure.checked) {
        costoazure=400;
        datihosting = "<table width=\"650\"><tr><th style=\"border:1px #C1C1C1 solid;\">Item</th>";
		datihosting +="<th style=\"border:1px #C1C1C1 solid;\">Monthly</th></tr>";
        datihosting +="<tr><td>" + azure.value.toUpperCase() + "</td>";
        datihosting +="<td style=\"text-align:right\">€  " + costoazure + "</td></tr>";
        
        
          if          (Paese.options[Paese.selectedIndex].value=="IT") 
        {
        datihosting +="<tr><td>VAT</td>";
        datihosting +="<td style=\"text-align:right\">€  " +  arrotonda(costoazure*0.2,2) + "</td></tr>";    
        datihosting +="<tr><td style=\"border-top:1px #C1C1C1 solid;\">TOTAL (euro)</td>";
        datihosting +="<td style=\"text-align:right;border-top:1px #C1C1C1 solid;\">€  " +  eval(arrotonda(costoazure + arrotonda(costoazure*0.2,2))) + "</td></tr>"
        }
        else
        {datihosting+="<tr><td>VAT is not applicable</td>";
        datihosting +="<td style=\"text-align:right\">€ 0</td></tr>";
        
        datihosting +="<tr><td style=\"border-top:1px #C1C1C1 solid;\">TOTAL (euro)</td>";
        datihosting +="<td style=\"text-align:right;border-top:1px #C1C1C1 solid;\">€  " +  costoazure + "</td></tr>";
        }
        datihosting += "</table>";  
       	document.getElementById("intazure").style.display="";
  
	}
	else
	{
	datihosting = "";
	document.getElementById("intazure").style.display="none";
	}
  azureriepilogo.innerHTML=datihosting	
 
 var HideTabella=document.getElementById("HideTabella")
 HideTabella.value="<div style=\"clear:both; margin:5px 0 2px 0;font-weight:bold;padding:3px;\">Purchasing Information</div>" + anariepilogo.innerHTML + "<div style=\"clear:both; margin:10px 0 2px 0; font-weight:bold; padding:3px;\">Order Summary</div>	" + tableriepilogo.innerHTML; 
 
 if (azure.checked){
HideTabella.value+= azure.innerHTML + "<div style=\"clear:both; margin:10px 0 2px 0; font-weight:bold; padding:3px;\">INFRASTRUCTURE</div>	" + azureriepilogo.innerHTML;
}
 
}

function GetPrezzoUnitario(tipoformula,indice){

    var testospiega=document.getElementById("testospiega");
    var annuo;
    if (indice){annuo=12}else{annuo=1}
    
switch (tipoformula){
    
    case "Base":
        testospiega.innerHTML="Activate and deactivate players as you wish, no minimum subscription";
        return 55;
    case "Base Formula 12":
        testospiega.innerHTML="10% discount, applies by paying one year in advance";
        return (55-((55*10)/100))*annuo;        
        
    case "Bronze":
        testospiega.innerHTML="Starting from 25 active players";
        return 44;        
    case "Bronze Formula 12":
        testospiega.innerHTML="10% discount, applies by paying one year in advance";
        return (44-((44*10)/100))*annuo;        
    case "Silver":
        testospiega.innerHTML="Starting from 50 active players";
        return 36;        
    case "Silver Formula 12":
        testospiega.innerHTML="10% discount, applies by paying one year in advance";
        return (36-((36*10)/100))*annuo;        
    case "Gold":
        testospiega.innerHTML="Starting from 100 active players";
        return 29;        
    case "Gold Formula 12":
        testospiega.innerHTML="10% discount, applies by paying one year in advance";
        return (29-((29*10)/100))*annuo;        
    case "Formula Free":
        testospiega.innerHTML="Activate and deactivate players as you wish, minimum initial purchase 3 licenses";
        return 29;        
    case "Formula 36":
        testospiega.innerHTML="Price for a 3 year contract, paid in advance";
        return 572.40;
    default: 
     return 55;   
    
}
}


function ViewAltro(){
var AltroPaese=document.getElementById("AltroPaese");
 var Paese=document.getElementById("Paese");
 var PartitaIva=document.getElementById("PartitaIva");
 
 var selIndex = Paese.selectedIndex;
 if (Paese.options[selIndex].value=="AAA"){
 AltroPaese.style.display="block";
 }
 else{AltroPaese.style.display="none";}
 
 
 if(Paese.options[Paese.selectedIndex].value.length<3){
        PartitaIva.value=Paese.options[Paese.selectedIndex].value;
        PartitaIva.style.display="block";
  
  }
 else{
 PartitaIva.value="";
  }
}

function arrotonda(numero, numeroDecimali){ 
  var modificatore = '1'; 
  for(var i=0;i<numeroDecimali;i++)
    modificatore += "0"; 
  modificatore = parseInt(modificatore,10)
  return Math.round(numero*(modificatore))/(modificatore);  
}
