function CycleOnBefore ( )
{
	$('#banner_home_quote').html(this.alt);
}

function FixColumnHeight ( )
{
	var newHeight = 0;
	var minHeight_menu = 433;
	var minHeight_content = 240;
	
	$('#menu_container').css('height', 0);
	
	var menuHeight = $('#menu_container').height();
	var contentHeight = $('#content').height();

	//alert('menuHeight = ' + $('#menu_container').height() + '\n' + 'contentHeight = ' + $('#content').height() + '\n');

	if (contentHeight != null) 
	{		
		if (menuHeight < minHeight_menu && contentHeight < minHeight_content) {
			$('#menu_container').css('height', minHeight_menu + 25);
			$('#content').css('height', minHeight_content);
		}
		else 
			if (menuHeight < minHeight_menu && contentHeight > minHeight_content) {
				var contentHeightDifference = contentHeight - minHeight_content;
				newHeight = menuHeight + contentHeightDifference + minHeight_menu;
				$('#menu_container').css('height', newHeight + 25);
			}
			else 
				if (menuHeight > minHeight_menu && contentHeight < minHeight_content) {
					var menuHeightDifference = menuHeight - minHeight_menu;
					newHeight = menuHeight + menuHeightDifference + minHeight_content;
					$('#content').css('height', newHeight);
				}
	}
	else
	{
		$('#menu_container').css('height', minHeight_menu + 38);
	}
	
	//alert('menuHeight = ' + $('#menu_container').height() + '\n' + 'contentHeight = ' + $('#content').height() + '\n');
}

function Menu_Over (obj)
{
	$(obj).parent().css("background-image", "url('http://www.stmartinsj.org/images/main_nav_mouse_over.png')")
				   .css("background-position", "top left")
				   .css("background-repeat", "repeat-x");
}

function Menu_Out (obj)
{
	$(obj).parent().css("background-image", "url('http://www.stmartinsj.org/images/main_nav_border_2.png')")
				   .css("background-position", "bottom left")
				   .css("background-repeat", "no-repeat");
}

function SubMenu_Out (obj)
{
	$(obj).parent().css("background-image", "")
				   .css("background-color", "#eeeeee");
}

function Random_Homepage_Banner (objArray)
{
	var randomNumber = rand(objArray.length);
	$('#banner_home').css('background-image','url(\'' + objArray[randomNumber] + '\')');
}

function rand ( n )
{
	return ( Math.floor( Math.random() * n ) );
}

function changeFrame ( username )
{
	var obj = document.getElementById( "the_iframe" );
	
	if ( username == "middle_matters" )
	{
		obj.src = 'http://www.stmartinsj.org/content/shared/middle_matters.php';
	}
	else
	{
		obj.src = 'http://pages.stmartin.org/~' + username;
	}
}

