function postageCalc() {
var via = ""
for (i=0; i<mainform.shippingvia.length; i++) { if (mainform.shippingvia[i].checked) { via = mainform.shippingvia[i].value } }
if (!via.length) { alert('Please select the type of shipping') ; return(0) }
var postBand = eval("postBand" + via)
var post = eval("post" + via)
var weight = boxWeight
	weight += mainform.squiglenum.value * squigleWeight
	weight += mainform.toothbuildernum.value * toothbuilderWeight
	weight += mainform.gengigelnum.value * gengigelWeight
	weight += mainform.gengigelrinsenum.value * gengigelrinseWeight
	weight += mainform.lysinenum.value * lysineWeight
	weight += mainform.oralbnum.value * oralbWeight
	weight += mainform.curasept220num.value * curasept220Weight
	weight += mainform.cankermeltsnum.value * cankermeltsWeight
	weight += mainform.curaseptgelnum.value * curaseptgelWeight
	weight += mainform.ulcereasenum.value * ulcereaseWeight
	weight += mainform.cankercovernum.value * cankercoverWeight
	weight += mainform.coldsticknum.value * coldstickWeight
	weight += mainform.superlysine90num.value * superlysine90Weight
	weight += mainform.superlysine180num.value * superlysine180Weight
	weight += mainform.xylimeltsnum.value * xylimeltsWeight
	weight += mainform.xyligumnum.value * xyligumWeight
	weight += mainform.periobalancenum.value * periobalanceWeight
	weight += mainform.curasept205num.value * curasept205Weight
	weight += mainform.avaminmeltsnum.value * avaminmeltsWeight
	weight += mainform.hybenxnum.value * hybenxWeight
	weight += mainform.mirrornum.value * mirrorWeight

	if (weight>postBand[postBand.length-1]) { return(-1) }
	if (weight>boxWeight) {
		for ( n=0 ; n<postBand.length ; n++ ) {
			if ( weight < postBand[n]) { break }
		}
		var postageprice = post[n]
		var packaging = boxUKP + labelUKP 
		var handling = (15/100) * (postageprice+packaging)
		return( postageprice + packaging + handling )
	}
	else { return(0) }
}

function infoButn(product) {
	for (n=0; n<brandnames.length; n++) {
		if (product==brandnames[n]) {
			var productInfo = eval(product+"Info")
			var productInfoButn = eval(product+"InfoButn")
			if (productInfo.style.display=="none") { productInfo.style.display="inline" ; productInfoButn.innerHTML="Hide" }
			else { productInfo.style.display="none" ; productInfoButn.innerHTML="Show" }
		}
		else {
			eval(brandnames[n]+"Info").style.display="none"
			eval(brandnames[n]+"InfoButn").innerHTML="Show"
		}	
	}
}

function hideInfo() {
	for (n=0; n<brandnames.length; n++) {
		eval(brandnames[n]+"Info").style.display="none"
		eval(brandnames[n]+"InfoButn").innerHTML="Show"
	}	
}

function valNum(that) {
	hideInfo()
	re = /\D/
	if (re.test(that.value)||!that.value||that.value==0) { that.value = "" }
	//if (that.value>23) { that.value = "24" ; alert('For bulk orders, please give me a call') }
}

function saveChoice() {
	expireDate = new Date
	expireDate.setDate(expireDate.getDate()+7)
	var selectionSTR = ""
	for (n=0; n<productnames.length; n++) {
		thisnum = eval("mainform."+productnames[n]+"num.value")
		if (thisnum>9) { selectionSTR += thisnum }
		else if (thisnum>0) { selectionSTR += "0"+thisnum }
		else { selectionSTR += "00" }
	}
	var via = ""
	for (i=0; i<mainform.shippingvia.length; i++) { if (mainform.shippingvia[i].checked) { via = mainform.shippingvia[i].value } }
	document.cookie = ( "MouthUlcersShop=" + via + selectionSTR + "; expires=" + expireDate.toGMTString() )
	document.mainform.oldCookie.value = ( "MouthUlcersShop=" + via + selectionSTR + "; expires=" + expireDate.toGMTString() )
}

function loseChoice() {
	expireDate = new Date
	expireDate.setDate(expireDate.getDate()-1)		
	document.cookie = ( "MouthUlcersShop=''; expires=" + expireDate.toGMTString() )
}