// clear form fields on focus and reset when not focused

var swap_text_boxes = [];

function init_swap_text_boxes(){
  //Store the default value for each box
  $('input[type=text][value].searchtext').each(function() {
    swap_text_boxes[$(this).attr('id')] = $(this).attr('value');
  });
  //Add focus and blur events to set or clear the value
  $('input[type=text][value].searchtext').bind('focus', function() {
    if($(this).val() == swap_text_boxes[$(this).attr('id')]) {
      $(this).val('');
    }
  });
  $('input[type=text][value].searchtext').bind('blur', function() {
    if($(this).val() == '') {
      $(this).val(swap_text_boxes[$(this).attr('id')]);
    }
  });
}

$(document).ready(function(){ init_swap_text_boxes();
  });
	$(function(){	
		var path = location.pathname.substring(1);
		if ( path )
			$('.navlink a[href$="' + path + '"]').attr('class', 'selected');

// toggle menus
$(function(){
	$(".menu > h3").click(function() {
			$(this).siblings().toggle();
		}).siblings().toggle();
	});
});

// homepage tabs

$(function() {
	$('#selection > ul').tabs();
	$("ul#tabs").removeClass("hide");
	$("div#currentstaff h2, div#prospectivestaff h2").addClass("hide");
});



