var isNS4 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) == 4);
var isNS6 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 5);
var isIE4 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4);
var isIE5 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 5);

// var isNS4 = (document.layers) ? true : false;
// var isIE4 = (document.all && !document.getElementById) ? true : false;
// var isIE5 = (document.all && document.getElementById) ? true : false;
// var isNS6 = (!document.all && document.getElementById) ? true : false;

function setCookie (c_name, value, expiredays)
{
var exdate = new Date();
exdate.setDate (expiredays);
document.cookie = c_name + "=" + escape (value) +
  ((expiredays == null) ? "" : ";expires=" + exdate);
}

function getCookie (c_name)
{
if (document.cookie.length > 0)
  {
  c_start = document.cookie.indexOf (c_name + "=");
  if (c_start != -1)
    { 
    c_start = c_start + c_name.length + 1;
    c_end = document.cookie.indexOf (";", c_start);
    if (c_end == -1) c_end = document.cookie.length;
    return unescape (document.cookie.substring (c_start, c_end));
    } 
  }
return null;
}

var oldList = getCookie ("stlukesmenu");

function switchit (list) {
  var listElementStyle;
  if (!isNS4) {
  if (isNS4)
    listElementStyle = document.layers[list];
  else
    listElementStyle = document.getElementById(list).style;
  if (listElementStyle.display == "none") {
    listElementStyle.display = "block";
    setCookie ("stlukesmenu", list);
    }
  else {
    listElementStyle.display="none";
    setCookie ("stlukesmenu", "");
    }
  if (oldList != "" && oldList != null && oldList != list) {
    var oldListElement = document.getElementById (oldList).style;
    oldListElement.display = "none";
  }
  oldList = list;
  }
}

function write_header (list, header) {

document.write ("<tr><td>");
if (isNS4)
  document.write ("<div class=\"LeftHandLink\">");
else
  document.write ("<a href=\"javascript:switchit('" + list + "')\" class=\"LeftHandLink\">");
document.write (header);
if (isNS4)
  document.write ("</div>");
else
  document.write ("</a>");
document.write ("<table border=\"0\" id='" + list + "'");
if (oldList != list && !isNS4)
  document.write (" style=\"display:none\"");
document.write ("><tbody>");
}

function menu (opencell) {

var stlukes;

/* if (location.protocol == "file:") { */
if (isNS6 || isIE4)
    stlukes = "St.&nbsp;Luke&rsquo;s";
else if (isNS4)
    stlukes = "St.&nbsp;Luke&#8217;s";
else
    stlukes = "St.&nbsp;Luke's";

if (opencell != 0)
    document.write ("<td valign=\"top\" bgcolor=\"#aa0000\" width=\"20%\" align=\"left\">");
// document.write ("<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\" width=\"100%\">");
// document.write ("<tbody>");
// document.write ("<tr>");
// document.write ("<td valign=\"top\" align=\"center\"><img src=\"EpisShld.gif\"");
// document.write (" title=\"\" alt=\"\" width=\"104\" height=\"117\"><br>");
// document.write ("</td>");
// document.write ("</tr>");
// document.write ("</tbody>");
// document.write ("</table>");
document.write ("<br>");
document.write ("<table align=\"left\" border=\"0\"><tbody>");
document.write ("<tr><td><a href=\"index.shtml\" class=\"LeftHandLink\">Home Page</a></td></tr>");
// document.write ("<tr><td><a href=\"auction/index.html\" class=\"LeftHandLink\">Silent Auction</a></td></tr>");
//
write_header ("welcome", "Welcome to " + stlukes);
document.write ("<tr><td>&nbsp;</td><td><a href=\"findus.shtml\" class=\"LeftHandLink\">How to find us</a></td></tr>");
document.write ("<tr><td></td><td><a href=\"services.shtml\" class=\"LeftHandLink\">Schedule of Services</a></td></tr>");
document.write ("<tr><td>&nbsp;</td><td><a href=\"newcomers.shtml\" class=\"LeftHandLink\">For Newcomers</a></td></tr>");
document.write ("<tr><td></td><td><a href=\"faq.shtml\" class=\"LeftHandLink\">What is the<br>&nbsp;&nbsp;&nbsp;Episcopal Church?</a></td></tr>");
document.write ("</tbody></table>");
document.write ("</td></tr>");
//
write_header ("whoweare", "Who We Are at " + stlukes);
document.write ("<tr><td>&nbsp;</td><td><a href=\"parishlife.shtml\" class=\"LeftHandLink\">Parish Life at " + stlukes + "</a></td></tr>");
document.write ("<tr><td></td><td><a href=\"annualmeeting.shtml\" class=\"LeftHandLink\">Annual Reports 2005</a></td></tr>");
document.write ("<tr><td></td><td><a href=\"clergy.shtml\" class=\"LeftHandLink\">Clergy and Staff</a></td></tr>");
document.write ("<tr><td></td><td><a href=\"photoalbum.shtml\" class=\"LeftHandLink\">Our Photo Album</a></td></tr>");
document.write ("</tbody></table>");
document.write ("</td></tr>");
//
write_header ("specialgroups", "Special Groups");
document.write ("<tr><td></td><td><a href=\"belizemission.shtml\" class=\"LeftHandLink\">Belize Mission Group</a></td></tr>");
document.write ("<tr><td></td><td><a href=\"wellness.shtml\" class=\"LeftHandLink\">Wellness Council</a></td></tr>");
document.write ("</tbody></table>");
document.write ("</td></tr>");
//
write_header ("calendar", "Calendars");
document.write ("<tr><td>&nbsp;</td><td><a href=\"weekly.shtml\" class=\"LeftHandLink\">The Weekly Bulletin</a></td></tr>");
document.write ("<tr><td>&nbsp;</td><td><a href=\"thismonth.shtml\" class=\"LeftHandLink\">The Monthly Newsletter</a></td></tr>");
document.write ("<tr><td>&nbsp;</td><td><a href=\"pentecost.shtml\" class=\"LeftHandLink\">Seasons of the Church:");
document.write ("<br>&nbsp;&nbsp;&nbsp;Pentecost</a></td></tr>");
document.write ("<tr><td></td><td><a href=\"bboard.shtml\" class=\"LeftHandLink\">Bulletin Board</a></td></tr>");
document.write ("</tbody></table>");
document.write ("</td></tr>");
//
write_header ("ministries", "Ministries and Outreach");
document.write ("<tr><td>&nbsp;</td><td><a href=\"worship.shtml\" class=\"LeftHandLink\">Worship & Pastoral Care</a></td></tr>");
document.write ("<tr><td></td><td><a href=\"sermons.shtml\" class=\"LeftHandLink\">Sermons at " + stlukes + "</a></td></tr>");
document.write ("<tr><td></td><td><a href=\"outreach.shtml\" class=\"LeftHandLink\">Outreach Ministries</a></td></tr>");
document.write ("</tbody></table>");
document.write ("</td></tr>");
//
write_header ("children", "Children and Youth");
document.write ("<tr><td>&nbsp;</td><td><a href=\"kids.shtml\" class=\"LeftHandLink\">Activities</a></td></tr>");
document.write ("<tr><td></td><td><a href=\"forkids.shtml\" class=\"LeftHandLink\">Just for Kids</a></td></tr>");
document.write ("</tbody></table>");
document.write ("</td></tr>");
document.write ("<tr><td><a href=\"whatsnew.shtml\" class=\"LeftHandLink\">What's New</a></td></tr>");
//
document.write ("<tr><td><a href=\"gallery.shtml\" class=\"LeftHandLink\">Buildings & Grounds</a></td></tr>");
document.write ("<tr><td><a href=\"music.shtml\" class=\"LeftHandLink\">Music at " + stlukes + "</a></td></tr>");
document.write ("<tr><td><a href=\"StLukeArt.shtml\" class=\"LeftHandLink\">St.&nbsp;Luke in Art</a></td></tr>");
document.write ("<tr><td><a href=\"school/schoolhome.html\" class=\"LeftHandLink\">" + stlukes +" School</a></td></tr>");
// document.write ("<br>");
// document.write ("<!-- Start Bravenet.com Service code -->");
// document.write ("<a href=\"http://pub15.bravenet.com/forum/show.php?usernum=1235727492&cpv=2\" // class=\"LeftHandLink\">Message Forum</a><br>");
// document.write ("<br>");
// document.write ("<a href=\"http://pub15.bravenet.com/guestbook/show.php?usernum=1235727492&cpv=2\" // class=\"LeftHandLink\">Guest Book</a><br>");
// document.write ("<!-- End Bravenet.com Service code -->");
document.write ("<tr><td><a href=\"links.shtml\" class=\"LeftHandLink\">Useful links</a></td></tr>");
if (opencell != 0)
    document.write ("<tr><td><a href=\"sitemap.shtml\" class=\"LeftHandLink\">Site Map</a></td></tr>");
document.write ("</tbody></table>");
if (opencell != 0)
    document.write ("</td>");
/* } */
};

function do_addr ()
{
document.write ("<a");
document.write (" hr");
document.write ("ef=\"");
document.write ("mai");
document.write ("lto");
document.write (String.fromCharCode (58));
}

function do_endaddr ()
{
document.write ("\">");
}

function church_addr ()
{
do_addr ();
document.write ("stlukeep");
document.write (String.fromCharCode (64));
document.write ("veriz");
document.write ("on" + String.fromCharCode (46));
document.write ("ne" + "t");
do_endaddr ();
}

function jan_addr ()
{
do_addr();
document.write ("janiceaf");
document.write (String.fromCharCode (64));
document.write ("ix" + String.fromCharCode (46));
document.write ("netc");
document.write ("om" + String.fromCharCode (46));
document.write ("co" + "m");
do_endaddr ();
}

function bruce_addr ()
{
do_addr();
document.write ("bcwright");
document.write (String.fromCharCode (64));
document.write ("ix" + String.fromCharCode (46));
document.write ("netc");
document.write ("om" + String.fromCharCode (46));
document.write ("co" + "m");
do_endaddr ();
}

function top_table (display_address)
{
document.write ("<table align=\"center\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\" width=\"80%\">");
document.write ("<tbody>");
document.write ("<tr>");
document.write ("<td align=\"right\"><img alt=\"\" src=\"logo/smredoncream-100p-transp1.gif\" height=\"100\" width=\"137\"></td>");
document.write ("<td><img alt=\"\" src=\"logo/StLukes-rgb2-crop.gif\" height=\"68\" width=\"202\"><br>");
document.write ("<img alt=\"Episcopal\" src=\"logo/Episcopal4.gif\" height=\"32\" width=\"202\"></td>");
document.write ("</tr>");
if (display_address != 0) {
  document.write ("<tr>");
  document.write ("<td align=\"center\" colspan=\"2\">");
  document.write ("<b>1737 Hillandale Road, Durham, NC 27705</b><br>");
  document.write ("<b>(919) 286-2273</b>");
  document.write ("</td>");
  document.write ("</tr>");
}
document.write ("</tbody>");
document.write ("</table>");
}

function bottom_table (subdirectory)
{
var church;
var directory;

if (isNS6 || isIE4)
    church = "St. Luke&rsquo;s Church";
else if (isNS4)
    church = "St. Luke&#8217;s Church";
else
    church = "St. Luke's Church";

if (subdirectory != 0)
  directory = "../";
else
  directory = "";

document.write ("<table align=\"center\" width=\"90%\" border=\"0\" cellspacing=\"2\" ");
document.write ("cellpadding=\"2\">");
document.write ("<tbody>");
document.write ("<tr>");
/* Write church address */
document.write ("<td valign=\"middle\" align=\"center\">");
document.write ("<b>Email ");  church_addr ();
document.write (church + "</b><br>");
document.write ("<img src=\"" + directory + "email24.gif\" title=\"\" alt=\"\" width=\"89\" height=\"26\"><br>");
document.write ("</a></td>");
/* Write copyright */
document.write ("<td align=\"center\" valign=\"middle\">");
document.write ("<font size=\"-2\"><i>");
document.write ("This site copyright &copy; 2003-2006<br>");
document.write (church + ".<br>");
document.write ("All rights reserved.</i></font></td>");
/* Write the ox */
document.write ("<td valign=\"middle\" align=\"center\">");
document.write ("<img src=\"" + directory + "logo/oxsmwing-vsmall2.gif\" title=\"\" alt=\"\" width=\"47\" height=\"50\">");
document.write ("<br></td>");
/* Write website address */
document.write ("<td valign=\"middle\" align=\"center\">");
document.write ("<font size=\"-2\"><i>");
document.write ("Website designed and maintained<br>");
document.write ("by SoftWright Systems<br></i></font>");
document.write ("<small>Email "); jan_addr ();
document.write ("Janice Frank</a></small><br>");
document.write ("<small>Email "); bruce_addr ();
document.write ("Bruce Wright</a></small><br></td>");
/* End of table */
document.write ("</tr>");
document.write ("</tbody>");
document.write ("</table>");
};
