/*!
 * Copyright 2011 Pebble Design Pty Ltd. All Rights Reserved.
 * Author: Reiss Watts, Gary Swanepoel.
 */

jQuery(document).ready(function() {

/*--START-------------------------------------*/

	/* Homepage Slideshow Tabs */
	jQuery('.slidetabs').append(jQuery('#promo a.tab'));
	
/*--END---------------------------------------*/
	
});

jQuery(document).ready(function() {

/*--START-------------------------------------*/

	/* Homepage Slideshow */
	jQuery('.slidetabs').tabs('.tabs > #promo', { effect: 'fade', fadeInSpeed: 1000, fadeOutSpeed: 1000, rotate: true })
	.slideshow({ autoplay: true, autopause: false, clickable: false, interval: 7000 });

	// transition effects
    jQuery.tools.tabs.addEffect('fade', function(i, done) {
		this.getPanes().stop().hide().eq(i).show(function()  {
            
			//start animation
			jQuery(this).delay(0).animate({opacity:'1'}, 1000)
			jQuery(".p-banner", this).delay(0).animate({opacity:'1', top:'238', height:'103', _height:'80'}, 1000)
			jQuery(".p-center", this).delay(0).animate({height:'100'}, 1000)
			jQuery(".p-border", this).delay(500).animate({opacity:'1'}, 1000)
			jQuery(".p-text", this).delay(1000).animate({opacity:'1'}, 500)
	
			//reverse animation
 			jQuery(".p-text", this).delay(3500).animate({opacity:'0'}, 500)
			jQuery(".p-border", this).delay(3500).animate({opacity:'0'}, 1000)
			jQuery(".p-banner", this).delay(4500).animate({opacity:'0', top:'0', height:'530'}, 1000)
			jQuery(".p-center", this).delay(4500).animate({height:'530'}, 1000)
			jQuery(this).delay(4500).animate({opacity:'0'}, 1000)
			
		    done.call();
			
		});
	});
	
/*--END---------------------------------------*/
	
});

jQuery(document).ready(function() {

/*--START-------------------------------------*/

	/* Homepage Navigation */
    jQuery(".nav1").hover(
        function(){jQuery('.nav-conference').stop().animate({opacity:'1', height:'190'}, 300);},
        function(){jQuery('.nav-conference').stop().animate({opacity:'0', height:'180'}, 150);}
    );
    jQuery(".nav2").hover(
        function(){jQuery('.nav-rooms').stop().animate({opacity:'1', height:'190'}, 300);},
        function(){jQuery('.nav-rooms').stop().animate({opacity:'0', height:'180'}, 150);}
    );
    jQuery(".nav3").hover(
        function(){jQuery('.nav-dining').stop().animate({opacity:'1', height:'190'}, 300);},
        function(){jQuery('.nav-dining').stop().animate({opacity:'0', height:'180'}, 150);}
    );
    jQuery(".nav4").hover(
        function(){jQuery('.nav-escapes').stop().animate({opacity:'1', height:'190'}, 300);},
        function(){jQuery('.nav-escapes').stop().animate({opacity:'0', height:'180'}, 150);}
    );
    jQuery(".nav5").hover(
        function(){jQuery('.nav-club').stop().animate({opacity:'1', height:'190'}, 300);},
        function(){jQuery('.nav-club').stop().animate({opacity:'0', height:'180'}, 150);}
    );
	
/*--END---------------------------------------*/
	
});
