/***************************** can't touch this!! ***************************************/
var mainNavBar=new Array();
var mmi=-1;
function makeMenuItem(text,href){
	mmi++;
	mainNavBar[mmi]=new Array(text,href);
	}
/********************************* ok, it's safe ****************************************/

makeMenuItem('Home',					'index.htm');
makeMenuItem('Contact the Church/ Driving Directions',	'contactDirections.htm');
makeMenuItem('Youth/ Adult Ministries',			'youthAdultMinistries.htm');
//makeMenuItem('About the Pastor',			'aboutPastor.htm');
//makeMenuItem('Calendar of Events',			'javascript:openCalendar();');
makeMenuItem('ProTeens',				'proteens.htm');
makeMenuItem('About the Church/ History',		'aboutChurch.htm');
makeMenuItem('Countries of Our Missionaries',		'missionaries.htm');
//makeMenuItem('Messages',				'messageArchives.htm');
makeMenuItem('Are You Going To Heaven?',		'messageArchives.htm');
//makeMenuItem('Links',					'links.htm');



var mainNavBarStr = '';
for(i=0; i < mainNavBar.length; i++) {
	mainNavBarStr += '	<tr>\n' + ((pageName != mainNavBar[i][0]) ? '	<td align="left" class="nav" onMouseOver="this.style.backgroundColor=\'#ffffff\';this.style.color=\'#336699\';window.status=\'' + mainNavBar[i][1] + '\';return true;" onMouseOut="this.style.backgroundColor=\'#336699\';this.style.color=\'#ffffff\';" onClick="window.location.href=\'' + mainNavBar[i][1] + '\';window.status=\'\';return true;">' + ((document.layers) ? '<a href="' + mainNavBar[i][1] + '" class="nav">' : '') + mainNavBar[i][0] + ((document.layers) ? '</a>' : '') + '</td>' : '	<td align="left" class="navHot" bgcolor="#ffffff">' + mainNavBar[i][0] + '</td>') + '\n	</tr>\n';
	}



document.write('	<title>Berwick Bible Church' + ((pageName == "Home") ? '' : ' | ' + pageName) + '</title>');

var headerStr = '';
var today = new Date();
var month = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
var day = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
today = day[today.getDay()] + ', ' + month[today.getMonth()] + ' ' + today.getDate() + ', ' + today.getFullYear();

headerStr += '\
<body marginheight="0" marginwidth="0">\
\
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">\
<tr>\
<td align="center" valign="top">\
<img src="images/spacer.gif" height="32" width="778" alt=""><br>\
<table border="0" cellpadding="2" cellspacing="0"><tr><td bgcolor="#000000"><table border="0" cellpadding="0" cellspacing="0">\<tr><td bgcolor="#ffffff">\
	<table border="0" cellpadding="0" cellspacing="0" width="778">\
	<tr>\n\
	<td align="left" background="images/header_clouds3.jpg">\n\
		<table border="0" cellpadding="0" cellspacing="0" width="100%">\
		<tr>\n\
		<td align="left">\n' +
		((pageName != "Home") ? '		<a href="index.htm">\n' : '') + '\
		<img src="images/bbc_logo2.gif" height="84" width="193" border="0" alt="Berwick Bible Church"></a></td>\
		<td align="right" valign="middle" background="images/spacer.gif" nowrap>\
		<small><b>' + today + '&nbsp;</b></small></td>\
		</tr>\
		</table></td>\
	</tr>\
	<tr>\
	<td background="images/tile.gif">\
	<img src="images/spacer.gif" height="12" width="780"></td>\
	</tr>\
	<tr>\
	<td bgcolor="#ffffff"><img src="images/spacer.gif" height="2" width="778"></td>\
	</tr>\
	</table>\
	<table border="0" cellpadding="0" cellspacing="0" width="778">\
	<tr>\
	<td><img src="images/spacer.gif" height="480" width="2"></td>\
	<td align="left" valign="top" bgcolor="#336699"><br>\
		<table border="0" cellpadding="6" cellspacing="3" width="190">\n' +
		mainNavBarStr + '\
		</table></td>\
		<td align="left" valign="top">\n' +
		((pageName != "Home") ? '	<p class="header">' + pageName + '</p>' : '') + '\
		<table border="0" cellpadding="18" cellspacing="0" width="586">\
		<tr>\
		<td align="left" valign="top">\n';
document.write(headerStr);



var scrArray = new Array(
						'<i>Our help is in the name of the Lord, who made heaven and earth.</i><br>Psalms 124:8',
						'<i>This is my commandment that you love one another, as I have loved you.</i><br>John 15:12',
						'<i>Thy word is a lamp unto my feet, and a light unto my path.</i><br>Psalms 119:105',
						'<i>When thou criest, let thy companies deliver thee;  but the wind shall carry them all away, vanity shall take them;  but he that putteth his trust in me shall possess the land, and shall inherit my holy mountain.</i><br>Isaiah 57:13',
						'<i>But God commendeth His love toward us in that, while we were yet sinners, Christ died for us.</i><br>Romans 5:8',
						'<i>For all have sinned, and come short of the glory of God.</i><br>Romans 3:23',
						'<i>For the wages of sin is death, but the gift of God is eternal life through Jesus Christ, our Lord.</i><br>Romans 6:23',
						'<i>For Christ is the end of the law for righteousness to everyone that believeth.</i><br>Romans 10:4',
						'<i>Nor forsaking the assembling of ourselves together, as the manner of some is, but exhorting one another, and so much the more, as ye see the day approaching.</i><br>Hebrews 10:25',
						'<i>But put ye on the Lord Jesus Christ, and make not provision for the flesh, to fulfill its lusts.</i><br>Romans 13:14',
						'<i>There hath no temptation taken you but such as is common to man;  but God is faithful, who will not permit you to be tempted above that ye are able, but will, with the temptation, also make the way to escape, that ye may be able to bear it.</i><br>I Corinthians 10:13'
						);

var homeScrArray = new Array(
						'<i>Moreover, brethren, I declare unto you the gospel which I preached unto you, which also ye have received, and in which ye stand.  For I delivered unto you first of all that which I also received, that Christ died for our sins according to the scriptures.  And that he was buried, and that he rose again the third day according to the scriptures.  And that he was seen of Cephas, then of the twelve.  Therefore, whether it were I or they, so we preach, and so ye believed.</i><br>I Corinthians 15:1,3-5,11',
						'<i>O God, thou art my God, early will I seek thee;  my soul thirsteth for thee, my flesh longeth for thee in a dry and thirsty land, where no water is, To see thy power and thy glory, as I have seen thee in the sanctuary.  Because thy loving-kindness is better than life, my lips shall praise thee.</i><br>Psalms 63:1-3',
						'<i>For by grace are ye saved through faith;  and that not of yourselves, it is the gift of God &mdash; Not of works, lest any man should boast.  For we are his workmanship, created in Christ Jesus unto good works, which God hath before ordained that we should walk in them.</i><br>Ephesians 2:8-10',
						'<i>Blessed is the man who walketh not in the counsel of the ungodly, nor standeth in the way of sinners, nor sitteth in the seat of the scornful.  But his delight is in the law of the LORD;  and in his law doth he meditate day and night.  And he shall be like a tree planted by the rivers of water, that bringeth forth irs fruit in its season;  its leaf also shall not wither;  and whatsoever he doeth shall prosper.  The ungodly are not so, but are like the chaff which the wind driveth away.  Therefore, the ungodly shall not stand in the judgment, nor sinners in the congregation of the righteous.  For the LORD knoweth the way of the righteous;  but the way of the ungodly shall perish.</i><br>Psalms 1:1-6',
						'<i>And this is the record, that God hath given to us eternal life, and this life is in his Son.  He that hath the Son hath life;  and he that hath not the Son of God hath not life.</i><br>I John 5:11-12',
						'<i>If ye, then, be risen with Christ, seek those things which are above, where Christ sitteth on the right hand of God.  Set your affection on things above, not on things on the earth.  For ye are dead, and your life is hidden with Christ in God.  When Christ, who is our life, shall appear, then shall ye also appear with him in glory.</i><br>Colossians 3:1-4',
						'Then spake Jesus again unto them, saying, <i>I am the light of the world:  he that followeth me shall not walk in darkness, but shall have the light of life...if ye believe not that I am he, ye shall die in your sins...if ye continue in the word, then are ye my disciples indeed;  and ye shall know the truth, and the truth shall make you free.</i><br>John 8:12, 24b, 31b-32'
						);

var rndNum = Math.round(Math.random() * (scrArray.length-1));

var rndNum2 = Math.round(Math.random() * (homeScrArray.length-1));



var rndFooterStr = 	'<table border="0" cellpadding="0" cellspacing="0" width="778">\
			<tr>\
			<td align="left" valign="top" background="images/footerTile.gif">\
			<img src="images/spacer.gif" height="14" width="2" alt=""></td>\
			<td align="left" valign="top" background="images/footerTile.gif">\
			<img src="images/blueBlock.gif" height="14" width="190" alt=""></td>\
			<td align="right" background="images/footerTile.gif">\
				<table border="0" cellpadding="0" cellspacing="4">\
				<tr>\
				<td align="right" valign="top" background="images/spacer.gif">\
				<img src="images/spacer.gif" height="28" width="530"><br>\
				<span class="footer">\n' +
				scrArray[rndNum] + '</span></td>\
				<td valign="top" background="images/spacer.gif"><img src="images/cross_med.gif" width="46" height="56"></td>\
				</tr>\
				</table></td>\
			</tr>\n\
			</table>';



//alert(footerStr);




var footerStr = '';
function buildFooter() {
	footerStr += 	'</td>\
		</tr>\
		</table></td>\
	</tr>\
	</table>' +
rndFooterStr + '\
</tr>\
</table></td></tr></table><br>\
<img src="images/spacer.gif" height="32" width="778" alt=""></td></td></tr></table>\n';
	document.write(footerStr);
	}

var month = new Array('January','February','March','April','May','June','July','August','September','October','November','December');

var calHeight = (screen.availHeight < 660) ? screen.availHeight : 660;
var today2 = new Date();
function openCalendar() {
	today2 = month[today2.getMonth()].toLowerCase() + today2.getFullYear();
	var calWindow = window.open("calendar/" + today2 + ".htm","calWindow","resizable=1,scrollbars=1,menu=0,status=0,location=0,top=100,left=100,height=" + calHeight + ",width=780");
	//calWindow.focus();
	}