
/* Search Submit **/
function sg_searchSubmit() {
	var formObj = document.forms['searchForm'];
	var searchValue = formObj.searchterm.value;

	if (searchValue != '') {
		document.location.href = SG_URL_PREFIX + 'search/' + formObj.searchterm.value;
		return false;
	}
	return false;
}

/* Fancy Table */
function sg_fancyTable() {

	$('table.twocolFancy tr').each(function(i) {

		if (i%2 != 0) $(this).addClass('row-even');

		$(this).hover(
			function() { $(this).addClass('fancy-on'); },
			function() { $(this).removeClass('fancy-on'); }
		);

	});

}

/* Load Events */
$(document).ready(function() {

	// Fancy Tables
	sg_fancyTable();

	// Side Nav Hide Non-active ul's
	$('.sideNav li:not(.active) ul').hide();
	$('.sideNav li.active').each(function() {
		if ($('ul',$(this)).length == 0) {
			$(this).addClass('nochilds');
		}
	});


});