$(function() {
	$(".sub-nav li:last-child, #top-nav li:last, .gallery li:nth-child(3n), .section.comment-box li:last, #banner .gallery li:nth-child(5n), #big-nav.hotels li:nth-child(6n), .link-list:last, .link-list li:last-child, .lined-list li:last-child, .section.contact:nth-child(2n), .vaca:last-child, .carbon-sense #top-nav li:last, .carbon-sense .section.contact:nth-child(2n), .carbon-sense .sub-nav li:last-child, .carbon-sense .link-list li:last-child, .box-list li a:last-child, .carbon-sense #big-nav li ul li:last-child, .carbon-sense #big-nav .active ul li.last:last-child, #big-nav li ul li:last-child, #big-nav .active ul li.last:last-child, .carbon .sub-nav li:last-child, .carbon .link-list li:last-child, .carbon .vaca:last, .eburon .sub-nav li:last-child, .eburon .link-list li:last-child, .eburon .vaca:last, .ecu .sub-nav li:last-child, .ecu .link-list li:last-child, .ecu .vaca:last, .carbon-sense .vaca:last, .rooms .section:nth-child(3n), .atlantis .rooms .lined-list li:last-child, .carbon .rooms .lined-list li:last-child, .eburon .rooms .lined-list li:last-child, .ecu .rooms .lined-list li:last-child, .eurotel .rooms .lined-list li:last-child, .mardaga .rooms .lined-list li:last-child, .carbon-sense .rooms .lined-list li:last-child, .icon-list li:last").addClass("last");
	$("ul.tabs").tabs("div.panes .pane");
	$(".scrollable").scrollable();
	$(".slider").anythingSlider({
	    easing: "easeInOutExpo",       
	    autoPlay: true,                 
	    delay: 7000,                   
	    startStopped: false,           
	    animationTime: 600,             
	    hashTags: false,               
	    buildNavigation: true,        
		pauseOnHover: true         
	 });
 
	 var prevCont =  $('.subscribe').html();
	 $(".subscribe").click(function () {
		var currentOpt =  $(this).html();
    	currentOpt = (currentOpt == 'X Close' ? prevCont : 'X Close');
    	$(this).text(currentOpt);
      	$("#newsletter-panel").slideToggle("slow");
	  	return false
      });
      
	$("select").uniform();
	 $(".social img").hover(
			function(){this.src = this.src.replace("-off","-on");},
			function(){this.src = this.src.replace("-on","-off");
		});
		
	 $(".gallery.pop a").fancybox({overlayOpacity: 0.5, overlayColor: '#000'});
	 
	 $(".poplink").fancybox({overlayOpacity: 0.5, overlayColor: '#000' });

	 $(".footer .poplink.iframe").fancybox({overlayOpacity: 0.5, overlayColor: '#000', width: 348, height: 538 });

	$(".business-poplink").fancybox({ type: 'iframe', overlayOpacity: 0.5, overlayColor: '#000', width: 348, height: 538 });
	 
	 $(".availability-btn").fancybox({overlayOpacity: 0.5, overlayColor: '#000', type: 'iframe', height: '80%'});
	 
	 $(".map-iframe").fancybox({padding: 0, overlayOpacity: 0.5, overlayColor: '#000', type: 'iframe', width: 465, height: 296});
	 
	 $("h4.expand").append("<span class='right'>+ more info</span>").addClass("active");
	 
	 var prevExpandCont =  '+ more info';
	 $(".expand").click(function(){
	 	var currentExpandOpt =  $(this).find("span.right").html();
    	currentExpandOpt = (currentExpandOpt == '- close' ? prevExpandCont : '- close');
	 	$(this).toggleClass("active");
	   	$(this).next("div.collapse").slideToggle("slow");
	   	$(this).find('span.right').text(currentExpandOpt);
	  	 return false;
	  });
	  
	  $(".addthis_button_facebook_like iframe").css("width", 115);
	  
	  $(".logos").cycle({ fx: 'scrollLeft', width: '960px', fit: 1, timeout: 6000, pause: 1 });
	  
	  // Expand collapse //
	  
	 // testimonial masonry //
	 
	 $('.testimonials').masonry({
    	// options
    	columnWidth : 240
  	 });
	  
});
