<!--	// hiding

//temp storage for calculated values if changed
var tmp_subtotal = "$34.95";
var tmp_ship = "$1.00";
var tmp_total = "$35.95";

//format a decimal number to 2 digits and convert to string
function fix(num){
	num = num + 0.005		//round the last digit
	string = "" + num;
	if(string.indexOf('.',0) == -1){
		return string + '.00';
	}
	separation = string.length - string.indexOf('.',0);
	if (separation > 3){
		return string.substring(0,string.length - separation + 3);
	} else if (separation == 2){
		return string + '0';
	}
	return string;
}

//calculate subtotal
function setsubtotal(){
	setship();							//reset shipping based on new quantity
	var quan = document.checkout.Quantity.value;
	var quan_num = parseInt(quan);
	var subtot = quan * 34.95;
	document.checkout.SubTotal.value = "$" + fix(subtot);
	tmp_subtotal = "$" + subtot;
	//recalculate total
	var ratenum = document.checkout.Ship_Rate.value;
	ratenum = ratenum.substring(1,ratenum.length);
	var newnum = parseFloat(ratenum);
	var newtot = subtot + newnum;
	document.checkout.Total.value = "$" + fix(newtot);
	tmp_total = "$" + fix(newtot);
	document.paypal.quantity.value = document.checkout.Quantity.value;
}

//calculate shipping based on selection
function setship(){
	var shipnum = 0;
	if (document.checkout.Shipping[0].checked) {					//US Mail
		shipnum = 1.0 * eval(document.checkout.Quantity.value);
		document.paypal.shipping.value = 1.00;
		document.paypal.shipping2.value = 1.00;
	} else if (document.checkout.Shipping[2].checked) {			//Canada/Mexico Mail
		shipnum = 1.5 * eval(document.checkout.Quantity.value);
		document.paypal.shipping.value = 1.50;
		document.paypal.shipping2.value = 1.50;
	} else if (document.checkout.Shipping[4].checked) {			//Int. Mail
		shipnum = 3.4 * eval(document.checkout.Quantity.value);
		document.paypal.shipping.value = 3.40;
		document.paypal.shipping2.value = 3.40;
	} else if (document.checkout.Shipping[1].checked) {						//US Priority
		shipnum = 3.20 * eval(document.checkout.Quantity.value);
		document.paypal.shipping.value = 3.20;
		document.paypal.shipping2.value = 3.20;
	} else if (document.checkout.Shipping[3].checked) {
		shipnum = 8.00 * eval(document.checkout.Quantity.value);
		document.paypal.shipping.value = 8.00;
		document.paypal.shipping2.value = 8.00;
	} else if (document.checkout.Shipping[5].checked) {
		shipnum = 10.00 * eval(document.checkout.Quantity.value);
		document.paypal.shipping.value = 10.00;
		document.paypal.shipping2.value = 10.00;
	}
	var newnum = "$" + fix(shipnum);
	document.checkout.Ship_Rate.value = newnum;
	tmp_ship = newnum;
	//recalculate total
	var ratenum = document.checkout.Ship_Rate.value;
	ratenum = ratenum.substring(1,ratenum.length);
	var subnum = document.checkout.SubTotal.value;
	subnum = subnum.substring(1,subnum.length);
	var newsub = parseFloat(subnum);
	var newrate = parseFloat(ratenum);
	var newtot = newrate + newsub;
	document.checkout.Total.value = "$" + fix(newtot);
	tmp_total = "$" + fix(newtot);
}

//reset subtotal if somebody tries to change it
function reset_sub(){
	document.checkout.SubTotal.value = tmp_subtotal;
}

//reset shipping if somebody tries to change it
function reset_ship(){
	document.checkout.Ship_Rate.value = tmp_ship;
}

//reset total if somebody tries to change it
function reset_total(){
	document.checkout.Total.value = tmp_total;
}

// end mask -->