$(document).ready(function(){
	init_swap_text_boxes()	
});

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