
<!--
var discnt = 0; // no default percent discount
var coupons = new Array ( // place to put coupon codes
"SAFEPUP", // 1st coupon value - comma seperated
"safepup", // 2nd coupon value - add all you want
"Safepup" // 3rd coupon value
);
var coupdc = new Array ( // place to put discounts for coupon vals
15,
15,
15
);
var coupval = "(blanket)"; // what user entered as coupon code
function ChkCoup () { // check user coupon entry
var i;
discnt = 0; // assume the worst
for (i=0; i<coupons.length; i++) {
if (coupval == coupons[i]) {
discnt = coupdc[i]; // remember the discount amt
alert ("You have entered a valid Code! \n\n" + discnt +
"% discount with be applied to your basket.");
return;
}
}
alert ("Sorry, '" + coupval + "' is not a valid discount Code!");
}
function pound (val) { // force to valid pound 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 and include text fields
var amt,des;
amt = obj1.baseamt.value*1.0; // base amount
des = obj1.basedes.value; // base description
 

if(document.bumperform.os0.selectedIndex==2)
{
 amt = 25.95;
 } 







 
if (discnt > 0) { // only if discount is active and include text fields
amt = pound (amt - (amt * discnt/100.0));
des = des + ", " + discnt + "% discount = " + coupval;
 
}
obj1.amount.value = pound (amt);
obj1.item_name.value = des;
}
//-->
