function calc(){
if (isNaN(form.quantity.value)|| form.quantity.value<1) {form.quantity.value=1}

price=125
form.amount.value=price
form.amount1.value=price * form.quantity.value

zip = (form.os0.value)

if(zip.length==5 && (zip==eval(zip))){
zip = zip.slice(0,3)


zips = new Array("5", "9", "29", "34", "37", "43", "44", "45", "47", "48", "67", "79", "84", "119", "123", "127", "129", "139", "147", "149", "179", "189", "192", "194", "212", "239", "243", "245", "253", "254", "259", "260", "261", "268", "314", "342", "344", "347", "352", "369", "374", "375", "379", "383", "385", "398", "418", "420", "427", "438", "447", "499", "516", "520", "528", "532", "535", "539", "540", "545", "548", "549", "551", "567", "574", "577", "584", "588", "591", "593", "599", "611", "612", "619", "620", "623", "628", "631", "641", "658", "662", "668", "672", "673", "679", "681", "687", "693", "701", "703", "704", "708", "711", "712", "714", "717", "718", "729", "731", "739", "741", "744", "748", "749", "768", "769", "782", "785", "796", "799", "810", "816", "820", "821", "822", "825", "828", "838", "847", "850", "853", "857", "860", "865", "875", "885", "891", "895", "898", "908", "928", "986", "999")
zones= new Array("3", "7", "2", "1", "2", "1", "2", "1", "2", "1", "2", "3", "4", "3", "2", "3", "2", "3", "4", "3", "4", "3", "4", "3", "4", "4", "5", "4", "5", "4", "5", "4", "5", "4", "5", "6", "6", "6", "6", "6", "5", "6", "5", "6", "5", "6", "5", "6", "5", "5", "4", "5", "6", "5", "6", "5", "5", "5", "6", "5", "6", "5", "6", "6", "6", "7", "6", "7", "8", "7", "8", "5", "6", "5", "6", "6", "5", "6", "6", "6", "6", "6", "7", "6", "7", "6", "6", "7", "7", "7", "6", "7", "7", "6", "7", "6", "7", "6", "7", "7", "6", "6", "7", "6", "7", "8", "7", "8", "7", "8", "7", "8", "7", "8", "7", "8", "7", "8", "8", "8", "8", "8", "8", "8", "8", "8", "8", "8", "8", "8", "8", "8", "8")
prio  = new Array("9.35", "9.35", "11.75", "14.50", "29.90", "34.40", "37.45", "44.90")
parcel= new Array("12.85", "12.85", "15.30", "16.30", "17.05", "17.86", "18.74", "20.46")
i=0
for (z in zips){

	if (eval(zip) <= eval(zips[i])) {
	azone= eval(zones[i])-1
	break
	}
i=i+1
}
ship = form.os1.checked? prio[azone]: parcel[azone]
ship=eval(ship)
ship=ship.toFixed(2)
form.shipping.value= ship
form.shipping2.value=ship
q=eval(form.quantity.value)
q=q.toFixed(2)
form.shipping1.value= ship*q
form.total.value=(price *q + ship*q)
}else
{
form.total.value=price
form.shipping.value= "ZIP"
form.shipping1.value= "ZIP"
form.total.value="ZIP"
}

formatprices()
}


function formatprices(){
form.shipping.value= formatCurrency(form.shipping.value)
form.shipping1.value=formatCurrency(form.shipping1.value)
form.total.value=formatCurrency(form.total.value)
form.amount.value=formatCurrency(form.amount.value)
form.amount1.value=formatCurrency(form.amount1.value)


}

function formatCurrency(num) {
if (isNaN(num) == false){

if (num.indexOf(".")==-1){

num=num+".00";
}else{

num=num+"00"
num=num.substr(0,num.indexOf(".")+3)

};
}
return ( num);
}

function checkzip(){
calc();
if (form.total.value == "ZIP") { 
alert ("Please enter your ZIP code");
return false;
}
else{
return true;
}
}
