function googleSearch(){
	if($('#search').val() == ''){
		alert('Please enter text to search for.');
		return false
	} else {
		return true
	}
}

$(function(){
	//// Toggle log in menu
	$('#blogin').click(function(){
		$('#loginstrip').slideToggle('fast');
		if($('#arrow').hasClass('arrowup')){
			$('#arrow').removeClass('arrowup');
		} else {
			$('#arrow').addClass('arrowup');
		}
		return false;
	});
	
	//// Navigation
	$('ul.sf-menu').supersubs({ 
			minWidth:    12,   // minimum width of sub-menus in em units 
			maxWidth:    27,   // maximum width of sub-menus in em units 
			extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
							   // due to slight rounding differences and font-family 
		}).superfish({
		animation: {height:'show'},
		autoArrows: false,
		speed: 'fast',
		delay: 200,
		dropShadows: false
	});
	
	
	//// Show over state of links for dropdowns. Delay removal of class to match menu hide delay.
	var menuTimer;
	
	$('a.sub').mouseover(function(){
		clearTimeout(menuTimer);
		$(this).parent().parent().parent().children('.nav').addClass('subhover');
	}).mouseout(function(){
		menuTimer = setTimeout("$('.subhover').removeClass('subhover')",200);
	});
	
	//// Overlay
	$("a[rel]").overlay({
 
		mask: '#000000',
 
		onBeforeLoad: function() {
 
			// grab wrapper element inside content
			var wrap = this.getOverlay().find(".contentWrap");
 			wrap.html('<div class="loading" align="center" style="padding:5px;"><img src="images/ajax-loader.gif" alt="" width="24" height="24" style="vertical-align:middle; margin-right:3px" /> Loading...</div>');
			// load the page specified in the trigger
			wrap.load(this.getTrigger().attr("href")+'?popup=true');
		}
 
	});

});

