var swap_text_boxes = [];

function init_swap_text_boxes(){
  //Store the default value for each box
  $('input[type=text][value].swaptextbox').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].swaptextbox').bind('focus', function() {
    if($(this).val() == swap_text_boxes[$(this).attr('id')]) {$(this).val('');}
  });
  $('input[type=text][value].swaptextbox').bind('blur', function() {
    if($(this).val() == '') {$(this).val(swap_text_boxes[$(this).attr('id')]);}
  });
} 

$(document).ready(function(){
  $('#lgnstuff').hide();

    $('#lgnlink').show();
  
 $('#lgn').click(function() {
    $('#lgnlink').hide();
    $('#lgnstuff').show();
  });
  
  $('#lgnhide').click(function() {
    $('#lgnstuff').hide();
    $('#lgnlink').show();
  });


init_swap_text_boxes();

$('#searchtabs ul li a').click(function(){ //When any link is clicked
	$('#searchtabs ul li').removeClass('active'); // Remove active class from all links
	$(this).parent().addClass('active'); //Set clicked link class to active
	
	var currentTab = $(this).attr('href'); // Set variable currentTab to value of href attribute of clicked link
	$('#searchboxes div').hide(); // Hide all divs
	$(currentTab).show(); // Show div with id equal to variable currentTab
	return false;
	});
});

