<script type="text/javascript">
	/* 
	 * This example is from the book _Ajax: The Definitive Guide_ by Anthony T. Holdener III.
	 * Written by Anthony T. Holdener III.  Copyright (C) 2008 O'Reilly Media, Inc.
	 * You may study, use, modify, and distribute this example for any purpose.
	 * This example is provided WITHOUT WARRANTY either expressed or implied.
	 */
	//<![CDATA[
	/**
	 * This function, saveDropDownValues, takes the passed /p_dropDownId/ and
	 * gets all <option> elements within the drop down as an /Array/. It then
	 * adds any selected element to the string to be set in the passed
	 * /p_hiddenInputId/.
	 *
	 * @param {String} p_dropDownId The string id of the drop down.
	 * @param {String} p_hiddenInputId The string id of the hidden input that will
	 * 		get the value.
	 * @return Returns false so that no other event is fired after this.
	 * @type Boolean
	 */
	function saveDropDownValues(p_dropDownId, p_hiddenInputId) {
		var value = '';
		/*
		 * Use the id of the drop down to get a list of <option> elements it
		 * contains
		 */
		var options = $(p_dropDownId).getElementsByTagName('option');

		/* Loop through the list of <option> elements */
		for (var i = 0, il = options.length; i < il; i++)
			/* Is this option selected? */
			if (outputs[i].selected)
				/* Should a comma be added? */
				if (value.length > 1) {
					value += ',';
					value += outputs[i].value;
				}
		$(p_hiddenInputId).value = value;
		return (false);
	}
	//]]]>
</script>