rem: function move_combo_selection(element, move_up) { 
add: function move_combo_selection(element, move_up) { 
context: function move_combo_selection(element, move_up) {	switch (element.type) {		case "select-one" :			if (element.selectedIndex >= 0) {				if (move_up) {					// can only move up if we ain't the first element					if (element.selectedIndex > 0) {						var i = element.selectedIndex;						var tmp1 = new Option(element.options[i - 1].text, element.options[i - 1].value);						tmp1.selected = element.options[i - 1].selected;						var tmp2 = new Option(element.options[i].text, element.options[i].value);						tmp2.selected = element.options[i].selected;						element.options[i - 1] = tmp2						element.options[i]     = tmp1;					}// end if not first element				// else moving down				} else {					// can only move down if we ain't the last element					if (element.selectedIndex < (element.options.length - 1)) {						var i = element.selectedIndex;						var tmp1 = new Option(element.options[i + 1].text, element.options[i + 1].value);						tmp1.selected = element.options[i + 1].selected;						var tmp2 = new Option(element.options[i].text, element.options[i].value);						tmp2.selected = element.options[i].selected;						element.options[i + 1] = tmp2						element.options[i]     = tmp1;					}// end if not last element				}// end if move_up			}// end if selected index		break;				case "select-multiple" :			if (move_up) {				for(var i = 0; i < element.options.length; i++) {					if (!element.options[i].selected) continue;					// can only move up if we ain't the first element					// and the element above it isn't selected					if (i > 0 && !element.options[i - 1].selected) {						var tmp1 = new Option(element.options[i - 1].text, element.options[i - 1].value);						tmp1.selected = element.options[i - 1].selected;						var tmp2 = new Option(element.options[i].text, element.options[i].value);						tmp2.selected = element.options[i].selected;						element.options[i - 1] = tmp2						element.options[i]     = tmp1;					}				}// end for			// else moving down			} else {				for(var i = element.options.length - 1; i > -1; i--) {					if (!element.options[i].selected) continue;					// can only move down if we ain't the last element					// and the element above isn't selected					if (i < (element.options.length - 1) && !element.options[i + 1].selected) {						var tmp1 = new Option(element.options[i + 1].text, element.options[i + 1].value);						tmp1.selected = element.options[i + 1].selected;						var tmp2 = new Option(element.options[i].text, element.options[i].value);						tmp2.selected = element.options[i].selected;						element.options[i + 1] = tmp2						element.options[i]     = tmp1;					}//end if				}// end for			}// end if move_up		break;		default:			alert('Element "' + element.name + '" is not a combo box');	}// end switch}// end move_combo_selection()
meta: 5635	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5635/740ce646ffda6c89fb5de463d9dbafb8ed1d7b06/html_form.js/clean/core/lib/html_form/html_form.js