// remap jQuery to $
(function($){})(window.jQuery);


/* trigger when page is ready */
$(document).ready(function (){


	// Load up jQuery UI for reservations form
	Modernizr.load(
		{
			load : ['/wp-content/themes/happytrails/_/js/jquery-ui-1.8.15.custom.min.js',
					'/wp-content/themes/happytrails/_/css/jquery-ui-1.8.15.custom.css'
			],
			complete: function() {
				$('.booking-date input').datepicker({ dateFormat: 'mm/dd/yy' });
				if ($.browser.msie ) {
					var version = parseInt($.browser.version, 10);
					if (version > '7.0') {
						$('.gfield_radio').buttonset();
					}
				} else {
					$('.gfield_radio').buttonset();
				} 
				$('.gfield_radio label').addClass('iphone-radio');
			}

		}
	);
	
	
	// Show booking options
	$('input[name=input_16], input[name=input_17]').live('click', function() {

	        $('.options').hide();
	        var typeChecked = $(this).attr("id");
	        $('.options').each(function(){
	            if ($(this).hasClass(typeChecked)) {
	                $(this).show(); 
	            } 
	        });
	    });
	
});


/* optional triggers

$(window).load(function() {
	
});

$(window).resize(function() {
	
});

*/
