/* Google Analytics Code */
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-18326153-1']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
/* Google Analytics Code */
$(function() {
	$('#depart_date, #return_date').datepicker();
	$('#depart_date, #return_date').datepicker('option', {
		beforeShow: customRange
		});
	});
function customRange(input) {
	if (input.id == 'return_date') {
		return { minDate: $('#depart_date').datepicker('getDate') };
		}
	else if (input.id == 'depart_date') {
		return { maxDate: $('#return_date').datepicker('getDate') };
		}
	}
	
// end of season redirect
$(function() {
	window.location.href = 'http://flybranson.com/?redirect=fbt';
});

$(function() {
	$("div#masthead").smoothDivScroll({ autoScroll: "onstart", autoScrollDirection: "backandforth", autoScrollStep: 1, autoScrollInterval: 15, startAtElementId: "img_branson", visibleHotSpots: "always"});
	});
this.vtip = function() {
	this.xOffset = -28;
	this.yOffset = 10;
	$(".vtip").unbind().hover(
		function(a) {
			this.t = this.title;
			this.title = "";
			this.top = (a.pageY+yOffset);
			this.left = (a.pageX+xOffset);
			$("body").append('<p id="vtip">'+this.t+'</p>');
			$("p#vtip").css("top",this.top+"px").css("left",this.left+"px").fadeIn("slow");
			},
		function() {
			this.title = this.t;
			$("p#vtip").fadeOut("slow").remove();
			}
	).mousemove(function(a) {
		this.top = (a.pageY+yOffset);
		this.left = (a.pageX+xOffset);
		$("p#vtip").css("top",this.top+"px").css("left",this.left+"px");
		});
	}
$(function(a) {
	vtip()
	});
function hide_return() {
	$('.hide_return').hide();
	$('.hide_return').attr({ 'value': '01/01/2012' });
	}
function show_return() {
	$('.hide_return').show();
	$('.hide_return').attr({ 'value': '' });
	}
function hide_routeMap() {
	$('.route_map').css('display', 'none');
	$('body').css('overflow', 'auto');
	}
function show_routeMap() {
	$('html, body').animate({ scrollTop: 0 }, 'fast');
	$('.route_map').css('display', 'block');
	$('body').css('overflow', 'hidden');
	}
function show_flightSearch() {
	$('html, body').animate({ scrollTop: 430 }, 'slow' );
	}

$(function() {
	$('#menu-item-308').replaceWith('<li id="menu-item-308" class="menu-item menu-item-type-custom menu-item-308"><a href="javascript:show_routeMap();" title="Branson AirExpress Route Map">Route Map</a></li>');
	});
$(function() {
	$('#menu-item-147 .sub-menu .menu-item a').attr('target', '_blank');
	});
$(function() {
	$('.menu-item').hover(function() {
		$(this).find('.sub-menu').css('display', 'block');
		}, function() {
		$(this).find('.sub-menu').css('display', 'none');
		});
	});
