$(function() {
		   
	$(".png").supersleight();

	$("a").click(function(){
		var href = $(this).attr("href");
		if(href == "#"){
			return false;
		}
	});

	// dropdown menu
    var menuHover = {
         sensitivity: 4, // number = sensitivity threshold (must be 1 or higher)
         interval: 100, // number = milliseconds for onMouseOver polling interval
         over: hoverMenu, // function = onMouseOver callback (REQUIRED)
         timeout: 300, // number = milliseconds delay before onMouseOut
         out: hoveroutMenu // function = onMouseOut callback (REQUIRED)
    };
    $("#navigation ul.parent li").hoverIntent( menuHover );  
	
	// this is for default virtual tour link
	$("a.virtual-tour").click(function(){
		$("#virtual-tour-start").trigger("click");
	});

});

function hoverMenu(){
	var widest = 0;
	$(this).find('ul.dropdown').show().css({'opacity':0});
	$(this).find('ul.dropdown li a').each(function() {
		var thisWidth = $(this).width();
		if(thisWidth > widest) {
			widest = thisWidth;
		}
		$(this).css({'width':widest+'px'});
	});
	$(this).find('ul.dropdown').hide().css({'opacity':1});
	$(this).find("ul.dropdown").fadeIn(350);
}
function hoveroutMenu(){
	$(this).find("ul.dropdown").fadeOut(250);
}
