<!--Hide from JS-Impaired Browsers
// Some code from http://www.infohiway.com/javascript/ecal2.htm
// Cut-N-Paste JavaScript from ISN Toolbox 
// Copyright 1999, Infohiway, Inc. -->

var default_bg = "linen";

function numDaysIn(mth,yr) {
 if (mth==3 || mth==5 || mth==8 || mth==10) return 30;
 else if ((mth==1) && leapYear(yr)) return 29;
 else if (mth==1) return 28;
 else return 31;
}
function leapYear(yr) {
 if (((yr % 4 == 0) && yr % 100 != 0) || yr % 400 == 0)
  return true;
 else
  return false;
}
// fixes a Netscape 2 and 3 bug
function getFullYear(d) { // d is a date object
 yr = d.getYear();
// if (yr < 1000)
//  yr+=2000;
	if (yr < 90)
		{yr+=2000};
	if (yr < 100)
		{yr+=1900};
	if (yr < 200)
		{yr+=1900};

 return yr;
}
function arr() {
 for (n=0;n<arr.arguments.length;n++) {
  this[n] = arr.arguments[n];
 }
}

//weekdays = new arr("Sun.","Mon.","Tues.","Wed.", "Thurs.","Fri.","Sat.");
// *** comment out the one you don't want to use ***
weekdays = new arr("Sunday","Monday","Tuesday","Wednesday", "Thursday","Friday","Saturday");
 
//months = new arr("Jan.","Feb.","Mar.","Apr.","May", "June","July","Aug.","Sep.","Oct.","Nov.","Dec.");
// *** comment out the one you don't want to use ***
months = new arr("January","February","March","April","May", "June","July","August","September","October","November", "December");

// Change filename to be the name of this file
var filename="calendar.shtml";
var flg=0;
var today = new Date();

/* You control the size of this calendar by specifying the font size (from 1 through 7) in the var fs below. */
var fs=4;

/* The events array - E - below uses an array element for each month from Jan thru Dec. The string for each
     month is indexed with a tilde (~), the date and a space, followed by the event description.  Substitute the
     events you wish here. Use two lines (with <BR>) for each. */
/* 
* Note:
* This has now been expanded to a two dimensional array.
* The first index is the year and the second is the month.
*/
/* Note: do *NOT* fill date with 0. For example, 1/9 should be entered as ~9 not ~09 
* NOTE: Month 0 = January, 1 = February, ... , 11 = Dec
*/
E=new arr( 2006, 2007, 2008, 2009, 2010);
E[2006]=new arr("","","","","","","","","","","","");
E[2007]=new arr("","","","","","","","","","","","");
E[2008]=new arr("","","","","","","","","","","","");
E[2009]=new arr("","","","","","","","","","","","");
E[2010]=new arr("","","","","","","","","","","","");


E[2006][3]="~18 Troop Gathering~25 Troop Meeting ~28 Camporee ~29 <a href=\"http://www.cnjcscouting.org/documents/camporeeregistrationform.pdf\">Camporee</a>~30 Camporee~"
E[2006][4]="~2 Troop Meeting Earn Scout Rank~9 Troop Meeting Class A Prep for hike~16 Troop Meeting Class B Prep for hike~19 Help at Pack meeting~23 Troop Meeting Class A Prep for hike~30 Troop Meeting Class B Prep for summer camp~"
E[2006][5]="~1 Committee Meeting~6 Troop Meeting<br>Parent Mtg<br>Class A<br>merit badges, medical~13 Troop Meeting<br>Class B<br>Complex 1~20 Troop Meeting<br>Class A<br>Topic TBD~24 Hike? ~25 Hike?~"
E[2006][6]="~3 Triple Float Day at Wolvertons'<br>12:00 on~4 Milltown Parade<br>Class A~6 Parent/Committee Mtg<br>7:00 (note time)~11 Camping meeting 7:00~16 Camping 11:00 Trinity~17 Camping~18 Camping~19 Camping~20 Camping~21 Camping~22 Camping~"
E[2006][7]="~1 National Night Out~5 Somerset Patriots 7pm~"
E[2006][8]="~19 Troop Meeting<br>Scoutmaster Conference~26 Troop Meeting<br>Board of Review~30 9:00 Cleanup<br>11:00 Hike~"
E[2006][9]="~3 Troop Meeting<br>Court of Honor~7 Church Cleanup 8:30-12~8 <a href=\"events/culturalfestival2006.pdf\">Cultural Festival</a>~10 Troop Meeting~13 <a href=\"events/9gunbattery.pdf\">Fall Camporee</a>~14 <a href=\"events/9gunbattery.pdf\">Fall Camporee</a>~15 <a href=\"events/9gunbattery.pdf\">Fall Camporee</a>~17 Troop Meeting~24 Troop Meeting~28 Orienteering <a href=\"events/NJSO_General_Info.pdf\">Info</a> <a href=\"events/NJSO_Registration_forms.pdf\">Registration</a>~31 <b>No Meeting!</b>~"
E[2006][10]="~2 Committee Mtg 7:30~7 Troop Meeting~14 Troop Meeting~21 Troop Meeting~24 <a href=\"events/Ten Commandments Hike Flyer and Map 2006.pdf\">Interfaith 10 Commandments hike</a>~28 Troop Meeting~"
E[2006][11]="~5 Troop Meeting~12 Troop Meeting~19 Troop Meeting~26 Troop Meeting~28 Winter Activity~"

E[2007][0]="~2 Troop Meeting~9 Troop Meeting~16 Troop Meeting~19 Help at Pinewood Weigh-in~20 Help at Pinewood Derby~23 Troop Meeting~27 Klondike Derby (cooking)~30 Troop Meeting~"
E[2007][1]="~4 Scout Sunday~6 Troop Meeting<br>Scoutmaster's Conference~10 <a href=\"http://www.cnjcscouting.org/documents/2007SDMBFRegistrationPacket_000.pdf\">Merit Badge Fair</a>~11 <a href=\"http://www.cnjcscouting.org/documents/2007SDMBFRegistrationPacket_000.pdf\">Merit Badge Fair</a>~13 Troop Meeting<br>Board of Review~20 Troop Meeting<br>Court of Honor~Help at Blue and Gold~27 Troop Meeting~"
E[2007][2]="~4 Community Day~6 Troop Meeting~13 Troop Meeting~20 Troop Meeting~ Camping?~27 Troop Meeting~"
E[2007][3]="~3 Troop Meeting~10 Troop Meeting~13 Camporee~14 Camporee~15 Camporee~17 Troop Meeting~24 Troop Meeting~"
E[2007][4]="~1 Troop Meeting~5 Snuffy Hollow?~8 Troop Meeting~15 Troop Meeting~22 Troop Meeting~29 Troop Meeting~"
E[2007][5]="~5 Troop Meeting~12 Troop Meeting~Help at pack picnic~19 Troop Meeting~22 <a href=\"http://joycekilmerdistrict.org/JK_aqua.htm\">JK Aqua Camporee</a>~23 JK Aqua Camporee~24 JK Aqua Camporee~"
E[2007][6]="~4 Milltown Parade~15 Troop Planning Meeting 4:00~22 Boy Scout Camping~23 Boy Scout Camping~24 Boy Scout Camping~25 Boy Scout Camping~26 Boy Scout Camping~27 Boy Scout Camping~28 Boy Scout Camping~30 <a href=\"events/2007SomersetPatriots.pdf\">Somerset Patriots Due</a>~"
E[2007][7]="~7 National Night Out~25 <a href=\"events/2007SomersetPatriots.pdf\">Somerset Patriots</a>~"
E[2007][8]="~11 Troop Meeting~18 Board of Review~22 Trininty Cleanup<br>9:00 - ?~25 Troop Meeting~29 <a href=\"http://www.moreyspiers.com/youth_beach_jam.htm\">Beach Jam Wildwood</a>~30 Beach Jam Wildwood~"
E[2007][9]="~2 Court of Honor~6 Popcorn Sale Begins~9 Troop Meeting<br>Merit Badge work~14 Hike~16 Troop Meeting<br>Merit Badge Work~20 Community Cleanup~21 Den Chief Training~23 Troop Meeting<br>Merit Badge Work~26 Haunted House<br><b>New Date</b>~30 No Meeting~"
E[2007][10]="~2 <a href=\"events/2007FallCamporee.pdf\">SEMEOS Camporee</a><br>Also<br><a href=\"events/2007FallCamporeeCompetition.pdf\">Boy Scout Competitions</a>~3 SEMEOS Camporee<br>Popcorn Sale Ends~4 SEMEOS Camporee~6 No Meeting~7 Committee Meeting~13 Troop Meeting<br>Teamwork~17 Popcorn Distribution~20 Troop Meeting<br>Knots/Lashing~23 <a href=\"http://www.cnjcscouting.org/documents/TenCommandmentsFlyerandMap2007.pdf\">Ten Commandments Hike</a>~27 Troop Meeting<br>Flag Ceremony~"
E[2007][11]="~2 <a href=\"events/Elijahs Promise.pdf\">Elijah's Promise</a><br>2:45-5:00~4 Troop Meeting<br>First Aid~11 Troop Meeting<br>Fire building~18 Troop Meeting<br>Ax/Saw~22 Recycling<br>Randy, Jimmy~25 No Troop Meeting~27 Snow Tubing~"

E[2008][0]="~1 No Troop Meeting~5 Recycling<br>Paras, Andrew~8 Troop Meeting<br>Compass/Orienteering~15 Troop Meeting<br>Cooking/Shakedown<br>Class B~19 Pinewood Derby<br>Class A<br>Recycling<br>Chintan, Darion~21 Troop Meeting/Shakedown 9-3~22 Troop Meeting<br>Class B~26 Klondike Derby~29 Troop Meeting~"
E[2008][1]="~2 Recycling<br>Jonathan, William~5 Troop Meeting~9 <a href=\"events/2008SDMBFRegistrationPacket.pdf\">SEMEOS Merit Badge Fair</a>~10 Chinese New Year Parade<br><a href=\"files/ChineseNewYear2008.pdf\">Permission Slip</a>SEMEOS Merit Badge Fair~12 Troop Meeting<br>Class B~16 Recycling<br>Douglas, Abhi~19 Board of Review<br>Class A~26 Troop Meeting<br>Class B~29 Blue and Gold 8:00~"
E[2008][2]="~1 Recycling<br>Jack, Paul~2 Community Day<br>SEMEOS district dinner~4 Court of Honor<br>Class A<br><a href=\"MtAllamuchy.shtml\">Allamuchy</a> Permission Slip Due~5 Committee Meeting~8 Recycling<br>Tony, David<br<a href=\"events/MADMBFair2008.pdf\">MAD Merit Badge Fair</a>~9 <a href=\"events/MADMBFair2008.pdf\">MAD Merit Badge Fair</a>~11 Troop Meeting<br>Class B~14 <a href=\"MtAllamuchy.shtml\">Allamuchy</a> Camping 7:00~15 Camping~16 Camping~18 Troop Meeting~25 Troop Meeting<br><a href=\"files/2008SEMEOSSpringCamporeePermissionSlip.pdf\">Camporee Permission Slips</a> due<br>Parent Mtg 8:15<br>Class A~29 Community Cleanup<br>9:00-11:30 Location TBD~"
E[2008][3]="~1 Troop Meeting<br>Rock Climbing<br><a href=\"files/2008ElijahsPromisePermissionSlip.pdf\">Elijah's permission slip</a> due~2 Committee Mtg 7:30-9~6 <a href=\"files/2008ElijahsPromisePermissionSlip.pdf\">Elijah's Promise</a><br>3:00-5:00<br><a href=\"events/ChocolateSederFlyer2008.pdf\">Chocolate Seder 12:00 - 2:30<br><a href=\"events/2008CNJCRecognitionDinner.pdf\">CNJC Recognition Dinner</a>~8 Troop Meeting~11 <a href=\"events/SpringCamporeeBrochure20082.pdf\">SEMEOS Camporee</a> (brochure updated 3/26/08)~12<a href=\"events/SpringCamporeeBrochure2008.pdf\">SEMEOS Camporee</a><br><a href=\"http://joycekilmerdistrict.org/JK_mbfair.htm\">JK Merit Badge Fair</a>~13 <a href=\"events/SpringCamporeeBrochure2008.pdf\">SEMEOS Camporee</a>~15 Troop Meeting~19 Church Cleanup 8:30~22 Troop Meeting~26 Activity: Horseback or Preserve~29 Troop Meeting~"
E[2008][4]="~3 <a href=\"events/CarWashFlyer2008.pdf\">Car wash</a>~6 Troop Meeting~7 Committee Mtg 7:30~13 Troop Meeting~17 Campout<br><a href=\"files/ThompsonParkCampout2008.pdf\">Permission Slip</a>~18 Campout~20 Troop Meeting Cancelled~21 Recycling Lunch~25 <a href=\"files/2008ColorGuard.pdf\">Memorial Day Observance</a>~27 Troop Meeting<br>Board of Review~31 TRex <a href=\"files/2008Mohonk.pdf\">Mohonk Trip</a>~"
E[2008][5]="~3 Court of Honor~7 <a href=\"files/2008RacewayPark.pdf\">Raceway Park</a>~10 Troop Meeting<br>Summer MB List Due~21 <a href=\"events/Picnic2008.pdf\">Pack/Troop Picnic</a>~29 Summer Camp~30 Summer Camp~"
E[2008][6]="~1 Summer Camp~2 Summer Camp~3 Summer Camp~4 Summer Camp<br>(Milltown Parade)~5 Summer Camp~"
E[2008][7]="~2 <a href=\"events/SomersetPatriotsGame2008.pdf\">Somerset Patriots</a>~9 <a href=\"events/MemorialCarWash2008.pdf\">Car Wash to benefit Memorial School</a> 9-2~23 <a href=\"events/ProgramLaunch2008memo.pdf\">Program Launch</a>~"
E[2008][8]="~ Troop Meeting~16 Troop Meeting<br>Court of Honor~17 SEMEOS Roundtable<br>OA Youth meeting~19 Popcorn Show and Sell orders due~20 Community Cleanup 9am~23 Troop Meeting~26 Camporee <a href=\"events/2008MADCamporeeFlyer.pdf\">Flyer</a> <a href=\"events/2008MADCamporeeInfo.pdf\">Info</a> <a href=\"events/2008TeeterTownInfo.doc\">Background Info</a> <a href=\"files/2008MadCamporeePermission.rtf\">Permission Slip</a>~27 Camporee <a href=\"events/2008MADCamporeeFlyer.pdf\">Flyer</a> <a href=\"events/2008MADCamporeeInfo.pdf\">Info</a> <a href=\"events/2008TeeterTownInfo.doc\">Background Info</a> <a href=\"files/2008MadCamporeePermission.rtf\">Permission Slip</a>~28 Camporee <a href=\"events/2008MADCamporeeFlyer.pdf\">Flyer</a> <a href=\"events/2008MADCamporeeInfo.pdf\">Info</a> <a href=\"events/2008TeeterTownInfo.doc\">Background Info</a> <a href=\"files/2008MadCamporeePermission.rtf\">Permission Slip</a>~30 Troop Meeting~"
E[2008][9]="~1 Committee Meeting 7:30-9~4 Popcorn Distribution<br>Popcorn sale begins~7 <font color=red>No Troop Meeting</font>~10 OA Fall Fellowship~11 OA Fall Fellowship~12 OA Fall Fellowship~14 Troop Meeting~15 SEMEOS Roundtable<br>OA Youth Meeting~21 Meeting~26 <a href=\"files/orienteering2008.pdf\">Orienteering - Quail Hill</a>~28 Troop Meeting~30 Popcorn Orders Due~"
E[2008][10]="~1 <a href=\"http://mercerarea-bsa.org/rescue2008/index.html\">Scouts to the Rescue</a>~4 No Meeting~5 PLC Meeting 6:30, BOR~9 <a href=\"files/JockeyHollow2008.pdf\">Jockey Hollow Hike</a>~11 No Meeting~15 Popcorn Distribution~18 Troop Meeting~19 SEMEOS Roundtable<br>OA Youth Meeting~23 Popcorn money due~25 Troop Meeting~28 Ten Commandments Hike~"
E[2008][11]="~2 Troop Meeting~7 Elijahs Promise 3-5~9 Troop Meeting~13 OA Service Day~16 Troop Meeting~17 SEMEOS Roundtable<br>OA Youth meeting~29 <a href=\"events/2008IceSkating.pdf\">Ice Skating</a>~"


E[2009][0]="~18 Klondike Shakedown 1-4~24 <a href=\"files/2009KlondikeDerby.pdf\">Klondike Derby</a>~27 Deadline for Hawk Mountain Deposit~30 <a href=\"files/2009HawkMountain.pdf\">Hawk Mountain</a>~31 <a href=\"files/2009HawkMountain.pdf\">Hawk Mountain</a><br><a href=\"files/2009MiniMeritBadgeMidway.pdf\">Mini Merit Badge Midway</a>~"
E[2009][1]="~1 <a href=\"files/2009HawkMountain.pdf\">Hawk Mountain</a>~21 <a href=\"events/2009SDMBFRegistrationPacketv5.pdf\">Merit Badge Fair</a>~22 <a href=\"events/2009SDMBFRegistrationPacketv5.pdf\">Merit Badge Fair</a>~"
E[2009][2]="~3 Court of Honor~15 <a href=\"files/2009Sfishpondhike.pdf\">Sun Fish Pond Hike</a>~"
E[2009][3]="~"
E[2009][4]="~2 Campout with Pack~3 Campout with Pack~5 No Mtg - moved to Wed~6 Troop Mtg~9 Car Wash~12 Final Payment due for Hawk Mountain~16 Church Cleanup 8:30-11:30~24 EB Memorial Day Ceremony<br>Color Guard<br>12:15 pm~26 FISH Dinner/Hospitality 5-10pm~29 OA Ordeal Weekend~30 OA Ordeal Weekend~"
E[2009][5]="~1 Medical health forms are due for summer camp ~3 BOR / PLC / Committee Mtg~9 Court of Honor~20 Troop/Pack Picnic~20 Father/Son Whitewater Challenge - Rafting Trip (Overnighter)~21 Whitewater Challenge~"
E[2009][6]="~5 Summer Camp~6 Summer Camp~7 Summer Camp~8 Summer Camp~9 Summer Camp~10 Summer Camp~11 Summer Camp~12 Summer Camp~"
E[2009][7]="~"
E[2009][8]="~15 Troop Meeting~16 Roundtable Trinity 7:30-9~19 Community Clean Up 9-12<br>West Point Hike 5 miler 12-5~22 Troop Meeting~26 Wilderness Survival Overnighter (1st Class and above)~27 Wilderness Survival Overnighter~29 Troop Meeting~"
E[2009][9]="~6 Troop Meeting~7 Committee Mtg BOR 7:30-9~10 Beaver Day<br>Yards Creek~13 Troop Meeting COH~16 OA Fall Fellowship~17 OA Fall Fellowship~18 OA Fall Fellowship~20 Troop Meeting~21 Roundtable Trinity 7:30-9~23 SEMEOS Fall Camporee~24 SEMEOS Fall Camporee~25 SEMEOS Fall Camporee~27 Troop Meeting~"
E[2009][10]="~1 Deliver The Club Newsletter<br>Drop off Scouting for Food bags~3 Troop Meeting~4 ASM Meeting 7:30-9~6 NYLT @YCSR~7 NYLT @YCSR~8 NYLT @YCSR<br>Pick up Scouting for Food bags~10 Troop Meeting~13 NYLT @YCSR~14 NYLT @YCSR<br>Battleship Cove Overnighter, Mass.~15 NYLT @YCSR<br>Battleship Cove Overnighter, Mass.~17 Troop Meeting~18 Roundtable Trinity 7:30-9~24 Troop Meeting~"
E[2009][11]="~1 Troop Meeting~2 Committee Mtg 7:30-9~5 Day Hike/OA Service Day~8 Troop Meeting~15 Troop Meeting<br>FISH Community Service 5-10~16 Roundtable Trinity 7:30-9~22 Troop Meeting~29 Winter Break Activity~31 Deliver The Club Newsletter~"


E[2010][0]="~5 Troop Meeting~6 ASM Mtg 7:30-9~9 Pancake Breakfast~12 Troop Meeting~16 Cub Scout Pinewood Derby~19 Troop Meeting<br>OA Elections~20 Roundtable Trinity 7:30-9~22 MAD Klondike Derby KMSR~23 MAD Klondike Derby KMSR~24 MAD Klondike Derby KMSR~26 Troop Meeting~"
E[2010][1]="~2 Troop Meeting~3 Committee Mtg BOR 7:30-9~9 Troop Meeting COH 100 year celebration~16 Troop Meeting~17 roundtable Trinity 7:30-9~20 Merit Badge Fair~21 Merit Badge Fair~23 Troop Meeting~27 Blue and Gold Banquet~28 Deliver The Club Newsletter~"
E[2010][2]="~2 Troop Meeting~3 ASM Meeting 7:30-9~7 Community Day EB Square Mall~9 Troop Meeting~12 Mt Allamuchy Winter Camp Out~13 Mt Allamuchy Winter Camp Out~14 Mt Allamuchy Winter Camp Out~16 Troop Meeting~17 Roundtable Trinity 7:30-9~23 Troop Meeting~30 NO Troop Meeting~"
E[2010][3]="~6 Troop Meeting~7 Committee Mtg 7:30-9~13 Troop Meeting~16 Spring Camporee~17 Spring Camporee~18 Spring Camporee~20 Troop Meeting~21 Roundtable Trinity 7:30-9~23 OA Spring Fling at KMSR~24 OA Spring Fling at KMSR~25 OA Spring Fling at KMSR~27 Troop Meeting~"
E[2010][4]="~1 Community Clean Up 9:00~2 Deliver The Club Newsletter 1:00~4 Troop Meeting~5 ASM Meeting 7:30-9~9 Mothers Day Car Wash~11 Troop Meeting~14 OA Induction Weekend~15 OA Induction Weekend~16 OA Induction Weekend~18 Troop Meeting~19 Roundtable Trinity 7:30-9~25 Troop Meeting~30 Participate in EB Memorial Day Ceremony~"
E[2010][5]="~1 Troop Meeting~8 Troop Meeting~9 Committee Mtg BOR 7:30-9~12 Pack/Troop Picnic~15 Troop Meeting~16 Roundtable Trinity 7:30-9~18 Fathers Day Rafting Trip~19 Fathers Day Rafting Trip~20 Fathers Day Rafting Trip~22 Troop Meeting COH~"
E[2010][6]="~4 Summer Camp~5 Summer Camp~6 Summer Camp~7 Summer Camp~8 Summer Camp~9 Summer Camp~10 Summer Camp~"
E[2010][7]="~"
E[2010][8]="~"
E[2010][9]="~"
E[2010][10]="~"
E[2010][11]="~"


/*
* Determine the month that is required.
*/
function getMonth()
{
   month=today.getMonth();
   endIndex=location.search.length;
   if( location.search.length > 1 )
   {
      index = location.search.indexOf(",");
      if( index != -1 )
      {
         endIndex=index;
      }
      mon = parseInt(location.search.substring(1,endIndex) );
      if ( ((""+mon).length<=2) && (mon >= 0) && (mon <= 11)) {
         month=mon;
      }
   }
   return( month );
}

/*
* Determine the year that is required.
*/
function getYear() 
{
   year=getFullYear(today);
   if( location.search.length > 1 )
   {
      index = location.search.indexOf(",");
      if( index != -1 )
      {
         yr = parseInt(location.search.substring(index+1) );
      }
      if ( ((""+yr).length<=4) && (yr >= 1900) && (yr <= 2010)) {
         year=yr;
      }
   }
   return( year );
}

/*
* Output HTML to provide a month selection choice.
*/
function addMonthSelect()
{
   document.write( "<SELECT NAME='monthSelect' SIZE=1>" );
   for( i=0; i<mo; i++ )
   {
      document.write( "<OPTION>"+months[i] );
   }
   document.write( "<OPTION SELECTED>"+months[mo] );
   for( i=mo+1; i<12; i++ )
   {
      document.write( "<OPTION>"+months[i] );
   }
   document.write( "</SELECT>" );
}

/*
* Output HTML to provide a year selection choice.
*/
function addYearSelect()
{
   document.write( "<SELECT NAME='yearSelect' SIZE=1>" );
   for( i=2; i>0; i-- )
   {
      document.write( "<OPTION>"+(yr-i) );
   }
   document.write( "<OPTION SELECTED>"+yr );
   for( i=1; i<3; i++ )
   {
      document.write( "<OPTION>"+(yr+i) );
   }
   document.write( "</SELECT>" );
}

/*
* Handle changing the date from month and year selects.
*/
function changeDate(monthObj, yearObj)
{
   newMonth=monthObj.selectedIndex;
   newYear=yearObj.options[yearObj.selectedIndex].text;
   location.href=filename+"?"+newMonth+","+newYear;
}

/*
* Main calendar generator.
*/
function Calendar()
{
 todayYr=getFullYear(today);
 mo=getMonth();
 yr=getYear();

 bgn=new Date(months[mo]+" 1,"+yr);
 dy=bgn.getDay();
 ld=numDaysIn(mo,yr);

// Start table

 document.write("<TABLE BORDER=0 BGCOLOR="+default_bg+" width=85%>");

// janet added links here

document.write("<tr>");
 // Create prev/next jump links
   document.write("<TD align=left>");

   // Prev link
   prevMonth=(mo - 1);
   prevYr=yr;
   if( mo == 0 )
   {
      prevMonth=11;
      prevYr=yr - 1;
   }
   document.write('<a href="'+filename+'?'+prevMonth+','+prevYr+'">&lt;- '+months[prevMonth]+'</a></td><td align=center>');

   // Middle
 document.write("&#09;&#09;<FONT SIZE="+(fs+2)+"><B>"+months[mo]+" "+yr+"</B></FONT>&#09;&#09;");

   // Next link
   nextMonth=(mo + 1);
   nextYr=yr;
   if( mo == 11 )
   {
      nextMonth=0;
      nextYr=yr + 1;
   }
   document.write('</td><td align=right><a href="'+filename+'?'+nextMonth+','+nextYr+'">'+months[nextMonth]+' -&gt;</a>');

   document.write("</TD>");

	if( ( mo == 8) && ( year == 2005 ) )
	{
		document.write('</tr><tr><td colspan=3 align="center">Theme: <a href="http://usscouts.org/bbugle/bb0508/index.html">Cub Scout Round Up</a>');
	}

document.write("</tr></table><TABLE BORDER=2 BGCOLOR="+default_bg+" width=85%>");

// janet added open tr and bold/unbold
	document.write("<tr>");
 for (var i=0;i<7;i++){
  document.write("<TD ALIGN=CENTER WIDTH=14%>"
  +"<FONT SIZE=1><b>"+weekdays[i]+"</b></FONT></TD>");
 }
 document.write("</TR><TR>");
 ctr=0;
 for (var i=0;i<7;i++) {
  /* If the ctr is less than the day of the week determined to be the first day of the month, print a space in this cell of the table. */
  if (i<dy){
   document.write("<TD ALIGN=CENTER>"
   +"<FONT SIZE="+fs+">&nbsp;</FONT>"
   +"</TD>");
  }
  /* Otherwise, write date and the event, if any, in this cell of the table. */
  else {
   ctr++;
   di=i; // carry var i outside this routine
   dupWrt();
  }
 }

 document.write("</TR><TR>");
 while (ctr<ld){
  for (var i=0;i<7;i++){
   ctr++;
   /* If the ctr is greater than the last
      day of the month, print a space in
      this cell of the table. */
   if (ctr>ld){
    document.write("<TD ALIGN=CENTER>"
    +"&nbsp;</TD>");
   }
   /* Otherwise, write date and the event,
      if any, in this cell of the table. */
   else{
    di=i; // carry var i outside this routine
    dupWrt();
   }
  }
  document.write("</TR><TR>");
 }

 // Create prev/next jump links
 jump = "";
   document.write("<TD colspan=2 align=center>");

   // Prev link
   prevMonth=(mo - 1);
   prevYr=yr;
   if( mo == 0 )
   {
      prevMonth=11;
      prevYr=yr - 1;
   }
   document.write('<a href="'+filename+'?'+prevMonth+','+prevYr+'">&lt;- '+months[prevMonth]+'</a>');

   // Middle
   // document.write(" &nbsp; | &nbsp; ");
   document.write("</td>");

   // Create quick jump
   document.write( "<TD ALIGN=CENTER COLSPAN=3>" );
   document.write( "<FORM Name='selectForm'>" );
   addMonthSelect();
   addYearSelect();
   document.write( "<INPUT TYPE=BUTTON VALUE='Go' onClick='changeDate"
      +"(document.selectForm.monthSelect,document.selectForm.yearSelect)'>" );
   document.write( "</FORM>" );
   document.write("</TD>");

   // Next link
   nextMonth=(mo + 1);
   nextYr=yr;
   if( mo == 11 )
   {
      nextMonth=0;
      nextYr=yr + 1;
   }
   document.write('<TD ALIGN=CENTER COLSPAN=2><a href="'+filename+'?'+nextMonth+','+nextYr+'">'+months[nextMonth]+' -&gt;</a>');

   document.write("</TD>");

   document.write("</TR>");


 document.write("</TABLE>");

}

function dupWrt() {
var bgcolor = default_bg;
var blank_bg = "lightskyblue";
var past_bg  = "lightgrey";
var today_bg = "lightskyblue";
var future_bg = "lightskyblue";
var event_bg = "lightgoldenrodyellow";

 if ( (mo==today.getMonth()) && (yr==todayYr) && (ctr==today.getDate()) )
 {
	bgcolor=today_bg;
 }
 else if ( (mo==today.getMonth()) && (yr==todayYr) && (ctr<today.getDate()) )
{
	bgcolor=past_bg;
}
 else if ( (mo<today.getMonth()) && (yr==todayYr) )
{
	bgcolor=past_bg;
}
 else if ( yr<todayYr )
{
	bgcolor=past_bg;
}
 else if ( (mo==today.getMonth()) && (yr==todayYr) && (ctr>today.getDate()) )
{
	bgcolor=future_bg;
}
 else if ( (mo>today.getMonth()) && (yr==todayYr) )
{
	bgcolor=future_bg;
}
 else if ( yr>todayYr )
{
	bgcolor=future_bg;
}
 

// now set bgcolor=event_bg;
 if( E[yr] )
 {
  pos=E[yr][mo].indexOf("~"+ctr+" ");
  if (pos>-1){
	bgcolor=event_bg;
   }
  }



 document.write("<TD ALIGN=CENTER bgcolor="+bgcolor+"><FONT SIZE="+fs);
 colorSet=0;
var timeValue = ""
 if ( (mo==today.getMonth()) && (yr==todayYr) && (ctr==today.getDate()) )
 {
  /* Change color to whatever color you wish
     for the current date to be differentiated on
     screen.  */
  document.write(" COLOR='green'");
  colorSet=1;
// janet - put time in today's box
         var now = new Date();
        var hours = now.getHours();
        var minutes = now.getMinutes();
        var timeValue = "<Font color='green'>" + ((hours >12) ? hours -12 :hours)
        timeValue += ((minutes < 10) ? ":0" : ":") + minutes
        timeValue += (hours >= 12) ? " P.M." : " A.M."
        timeValue += "</font><br>"
}
 else if ( (di==0) )
 {
  /* Change color to whatever color you wish
     for Sundays to be differentiated on
     screen.  */
  document.write(" COLOR='black'");
  colorSet=1;
 }
 /* For dates without an event, an HTML padder that will align dates properly with dates having an event. Here, space break space. */
 tmp="&nbsp;<BR>&nbsp;";
 /* Then check for event in this month's events array for this date. If present, rewrite the tmp variable to contain the event. */
 if( E[yr] )
 {
  pos=E[yr][mo].indexOf("~"+ctr+" ");
  if (pos>-1){
   tmp=E[yr][mo].substring(pos+3,E[yr][mo].length);
   pos=tmp.indexOf("~");
   tmp=tmp.substring(0,pos);
   if (colorSet!=1){
    /* Change color to whatever color you wish
       for the events to be differentiated on
       screen.  */
    document.write(" COLOR='red'");
   }
  }
 }
 document.write("><B>"+ctr+"</B></FONT><BR><FONT SIZE=1>"+timeValue+tmp+"</TD>");
 }
// End Hiding -->

