   function FormatNumber(num)
   {
     if(isNaN(num)) { num = "0"; }
     sign = (num == (num = Math.abs(num)));
     num = Math.floor(num*100+0.50000000001);
     cents = num%100;
     num = Math.floor(num/100).toString();
     if(cents<10) { cents = "0" + cents; }
     for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
     {
       num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3));
     }
     return (((sign)?'':'-') + num + '.' + cents);
   }

  function showPrice(form)
  {  
    var myTotalPriceradio = myTotalPriceradio;
    if (myTotalPriceradio)
    { myTotalPrice = myTotalPriceradio;
    } else {
      var myTotalPrice = 0;
    }
    var myTotalPricedropdown = 0;
    var showUP = 0;
    var myMathProblem = "";
    myItemPrice = parseFloat(form.nuPrice.value);
    for (var i = 0; i < form.elements.length; i++)
    {
      var e = form.elements[i];
      if ( e.type == 'select-one' )
      {
        showUP = 1;
        Item = e.selectedIndex;
        myPrice = e.options[Item].text;
        myDollarSign = myPrice.indexOf("$",0)
        if ( myDollarSign != "-1" )
        {
          myParSign = myPrice.indexOf(")", myDollarSign);
          myAttributeString = myPrice.substring(myDollarSign+1, myParSign);
          myAttributeString = myAttributeString.replace(/,/,"");
          myAttributePrice = parseFloat(myAttributeString);
          myMathProblem = myPrice.charAt(myDollarSign - 1);
        } else { myAttributePrice = 0; }
          if (myMathProblem == "-")
          {
            myTotalPrice = myTotalPrice - myAttributePrice;
          } else {
            myTotalPrice = myTotalPrice + myAttributePrice;
          }
      }
    }
    if ( showUP )
    {

        myTotalPrice = FormatNumber(myTotalPrice + myItemPrice);
            document.getElementById("productNEWprice").innerHTML = "Selected Item Price: $" + myTotalPrice;

    }
  }
  
  function showPriceradio(form)
  {  
    var myTotalPricedropdown = myTotalPricedropdown;
    var myTotalPrice = myTotalPricedropdown;
    var myTotalPriceradio = 0;
    var showUP = 0;
    var myMathProblem = "";
    myItemPrice = parseFloat(form.nuPrice.value);
    for (var i = 0; i < form.elements.length; i++)
    {
      var e = form.elements[i];
      if ( e.type == 'radio' )
      {
      if ( e.checked == '1' )
      {
        showUP = 1;
        myPrice = e.id;
        myDollarSign = myPrice.indexOf("$",0)
        if ( myDollarSign != "-1" )
        {
          myParSign = myPrice.indexOf(")", myDollarSign);
          myAttributeString = myPrice.substring(myDollarSign+1, myParSign);
          myAttributeString = myAttributeString.replace(/,/,"");
          myAttributePrice = parseFloat(myAttributeString);
          myMathProblem = myPrice.charAt(myDollarSign - 1);
        } else { myAttributePrice = 0; }
          if (myMathProblem == "+")
          {
            myTotalPrice = myTotalPrice + myAttributePrice;
          } else {
            myTotalPrice = myTotalPrice - myAttributePrice;
          }
      }
      }

    }
    if ( showUP )
    {

        myTotalPriceradio = FormatNumber(myTotalPrice + myItemPrice);
        if ( myTotalPricedropdown )
        {
            myTotalPrice = FormatNumber(myTotalPricedropdown + myTotalPriceradio);
            document.getElementById("productNEWprice").innerHTML = "Selected Item Price: $" + myTotalPrice;
               } else {
            myTotalPrice = FormatNumber(myTotalPriceradio);
            document.getElementById("productNEWprice").innerHTML = "Selected Item Price: $" + myTotalPrice;
         }
    }
  }

  function showPriceradio1(form)
  {  

      if ( e.type == 'radio' )
      {
      if ( e.checked == '1' )
      {
        showUP = 1;
        myPrice = e.id;
        myDollarSign = myPrice.indexOf("$",0)
        if ( myDollarSign != "-1" )
        {
          myParSign = myPrice.indexOf(")", myDollarSign);
          myAttributeString = myPrice.substring(myDollarSign+1, myParSign);
          myAttributeString = myAttributeString.replace(/,/,"");
          myAttributePrice = parseFloat(myAttributeString);
          myMathProblem = myPrice.charAt(myDollarSign - 1);
        } else { myAttributePrice = 0; }
      }
      }

  }

  function showPrice1(form)
  {  


      if ( e.type == 'select-one' )
      {
        showUP = 1;
        Item = e.selectedIndex;
        myPrice = e.options[Item].text;
        myDollarSign = myPrice.indexOf("$",0)
        if ( myDollarSign != "-1" )
        {
          myParSign = myPrice.indexOf(")", myDollarSign);
          myAttributeString = myPrice.substring(myDollarSign+1, myParSign);
          myAttributeString = myAttributeString.replace(/,/,"");
          myAttributePrice = parseFloat(myAttributeString);
          myMathProblem = myPrice.charAt(myDollarSign - 1);
        } else { myAttributePrice = 0; }
      }

  }

  function showPricecondensed(form)
  {
    for (var i = 0; i < form.elements.length; i++)
    {
      var e = form.elements[i];
    var myTotalPrice = 0;
    var showUP = 0;
    var myMathProblem = "";
    myItemPrice = parseFloat(form.nuPrice.value);
          showPrice1(form)
          showPriceradio1(form)

          if (myMathProblem == "-")
          {
            myTotalPrice = myTotalPrice - myAttributePrice;
          } else {
            myTotalPrice = myTotalPrice + myAttributePrice;
          }
    if ( showUP )
    {
        myTotalPrice = FormatNumber(myTotalPrice + myItemPrice);
        document.getElementById("productNEWprice").innerHTML = "Selected Item Price: $" + myTotalPrice;
    }
    }
  }



  function showPricecondensedoriginal(form)
  {  
    var myTotalPrice = 0;
    var showUP = 0;
    var myMathProblem = "";
    myItemPrice = parseFloat(form.nuPrice.value);
    for (var i = 0; i < form.elements.length; i++)
    {
      var e = form.elements[i];
      if ( e.type == 'select-one' )
      {
          showPrice(form)
      } else {
              showPriceradio(form)
             }
    }
  }

  function showPricecomboreversed(form)
  {  
    var myTotalPrice = 0;
    var showUP = 0;
    var myMathProblem = "";
    myItemPrice = parseFloat(form.nuPrice.value);
    for (var i = 0; i < form.elements.length; i++)

    {
    var e = form.elements[i];
          if ( e.type == 'radio' )
          {
            if ( e.checked == 1 )
            {
              showUP = 1;
              myPrice = e.id;
              myDollarSign = myPrice.indexOf("$",0)
              if ( myDollarSign != "-1" )
              {
                myParSign = myPrice.indexOf(")", myDollarSign);
                myAttributeString = myPrice.substring(myDollarSign+1, myParSign);
                myAttributeString = myAttributeString.replace(/,/,"");
                myAttributePrice = parseFloat(myAttributeString);
                myMathProblem = myPrice.charAt(myDollarSign - 1);
              }
            }
      } else {
    var e = form.elements[i];
      if ( e.type == 'select-one' )
      {
        showUP = 1;
        Item = e.selectedIndex;
        myPrice = e.options[Item].text;
        myDollarSign = myPrice.indexOf("$",0)
        if ( myDollarSign != "-1" )
        {
          myParSign = myPrice.indexOf(")", myDollarSign);
          myAttributeString = myPrice.substring(myDollarSign+1, myParSign);
          myAttributeString = myAttributeString.replace(/,/,"");
          myAttributePrice = parseFloat(myAttributeString);
          myMathProblem = myPrice.charAt(myDollarSign - 1);
        }
          } else { myAttributePrice = 0; }
       }
    if (myMathProblem == "+")
    {
      myTotalPrice = myTotalPrice + myAttributePrice;
    } else {
      myTotalPrice = myTotalPrice - myAttributePrice;
    }

    } 

    if ( showUP )
    {
        myTotalPrice = FormatNumber(myTotalPrice + myItemPrice);
        document.getElementById("productNEWprice").innerHTML = "Selected Item Price: $" + myTotalPrice;


    }
  }

  function showPricecombo(form)
  {  
    var myTotalPrice = 0;
    var showUP = 0;
    var myMathProblem = "";
    myItemPrice = parseFloat(form.nuPrice.value);
    for (var i = 0; i < form.elements.length; i++)

    {
    var e = form.elements[i];
      if ( e.type == 'select-one' )
      {
        showUP = 1;
        Item = e.selectedIndex;
        myPrice = e.options[Item].text;
        myDollarSign = myPrice.indexOf("$",0)
        if ( myDollarSign != "-1" )
        {
          myParSign = myPrice.indexOf(")", myDollarSign);
          myAttributeString = myPrice.substring(myDollarSign+1, myParSign);
          myAttributeString = myAttributeString.replace(/,/,"");
          myAttributePrice = parseFloat(myAttributeString);
          myMathProblem = myPrice.charAt(myDollarSign - 1);
        }
      } else {
    var e = form.elements[i];
          if ( e.type == 'radio' )
          {
            if ( e.checked == 1 )
            {
              showUP = 1;
              Item = e.checked;
              myPrice = e.id;
              myDollarSign = myPrice.indexOf("$",0)
              if ( myDollarSign != "-1" )
              {
                myParSign = myPrice.indexOf(")", myDollarSign);
                myAttributeString = myPrice.substring(myDollarSign+1, myParSign);
                myAttributeString = myAttributeString.replace(/,/,"");
                myAttributePrice = parseFloat(myAttributeString);
                myMathProblem = myPrice.charAt(myDollarSign - 1);
              }
            }
          } else { myAttributePrice = 0; }
       }
    if (myMathProblem == "+")
    {
      myTotalPrice = myTotalPrice + myAttributePrice;
    } else {
      myTotalPrice = myTotalPrice - myAttributePrice;
    }

    } 

    if ( showUP )
    {
        myTotalPrice = FormatNumber(myTotalPrice + myItemPrice);
        document.getElementById("productNEWprice").innerHTML = "Selected Item Price: $" + myTotalPrice;


    }
  }

