$(document).ready(function () {

var web_field = $("#websearch input[type=text]");
var people_field = $("#peoplesearch input[type=text]");
var default_txt = 'SEARCH';

$("#peoplesearch").hide();
web_field.val(default_txt);
web_field.addClass('default');
people_field.val(default_txt);
people_field.addClass('default');

$("#searchweb").bind("click", function() {
	$("#peoplesearch").hide();
	$("#websearch").show();
	if (!people_field.hasClass('default')) {
		web_field.val(people_field.val());
		web_field.removeClass('default');
		web_field.unbind('focus');
	}
});

$("#searchpeople").bind("click", function() { 
	$("#websearch").hide(); 
	$("#peoplesearch").show(); 
	if (!web_field.hasClass('default')) {
		people_field.val(web_field.val());
		people_field.removeClass('default');
		people_field.unbind('focus');
	}
});

web_field.bind("focus", function() { $(this).val(''); $(this).removeClass('default'); $(this).unbind(); });
people_field.bind("focus", function() { $(this).val(''); $(this).removeClass('default'); $(this).unbind(); });

$("#websearch").bind("submit", function() {
	if (web_field.val() == default_txt) {
		web_field.focus();
		return false;
	}
});

$("#peoplesearch").bind("submit", function() { 
	if (people_field.val() == default_txt) {
		people_field.focus();
		return false;
	}
});

});
