// <!--
// $Header$
function showmenu(menuname)
{
	document.getElementById(menuname).style.visibility='visible';
}
function hidemenu(menuname)
{
	document.getElementById(menuname).style.visibility='hidden';
}

var scriptures= new Array(
	new Array("&quot;For God so loved the world, that He gave His only begotten Son, that whoever believes in Him shall not perish, but have eternal life.&quot;", "&#151; John 3:16 (NIV)"),
	new Array("&quot;Go therefore and make disciples of all the nations, baptizing them in the name of the Father and the Son and the Holy Spirit&quot;", "&#151; Matthew 28:19 (NIV)"),
	new Array("&quot;We were therefore buried with him through baptism into death in order that, just as Christ was raised from the dead through the glory of the Father, we too may live a new life.&quot;", "&#151; Romans 6:4 (NIV)")
);

function initPage()
{
	var d = new Date();
	var s = d.getSeconds();
	var count = 3;
	document.getElementById('id_script_text').innerHTML=scriptures[s%count][0];
	document.getElementById('id_script_ref').innerHTML=scriptures[s%count][1];
}

var lRatio = 1;
var lOrigWidth = 0;

function resizeDivs() {
	var navWidth=$("div.navmenu").width();
	var newsWidth=$("div.news_block").size() == 1 ? $("div.news_block").width() : 0;
	var fullWidth=$("div.page_head").width()-30;
	//$("div#mainbody").width((fullWidth-(navWidth+newsWidth))+"px");
	//$("div.news_block").height(Math.max($("div.news_block").height(), $("div.navmenu").height()));
	if ($("#gslogoimg").size() > 0 && lOrigWidth + navWidth + newsWidth > fullWidth) {
		var logo = $("#gslogoimg");
		var newWidth = fullWidth - (navWidth + newsWidth);
		logo.width(newWidth);
		logo.height(newWidth * lRatio);
	}
}

$(window).resize(function() {
	resizeDivs();
});

$(document).ready(function(){
	if ($("#gslogoimg").size() > 0) {
		var logo = $("#gslogoimg");
		lRatio = logo.height() / logo.width();
		lOrigWidth = logo.width();
	}
	resizeDivs();
	initPage();
	if ($("div#news_content").size() > 0) {
		$("div#news_content").load("/members/p_displaynews.php");
	}
});
// -->

