ciao a tutti sempre su questo forum ho trovato un o script molto carino che mi permette di cambiare quantità del prodotto ed in automatico acnhe il prezzo, ora però volevo aggiungere un check perchè se l'azienda è italiana a quel totale devo aggiungere l' iva.
Mi potete dare una mano?
lo script è questo, stavo aggiungendo la funzione del check, ma non so come farla funzionare


Codice PHP:

<script>
function $(
id) {
   return 
document.getElementById(id);
}

function 
addPieces(campobylimite_inferiore) {
    var 
pezzi campo.value;
    
pezzi parseInt(pezzi10);
    if (
isNaN(pezzi)) pezzi 0;
    
    
pezzi += by;
    if (
pezzi limite_inferiore) return;
    
    
campo.value pezzi;
    
calctot(campo.id);
}

function 
calctot(campo) {
  var 
res =  parseInt($(campo).value10) * parseFloat($('unitario_'+campo).innerHTML);
  $(
'totale_'+campo).innerHTML = (Math.round(res 100)) /100;
}


function 
myfunction(obj,campo){
    if (
obj.checked)
    {
    
    
      
//var ras =  parseInt($(campo).value, 10) * parseFloat($('unitario_'+campo).innerHTML);
      
$('totale_'+campo).innerHTML =come fare;

      
     
    }
    else
    {
        
    }
}

</script>




<table width="738" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td width="34%">[img]products.png[/img]</td>
    <td width="19%"></td>
    <td width="47%"></td>
  </tr>
  <tr>
    <td height="21" colspan="3"><hr></td>
    </tr>
  <tr>
    <td></td>
    <td colspan="2">[B]Munsingwear Shirt[/B]</td>
    </tr>
  <tr>
    <td>[img]djacket.gif[/img]</td>
    <td colspan="2">Show the caddies who's boss in this eye-catching tribute to leisure. This windshirt, with its 100% black suede nylon shell, V-neck collar, cuff, and waistband will kepp you toasty and warm on the links. It boasts side seam, and set-in pockets.</td>
    </tr>
  <tr>
    <td></td>
    <td>Price (EUR):</td>
    <td>
    
    
    &euro;
  <span id="unitario_articolo12">78.00</span> 
    
    
    </td>
  </tr>
  <tr>
    <td></td>
    <td>Qty:</td>
    <td>
    
            <!--    
            <INPUT name="QTY" size="8" value="1" align="right">
            -->
        <input type="text" id="articolo12" readonly="readonly" value="1"/>
<input type="button" value="+" onClick="addPieces($('articolo12'), 1, 1)" />
<input type="button" value="-" onClick="addPieces($('articolo12'), -1, 1)" />
    
    
    
    </td>
  </tr>
  <tr>
    <td></td>
    <td valign="top">Totale:</td>
    <td valign="top">
      
<span id="totale_articolo12"></span> 
<script>calctot('articolo12')</script>

    
    
    </td>
  
  
  </tr>
    <tr>
    <td></td>
    <td>Factory Italy 
</td>
    <td valign="top"><label>
      <input type="checkbox" name="checkbox" id="checkbox" onClick="myfunction(this,'articolo12');" >
    </label>
    (If you are an 'Italian company must add 20% VAT)</td>
  </tr>

  
  
  <tr>
    <td></td>
    <td></td>
    <td><INPUT TYPE="Submit" Value="Purchase"></td>
  </tr>
</table>
</FORM>