// ONCE THE PAGE LOADS ...
$(document).ready(function(){

	//create an object to store configuration values for hoverIntent
	var intentConfig = {
			interval: 100, //how long to wait before we trigger the "over" event, in ms
			sensitivity: 20, //pixel movement threshold to reset interval timer
			over: intentOver, //function to call when we found an intentional hover
			timeout: 100, //how long to wait after mouseout before we trigger "out"
			out: intentOut //function to call when the user intentionally ends hover
		}

	function intentOver(){ //display the mega-dropdown for navigation
		$("#nav_dropdown").css("background","url(_skins/default/images/bg_dropdown_spacer.png) repeat-y");
		$(".nav_submenu").show();
		$("#dropdown_foot").show();
	}
	
	function intentOut(){ //hide nav dropdown
		$("#nav_dropdown").css("background","none");
		$(".nav_submenu").hide();
		$("#dropdown_foot").hide();
	}
	
	// add hoverIntent handler to #nav element, use intentConfig object created above
	$("#nav").hoverIntent(intentConfig);

	// search box
	$("#search_keywords").bind("focus", function() {
		if(this.value == 'Enter Keyword(s)') this.value='';
	}).bind("blur", function(){
		if(this.value == '') this.value='Enter Keyword(s)';
	});

	// jquery.lightbox image galleries
	$(".imageGallery a").lightBox({
		imageLoading: '_skins/default/images/lightbox-ico-loading.gif'
		, imageBtnClose: '_skins/default/images/lightbox-btn-close.gif'
		, imageBtnPrev: '_skins/default/images/lightbox-btn-prev.gif'
		, imageBtnNext: '_skins/default/images/lightbox-btn-next.gif'
	});
});


