function clearit(obj) {
	if (obj.value == "church name" || obj.value == "email address"
			|| obj.value == "user name" || obj.value == "password") {
		obj.value = "";
	}
}

function trim(str) {
	return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}

$(document).ready(function()
{
	// Highlight nav menu on hover
	$('#subNav li').mouseover(function(m)
	{
		if ($(this).attr('class') == '') {
			$(this).css('background-color', '#00546B');
		}
	});
	$('#subNav li').mouseout(function(m)
	{
		if ($(this).attr('class') == '') {
			$(this).css('background-color', '#aaa');
		}
	});

	// Highlight current page in menu
	$('#t-'+$('body').attr('id')).css('background-color', '#00546B');

	// Provide default text in input boxes
	$(".defaultText").focus(function(srcc)
	{
		if ($(this).val() == $(this)[0].title) {
			$(this).removeClass("defaultTextActive");
			$(this).val("");
		}
	});

	$(".defaultText").blur(function()
	{
		if ($(this).val() == "") {
			$(this).addClass("defaultTextActive");
			$(this).val($(this)[0].title);
		}
	});

	$(".defaultText").focus();
	$(".defaultText").blur();
});

$("question").submit(function() {
	$(".defaultText").each(function() {
		if($(this).val() == $(this)[0].title) {
			$(this).val("");
		}
	});
}); 

