Cufon.replace('.details h4');
Cufon.replace('.welcome h1, .featured h2');
Cufon.replace('.details p');
Cufon.replace('#nav ul li > a', {textShadow: '1px 1px #000', hover: true});
// Cufon.set('hover', true);

$(function() {

  // Options for SuperBGImage
 $.fn.superbgimage.options = {
    transition: 0, // 0-none, 1-fade, 2-slide down, 3-slide left, 4-slide top, 5-slide right, 6-blind horizontal, 7-blind vertical, 90-slide right/left, 91-slide top/down
    //randomtransition: 1, // 0-none, 1-use random transition (0-7)
    slideshow: 0, // 0-none, 1-autostart slideshow
    slide_interval: 6000, // interval for the slideshow
    randomimage: 1, // 0-none, 1-random image
    speed: 'slow' // animation speed
  };

  // initialize SuperBGImage
  $('#thumbs').superbgimage().hide();

  $('.weddings, .leisure, .conference, .reservation').mosaic({
    animation  :  'slide'    //fade or slide
  });

  $('.family, .see-do, .whatson').mosaic({
    animation  :  'slide'    //fade or slide
  });

  /*$('.family, .see-do, .whatson').mosaic({
   animation	:	'slide',	//fade or slide
   anchor_y	:	'bottom',
   hover_y		:	'bottom'		//Vertical anchor position
   });*/

});

// Begin jQuery
$(document).ready(function() {

  $(".footer a").filter(
    function() {

      return this.hostname && this.hostname.replace("www.", "") != location.hostname.replace("www.", "");

    }).click(function() {

      window.open($(this).attr("href"));

      return false;

    });

  /**
   * HOME PAGE FLOATING PROMOTION ROTATOR
   */

  var promotions_qty = $('div.featured ul li').size();
  var next_promotion = 0;

  var rotate_promotions = function() {
    if (next_promotion == promotions_qty) {
      next_promotion = 0
    }

    $('div.featured ul li').hide();
    $('div.featured ul li').eq(next_promotion).fadeIn(500);

    next_promotion++;
  };

  //rotate_promotions();
  $('div.featured ul li').hide();

  setInterval(rotate_promotions, 9000);

  $(".mosaic-block").hide();

  $(".small-box").hide();

  $(".band").hide();

  $(".band").delay(1000).fadeIn('slow');

  //$('.band').css('opacity','0');

  //$('.band').delay(1000).animate({"opacity":"1"}, 2000);

  $(".expand").click(function() {
    $("#trigger").slideToggle("slow");
    $(this).toggleClass("active");
  });

  setTimeout("init()", 500);

});

function init() {

  $(".weddings").show("scale", {percent: '100'}, 1000);

  $(".leisure").show("scale", {percent: '100', direction:'horizontal'}, 1000);

  $(".conference").show("scale", {percent: '100', direction:'vertical', origin:['middle','center']}, 1500);

  $(".weddings, .conference, .whatson, .leisure, .family, .see-do").hover(function() {
      $(this).animate({borderColor: '#4d132a'});
    },
    function() {
      $(this).animate({borderColor: '#972754'});
    });

  $(".whatson").slideDown('slow');

  $(".reservation").fadeIn();

  $(".family").slideDown('slow');

  $(".see-do").show('explode', {}, 500);

  $(".featured").delay(3500).fadeIn();

  $(".welcome").fadeIn();

  $(".small-box").fadeIn();

  Cufon.refresh();
}

$(document).ready(function() {
  var currDate = new Date();
  var url = (currDate.getHours() >= 6 && currDate.getHours() < 18) ? '/banner-home-day.htm' : '/banner-home-night.htm';

  $.get(url, function(data) {
    $('#thumbs').html(data);
    $('#thumbs').stopSlideShow();
    $('#thumbs').superbgimage({ reload: true });
  });
  
/*  var hite = $(window).width();
	if ( hite < 1024) {
	$('body').css('overflow-x','scroll');
	}
	else  {
  }*/

});
