function Dollar (val) {  // force to valid dollar amount
var str,pos,rnd=0;
  if (val < .995) rnd = 1;  // for old Netscape browsers
  str = escape (val*1.0 + 0.005001 + rnd);  // float, round, escape
  pos = str.indexOf (".");
  if (pos > 0) str = str.substring (rnd, pos + 3);
  return str;
}

function ReadForm (obj1) { // process un-named selects
var i,amt,des,obj,pos,val,extras;
  extras = 0.0;
  amt = obj1.baseamt.value*1.0;       // base amount
  des = obj1.basedes.value;           // base description
  for (i=0; i<obj1.length; i++) {     // run entire form
    obj = obj1.elements[i];           // a form element
    if (obj.type == "select-one" &&   // just get selects
        obj.name == "") {             // must be un-named
      pos = obj.selectedIndex;        // which option selected
      val = obj.options[pos].value;   // selected value

	  if( val == "" ) {
	  	alert('Please choose your session and then click the purchase button again.');
	  	return false;
	  }

      pos  = val.indexOf ("@");       // price set?
      if (pos > 0){ amt = val.substring (pos + 1)*1.0; val = val.substring(0,pos); }
      pos  = val.indexOf ("+");       // price increment?
      if (pos > 0){ amt = amt + val.substring (pos + 1)*1.0; val = val.substring(0,pos); }
      pos  = val.indexOf ("%");       // percent change?
      if (pos > 0){ amt = amt + (amt * val.substring (pos + 1)/100.0); val = val.substring(0,pos); }
	  des = des + ", " + val;         // accumulate value, or text
    }
    if (obj.type == "checkbox" &&     // just get shipOp checkboxes
        obj.name == "shipOp") {
      if( obj.checked ){
			des = des + ", session tape recording";
			extras = extras + 5.0;
	  }
    }
  }
  amt = amt + extras;
  obj1.item_name.value = des;
  obj1.amount.value = Dollar(amt);
  
  return true;
}