/* _js/main.js */


// - execute on page load

$(document).ready(function(){

	// -- set colorbox handlers
	setColorboxHandlers();

	// -- initialize main menu
	mainMenuInit();
});



// - colorbox

// -- properties
var colorbox_types = {
	"cottage":{"iframe":true, "innerWidth":"800", "innerHeight":"600"}
};


// -- set handlers
function setColorboxHandlers() {
	$("a.cottage").colorbox(colorbox_types.cottage); // cottage	
};


// - main menu */
function mainMenuInit() {
	// - use JS to hide the following elements instead of css
	$('div.mm_tier2').hide();
	
	// - hover listner for tier 2 overlay
	$('ul#menu > li.submenu_parent').hover(function() {
		// -- mouse over
		if(!$(this).hasClass('active')) {
			$(this).addClass('active');
			$(this).children('div:first').slideDown(150);
		}
	}, function(){
		// -- mouse out
		if($(this).hasClass('active')) {
			$(this).children('div:first').slideUp(100, function(){
				$(this).parent().removeClass('active');											  
			}); 
		}
	});
}


