function count()
{
 if (document.calc.pret.value!=0){
   var pretul =document.calc.pret.value;
 } else {
   var pretul = 0;
 }

  box1 = document.calc.cantitate;
 if (box1.value!=0){
   var cant =  box1.options[box1.selectedIndex].value;
 } else {
   var cant = 1;
 }
 
 
 if (document.calc.decor[0].checked){
   var decora =document.calc.decor[0].value;
 } else {
   var decora = 0;
 }
 
  if (document.calc.im[0].checked){
   var ima =document.calc.im[0].value;
 } else {
   var ima = 0;
 }
 
   if (document.calc.prelucrare[0].checked){
   var prel =document.calc.prelucrare[0].value;
 } else {
   var prel = 0;
 }
 
   if (document.calc.livrare[0].checked){
   var livr =document.calc.livrare[0].value;
 } else {
   var livr = 0;
 }
 
  if (document.calc.referiri[0].checked){
   var ref =document.calc.referiri[0].value;
 } else {
   var ref = 0;
 }
 
disc=(pretul*cant+Math.round(decora)+Math.round(ima)+Math.round(prel)+Math.round(livr)+Math.round(ref))*(document.calc.discount.value)/100;
document.calc.pay.value=(pretul*cant+Math.round(decora)+Math.round(ima)+Math.round(prel)+Math.round(livr)+Math.round(ref))-Math.round(disc);
document.calc.ron.value=((pretul*cant+Math.round(decora)+Math.round(ima)+Math.round(prel)+Math.round(livr)+Math.round(ref))-Math.round(disc))/10000;
 }
