/*
*************************************************

SEBASTIAN NITU
jQuery Document & Image Ready Scripts

Created by Sebastian Nitu
http://www.sebnitu.com

*************************************************
*/

/*-------------------------------------------    
	When Document is Ready
---------------------------------------------*/
$(document).ready(function() {
	
	/**
	 * External Links
	 */
	$("a[href^='http']").each(
    function(){
      if(this.href.indexOf(location.hostname) == -1) {
        $(this).attr('target', '_blank');
      }
    }
  );
	
	/**
	 * Gallery
	 */
	$('.gallery-rooms').gallery();
	
	/**
	 * Home Page Carousels
	 */
	
	$('.home-banner-images').infiniteCarousel({
		effect : 'fade',
		autoRotateSpeed : 8000,
		navContainer: '.home-banner-nav',
		dotNav : false
	});
	
	/*
	$('.home-content .gallery').infiniteCarousel({
		effect : 'fade',
		autoRotateSpeed : 5000,
		leftRightNav : false,
		dotNav : false
	});
	*/
	
	$('.home-blog .content').infiniteCarousel({
		effect : 'scroll',
		autoRotate : false,
		navContainer: '.menu',
		equalHeight : true,
		dotNav : false
	});
	
	/**
	 * Sub Page Carousels
	 */
	
	$('#sidebar-item-gallery .sidebar-item-content').infiniteCarousel({
		effect : 'scroll',
		autoRotateSpeed : 5000,
		leftRightNav : false,
		dotNav : true
	});
	
	/**
	 * Tab Functionality
	 */
	
	$('.tabs-content .content-item').hide();
	
	$('.tabs li:first-child').addClass("active");
	$('.tabs-content .content-item:first-child').show();
	
	$('.home-content .tabs a').click(function(){
		
		$('.tabs-content .content-item').hide();
		
		$('.tabs li').removeClass("active");
		
		var id = $(this).attr("href");

		$(id).show();
		
		$(this).parent().addClass("active");
		
		return false;
		
	});
	
});

/*-------------------------------------------    
	After Images are Loaded
---------------------------------------------*/

$(window).load(function() {



});

/*-------------------------------------------    
	Fin
---------------------------------------------*/
