myBrowser = navigator.appName
myVersion = navigator.appVersion
var version45 = (myVersion.indexOf ("4.") != -1 || myVersion.indexOf ("5.") != -1)
var NS = (myBrowser.indexOf ("Netscape") != -1 && version45)
var IE = (myBrowser.indexOf ("Explorer") != -1 && version45)
if (!NS && !IE)
  alert ("This page is intended to be viewed under Netscape versions 4.0+ or Internet Explorer versions 4.0+, and may not run properly on earlier versions")

var logoimg = new Image()
logoimg.src = "images/nbcclogo.gif" 
var titleleftimg = new Image()
titleleftimg.src = "images/titleleft.gif"
var titlerightimg = new Image()
titlerightimg.src = "images/titleright.gif"

function timeofdaygif(path)
{
   d = new Date ()
   h = d.getHours ()
   if (h <= 23 && h >= 18) 
      document.write ("<img src=\"" + path + "images/evening.gif\" alt=\"Good Evening!\"><br>")
   else if (h < 18 && h >= 12)
      document.write ("<img src=\"" + path + "images/afternoon.gif\" alt=\"Good Afternoon!\"><br>")
   else
      document.write ("<img src=\"" + path + "images/morning.gif\" alt=\"Good Morning!\"><br>")
}

function mainpageheader(path)
{
   document.write("<table width=\"750\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n")
   document.write("<tr>\n")
   document.write("<td width=\"300\" align=\"center\" background=\"" + path + "images/titleleft.gif\">")
   timeofdaygif(path)
   document.write("<img src=\"" + path + "images/welcome.gif\" alt=\"Welcome!\">")
   document.write("</td>\n")
   document.write("<td width=\"150\" align=\"center\"><a href=\"" + path + "\"><img src=\"" + path + "images/nbcclogo.gif\" border=\"0\" alt=\"NBCC Logo\"></a></td>\n")
   document.write("<td width=\"300\" align=\"center\" background=\"" + path + "images/titleright.gif\"><img src=\"" + path + "images/pastor.gif\" alt=\"Pastor\"><br>")
   document.write("<a href=\"mailto:mark@nbccn.org\"><img src=\"" + path + "images/markvaladez.gif\" border=\"0\" alt=\"Mark Valadez\"></a></td>\n")
   document.write("</tr>\n")
   document.write("</table>\n")
}

function mainnavbar(path)
{
   document.write("<hr width=\"750\" size=\"5\">\n")
   document.write("<a href=\"" + path + "\"><img src=\"" + path + "images/homesm.gif\" border=\"0\" alt=\"Home\"></a>")
   document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"" + path + "?link=weeklyupd\"><img src=\"" + path + "images/weeklyupdsm.gif\" border=\"0\" alt=\"Weekly Update\"></a>")
   document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"" + path + "lists.php?listtype=Acts\"><img src=\"" + path + "images/actsinactionsm.gif\" border=\"0\" alt=\"Acts In Action\"></a>")
   document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"" + path + "lists.php?listtype=Prayer\"><img src=\"" + path + "images/prayerlistsm.gif\" border=\"0\" alt=\"Prayer/Praise List\"></a>\n")
   document.write("<hr width=\"750\" size=\"5\">\n")
   document.write("<br>\n")
}

function adminpageheader()
{
   document.write("<table width=\"750\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n")
   document.write("<tr>\n")
   document.write("<td width=\"300\" align=\"center\" background=\"../images/titleleft.gif\">\n")
   document.write("</td>\n")
   document.write("<td width=\"150\" align=\"center\">\n")
   document.write("<a href=\"../\"><img src=\"../images/nbcclogo.gif\" border=\"0\" alt=\"NBCC Logo\"></a></td>\n")
   document.write("<td width=\"300\" align=\"center\" background=\"../images/titleright.gif\">\n")
   document.write("</td>\n")
   document.write("</tr>\n")
   document.write("</table>\n")
}

function adminnavbar()
{
   document.write("<hr width=\"750\" size=\"5\">\n")
   document.write("<a href=\"http://www.nbccn.org\"><img src=\"../images/homesm.gif\" border=\"0\" alt=\"Home\"></a>")
   document.write("&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"../\"><img src=\"../images/mainmenusm.gif\" border=\"0\" alt=\"Main Menu\"></a>")
   document.write("&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"listpeople.php\"><img src=\"../images/listpeoplesm.gif\" border=\"0\" alt=\"List People\"></a>")
   document.write("&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"listaddresses.php\"><img src=\"../images/listaddressessm.gif\" border=\"0\" alt=\"List Addresses\"></a>")
   document.write("&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"newperson.php\"><img src=\"../images/newpersonsm.gif\" border=\"0\" alt=\"New Person\"></a>\n")
   document.write("<hr width=\"750\" size=\"5\">\n")
   document.write("<br><br>\n")
}

function newthingclick(theField, theDiv)
{
   if (theField.checked)
   {
      if (IE)
         theDiv.style.display = "block"
      if (NS)
         theDiv.display = "block"
   }
   else
   {
      if (IE)
         theDiv.style.display = "none"
      if (NS)
         theDiv.display = "none"
   }
}

function expanddiv (theDiv)
{
   if (NS)
   {
      if (theDiv.display == "block")
         theDiv.display = "none"
      else
         theDiv.display = "block"
   }
   
   if (IE)
   {
      if (theDiv.style.display == "block")
         theDiv.style.display = "none"
      else
         theDiv.style.display = "block"
   }
}

function delall(form, text)
{
   if (confirm("Are you sure you want to delete all the checked " + text + "?"))
   {
      form.submit()
   }
}

