jQuery(document).ready(function($){
// need the above line so I can use the $	
// **************************************



$(window).load(function() {
	$('.blueberry').blueberry({
		duration: 3000,
		interval: 7000
	});
	
});

$('#bg-blueberry').hide().delay(3000).fadeIn('slow');



$('li#menu-item-801 a').attr('rel', '#overlay');



// http://www.broken-links.com/2009/01/20/very-quick-equal-height-columns-in-jquery/ SEE PAUL IRISH's comment...
$(window).load(function() {
$.fn.setAllToMaxHeight = function(){
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) );
};
$('div.triple').setAllToMaxHeight();
});



// overlay


/*
$(function() {
    // Setup a basic iframe for use inside overlays.
    var theframe = $('<iframe frameborder="0" scrolling="auto"></iframe>');
    // Overlay
    $('.butt-book a[rel],#menu-item-801 a[rel]').overlay({
        // some mask tweaks suitable for modal dialogs
		mask: {
			color: '#3b1212',
			loadSpeed: 200,
			opacity: 0.8
		},
        effect: 'apple',
        onBeforeLoad: function() {
            //First get the wrap
            var wrap = this.getOverlay().find(".contentWrap");
            //Get the URL from the trigger
            var link = this.getTrigger().attr("href");
            //Add the link and style attributes to the basic iframe
            $(theframe).attr({ src: link, style: 'height:730px; width:800px; border:none;' });
            //Write the iframe into the wrap
            wrap.html(theframe);
        }
    });
});
*/



$(".form-bw-trigger[rel]").overlay({
    // some mask tweaks suitable for modal dialogs
	mask: {
		color: '#3b1212',
		
		loadSpeed: 200,
		opacity: 0.8
	},
    effect: 'apple',
    fixed: false
    });




// fit the videos with http://fitvidsjs.com/ - thanks Chris Coyer!
$(document).ready(function(){
    // Target your .container, .wrapper, .post, etc.
    $("#sidebar-cont").fitVids({ customSelector: "iframe[src^= 'http://embed.animoto.com/play.html?w=swf/vp1&e=1314718865&f=3zgZFURNDnOEZnQebx0n4Q&d=206&m=p&r=360p&volume=100&start_res=360p&i=m&ct=Visit%20us%20at%20WatersideInn.ca&cu=http://www.watersideinn.ca&options=' "});
  });


// datepicker

$( "#from, #to" ).datepicker({ dateFormat: 'DD, MM d, yy' });
$( "#res-date" ).datetimepicker({
	dateFormat: 'DD, MM d, yy', 
	showSecond: false,
	timeFormat: 'h:mm tt',
	hour: 18,
	minute: 0,
		ampm: true,
		stepHour: .05,
		stepMinute: 15,
		hourMin: 7,
		hourMax: 23
		
});

// date range picker
$(function() {
    var dates = $( "#from, #to" ).datepicker({
        defaultDate: "+1w",
        numberOfMonths: 1,
        onSelect: function( selectedDate ) {
            var option = this.id == "from" ? "minDate" : "maxDate",
                instance = $( this ).data( "datepicker" );
                date = $.datepicker.parseDate(
                    instance.settings.dateFormat ||
                    $.datepicker._defaults.dateFormat,
                    selectedDate, instance.settings );
            dates.not( this ).datepicker( "option", option, date );
        }
    });
});
	
	
// Hello, formly.js

$(".wpcf7-form, #constant-contact-signup").formly({'onBlur':false, 'theme':'Dark'});


// Stripe the tables, baby
$(document).ready(function(){
   $(".stripeMe tr").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
   $(".stripeMe tr:even").addClass("alt");
 });
 
 // Let's make the video poster frame clickable

 $(document).ready(function(){
	 $('#promovid').click( function(){
	 $('#video').get(0).play();       // get(0) gets the original DOM element
	 $('#promovid').unbind('click');  // remove click listener
	  });
 });
 
 
// ***************************************
// the following line closes everything up
});

