var dollar = "$";  // String.fromCharCode(36); 

function getAttPriceFromString(posVal) {
     // the format of this is "1 (+$9.40)".  Parse out the upcharge
     var open = posVal.indexOf(dollar);
     var close = posVal.indexOf(")", open); 
     if ((open != -1) && (close != -1)) {
         var strval = posVal.substring(open+1, close); 
         var re = /,/gi
         var strvalnocomma = strval.replace(re,"" );
         var posValFloat = parseFloat(strvalnocomma); 
         return posValFloat;
     } 
     return 0;
}

function getAttPrice(attid) { 
  // the format of this is "1 (+$9.40)".  Parse out the upcharge
  var attrib = document.getElementById(attid); 
  if (attrib == null) return 0; 
  var pos = attrib.selectedIndex;
  var posVal = attrib[pos].text;
  return getAttPriceFromString(posVal);
}
