$(document).ready(function() {  

// Options for SuperBGImage
	$.fn.superbgimage.options = {
	//z_index: 0, // z-index for the container
		inlineMode: 1, // 0-resize to browser size, 1-do not resize to browser-size
		showimage: 1, // number of first image to display
		vertical_center: 1, // 0-align top, 1-center vertical
		transition: 1, // 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
		transitionout: 1, // 0-no transition for previous image, 1-transition for previous image
		randomtransition: 0, // 0-none, 1-use random transition (0-7)
		showtitle: 0, // 0-none, 1-show title
		slideshow: 1, // 0-none, 1-autostart slideshow
		slide_interval: 5000, // interval for the slideshow
		randomimage: 0, // 0-none, 1-random image
		speed: 'slow', // animation speed
		preload: 1 // 0-none, 1-preload images
	};

	// initialize SuperBGImage
	$('#superbgimage').superbgimage();//.hide();

/*$('a#check-availability').click(function(){ 
       $(this).animate({backgroundPosition: '500px 150px'}).animate({backgroundPosition: '-20px 250px'}); 
   });*/

$('a#check-availability').click(function() {
	$('#availability').slideToggle();
	$(this).toggleClass("active");
	$("#availability").css('z-index', '+=1');

});

$('a#welcome').click(function() {
  $('#welcomebox').slideToggle();
  $(this).toggleClass("active");
  $("#welcomebox").css('z-index', '+=1');
  $('#scrollpane').jScrollPane();
});


$("#zoom-gallery").jCarouselLite({
	btnNext: ".next",
    btnPrev: ".prev",
    /*auto: 1500,
    speed: 2500,*/
	visible:4
});


$('.prev').click(function(e){
    Cufon.replace('#zoom-gallery .title');
  });
  $('.next').click(function(e){
    Cufon.replace('#zoom-gallery .title');
  });


	var promotions_qty = $('#featuredoffer h2').size();
var next_promotion = 0;
var rotate_promotions = function() {
if (next_promotion == promotions_qty) { next_promotion = 0 }
$('#featuredoffer h2').hide();
$('#featuredoffer h2').eq(next_promotion).fadeIn(500);
next_promotion++;
};
//rotate_promotions();
$('#featuredoffer h2').hide();
setInterval(rotate_promotions, 6000); 

/*$(function() {
			$('a#check-availability').hover(function(){
				$(this).animate({backgroundPosition: '0px -48px'},{queue:false,duration:500});
			}, function(){
				$(this).animate({backgroundPosition: '0px 0px'},{queue:false,duration:500});
			});
		});*/


/*$("a#welcome").hover(
  function () {
  //alert("hover");
    $(this).css('backgroundPosition', '0 -54px');
  }, 
  function () {
  //alert("leave");
    $(this).css('backgroundPosition', '0 0');

  }
);*/



/*$('a#welcome')
	.css( {backgroundPosition: "0 0"} )
	.mouseover(function(){
		$(this).stop().animate(
			{backgroundPosition:"(0 -48px)"}, 
			{duration:500})
		})
	.mouseout(function(){
		$(this).stop().animate(
			{backgroundPosition:"(0 0)"}, 
			{duration:500})
		})
*/





});
