function calculate(){
	var productListUL = document.getElementById("product-list");
	var productListLI = productListUL.getElementsByTagName("li");
	var totalPrice = 0;
	var description = "";

	for(i=0; i<productListLI.length; i++){
		productQuantity = productListLI[i].getElementsByTagName("input");
		productPriceRaw = productListLI[i].getElementsByTagName("span");
		
		if(productQuantity[0]!=null){
			if(productQuantity[0].value > 0){
				// Takes the price from the page and takes out the dollar sign and space 
				productPrice = (productPriceRaw[0].innerHTML).replace(/\$|^\s*/g,'');
				price = productQuantity[0].value * productPrice;
				totalPrice+=price;
				
				description+=productQuantity[0].value + " " + productQuantity[0].getAttribute("name") + " @ $" + productPrice + "ea. // ";
			}
		}
	}
	document.getElementById("total").innerHTML = "$" + totalPrice;	
	document.getElementById("DESCRIPTION").value = description;
	document.getElementById("AMOUNT").value = totalPrice;
}

function formSwitcher(type){
	
	var subscriptionPrice = document.getElementById("SubscriptionLI").getElementsByTagName("span")[0];
	var fullBackissuesPrice = document.getElementById("FullBackissuesLI").getElementsByTagName("span")[0];

	if(type == "individual"){
		subscriptionPrice.innerHTML = "$55";
		fullBackissuesPrice.innerHTML = "$750";
	}
	
	if(type == "institutional"){
		subscriptionPrice.innerHTML = "$80";
		fullBackissuesPrice.innerHTML = "$1040";
	}
	
	calculate();
	
}