function reportPrice(price,mp)
{
		//cycle through all form elements, drop the selected values into an array (currSelected)
		var frm = document.productForm;
		var currSelected = new Array();
		for(var i = 0; i < frm.elements.length; i++)
		{
			var e = frm.elements[i];
			if(e.type != 'select-one' || e.name == "product_quantity") break;
			currSelected[i] = e.options[e.selectedIndex].value;
		}
		var combo_price = 0.0;
		
		// now cycle through the option value array, 
		// for each value, cycle through the selected values and look for a match. 
		// If there's a match, update price. 
		for(var j = 0; j < opv_id.length; j++)
		{
			for(var i = 0; i < currSelected.length; i++)
			{
				if (opv_id[j] == currSelected[i])
				{
						//alert(' option_id ' + currSelected[i] + ' = ' + opv_price[j])
						combo_price += opv_price[j];
				}
			}
		}
	
		//alert('combo price = ' + combo_price);
		var output = '';
		if (combo_price > 0) {
			//output = "Selected option(s) add " + formatCurrency(combo_price) + " to the price";
			output = 'Selected option(s) changes the price';
			show('price_delta');
		}
		if (combo_price < 0) {
			//output = "Selected option(s) reduce the price by " + formatCurrency(combo_price);
			output = 'Selected option(s) changes the price';
			show('price_delta');
		}
		if (combo_price == 0)
		{
			hide('price_delta'); 
		}
		
		//to simply change the visible price, do this: 
		document.getElementById('price').innerHTML = formatCurrency(price + combo_price);
		
		//some products have no member price
		if (null != document.getElementById('member_price'))
		{
			//lower combo_price by 10%
			combo_price = toNearestNickel(combo_price - (combo_price * .10));
			document.getElementById('member_price').innerHTML = formatCurrency(mp + parseFloat(combo_price));
		}
		//to output a message with new price change do this: 
		document.getElementById('price_delta').innerHTML = output;
}
		
function formatCurrency(num){
	num = (parseFloat(num)).toFixed(2);
	return (num);
}

function hide(div)
{
	document.getElementById(div).style.display = 'none';
}
function show(div)
{
	document.getElementById(div).style.display = 'block';
}


function toNearestNickel(num)
{
	num = new String(num); 
	
	//find decimal, then grab 2nd num after decimal
	var decPos = num.indexOf("."); 
	var digit = num.substr(decPos + 2,1); 
	var cutNum = num.substr(0,decPos + 2);

	var to_zero = [0,1,2,8,9]; 
	var to_five = [3,4,5,6,7];

	for(i=0; i < to_zero.length; i++){
		if (digit == to_zero[i])
		{
			num = Math.round(num*10)/10; 
		}
	}
	for(i=0; i < to_five.length; i++){
		if (digit == to_five[i])
		{
			num = cutNum + '5'; 
		}
	}
	return num; 	
}
