var kcal=0;
var sitem="";
var heat="";
var total="";
var s_item=0;
function add_count(s_item){
	kcal = kcal + parseInt(s_item);
	return kcal;
}
function delete_item(form){
	sitem=(form.selected_display.options[form.selected_display.selectedIndex].innerHTML);
    heat=(form.selected_display.options[form.selected_display.selectedIndex].value);
	if (form.selected_display.selectedIndex != 0)
	{
		form.cal_volume.value = delete_count(heat);
		form.selected_display.options[form.selected_display.selectedIndex]=null;
	}
}
function delete_count(s_item){
	kcal = kcal - parseInt(s_item);
	return kcal;
}
function cal_volume1(form){
	sitem=(form.kcal_item1.options[form.kcal_item1.selectedIndex].innerHTML);
	heat=(form.kcal_item1.options[form.kcal_item1.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length]=food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item1.selectedIndex=0;
}
function cal_volume2(form){
	sitem=(form.kcal_item2.options[form.kcal_item2.selectedIndex].innerHTML);
	heat=(form.kcal_item2.options[form.kcal_item2.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length]=food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item2.selectedIndex=0;
}
function cal_volume3(form){
	sitem=(form.kcal_item3.options[form.kcal_item3.selectedIndex].innerHTML);
	heat=(form.kcal_item3.options[form.kcal_item3.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length]=food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item3.selectedIndex=0;
}
function cal_volume4(form){
	sitem=(form.kcal_item4.options[form.kcal_item4.selectedIndex].innerHTML);
	heat=(form.kcal_item4.options[form.kcal_item4.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length]=food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item4.selectedIndex=0;
}
function cal_volume5(form){
	sitem = (form.kcal_item5.options[form.kcal_item5.selectedIndex].innerHTML);
	heat=(form.kcal_item5.options[form.kcal_item5.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length] = food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item5.selectedIndex=0;
}
function cal_volume6(form){
	sitem = (form.kcal_item6.options[form.kcal_item6.selectedIndex].innerHTML);
	heat=(form.kcal_item6.options[form.kcal_item6.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length] = food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item6.selectedIndex=0;
}
function cal_volume7(form){
	sitem = (form.kcal_item7.options[form.kcal_item7.selectedIndex].innerHTML);
	heat=(form.kcal_item7.options[form.kcal_item7.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length] = food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item7.selectedIndex=0;
}
function cal_volume8(form){
	sitem = (form.kcal_item8.options[form.kcal_item8.selectedIndex].innerHTML);
	heat=(form.kcal_item8.options[form.kcal_item8.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length] = food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item8.selectedIndex=0;
}
function cal_volume9(form){
	sitem = (form.kcal_item9.options[form.kcal_item9.selectedIndex].innerHTML);
	heat=(form.kcal_item9.options[form.kcal_item9.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length] = food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item9.selectedIndex=0;
}
function cal_volume10(form){
	sitem = (form.kcal_item10.options[form.kcal_item10.selectedIndex].innerHTML);
	heat=(form.kcal_item10.options[form.kcal_item10.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length] = food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item10.selectedIndex=0;
}
function cal_volume11(form){
	sitem = (form.kcal_item11.options[form.kcal_item11.selectedIndex].innerHTML);
	heat=(form.kcal_item11.options[form.kcal_item11.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length] = food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item11.selectedIndex=0;
}
function cal_volume12(form){
	sitem = (form.kcal_item12.options[form.kcal_item12.selectedIndex].innerHTML);
	heat=(form.kcal_item12.options[form.kcal_item12.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length] = food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item12.selectedIndex=0;
}
function cal_volume13(form){
	sitem = (form.kcal_item13.options[form.kcal_item13.selectedIndex].innerHTML);
	heat=(form.kcal_item13.options[form.kcal_item13.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length] = food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item13.selectedIndex=0;
}
function cal_volume14(form){
	sitem = (form.kcal_item14.options[form.kcal_item14.selectedIndex].innerHTML);
	heat=(form.kcal_item14.options[form.kcal_item14.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length] = food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item14.selectedIndex=0;
}
function cal_volume15(form){
	sitem = (form.kcal_item15.options[form.kcal_item15.selectedIndex].innerHTML);
	heat=(form.kcal_item15.options[form.kcal_item15.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length] = food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item15.selectedIndex=0;
}
function cal_volume16(form){
	sitem = (form.kcal_item16.options[form.kcal_item16.selectedIndex].innerHTML);
	heat=(form.kcal_item16.options[form.kcal_item16.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length] = food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item16.selectedIndex=0;
}
function cal_volume17(form){
	sitem = (form.kcal_item17.options[form.kcal_item17.selectedIndex].innerHTML);
	heat=(form.kcal_item17.options[form.kcal_item17.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length] = food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item17.selectedIndex=0;
}
function cal_volume18(form){
	sitem = (form.kcal_item18.options[form.kcal_item18.selectedIndex].innerHTML);
	heat=(form.kcal_item18.options[form.kcal_item18.selectedIndex].value);
	food = new Option(sitem,sitem);
	form.selected_display.options[form.selected_display.length] = food;
	form.cal_volume.value = add_count(heat);
	form.kcal_item18.selectedIndex=0;
}

function starting_yy(){
      xajax_calorie(document.getElementById('cal_volume').value);
}
function resetall(){
    //this_form.selected_display.options[form.selected_display.Index]="";
    document.getElementById('this_form').selected_display.innerHTML='';
    document.getElementById('this_form').cal_volume.value = "0";
}
