//This function is called onChange of selection on the select menu.
//It firstly sets the amount value to the same value as the
//current selected item value.
//It then concatenates the innerHTML text from the
//current selected option onto the itemname.value.
//It also performs a check to see if the function has been
//called, if so, the innerHTML from the previous current selected
//option is removed
function calc(ppForm) {
	
	//Get the selected option
	var option_price = ppForm.os0.options[ppForm.os0.selectedIndex];

	//Get the <input name="amount"
	var amount = ppForm.amount;

	//Set amount value to the selected option value
	amount.value = option_price.value;

	//Get item_name
	var itemname = ppForm.item_name;

	//Get selected option innerHTML
	var selected_option = ppForm.os0.options[ppForm.os0.selectedIndex].innerHTML;
  
	//loop through options in select menu
	for (i=0; i <= ppForm.os0.options.length - 1; i++) {
		
		//Check if the function has been called already by checking if
		//the options innerHTML has been concatenated onto the itemname
		//value
		if (itemname.value.indexOf(ppForm.os0.options[i].innerHTML) > -1) {
			
			//We matched the innerHTML in the itemname value.
			//Get the length we need to chop off for the substr
			var chop = parseInt(itemname.value.length - ppForm.os0.options[i].innerHTML.length); 
			
			//Remove the innerHTML form the previous function call
			//by substringing it
			itemname.value = itemname.value.substr(0, chop);
					
		}
		
	}
	
	//Concatenate the selected option innerHTML onto the itemname value
	itemname.value += ' ' + ppForm.os0.options[ppForm.os0.selectedIndex].innerHTML;


}
