//
// format date as dd-mmm-yy
// example: 12-Jan-99
//
function date_ddmmmyy(date)
{
  var d = date.getDate();
  var m = date.getMonth() + 1;
  var y = date.getYear();

  // handle different year values 
  // returned by IE and NS in 
  // the year 2000.
  if(y >= 2000)
  {
    y -= 2000;
  }
  if(y >= 100)
  {
    y -= 100;
  }

  // could use splitString() here 
  // but the following method is 
  // more compatible
  var mmm = 
    ( 1==m)?'Jan':( 2==m)?'Feb':(3==m)?'Mar':
    ( 4==m)?'Apr':( 5==m)?'May':(6==m)?'Jun':
    ( 7==m)?'Jul':( 8==m)?'Aug':(9==m)?'Sep':
    (10==m)?'Oct':(11==m)?'Nov':'Dec';

  return "" +
    (d<10?"0"+d:d) + "-" +
    mmm + "-" +
    (y<10?"0"+y:y);
}


//
// get last modified date of the 
// current document.
//
function date_lastmodified()
{
  var lmd = document.lastModified;
  var s   = "Unknown";
  var d1;

  // check if we have a valid date
  // before proceeding
  if(0 != (d1=Date.parse(lmd)))
  {
    s = "" + date_ddmmmyy(new Date(d1));
  }

  return s;
}


function ccbcheading (name, prefix) {
document.write("<!--This page is " + name + "-->");
document.write("<CENTER><TABLE WIDTH='750' BORDER='0' CELLSPACING='2' CELLPADDING='0'>");
document.write("  <TR>");
document.write("    <TD WIDTH='21%' valign='top'><div STYLE='line-height: 90%;'><FONT SIZE='-1' FACE='Times New Roman'>");

if (name == "index") { document.write("&bull; <FONT SIZE='-1' FACE='Times New Roman'>Home</font> <br>");
} else { document.write("&bull; <A HREF='" + prefix + "index.html'><FONT SIZE='-1' FACE='Times New Roman'>Home</font></A> <br>"); }

if (name == "Staff") { document.write("&bull; <FONT SIZE='-1' FACE='Times New Roman'>Staff</font> <br>");
} else { document.write("&bull; <A HREF='" + prefix + "Staff.html'><FONT SIZE='-1' FACE='Times New Roman'>Staff</font></A> <br>"); }

if (name == "Missions") { document.write("&bull; <FONT SIZE='-1' FACE='Times New Roman'>Missions Programs</font> <br>");
} else { document.write("&bull; <A HREF='" + prefix + "Missions.html'><FONT SIZE='-1' FACE='Times New Roman'>Missions Programs</font></A> <br>"); }

if (name == "Calendars") { document.write("&bull; <FONT SIZE='-1' FACE='Times New Roman'>Church Calendars</font> <br>");
} else { document.write("&bull; <A HREF='" + prefix + "Calendars.html'><FONT SIZE='-1' FACE='Times New Roman'>Church Calendars</font></A> <br>"); }

if (name == "Youth") { document.write("&bull; <FONT SIZE='-1' FACE='Times New Roman'>Youth Page</font> <br>");
} else { document.write("&bull; <A HREF='" + prefix + "Youth.html'><FONT SIZE='-1' FACE='Times New Roman'>Youth Page</font></A> <br>"); }

if (name == "Sermons") { document.write("&bull; <FONT SIZE='-1' FACE='Times New Roman'>Recent Sermons</font> <br>");
} else { document.write("&bull; <A HREF='" + prefix + "Sermons.html'><FONT SIZE='-1' FACE='Times New Roman'>Recent Sermons</font></A> <br>"); }

if (name == "Publications") { document.write("&bull; <FONT SIZE='-1' FACE='Times New Roman'>Online Publications</font><br>");
} else { document.write("&bull; <A HREF='" + prefix + "Publications.html'><FONT SIZE='-1' FACE='Times New Roman'>Online Publications</font></A><br>"); }

if (name == "ContactUs") { document.write("&bull; <FONT SIZE='-1' FACE='Times New Roman'>Contact Us</font> <br>");
} else { document.write("&bull; <A HREF='" + prefix + "ContactUs.html'><FONT SIZE='-1' FACE='Times New Roman'>Contact Us</font></A> <br>"); }

if (name == "Links") { document.write("&bull; <FONT SIZE='-1' FACE='Times New Roman'>Links</font> <br>");
} else { document.write("&bull; <A HREF='" + prefix + "Links.html'><FONT SIZE='-1' FACE='Times New Roman'>Links</font></A> <br>"); }

if (name == "Outline") { document.write("&bull; <FONT SIZE='-1' FACE='Times New Roman'>Site Outline</font>");
} else { document.write("&bull; <A HREF='" + prefix + "Outline.html'><FONT SIZE='-1' FACE='Times New Roman'>Site Outline</font></A>"); }

document.write("	</font></div></TD>");
document.write("    <TD WIDTH='60%' valign=center align=center>");
document.write("      <H4><FONT SIZE='+3' FACE='Garamond'>Cane Creek Baptist Church</FONT></H4>");

document.write("      <H5><A HREF='http://www.mapquest.com/maps/map.adp?latlongtype=decimal&latitude=35.9773&longitude=-79.19443'");
document.write("      TARGET='_blank'><FONT FACE='Garamond'>6901 Orange Grove Road,");
document.write("      Hillsborough, North Carolina 27278</FONT></A></H5>");

document.write("      <P><FONT FACE='Garamond'>Serving the Lord in Orange County since 1789</FONT>");
document.write("    </TD>");
document.write("    <TD WIDTH='19%' valign='center'>");
document.write("      <P><CENTER>&nbsp;<IMG SRC='" + prefix + "Images/CrossToWorld.jpg' WIDTH='105'");
document.write("      HEIGHT='121' ALIGN='BOTTOM' BORDER='0' NATURALSIZEFLAG='3' ALT=''></CENTER></TD>");
document.write("  </TR>");
document.write("</TABLE></CENTER>");
}

function ccbcfooting (name, prefix) {
document.write("    <HR>");
document.write("    <CENTER><FONT FACE='Times New Roman' size=-1>");

if (name == "index") { document.write("    Home |");
} else { document.write("    <A HREF='" + prefix + "index.html'>Home</A> |"); }

if (name == "Staff") { document.write("    Staff |");
} else { document.write("    <A HREF='" + prefix + "Staff.html'>Staff</A> |"); }

if (name == "Missions") { document.write("    Missions Programs |");
} else { document.write("    <A HREF='" + prefix + "Missions.html'>Missions Programs</A> |"); }

if (name == "Calendars") { document.write("    Church Calendars |");
} else { document.write("    <A HREF='" + prefix + "Calendars.html'>Church Calendars</A> |"); }

if (name == "Youth") { document.write("    Youth Page |");
} else { document.write("    <A HREF='" + prefix + "Youth.html'>Youth Page</A> |"); }

if (name == "Sermons") { document.write("    Recent Sermons |");
} else { document.write("    <A HREF='" + prefix + "Sermons.html'>Recent Sermons</A> |"); }

if (name == "Publications") { document.write("    Online Publications |");
} else { document.write("    <A HREF='" + prefix + "Publications.html'>Online Publications</A> |"); }

if (name == "ContactUs") { document.write("    Contact Us |");
} else { document.write("    <A HREF='" + prefix + "ContactUs.html'>Contact Us</A> |"); }

if (name == "Links") { document.write("    Links |");
} else { document.write("    <A HREF='" + prefix + "Links.html'>Links</A> |"); }

if (name == "Outline") { document.write("    Site Outline");
} else { document.write("    <A HREF='" + prefix + "Outline.html'>Site Outline</A>"); }

document.write("    </FONT></CENTER>");
document.write("    <CENTER><FONT FACE='Times New Roman'>This page was last updated on " + 
  date_lastmodified() + "</FONT></CENTER>");
document.write("    <CENTER><table>");
document.write("	<tr><td valign=top><A HREF='http://www.waddellsoftware.com/' TARGET='_blank'>");
document.write("      <FONT FACE='Times New Roman'><IMG SRC='" + prefix + "Images/WaddellSoftwareLogo.GIF'");
document.write("      WIDTH='208' HEIGHT='65' ALIGN='BOTTOM' BORDER='0' NATURALSIZEFLAG='3'");
document.write("      ALT='Waddell Software Development LLC'></FONT></A></td>");
document.write("	<td valign=center><FONT FACE='Times New Roman'>Please send comments to </FONT></td>");
document.write("	<td valign=top><A HREF='mailto:webmaster@canecreek.org'><IMG SRC='" + prefix + "Images/WriteMailByHand.gif' BORDER='0'></A></td>");
document.write("	<td valign=center><FONT FACE='Times New Roman'><A HREF='mailto:webmaster@canecreek.org'>Webmaster@canecreek.org</A></FONT></td>");
document.write("    </table></CENTER>");
}


function ShowAdobe (prefix) {
document.write("<HR><CENTER><TABLE BORDER='0' CELLSPACING='2' CELLPADDING='0' width='75%'>");
document.write(" <TR>");
document.write("  <TD width='15%' align=center valign=middle><A HREF='http://www.adobe.com/products/acrobat/readstep.html' TARGET='_blank'>");
document.write("   <IMG SRC='" + prefix + "Images/GetAdobeReader.gif' WIDTH='88' HEIGHT='31' border=0 ALT='Adobe Download'></A></TD>");
document.write("  <TD width='60%' align=left valign=top>Some of these documents are stored in Adobe's");
document.write("   PDF format. To obtain the free copy of the Adobe PDF reader, click the icon to the left.</TD>");
document.write(" </TR></TABLE></CENTER>");
}
