function initSearchForm() {
	var UA = navigator.userAgent;
	var safari2Mac = (UA.indexOf('Mac') != -1 && UA.indexOf('Version/') == -1 && UA.indexOf('Safari/') != -1);

	var searchInputs = $$('.searchForm .row1 input');
	searchInputs.each(function(theInput) {
		var l_oCurrentInput = theInput;
		// Re-select correct tab
		var currentLabel = $(l_oCurrentInput.id + 'Label');
		try {
			if (l_oCurrentInput.checked == false) {
				Element.removeClassName(currentLabel, 'labelSelected');
			} else {
				Element.addClassName(currentLabel, 'labelSelected');
			}
		} catch(e) {};

		if (safari2Mac) currentLabel.onclick = clickSearchLabel;
		l_oCurrentInput.onclick = clickSearchRadio;

		Event.observe(currentLabel, 'mouseover', function(eventData) {
			var tabLabel = Event.element(eventData);
			Element.addClassName(tabLabel, 'labelHovered');
		});

		Event.observe(currentLabel, 'mouseout', function(eventData) {
			var tabLabel = Event.element(eventData);
			Element.removeClassName(tabLabel, 'labelHovered');
		});
	});
};

// Needed because Safari 2/Mac doesn't fire the radio's onclick event when the corresponding label is clicked  
function clickSearchLabel() {
	var inputAssociatedWithClickedLabel = $(this.htmlFor);
	if (inputAssociatedWithClickedLabel) inputAssociatedWithClickedLabel.click();
};

// Set all tabs to "unselected", then select the correct one based upon the ID of the radio button that was selected
function clickSearchRadio() {
	var l_pLabels = this.parentNode.getElementsByTagName('label');
	if (l_pLabels.length) {
		for (var loop=0, max=l_pLabels.length; loop<max; loop++) {
			if (l_pLabels[loop].id != this.id + 'Label') {
				Element.removeClassName(l_pLabels[loop], 'labelSelected');
			} else {
				Element.addClassName(l_pLabels[loop], 'labelSelected');
			}
		}
	}
};

moduleManager.registerModuleLoad(initSearchForm);
