/*
Hover Fade for Sting frontpage 
*/
$(document).ready(function() {

    /** ANYTHINGSLIDER **/

    // Monday event slider
    $('#gh_slider_mon').anythingSlider({
        resizeContents:false,
        autoPlay:false,
        easing: 'swing',
        showMultiple:4,
        buildNavigation:false
    });

    // Wednesday event slider
    $('#gh_slider_wed').anythingSlider({
        resizeContents:false,
        autoPlay:false,
        easing: 'swing',
        showMultiple:4,
        buildNavigation:false
    });

    // Sunday event slider
    $('#gh_slider_sun').anythingSlider({
        resizeContents:true,
        autoPlay:false,
        easing: 'swing',
        showMultiple:4,
        buildNavigation:false
    }).bind('slide_begin', function(e, slider){
    	$("#gh_slider_title_sun").anythingSlider(slider.targetPage);
    });
    
    // Sunday event slider
    $('#gh_slider_title_sun').anythingSlider({
        resizeContents:true,
        autoPlay:false,
        easing: 'swing',
        showMultiple:4,
        buildNavigation:false,
        buildArrows:false
    });
    
    // Wednesday video slider
    $('.guesthouse_section_splash_video ul').anythingSlider({
        resizeContents:false,
        autoPlay:true,
        easing: 'swing',
        showMultiple:false,
        buildNavigation:false,
        buildArrows:false,
        delay:10000
    });

	
	$(".sliderCat").hover(function() {
		$(this).find(".sliderBG").css({"opacity":0});
		$(this).find(".sliderBG").stop(true,true).animate({"opacity":0.8},"fast");		
		$(this).find(".sliderContent").stop(true,true).animate({"opacity":1});
	},function() {
		$(this).find(".sliderBG").animate({"opacity":0},"slow");
		$(this).find(".sliderContent").animate({"opacity":0},"slow");
	});
	
//	$(".guestHouseHeader").cufon({fontFamiy: "BankGothic Lt BT"});
	
	// show and hide for forms
	
	$(document).ready(function() {
	
	$('.tablereservations').colorbox({ rel: 'tablereservations', opacity: 0.8 });
	ghdcleftheight = $('#ghdc_left').height();
	$('#ghdc_sidebar_content').height( ghdcleftheight ); 

 // hides the slickbox as soon as the DOM is ready
 // (a little sooner than page load)
	 $('#cforms4form').slideUp('fast'); 
	 // shows the slickbox on clicking the noted link

	 // toggles the slickbox on clicking the noted link
	  $('a#formSlideToggle').click(function() {
	 $('#cforms4form').toggle(400);
	 return false;
	  });
	  
	 $('#twitter-3 ul').slideUp('fast'); 
	 // shows the slickbox on clicking the noted link

	 // toggles the slickbox on clicking the noted link
	  $('#twitter-3 .widgettitle').click(function() {
	 $('#twitter-3 ul').toggle(400);
	 $('#text-4').toggle(400);
	 return false;
	  });

	});
	
	
	// GOOGLE ANALYTICS FORM TRACKING 
	
	currentLoc = window.location;
	
	
	$("#sendbutton").click(function() {
		_gaq.push(['_trackEvent', 'Get on a List Form', 'Get on a List Form Submission']);
	});
	
	
	$("#sendbutton2").click(function() {
		_gaq.push(['_trackEvent', 'Table Reservation Form', 'Table Reservation Submission']);
	});
	
	$("#sendbutton3").click(function() {
		_gaq.push(['_trackEvent', 'VIP Packages Form', 'VIP Packages Form Submission']);
	});
			
	$("#sendbutton4").click(function() {
		_gaq.push(['_trackEvent', 'Request Availability Form', 'Request Availability Form Submission']);
	});

				
	$("#sendbutton5").click(function() {
		_gaq.push(['_trackEvent', 'Gift Cards Form', 'Gift Cards Form Submission']);
	});
	
	$("#sendbutton6").click(function() {
		_gaq.push(['_trackEvent', 'Sting Card Form', 'Sting Card Form Submission']);
	});
	
	

});

var currentPosition = 3;
function calendarMoreClicked(totalEvents) {
	currentPosition++;
	if (currentPosition == totalEvents) { $('#calendar_more_button').fadeOut(); }
	$('#calendar_back_button').fadeIn();
	$('.post').animate({left: '-=325'}, {queue: false, duration: 500, specialEasing:{ width: 'linear',
	      height: 'easeOutBounce'}}, function() {
	    // Animation complete.
	});
}
function calendarBackClicked(totalEvents) {
	currentPosition--;
	if (currentPosition == 3) { $('#calendar_back_button').fadeOut(); }
	$('#calendar_more_button').fadeIn();
	$('.post').animate({left: '+=325'}, {queue: false, duration: 500}, function() {
	    // Animation complete.
	});
}


