$(document).ready(function() {
  $('#coda-slider-1').codaSlider({
    dynamicArrows: true
  });

  $('#coda-slider-2').codaSlider({
    dynamicArrows: false
  });


  $('.dropdown').each(function () {
    $(this).parent().eq(0).hoverIntent({
      timeout: 100,
      over: function () {
        var current = $('.dropdown:eq(0)', this);
        current.slideDown(100);
      },
      out: function () {
        var current = $('.dropdown:eq(0)', this);
        current.fadeOut(100);
      }
    });
  });


  $(function() {
    $("#check-in").datepicker({
      minDate: 0,
      showAnim: 'fadeIn',
      showOn: 'both',
      buttonImage: 'img/gui/icon-calandar.png',
      buttonImageOnly: true,
      dateFormat: 'mm/dd/yy',
      numberOfMonths: 2,
      onSelect: function(dateStr) {
        var date = $(this).datepicker('getDate');
        if (date) {
          date.setDate(date.getDate() + 1);
          $("#check-out").datepicker("option", "minDate", date);
        }
      }
    });

    $("#check-out").datepicker({
      showAnim: 'fadeIn',
      showOn: 'both',
      buttonImage: 'img/gui/icon-calandar.png',
      buttonImageOnly: true,
      dateFormat: 'mm/dd/yy',
      numberOfMonths: 2
    });
  });


  $("a.fancybox").fancybox({
    'width'       : '90%',
    'height'	  : '90%',
    'transitionIn' : 'none',
    'transitionOut' : 'none',
    'titlePosition' : 'over',
    'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
      return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
    }
  });

  $("a.fancyiframe").fancybox({
    'width'				: '90%',
    'height'			: '90%',
    'autoScale'			: false,
    'transitionIn'		: 'none',
    'transitionOut'		: 'none',
    'type'				: 'iframe'
  });

  $("a.fancysmall").fancybox({
    'width'				: 500,
    'height'			: 400,
    'type'				: 'iframe'
  });
  
  
  $("a.360").fancybox({
    'width'				: 900,
    'height'			: 566,
    'type'				: 'iframe'
  });
  
  $( "#tabs" ).tabs();
});
