function calculate() {
var total = 0;
var shipping = 0;
var shopping_string = "";
var standardprice = 439;
var alertprice = 489;
var rechargeprice = 539;
var onlineprice = 619;
var leatherprice = 19
var shippingtotal = 0;

var standard=document.getElementById('standard').value;
var gsalert=document.getElementById('gsalert').value;
var recharge=document.getElementById('recharge').value;
var online=document.getElementById('online').value;
var shipping=document.getElementById('shipping').value;
var leather=document.getElementById('leather').value;
var totalunits = (parseInt(standard) + parseInt(gsalert) + parseInt(online) + parseInt(recharge));

if (shipping == "0"){
	if (totalunits == 1){
	    shippingtotal = 18;	
	} else if (totalunits > 1){
	    shippingtotal = (18 + ((totalunits - 1)*5));	
	}
} else {
	if (totalunits == 1){
	    shippingtotal = 59;	
	} else if (totalunits > 1){
	    shippingtotal = (59 + ((totalunits - 1)*15));	
	}
}
if (totalunits == 0 && leather != 0 && shipping == 1) {
	if (leather == 1){
	    shippingtotal = 20;	
	} else if (leather == 2){
	    shippingtotal = (20 + ((leather - 1)*12));	
	} else if (leather > 2){
	    shippingtotal = (34 + ((leather - 2)*2));	
	}
}

var standardtotal = standard*standardprice;
var gsalerttotal = gsalert*alertprice;
var rechargetotal = recharge*rechargeprice;
var onlinetotal = online*onlineprice;
var leathertotal = leather*leatherprice;

var price = (standardtotal + gsalerttotal + rechargetotal + onlinetotal + leathertotal + shippingtotal);

document.myform.price.value = price;
document.getElementById('font-size-large').innerHTML = "$" + price;
if (price == "0") {
	document.getElementById('shopping-text').innerHTML = "There is nothing in the shopping cart";
} else {
	if (standard != "0") {
		shopping_string = shopping_string + standard + " Gamma-Scout Standard [$" + standardtotal + "]<br/>";
	}
	if (gsalert != "0") {
		shopping_string = shopping_string + gsalert + " Gamma-Scout Alert [$" + gsalerttotal + "]<br/>"
	}
	if (recharge != "0") {
		shopping_string = shopping_string + recharge + " Gamma-Scout Rechargeable [$" + rechargetotal + "]<br/>";
	}
	if (online != "0") {
		shopping_string = shopping_string + online + " Gamma-Scout Online [$" + onlinetotal + "]<br/>";
	}
	if (leather != "0") {
		shopping_string = shopping_string +  leather + " Gamma-Scout Leather Case [$" + leathertotal + "]<br/>";
	}
	if (shipping == "0") {
		shopping_string = shopping_string + "US Domestic Shipping [$" + shippingtotal + "]</br>";
	} else {
		shopping_string = shopping_string + "International Shipping [$" + shippingtotal + "]</br>";
	}
    if (leather == "0" && totalunits != "0") {
		shopping_string = shopping_string + "<div class=\"small mt5\">Don't forget to get a leather case as well</div>";
	}
	document.getElementById('shopping-text').innerHTML = shopping_string;
}

}


