On my order page for hosting, I want to have the price automatically update when the package is changed from a selection box. Also, the packages need to come in 4 lengths. Monthly, Quarterly, Semi-Annually, and Annually.

Here is where I set all the package variables in PHP:

PHP Code:
$price['yocto'] = .15;
$price['zepto'] = .30;
$price['atto'] = .5;
$price['femto'] = .75;
$price['pico'] = .98;
$price['nano'] = 1.25;
$price['mega'] = 1.87;
$price['giga'] = 2.50;
$price['tera'] = 7;
$price['peta'] = 10;
$price['exa'] = 15;
$price['zetta'] = 18;
$price['yotta'] = 20;
$price['neoncubed'] = 25
This is all that I have come up with for updatePrice()

Code:
function updatePrice() 
{ 
	var yocto = <?php echo $price['yocto'] ?>; 
	var zepto = <?php echo $price['zepto'] ?>; 
	var atto = <?php echo $price['atto'] ?>; 
	var femto = <?php echo $price['femto'] ?>; 
	var pico = <?php echo $price['pico'] ?>; 
	var nano = <?php echo $price['nano'] ?>; 
	var mega = <?php echo $price['mega'] ?>; 
	var giga = <?php echo $price['giga'] ?>; 
	var tera = <?php echo $price['tera'] ?>; 
	var peta = <?php echo $price['peta'] ?>; 
	var exa = <?php echo $price['exa'] ?>; 
	var zetta = <?php echo $price['zetta'] ?>; 
	var yotta = <?php echo $price['yotta'] ?>; 
	var neoncubed = <?php echo $price['neoncubed'] ?>; 
}
So I've got the variables from PHP to JS. The price appears in a little text box. How do I make the price change when the package and contract length change?

Oh, by the way