function routeFinderHeight() {
	var target = document.getElementById('routeFinder');
	
	target.style.height = 'auto';
	var x = target.offsetHeight;
	target.style.height = x + 200 + "px";
}

$(document).ready(function() {
		  
	$("#topNav")
		.superfish({animation : { opacity:"show", height:"show" }})
			.find(">li:has(ul)")
				.mouseover(function(){
					$("ul", this).bgIframe({opacity: true});
				})
					.find("a")
						.focus(function(){
							$("ul", $(".nav>li:has(ul)")).bgIframe({opacity: true});
						});

	$("#rf_route").change(function() {
		var routeData = $(this).val();
		$("#routeFinderLinks").load(routeData, "ul");
	});

	//form inputs
	$("input[@title]").example(function() {
 		return $(this).attr("title");
	});

	$("#tripPlannerToggle").click(function() {
		$("#tripPlannerForm").slideToggle(400);
		return false;
	});
	
	$("#routeFinderToggle").click(function() {
		$("#routeform").slideToggle(400);
		return false;
	});
	
	$('table.schedule tbody tr:odd').addClass('odd');
	$('table.schedule tbody tr:even').addClass('even');
	$('table.schedule tbody tr:nth-child(5n)').addClass('divider');
	$("table.schedule tbody tr").mouseover(function() {
		$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");
	});

	$("#rf_route").change(function() {
		var routeData = $(this).val();
		$("#routeFinderLinks").load(routeData, "ul");
	});
		
	$("a#helpTrigger").click(function() {
		var contents = $(this).attr("href");
		$("div#tripPlannerHelp").fadeIn("fast");
		$("div#tripPlannerHelpContent").load(contents);
		$("a#tripPlannerClose").click(function() {
			$("div#tripPlannerHelp").fadeOut("fast");
			return false
		});
		return false;
	});
});

