// JavaScript Document
$(document).ready(function(){
    $(".cal:first").show();
	$("#calNav a:first").addClass("current");
	
	$("#calNav a").click(function () { 
      $("#calNav a").removeClass("current");
	  $(this).addClass("current");
	  var currentId = $(this).parent().attr('id');
	  $(".cal").hide();
	  $("#cal"+currentId).show();
	  return false;
	  
	  
    });
	
	$('table#transportation_table a').click(function()
	{
		$('#'+$(this).attr('rel')).toggle("slow");
		return false;
	});
	
	$('a.new_window').click(function()
		{
			window.open($(this).attr('href'));
			return false;
		});

	$('#home_photos').cycle({
		before: onBefore
	});

});

$(function(){
	$("#searchbox").focus(
		function() {
			if(this.value == this.defaultValue) {
				this.value = "";
			}
		}
	).blur(
		function() {
			if(!this.value.length) {
				this.value = this.defaultValue;
			}
		}
	);
});

function onBefore() {
	$('p#photo_title').html(this.alt);
};