function display (category) {
	var whichcategory = document.getElementById(category);
	if (whichcategory.className=="show") {
		whichcategory.className="hide";
	} else {
		whichcategory.className="show";
	}
}
var currentPrices = new Hash();
function updatePrices(fieldName, val) {
	var selectedItem = productOptions.get('priceDeltas').get(fieldName).get(val);
	var valValue = parseInt(val);
	var options = productOptions.get('priceDeltas').get(fieldName);
	options.each(
		function(n) {
			var useValue = "";
			var itemValue = parseInt(n.value.get('num'));
			if (itemValue < valValue) {
				useValue = '[Subtract $' + (selectedItem.get('price') - n.value.get('price')) + ']';
			} else if (itemValue == valValue) {
				useValue = "[Included]";
				$(fieldName + "_" + val).checked = true;
			} else {
				useValue = "[Add $" + (n.value.get('price') - selectedItem.get('price')) + "]";
			}
			var elem = $(n.value.get('id'));
			elem.innerHTML = useValue;
		}
	)
	if ($('specs_' + fieldName + '_amount'))
		$('specs_' + fieldName + '_amount').update(selectedItem.get('amount'));
	currentPrices.set(fieldName, parseInt(selectedItem.get('price')));
	updateTotals();
}
function updateTotals() {
	var total = 0;
	currentPrices.each(
		function(n) {
			total += parseInt(currentPrices.get(n.key));
		}
	);
	var grandTotal = parseInt(productOptions.get('basePrice')) + parseInt(total);
	$('monthly_price').update(grandTotal + ".00");
	$('quarterly_price').update((grandTotal * 3) + ".00");
	$('biannual_price').update((grandTotal * 6) + ".00");
	$('annual_price').update((grandTotal * 12) + ".00");
	document.forms.cart1.price.value = grandTotal;
}
function adjustDolphiniView(val) {
	updatePrices('dolphini_view', val);
}
function adjustHandsOnDemand(val) {
	updatePrices('hands_on_demand', val);
}
function adjustBandwidth(val) {
	updatePrices('bandwidth', val);
}
function adjustCat5(val) {
	updatePrices('additional_cat5', val);
}
function adjustIpAddresses(val) {
	updatePrices('ip_addresses', val);
}
function adjustSwitch(val) {
	updatePrices('switch', val);
}
function adjustFirewall(val) {
	updatePrices('firewall', val);
}
function adjustDdos(val) {
	updatePrices('ddos', val);
}
function adjustLoadBalancer(val) {
	updatePrices('load_balancer', val);
}
function adjustAdditionalPower(val) {
	updatePrices('additional_power', val);
}
function onBodyLoad() {
	adjustAdditionalPower(0);
	adjustLoadBalancer(0);
	adjustDdos(0);
	adjustFirewall(0);
	adjustSwitch(0);
	adjustIpAddresses(0);
	adjustCat5(0);
	adjustBandwidth(0);
	adjustHandsOnDemand(0);
	adjustDolphiniView(0);
}
var productOptions = new Hash();
 productOptions.set("basePrice", 850.00);
productOptions.set('priceDeltas', 
	new Hash({
		'switch' : new Hash({
			0 : new Hash({'id' : 'switch_price_0', 'amount' : 'None', 'num' : 0, 'price' : 0.00}),
			1 : new Hash({'id' : 'switch_price_1', 'amount' : '8 Port Switch', 'num' : 1, 'price' : 25.00}),
			2 : new Hash({'id' : 'switch_price_2', 'amount' : '16 Port Switch', 'num' : 2, 'price' : 50.00}),
			3 : new Hash({'id' : 'switch_price_3', 'amount' : '24 Port Switch', 'num' : 3, 'price' : 100.00}),
			4 : new Hash({'id' : 'switch_price_4', 'amount' : '48 Port Switch', 'num' : 4, 'price' : 150.00})
		}),
		'firewall' : new Hash({
			0 : new Hash({'id' : 'firewall_price_0', 'amount' : 'None', 'num' : 0, 'price' : 0.00}),
			1 : new Hash({'id' : 'firewall_price_1', 'amount' : 'VLAN Secure Protection', 'num' : 1, 'price' : 50.00})
		}),
		'ddos' : new Hash({
			0 : new Hash({'id' : 'ddos_price_0', 'amount' : 'None', 'num' : 0, 'price' : 0.00}),
			1 : new Hash({'id' : 'ddos_price_1', 'amount' : 'VLAN DDoS Protection', 'num' : 1, 'price' : 50.00})
		}),
		'load_balancer' : new Hash({
			0 : new Hash({'id' : 'load_balancer_price_0', 'amount' : 'None', 'num' : 0, 'price' : 0.00}),
			1 : new Hash({'id' : 'load_balancer_price_1', 'amount' : 'Advanced Traffic Control', 'num' : 1, 'price' : 450.00})
		}),
		'additional_power' : new Hash({
			0 : new Hash({'id' : 'additional_power_price_0', 'amount' : 'None', 'num' : 0, 'price' : 0.00}),
			1 : new Hash({'id' : 'additional_power_price_1', 'amount' : '1 x 20 AMPS - 21 x 120V &amp; 6 x 208V Ports', 'num' : 1, 'price' : 200.00}),
			2 : new Hash({'id' : 'additional_power_price_2', 'amount' : '2 x 20 AMPS - 21 x 120V &amp; 6 x 208V Ports', 'num' : 2, 'price' : 400.00}),
			3 : new Hash({'id' : 'additional_power_price_3', 'amount' : '3 x 20 AMPS - 21 x 120V &amp; 6 x 208V Ports', 'num' : 3, 'price' : 600.00})
		}),
		'ip_addresses' : new Hash({
			0 : new Hash({'id' : 'ip_addresses_price_0', 'amount' : '1 Block  ( 5 usable)', 'num' : 0, 'price' : 0.00}),
			1 : new Hash({'id' : 'ip_addresses_price_1', 'amount' : '2 Blocks (13 usable)', 'num' : 1, 'price' : 8.00}),
			2 : new Hash({'id' : 'ip_addresses_price_2', 'amount' : '3 Blocks (21 usable)', 'num' : 2, 'price' : 16.00}),
			3 : new Hash({'id' : 'ip_addresses_price_3', 'amount' : '4 Blocks (29 usable)', 'num' : 3, 'price' : 24.00}),
			4 : new Hash({'id' : 'ip_addresses_price_4', 'amount' : '5 Blocks (37 usable)', 'num' : 4, 'price' : 32.00}),
			5 : new Hash({'id' : 'ip_addresses_price_5', 'amount' : '6 Blocks (45 usable)', 'num' : 5, 'price' : 40.00})
		}),
		'additional_cat5' : new Hash({
			0 : new Hash({'id' : 'additional_cat5_price_0', 'amount' : 'None', 'num' : 0, 'price' : 0.00}),
			1 : new Hash({'id' : 'additional_cat5_price_1', 'amount' : '1 Additional Cat5-E Connection', 'num' : 1, 'price' : 25.00}),
			2 : new Hash({'id' : 'additional_cat5_price_2', 'amount' : '2 Additional Cat5-E Connection', 'num' : 2, 'price' : 50.00}),
			3 : new Hash({'id' : 'additional_cat5_price_3', 'amount' : '3 Additional Cat5-E Connection', 'num' : 3, 'price' : 75.00})
		}),
		'bandwidth' : new Hash({
			0 : new Hash({'id' : 'bandwidth_price_0','amount' : '1 Mbps UNMETERED CAPPED','num' : 0,'price' : 0.00}),
			1 : new Hash({'id' : 'bandwidth_price_1','amount' : '2 Mbps UNMETERED CAPPED','num' : 1,'price' : 100.00}),
			2 : new Hash({'id' : 'bandwidth_price_2','amount' : '3 Mbps UNMETERED CAPPED','num' : 2,'price' : 200.00}),
			3 : new Hash({'id' : 'bandwidth_price_3','amount' : '4 Mbps UNMETERED CAPPED','num' : 3,'price' : 300.00}),
			4 : new Hash({'id' : 'bandwidth_price_4','amount' : '5 Mbps UNMETERED CAPPED','num' : 4,'price' : 400.00}),
			5 : new Hash({'id' : 'bandwidth_price_5','amount' : '10 Mbps UNMETERED CAPPED','num' : 5,'price' : 900.00}),
			6 : new Hash({'id' : 'bandwidth_price_6','amount' : '20 Mbps UNMETERED CAPPED','num' : 6,'price' : 1900.00}),
			7 : new Hash({'id' : 'bandwidth_price_7','amount' : '30 Mbps UNMETERED CAPPED','num' : 7,'price' : 2900.00}),
			8 : new Hash({'id' : 'bandwidth_price_8','amount' : '40 Mbps UNMETERED CAPPED','num' : 8,'price' : 3900.00}),
			9 : new Hash({'id' : 'bandwidth_price_9','amount' : '50 Mbps UNMETERED CAPPED','num' : 9,'price' : 4900.00}),
			10 : new Hash({'id' : 'bandwidth_price_10','amount' : '100 Mbps UNMETERED CAPPED','num' : 10,'price' : 9900.00})
		}),
		'dolphini_view' : new Hash({
			0 : new Hash({'id' : 'dolphini_view_price_0', 'amount' : 'None', 'num' : 0, 'price' : 0.00}),
			1 : new Hash({'id' : 'dolphini_view_price_1', 'amount' : '1 Dolphini Network View License', 'num' : 1, 'price' : 50.00})
		}),
		'hands_on_demand' : new Hash({
			0 : new Hash({'id' : 'hands_on_demand_price_0', 'amount' : 'None', 'num' : 0, 'price' : 0.00}),
			1 : new Hash({'id' : 'hands_on_demand_price_1', 'amount' : 'Hourly As Needed - \$75.00 per hour', 'num' : 1, 'price' : 0.00}),
			2 : new Hash({'id' : 'hands_on_demand_price_2', 'amount' : '3 Hours per month', 'num' : 2, 'price' : 225.00}),
			3 : new Hash({'id' : 'hands_on_demand_price_3', 'amount' : '5 Hours per month', 'num' : 3, 'price' : 375.00})
		})
	})
);