/* 
	Rollover linking from and between each mirvac site
	
*/
var hideIntervalID;

function showDashboard () {
	
	$("dashboard").setStyle({
	  display: 'block'
	});
	clearInterval(hideIntervalID);
	
}

function hideDashboard () {
	
	// hidden after a short delay to avoid potential flicker when 'hovering' between logo and the dash
	hideIntervalID = setInterval ( function () { $("dashboard").setStyle({
	  display: 'none'
	}); }, 100 );
	
}

Event.observe(window, 'load', function() {
	
	// hover shows and hides the dash...!
	$("header_logo").observe('mouseover', showDashboard);
	$("dashboard").observe('mouseover', showDashboard);
	$("header_logo").observe('mouseout', hideDashboard);
	$("dashboard").observe('mouseout', hideDashboard);
	
	$("search_input").observe('focus', searchFocus);
	$("search_input").observe('blur', searchBlur);
	
});


// clear search field on focus, and reset to "Search this site" on blur if search field is left blank

function searchFocus () {
	
	$("search_input").value = "";
	
}

function searchBlur () {
	
	if($("search_input").getValue().length <= 0)
		$("search_input").value = "Search this site";
	
}

