<!--
var discnt = 0;   // no default percent discount

//This is where the coupon codes go
var coupons = new Array (
	"EPEMS10",	//	Keep 10%
	"COMP0908", 	//	Compex Google 10%
	"GLOB0908", 	//	Globus Google 10%
	"COACHTB",	//	Tommy, No Discount
	"CTB05", 	//	Tommy 5%
	"CTB10",	//	Tommy 10%
	"CTB15", 	//	Tommy 15%
	"COACHSH",	//	Scott, No Discount
	"CSH05", 	//	Scott 5%
	"CSH10", 	//	Scott 10%
	"CSH15", 	//	Scott 15%
	"SALESBF",	//	Brian, No Discount
	"SBF05", 	//	Brian 5%
	"SBF10", 	//	Brian 10%
	"SBF15",  	//	Brian 15%
	"KMBB05",	//	Kelly Moore 5%
	"KMBB15",	//	Kelly Moore 15%
	"BODPOD09",	//	??
	"CoachJDS",	//	Jonathan  no Discount
	"JDS05",	//	Jonathan 5% Discount
	"JDS10",	//	Jonathan 10% Discount
	"JDS15",	//	Jonathan 15% Discount
	"ER09",		// E. Rock 09
	"12JDS09",	// December 09 15%
	"10GAR125" // Garmin 10%
      
);

//This is where the coupon values go
var coupdc  = new Array (
	10,	//	Keep 10%
	10,	//	Compex Google 10%
	10,	//	Globus Google 10%
	0,	//	Tommy, No Discount
	5,	//	Tommy 5%
	10,	//	Tommy 10%
	15,	//	Tommy 15%
	0,	//	Scott, No Discount
	5,	//	Scott 5%
	10,	//	Scott 10%
	15,	//	Scott 15%
	0,	//	Brian, No Discount
	5,	//	Brian 5%
	10,	//	Brian 10%
	15,	//	Brian 15%
	5,	//	Kelly Moore 5%
	15,	//	Kelly Moore 15%
	15,	//	??
	0,	//	Jonathan  no Discount
	5,	//	Jonathan 5% Discount
	10,	//	Jonathan 10% Discount
	15,	//	Jonathan 15% Discount
	10,  // E. Rock 09
	15,	// December 09 15%
	10

);
var coupval = "(blanket)"; // what user entered as coupon code

function ChkCoup () {      // check user coupon entry
//alert(coupval + ' yay!');
if(coupval != '') {
	var i;
	  discnt = 0;              // assume the worst
	  for (i=0; i<coupons.length; i++) {
		if (coupval.toUpperCase() == coupons[i].toUpperCase()) {
		  discnt = coupdc[i];  // remember the discount amt
		  //alert(discnt);
		  //alert ("Valid coupon number! \n\n" + discnt + 
		  //       "% discount now in effect.");
		  return;
		}
	  }
	  alert ("'" + coupval + "'  is not a valid code!");
	}
}

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) {  // apply the discount
//alert('1 - Discount ' + discnt);
//alert(obj1.baseamt.value + 'here');
//alert(obj1.basedes.value);
//alert('2 - Discount ' + discnt);
var amt,des;
  amt = obj1.baseamt.value*1.0;       // base amount
  des = obj1.basedes.value;           // base description
//alert('2 - Discount ' + discnt);
  if (discnt > 0) {                   // only if discount is active
  //alert('yup');
    amt = Dollar (amt - (amt * discnt/100.0));
    des = des + ", " + discnt + "% dis, COUP = " + coupval;
  }
  else {
	des = des + ", COUPON = " + coupval;
  }

  obj1.amount.value = Dollar (amt);
  obj1.item_name.value = des;
}
//-->