//Some useful functions. Added by Joel Hancock 2008-10-27.

/*
*
* This function is for toggling the commercial category in the search form.
* For this to work there will need to be an element with the id `commercial-category-container` in the form. A span will do for this.
*
*/

function toggle_commercial_category(element) {
	var selected_index = element.selectedIndex;
	var selected_value = element[selected_index].innerHTML;
	if (selected_value == 'Industrial' || selected_value == 'Industrial') {
		document.getElementById('commercial-category-container').innerHTML = '<input type="hidden" name="commercialCategory" value="Industrial" />';
	} else {
		document.getElementById('commercial-category-container').innerHTML = '';
	}
}
