var menu_on = "#eeeeff";
var menu_off = "#eeeeee";

function attach_menu_rollovers()
{
	var tds = document.getElementsByTagName("td");
	e = 0;
	while (tds[e]) {		
		if (tds[e].className == "mi") {			
			tds[e].onmouseover = new Function(mouseon());
			tds[e].onmouseout = new Function(mouseoff());
			if (tds[e].firstChild.click) {
				tds[e].onclick = new Function("this.firstChild.click()");
			}
		}	
		e ++;
	}
}

function mouseon()
{
	cmd = new Array();
	cmd[0] = "this.style.backgroundColor = '" + menu_on + "'";
	cmd[1] = "this.style.cursor = 'pointer'";
	return cmd.join(";");
}

function mouseoff()
{
	cmd = new Array();
	cmd[0] = "this.style.backgroundColor = '" + menu_off + "'";
	//cmd[1] = "this.style.cursor = 'pointer'";
	return cmd.join(";");
}

function setup()
{
	attach_menu_rollovers();
}

function update_price(id)
{
	var f = document.forms['frmCheckout'];
	price = (f.elements['quantity[' + id + ']'].value * f.elements['price[' + id + ']'].value);
	document.getElementById("total[" + id + "]").innerHTML = price + ".00";
	update_totals();
}

function update_totals()
{
	var f = document.forms['frmCheckout'];
	count = total = 0;
	while (f.elements['quantity[' + count + ']']) {
		total += (f.elements['quantity[' + count + ']'].value * f.elements['price[' + count + ']'].value);
		count ++;
	};
	document.getElementById("uber_total").innerHTML = total + ".00";
}

window.onload = setup;