$(document).ready(function() {
	$("a.fancybox").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'overlayOpacity':	0.7,
		'speedIn'		:	300, 
		'speedOut'		:	300, 
		'titlePosition'	:	'over'
	});
	$("a.iframe").fancybox({
		'width'				: 725,
		'height'			: 450,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	
	$(".day_inactive").click(function(e){
		alert("Sorry, that day is not part of the current month");
		e.preventDefault();
		return false;
	});
	
	$(".day_unavailable").click(function(e){
		alert("Sorry, that day is unavailable");
		e.preventDefault();
		return false;
	});
	
	$("#form_pickup_continue").click(function(e){
		$("#form_pickup").submit();
		e.preventDefault();
		return false;
	});
	
	$("#form_user_continue").click(function(e){
		$("#form_user").submit();
		e.preventDefault();
		return false;
	});
	
	$("#form_checkout_purchase").click(function(e){
		$("#form_checkout").submit();
		e.preventDefault();
		return false;
	});
	
	$("#form_event_checkout_purchase").click(function(e){
		$("#form_event_checkout").submit();
		e.preventDefault();
		return false;
	});
	
	$("#form_event_details_go").click(function(e){
		$("#form_event_details").submit();
		e.preventDefault();
		return false;
	});
	
	$(".tour_location_change").change(function(e){
		location.href = $(this).attr("rel") + "&pickup_location_id=" + $(this).val();
	});
	
	$(".select_rel").each(function(){
		$(this).val($(this).attr("rel"));
	});
	
	$(".focus_me").focus();
});

