	function adjustpopup()
	{
		//This function will size the border around the popup div to whatever the inner content width & height are
		//alert(document.getElementById('popupdivcontent').clientHeight)
		var extrapad=10
		document.getElementById('popupdivcontentwrapper').style.padding=extrapad+'px'
		/*if(document.getElementById('popupdivcontentwrapper').clientWidth>320)
		{
			document.getElementById('popupdivcontentwrapper').style.width=320+'px'
		}*/
		
		/*document.getElementById('xpopupdivwrapper').style.width=document.getElementById('popupdivcontentwrapper').clientWidth+51
		document.getElementById('xpopupdivwrapper').style.height=document.getElementById('popupdivcontentwrapper').clientHeight+51*/
		var pdcontentwrapperw=document.getElementById('popupdivcontentwrapper').clientWidth
		var pdcontentwrapperh=document.getElementById('popupdivcontentwrapper').clientHeight

		//document.getElementById('blah').innerHTML='popupdivcontentwrapper='+pdcontentwrapperw
		//document.getElementById('blah').innerHTML+='<br>pdcontentwrapperw='+pdcontentwrapperw
		//adjust

		document.getElementById('popupdivbordertop').style.width=pdcontentwrapperw+extrapad+41+'px' //the additional width is to account for the extra interior padding		
		
		document.getElementById('popupdivbordermid').style.width=pdcontentwrapperw+extrapad+41+'px'
		document.getElementById('popupdivbordermid').style.height=pdcontentwrapperh+'px'
		
		document.getElementById('popupdivborderbottom').style.width=pdcontentwrapperw+extrapad+41+'px'


		document.getElementById('popupdivcontentleft').style.height=pdcontentwrapperh+'px'
		document.getElementById('popupdivcontentright').style.height=pdcontentwrapperh+'px'
		document.getElementById('popupdivcontenttop').style.width=pdcontentwrapperw+extrapad+'px'
		document.getElementById('popupdivcontentbottom').style.width=pdcontentwrapperw+extrapad+'px'


		document.getElementById('popupdivcontentwrapper').style.width=pdcontentwrapperw-extrapad+'px'
		
		//alerts

		/*document.getElementById('blah').innerHTML+='<br>popupdivbordertop='+document.getElementById('popupdivbordertop').clientWidth
		document.getElementById('blah').innerHTML+='<br>xpopupdivwrapper='+document.getElementById('xpopupdivwrapper').clientWidth
		document.getElementById('blah').innerHTML+='<br>pdcontentwrapperw='+pdcontentwrapperw
		document.getElementById('blah').innerHTML+='<br>popupdivcontentwrapper client='+document.getElementById('popupdivcontentwrapper').clientWidth
		document.getElementById('blah').innerHTML+='<br>popupdivcontentwrapper style='+document.getElementById('popupdivcontentwrapper').style.width*/
	}

	function chgbg(what,num)
	{
		//alert('yay '+ num)
		if(num==1)
		{
			//mouseover
			what.className='divlinkon'
		}
		else
		{
			//mouseout
			what.className='divlinkoff'
		}
	}

	function initMenus()
	{
		//this function is on a lot of pages but is no longer needed
		var nyet
	}
	function handleResize()
	{
		//this function is on a lot of pages but is no longer needed
		var nyet
	}


	function entsub(myform,e)
	{
		//alert(window.event.keyCode)
		var kp
		if(navigator.appName.indexOf("Microsoft") > -1)
		{
			kp=window.event.keyCode
		}
		else
		{
			kp=e.which
			//alert(kp)
		}
		
		
		if ((window.event || e) && kp == 13)
		{
			myform.submit();
		}
		else
		{
			return true;
		}
	}

	function updownout(ob,swpimg)
	{
		//generic image swap function
		ob.src=swpimg
	}

	var curopen;
	var totalnavmenuitems=7

	function showhide(what,num,bk)
	{
		//what=object
		//num: 1=show, 0=hide
		//bk: 1=block, 0=don't block		

		//alert('what='+what+' num='+num+' bk='+bk)
		closemenus()
		if(document.getElementById(what))
		{
			if(num==1)
			{
				document.getElementById(what).style.visibility='visible'
			}
			else if(num==0)
			{
				document.getElementById(what).style.visibility='hidden'
				//onsubnav=0;
			}
		}
	}
	
	function showhideonclick(what)
	{
		if(document.getElementById(what).style.visibility=='visible')
		{
			document.getElementById(what).style.visibility='hidden'
		}
		else
		{
			document.getElementById(what).style.visibility='visible'
		}
	}

	function closemenus()
	{
		//be sure all menus are closed
		for (var f=0;f<totalnavmenuitems;f++)
		{
			if(gebid('ITEMS'+f)!=null)
			{
				document.getElementById('ITEMS'+f).style.visibility='hidden'
			}
		}
	
	}

	//menu #0 - About
	//menu #1  -Our Ministries
	//menu #2 - Support
	//menu #4 - Spiritual Help
	//menu #5 - Contact
	var navarray=[
['0',''],				  
				  
['1','Articles & News','/News_Article_index.asp',''],
['1','FAQ','/faq.asp',''],
['1','Employment','/BGEA_Employment.asp',''],
['1','Statement Of Faith','/StatementOfFaith.asp',''],
['1','Our Financial Commitment to You','/Development_AnnualReports.asp',''],
['1','International Offices','/BGEAIntl_Index.asp',''],
['1','Affiliated Ministries','/AffiliatedMinistries.asp',''],
['1','Biographies','/Biographies_Index.asp',''],


['2','Billy Graham Library','/BGLibrary_Index.asp',''],
//['2','Billy Graham Ambassadors','/BGamb_news.asp',''],
['2','Church Ministries','/ChurchMinistries_Index.asp',''],
['2','Crusade Ministries','/CrusadeMinistries_Index.asp',''],
['2','Decision Magazine','/DMag_article_index.asp',''],
['2','International Ministries','/IntlMin_Index.asp',''],
['2','Radio Ministries','/Radio_Index.asp',''],
['2','TV Specials','/TV_Index.asp',''],
['2','The Cove','http://www.bgtc.info/',''],
['2','World Wide Pictures','/WWP_Index.asp',''],

['3','Prayer','/Prayer_Index.asp',''],
['3','Online Giving','/donate.asp',''],
['3','Gift Planning','/support_plannedgiving_index.asp',''],
//['3','Gift Planning','/Support_GiftPlanningWelcome.asp',''],
//['3','Printable Donation Form','/pdfs/DonationForm2009.pdf',' target="_blank"'],


['4',''],

['5','Steps to Peace with God','/SH_StepsToPeace.asp',''],
['5','Order Steps to Peace with God','http://www.billygrahambookstore.org/product.asp?sku=2161_81854P25',''],
['5','Request Prayer','/Contact_BGEA.asp?q=2',''],
['5','The Second Coming','/News_Article.asp?ArticleID=448',''],
['5','Grief Resources','/SpiritualHelp_GriefResources.asp',''],
['5','Topics','/SpiritualHelp_Index.asp',''],

	
['6','Contact Form','/Contact_BGEA.asp',''],
['6','Phone/Mailing','/Contact_MailingPhoneInfo.asp','']
]

	var subnavarray=[
['Church Ministries','Online Training','/bgamb_current.asp'],
['Church Ministries','Schools Of Evangelism','/SOE_Index.asp'],
['Church Ministries','Christian Life & Witness Course','/CLWC_Index.asp'],
['Church Ministries','Dare to Be a Daniel','/D2BD_Index.asp'],
['Church Ministries','Rapid Response Team','/RapidResponse_Index.asp'],
['Church Ministries','TV Telephone Ministry','/TVTM_Index.asp']
]

var mainnavarr=[
'/default.asp',				
'/AboutUs_Index.asp',
'/OurMinistries_Index.asp',
'/Support_Index.asp',
'http://www.billygrahambookstore.com',
'/SpiritualHelp_Index.asp',
'/Contact_BGEA.asp']

	//alert(navarray.length+' '+navarray[0].length)
	var x=0
	var y=0
	var flg=0
	var subnavflg=0
	do
	{
		//alert('x='+x+' y='+y)
		document.write('<div style="float:left;position:relative;">')
		if(y==0)
		{
			//document.write('<img src="/images/Nav_Spacer01.gif" alt="space" width="9" height="43">')
		}
		document.write('<img src="/images/globalnavmenu2/spacer'+(x+1)+'.jpg" style="float:left;">')
		document.write('<a href="'+mainnavarr[x]+'">')
		document.write('<img src="/images/GlobalNavMenu2/Nav_0'+(x+1)+'.jpg" alt="Nav item" border="0" onmouseover="updownout(this,\'/images/GlobalNavMenu2/Nav_0'+(x+1)+'On.jpg\');showhide(\'ITEMS'+x+'\',1,0)" onmouseout="updownout(this,\'/images/GlobalNavMenu2/Nav_0'+(x+1)+'.jpg\');closemenus();showhide(\'ITEMS'+x+'\',0,0)">')
		document.write('</a>')
		
		if(navarray[y][1])
		{
			if(navigator.appName=="Microsoft Internet Explorer")
			{
				document.write('<div style="position:relative;top:0px;">')
			}
	
			document.write('<div id="ITEMS'+x+'" class="items" onmouseover="showhide(\'ITEMS'+x+'\',1,0)" onmouseout="showhide(\'ITEMS'+x+'\',0,0)">')
	
			do
			{

				document.write('<div style="position:relative;">')

				subnavflg=0
				for (var k=0;k<subnavarray.length;k++)
				{
					if(subnavarray[k][0]==navarray[y][1])
					{
						if(subnavflg==0)
						{
							if((navigator.appName=="Microsoft Internet Explorer") && (navigator.appVersion.indexOf('MSIE 6.0')>0))
							{
								document.write('<div id="ITEMSsub'+y+'" class="itemssub" onmouseover="showhide(\'ITEMSsub'+y+'\',1,0)" onmouseout="showhide(\'ITEMSsub'+y+'\',0,0)" style="right:-153px;">')
							}
							else
							{
								document.write('<div id="ITEMSsub'+y+'" class="itemssub" onmouseover="showhide(\'ITEMSsub'+y+'\',1,0)" onmouseout="showhide(\'ITEMSsub'+y+'\',0,0)">')
							}
							subnavflg=1 //this one has a subnav
						}
							document.write('<div class="divlinkoff" onmouseover="chgbg(this,\'1\');" onmouseout="chgbg(this,\'0\');" style="position:relative;">')
							document.write('<a href="'+subnavarray[k][2]+'" style="text-decoration:none;"><div class="mainnav"><span class="subnav">'+subnavarray[k][1]+'</span></div></a>')
							document.write('</div>')
					}
				}
				
				if(subnavflg==1)
				{
					document.write('</div>') //ends the ITEMSsub div
					document.write('<div class="divlinkoff" onmouseover="showhide(\'ITEMSsub'+y+'\',1,0);chgbg(this,\'1\');" onmouseout="showhide(\'ITEMSsub'+y+'\',0,0);chgbg(this,\'0\');" style="position:relative;">')
					subnavflg=0
				}
				else
				{
					document.write('<div class="divlinkoff" onmouseover="chgbg(this,\'1\');" onmouseout="chgbg(this,\'0\');">')
				}

					var hrefstuff=navarray[y][3]
					document.write('<a href="'+navarray[y][2]+'" style="text-decoration:none;"'+hrefstuff+'><div class="mainnav"><span class="subnav">'+navarray[y][1]+'</span></div></a>')
				document.write('</div>')

				document.write('</div>')
				y++
				if(y >= navarray.length)
				{
					break;
				}
			} while (navarray[y][0]==navarray[y-1][0])

			if(navigator.appName=="Microsoft Internet Explorer")
			{
				document.write('</div>')
			}
			document.write('</div></div>')
		}
		else
		{
			document.write('</div>')
			y++
			if(y >= navarray.length)
			{
				break;
			}
		}


		//document.write('<img src="images/Nav_Spacer02.gif" alt="space" width="10" height="43">')
		x++
		if (y >= navarray.length)
		{
			flg=1;
			//document.write('<img src="images/Nav_Spacer02.gif" alt="space" width="10" height="43" style="float:left;">')
		}

	} while (flg==0)
	document.write('<img src="/images/globalnavmenu2/spacer'+(x+1)+'.jpg" width="23" style="margin:0px;padding:0px;float:left;">')