$(document).ready(function() {

//image slider
$('#slider').orbit({
		'bullets': false,
		'advanceSpeed': 3000, 
		'timer' : true,
		'animation' : 'fade'
	});

//floorplan

$("#Map area").mouseover(function(){
		var area = $(this).attr('id');		
		$("#floorplan-image div.active").removeClass("active");
		$("#floorplan-image div." + area).addClass("active");
});

//subnav
$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)

	$("ul.main-nav li span").click(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() {
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});

//FancyBox Lightbox
	
	//$("ul.gallery a, a.zoom").lightBox();
	
	$("ul.gallery li a").append("<img src='images/magnify.jpg' class='magnify' />");
	$(".magnify").css({"opacity": 0});
	
	$("ul.gallery li a").hover(function(){
		$(this).children(".magnify").stop(true, true).animate({"opacity": 0.77});						
	}, function(){
		$(this).children(".magnify").stop(true, true).animate({"opacity": 0});	
	});
	
//Logo links hover

	$('.logo-links img').animate({
			"opacity": .5
	});

	$('.logo-links img').hover(function() {
		$(this).stop().animate({ "opacity": 1 });
	}, function() {
		$(this).stop().animate({ "opacity": .5 });
	});
	
	$('.logo-links:not(":first")').hide();


	if($('#logo-reviews').size()>0) {
		(function showNewThumbs(){
		   setTimeout(function(){
		   if ($('.logo-links:visible').next('.logo-links').size()>0) {
		       $('.logo-links:visible').fadeOut().next().fadeIn();
		   } else {
		       $('.logo-links:visible').fadeOut();
		       $('.logo-links:first').fadeIn();
		   }

		       showNewThumbs();
		   }, 3000);
		})();
	}

//menu links hover

$('.menu-btn').hover(function(){
		$(this).addClass("hovered");
		$('.menu-btn:not(.hovered)').stop().animate({'opacity': 0.3});
	}, function(){
		$(this).removeClass("hovered");
		$('.menu-btn:not(.hovered)').stop().animate({'opacity': 1});
	});

$('.menu-btn-christmas').hover(function(){
		$(this).addClass("hovered");
		$('.menu-btn-christmas:not(.hovered)').stop().animate({'opacity': 0.3});
	}, function(){
		$(this).removeClass("hovered");
		$('.menu-btn-christmas:not(.hovered)').stop().animate({'opacity': 1});
	});

//social links hover

 $(".social-links a").hover(function() {
        $(this).stop().animate({ top: "-10px" }, 200);
    },function(){
        $(this).stop().animate({ top: "0px" }, 300);
    });




});
