<!-- Hide
function round(number,X){X = (!X ? 2 : X);return Math.round(number*Math.pow(10,X))/Math.pow(10,X);}

function dp(price){
   string = "" + price;
   number = string.length - string.indexOf('.');
   if (string.indexOf('.') == -1)
      return string + '.00';
   if (number == 1)
      return string + '00';
   if (number == 2)
      return string + '0';
   if (number > 3)
      return string.substring(0,string.length-number+3);
return string;
}

function calc(name,price){
num = "0";
calcmoney = "document.FORM.T_" +name+ ".value=dp(round(((document.FORM.Q_" +name+ ".value)*("+price+"))-"+num+"))";
evalmoney = eval(calcmoney);if(evalmoney == "NaN.00"){nocalc(name);}else{calcsub();}
calcship();
}


function checkdeals(name,deal){
check = "document.FORM.Q_" +name+ ".value";make=eval(check);
testq= "" + make/deal;return testq;
}

function nocalc(name){
var nocalctotal = "document.FORM.T_" +name+ ".value='0.00'";eval(nocalctotal);
var nocalcquantity = "document.FORM.Q_" +name+ ".value=''";eval(nocalcquantity);
calcsub();
}

function calcsub(){
calcit=MST('SCKF4')+"+"+MST('SCFF8T')+"+"
+MST('SCFF8P')+"+"+MST('SCKF8T')+"+"+MST('SCKF12');
clc = eval(calcit);calced = "document.FORM.SUBTOTAL.value=dp(round("+clc+"))";eval(calced);calctot();
}

function MST(name){addto = "";addto="document.FORM.T_" +name+ ".value";newv = eval(addto);return newv;}
function SST(name,val){make = "";make = "document.FORM.Q_" +name+ ".value";give = eval(make);if(!give){shipval="0"}
else{shipval = give * val;shipval = round(shipval);}return shipval;}

function calcship(){
//oldship="7.00";
//newship=SST('SCKF4','.25')+"+"+SST('SCFF8T','.50')+"+"
//+SST('SCFF8P','.50')+"+"+SST('SCKF8T','.50')+"+"+SST('SCKF12','.75');
newship=7;
oldship=0;
var st = parseFloat(document.FORM.SUBTOTAL.value);
if(st >= 26 && st <= 45){
	newship=8;
}else if(st >= 46 && st <= 70){
	newship=9;
}else if(st > 70){
	newship=10;
}
newship = eval(newship);if(newship > oldship){document.FORM.SHIPPING.value = dp(newship);}else{document.FORM.SHIPPING.value = oldship;}

var isSample=false;
var doSample=true;
var ii = document.FORM.length;
for(i=0;i<ii;i++){
	if(document.FORM[i].name.substring(0,2) == "Q_"){
		if(document.FORM[i].name != "Q_SAMPLE"){
		 	if(document.FORM[i].value > 0){
		 		doSample=false;
		 	 }			
		 }else{
		 	if(document.FORM[i].value > 0){
		 		isSample=true;
		 	 }
		 }
	 }
 }
if(isSample && doSample){
	document.FORM.SHIPPING.value = "1.98";
 }

}

function calctax(tot){
tottot = dp(round(tot * 1.0660));
taxtot = dp(round(tot * .0660));
document.FORM.TOTAL.value = tottot;
document.FORM.TAX.value = taxtot;
}

function calctot(){total = "dp("+document.FORM.SUBTOTAL.value+"+"+document.FORM.SHIPPING.value+");";total = eval(total);
if(document.FORM.STATE.options[document.FORM.STATE.selectedIndex].value == "UT"){calctax(total);}else{document.FORM.TAX.value = "0.00"; document.FORM.TOTAL.value = total;}}

function nocalctot(){alert('Please do not alter the total fields.');document.FORM.FIRSTNAME.focus();}
//-->