
/*########################################################*/
/*-------------- tab groups --------------------*/
/*
 * generic handler for HTML selects that allows user to select between N content blocks (e.g., contact us form selection)
 * 
 * usage:
 * -each option in the select must have a value that matches a class name on the content block to be shown when that option is selected.
 * -e.g., to show a div with class "some-content", the option would look like this:
 * 		<option value="some-content">[text label has no bearing on functionality]</option>
 */
(function($)
{
    $.fn.initContentSelect = function()
    {
		$("select.content-select").change(setSelectedContent);

		function setSelectedContent() {
    		var $elem = $(this);
			$elem.find('option').each(
				function() {
					if (this.value != '') {
						$('.' + this.value).addClass('ektron-ui-hidden');
					}
				}
			);
			if ($elem.val() != '') {
				$('.' + $elem.val()).removeClass('ektron-ui-hidden');
			}

			return false;
		};
    }
})(jQuery);

$(document).ready(function () {
	$.fn.initContentSelect();
});
