/************************************************************
 ** Clears a field
 ** By: 	Joshua Sowin (fireandknowledge.org)
 ** HTML: <input type="text" value="Search" name="search"
 **			id="search" size="25" 
 ** 		onFocus="clearInput('search', 'Search')" 
 ** 		onBlur="clearInput('search', 'Search')" />
 ***********************************************************/
function clearInput(field_id, term_to_clear) {
	
	// Clear input if it matches default value
	if (document.getElementById(field_id).value == term_to_clear ) {
		document.getElementById(field_id).value = '';
	}
	
	// If the value is blank, then put back term
	else if (document.getElementById(field_id).value == '' ) {
		document.getElementById(field_id).value = term_to_clear;
	}
} // end clearSearch()





function deployFunctions() {

	
	/**************************************************
		GOOGLE MAPS
	**************************************************/
	
	if ($.browser.msie && $.browser.version=="6.0") {
		$("#background div.gradient .right, #background div.gradient .left").height($(window).height());
	}
	
}




$(document).ready(function() {

	deployFunctions();
	
	
	/**************************************************
		BACKGROUND
	**************************************************/
	
    $('#background img').load(function() {
		$(this).css({
			top: ($(window).height() - $(this).height()) / 2,
			display: 'block'
		});
    });
	
	$('#background img').css({
		top: ($(window).height() - $('#background img').height()) / 2,
		display: 'block'
	});
	
	
	/**************************************************
		NAVIGATION - SITEMAP
	**************************************************/
	
		
	$('div#header2').hover(function(){
		$(this).animate({opacity: '1'}, {queue:false, duration: 300});
	},
	function(){
		$(this).animate({opacity: '1'}, {queue:false, duration: 300});
	});
	
	
	
	
});

window.onresize = function() {

	deployFunctions();
	
	/**************************************************
		BACKGROUND
	**************************************************/
	
	$('#background img').css('top', ($(window).height() - $('#background img').height()) / 2);
}
