  calculate = function(totalElement)
  {
      if (totalElement)
      {   
          var calculation  = '';
          var overall = '';
          var fields = new Array();
          var theElement = document.getElementById(totalElement);
          var userInputs = myform.elements;
          var the_type = '';
          for (var f = 0; f < userInputs.length; f++)
          { 
              if (userInputs[f].className=='special_value')
              {
                  if (userInputs[f].type=='select-one')
                  {
                      if(userInputs[f].options[userInputs[f].selectedIndex].value)
                      {
                          fields[f] = userInputs[f].options[userInputs[f].selectedIndex].value;
                      }
                      else
                      {
                          fields[f] = 0;
                      }
                  }
                  else if(userInputs[f].type=='radio' || userInputs[f].type=='checkbox')
                  {
                      if (userInputs[f].checked)
                      {
                          fields[f] = userInputs[f].value;
                      }
                      else
                      {
                          fields[f] = 0;
                      }
                  }
                  else
                  {
                      if (userInputs[f].value)
                      {
                          fields[f] = userInputs[f].value;
                      }
                      else
                      {
                          fields[f] = 0;
                      }
                  }
              }
          }
                     
          for (var i=0; i<fields.length; i++)
          { 
              calculation += fields[i];
              
              if (i!=fields.length-1)
              {
                  calculation += '+';
              }
          }
          
          if (calculation!='')
          {
              overall = eval(calculation).toFixed(2);
          }
          
          if (overall!='')
          {
              theElement.innerHTML = '&euro;'+overall;
          }
      }
  }
