function validateForm(application){


	if (document.application.quantity.value >= 6)
		{
		 alert("The quantity you selected is greter than 5. If you are ordering more than 5 of this item, please select the 6 or more button to add to your shopping cart.")
		 return false
		}
}
function validateForm1(application){


	if (document.application.quantity.value <= 5)
		{
		 alert("The quantity you selected is less than 6. If you are ordering less than 6 of this item, please select the 1-5 button to add to your shopping cart.")
		 return false
		}
		
}
var amt;                 // place to put price
var txt;                 // place to put description

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) { // stuff button codes
  obj1.item_name.value = obj1.basedes.value +  // stuff text
                         ", " + txt + " @" + Dollar (amt);
  obj1.amount.value = Dollar (amt);            // and amount
}
function ReadForm1 (obj1, tst) { // process text fields
var i,des="",obj,val,tag,op1a="",op1b="",op2a="",op2b="";
  if (obj1.baseon0) op1a = obj1.baseon0.value;
  if (obj1.baseos0) op1b = obj1.baseos0.value;
  if (obj1.baseon1) op2a = obj1.baseon1.value;
  if (obj1.baseos1) op2b = obj1.baseos1.value;
  if (obj1.basedes) 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 == "text" ||    // just read text data
        obj.name == "textarea") &&
        obj.name != "tot"  &&     // ignore the tot field
        obj.name != "quantity") { // and the qty field
      val = obj.value;            // get the data
      if (tst == true &&          // only on final submit
          val == "") {            // force an entry
        alert ("Enter data for " + obj.name);
        return false;
      }
      tag = obj.name.substring (obj.name.length-2);  // get flag
      if      (tag == "1a") op1a = op1a + " " + val;
      else if (tag == "1b") op1b = op1b + " " + val;
      else if (tag == "2a") op2a = op2a + " " + val;
      else if (tag == "2b") op2b = op2b + " " + val;
      else if (des.length == 0) des = val;
      else des = des + ", " + val;
    }
  }
  obj1.item_name.value = des;  // stuff fields
  if (op1a.length > 0) obj1.on0.value = op1a;
  if (op1b.length > 0) obj1.os0.value = op1b;
  if (op2a.length > 0) obj1.on1.value = op2a;
  if (op2b.length > 0) obj1.os1.value = op2b;
}
