// JavaScript Document
jQuery(document).ready(function(){	
		
	//tab
    var TabPos = $('#tabWrapper').offset();
	if(TabPos){
    	jQuery('.tab').css({postion:"absolute",'left':0 + 'px', 'top': 0 + 'px'});
    	jQuery('.tab').slice(1).hide();
	}
	
	jQuery('#resortInfoMenu li a:first ').addClass('selected')//.removeClass('firstImg'); //make the first tab button selected
	//adventure selector
	jQuery('#leftCol h2:first').addClass("h2Minus").removeClass("h2Plus"); //make the first adventure selected
	jQuery('#leftCol .hider:not(:first)').hide(); //make the first adventure visible and hide the rest
	jQuery('#play').addClass("pause"); //special offes play button
	
	//footer
	jQuery('#footer .hider').hide(); // hide the footer
	
		//adventure selector
		//expand the adventure content when selected
  		jQuery("#leftCol h2").click(function(){ 
		
			jQuery(this).parents().find('#leftCol .hider:visible').slideUp(500);
			jQuery(this).siblings('#leftCol .hider').slideDown(500);
		
			jQuery(this).parents().find("#leftCol h2").removeClass("h2Minus").addClass("h2Plus");
			jQuery(this).addClass("h2Minus").removeClass("h2Plus");
		});
		
		//footer
		jQuery("#footer h3").click(function(){					   
			jQuery('#footer .hider').slideToggle("slow");
		});

			jQuery('#imageSlider').css({'overflow' : 'hidden'});
								  
			jQuery('#imageSlider').innerfade({
				animationtype: 'fade',
				speed: 'slow',
				timeout: 4000,
				type: 'sequence',
				containerheight: '242px'
			});
		//animate top menu links
		jQuery('#menu ul li a').hover(function(){
			jQuery(this).siblings('.firstImg').animate({opacity : 0.0}, 500);
		}, function(){
			jQuery(this).siblings('.firstImg').animate({opacity : 1.0}, 500);
		});
		
		//animate travel tools
		jQuery('#leftCol .travelTools a').hover(function(){
			jQuery(this).parent().find('span.hideTT').animate({opacity : 0.0}, 500);
		}, function(){
			jQuery(this).parent().find('span.hideTT').animate({opacity : 1.0}, 500);	
		});
		
		//animate buttons in resort info top part
		jQuery('.cell .rightPart li a').hover(function(){
			jQuery(this).siblings('.firstImg').animate({opacity : 0.0}, 500);
		}, function(){
			jQuery(this).siblings('.firstImg').animate({opacity : 1.0}, 500);
		});
		
		//animate buttons in resort info bottom details part
		jQuery('#resortInfoMenu li a').hover(function(){
			jQuery(this).siblings('.firstImg').animate({opacity : 0.0}, 500);
		}, function(){
			jQuery(this).siblings('.firstImg').animate({opacity : 1.0}, 500);
		});
		
		//
		jQuery('#resortInfoMenu li a').click(function(){
            var clickedBtn = jQuery(this).attr('href');
            //var visibleTab = jQuery('.tab:visible').attr('id');
            //var activeTab  = jQuery('#tabWrapper > .tab[id $='+clickedBtn+']');
            
            jQuery('.tab:visible').fadeOut(500,function(){
			jQuery(clickedBtn).fadeIn(500);
			});
                
				jQuery('#resortInfoMenu li a').removeClass('selected');
				jQuery(this).addClass('selected');
            return false;
		});
	
});
