//Pack Membership Numbers: Change the numbers accordingly for the number of scouts and leaders
intTigers=1
intWolves=19
intBears=16
intWebelos=17
intLeaders=8

//Pack Leaders: Change the name of the Leader inside the quotation marks ONLY, if the 
//name has an apostrophe in the name the apostrophe should be shown as \'
cm="Skip Lentz" //cubmaster
acm="Jeff Cardenas, William Swindull, and John Kennard "  //assistant cubmaster
cc="Diane Phillips" //committee chairperson
pt="Michelle Cardenas" //pack trainer
cor="Mark Nye" //charter org rep
sec="Laura Kennard" //secretary
tre="Greg McAuley" //treasurer
ac="Sharyn Lentz" //awards chairperson

//Arrays for den: DO NOT EDIT THE NEXT FOUR LINES
arrTigers=new Array();
arrWolves=new Array();
arrBears=new Array();
arrWebelos=new Array();

//Den Assignments: Change/assign den names within parenthesis, when you add a new rank den, copy
//the line of the first rank and change the number in the bracket. For instance, if you are adding
//another tiger den then the new line would be arrTigers[1]="Den 2"
arrTigers[0]="Den 1"
arrTigers[1]="Den 3 "
arrWolves[0]="Den 2"
arrWolves[1]="Den 4"
arrBears[0]="Den 6"
arrWebelos[0]="Den 7"
arrWebelos[0]="Den5 "


//Sponsors:To add a new sponsor copy one of the document write statements and change the web address
//and link description. Prototype for the document write statement is as follows
//document.write('<a href="http://www.something.com" class="clsMenu" target="_new"><b>Link</b></a><br>
function BuildSponsors(){
document.write('<a href="http://www.grstudios.com" class="clsMenu" target="_new"><b>GR Studios</b></a><br>')
document.write('<a href="http://www.13floornetwork.com" class="clsMenu" target="_new"><b>13th Floor Network</b></a><br>')
}

/* ------------------------------------ */
/* DO NOT EDIT ANYTHING BELOW THIS LINE */
/* ------------------------------------ */


//Day Array
arrDayName=new Array();
arrDayName[0]="Sunday";
arrDayName[1]="Monday";
arrDayName[2]="Tuesday";
arrDayName[3]="Wednesday";
arrDayName[4]="Thursday";
arrDayName[5]="Friday";
arrDayName[6]="Saturday";

//Month Array
arrMonthName=new Array();
arrMonthName[0]="January";
arrMonthName[1]="February";
arrMonthName[2]="March";
arrMonthName[3]="April";
arrMonthName[4]="May";
arrMonthName[5]="June";
arrMonthName[6]="July";
arrMonthName[7]="August";
arrMonthName[8]="September";
arrMonthName[9]="October";
arrMonthName[10]="November";
arrMonthName[11]="December";
var modifiedDate = new Date(document.lastModified);


//Browser Detection
function DetectBrowser(){
   if (document.all) //IE4,5
      btype = "IE"
   else if (document.layers) //NS4
      btype = "NN"
   else if (document.getElementById) //NS5
      btype = "NN"
   else if (document.images) //NS3,IE4
      btype = "IE"
   else //NS2,IE3
      btype = "NN"
return btype
}

//Date stamp
function DateStamp(){;
   TodayNow=new Date;
   DateDay=TodayNow.getDate();
   DateWeekDay=arrDayName[TodayNow.getDay()];
   DateMonth=arrMonthName[TodayNow.getMonth()];
   DateYear=TodayNow.getFullYear();
}

//Modified date stamp
function modifiedDateSuffix(date) { 
   if (date == 1 || date == 21 || date == 31){
       return 'st'; 
   }else if (date == 2 || date == 22){
      return 'nd';  
   }else if (date == 3 || date == 23){
      return 'rd';
   }else{
      return 'th';
   }
}

function getCorrectedYear(year) {
    year = year - 0;
    if (year < 70){ return (2000 + year)};
    if (year < 1900){ return (1900 + year)};
    return year;
}

function ModStamp(){
document.write('Last Modified : ' +arrDayName[modifiedDate.getDay()] + ', ' + 
                                    arrMonthName[modifiedDate.getMonth()] + ' ' + 
                                    modifiedDate.getDate() + 
                                    modifiedDateSuffix(modifiedDate.getDate()) + ', ' + 
                                    getCorrectedYear(modifiedDate.getFullYear()));
}

//Pop up window
function Pop(x){
   var screen =  x + ".htm";
   var spex = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=420";
   var popped = window.open(screen,'popped', spex);
   popped.focus();
}

//Build member table stats
function BuildMemberTable(){
intTotal=eval(intTigers+intWolves+intBears+intWebelos+intLeaders)
document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>')
document.write('<td>Tigers: </td><td align="right">'+intTigers+'</td></tr>')
document.write('<tr><td>Wolves: </td><td align="right">'+intWolves+'</td></tr>')
document.write('<tr><td>Bears: </td><td align="right">'+intBears+'</td></tr>')
document.write('<tr><td>Webelos: </td><td align="right">'+intWebelos+'</td></tr>')
document.write('<tr><td>Leaders: </td><td align="right">'+intLeaders+'</td></tr>')
document.write('<tr><td colspan="2"><hr color=#323182></td></tr>')
document.write('<tr><td><b>Total:</b> </td><td align="right"><b>'+intTotal+'</b></td></tr></table>')
}

//Build calendar
function BuildCalendar(){
var today = new Date();
var thisDay;
var monthDays = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30,31, 30, 31);
year = today.getYear();
   if (year < 2000){
      year = year + 1900;
   }
   thisDay = today.getDate();
   if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)){
      monthDays[1] = 29;
   }
   nDays = monthDays[today.getMonth()];
   firstDay = today;
   firstDay.setDate(1); 
   testMe = firstDay.getDate();
   if (testMe == 2){
      firstDay.setDate(0);   
   } 
   startDay = firstDay.getDay();
   document.writeln("<CENTER>");
   document.write("<TABLE BORDER=0 width=130 bgcolor=#323182>");
   document.write("<TR class=clsCal><TH COLSPAN=7>");
   document.write("<span class=\'clsToday\'>"+arrMonthName[today.getMonth()])
   document.write(" ");
   document.write(year+"</span></tr></table>");
   document.write("<TABLE BORDER=0 bgcolor=#ffffff width=130>")
   document.write("<TR align=center class=clsCalH><TH>S<TH>M<TH>T<TH>W<TH>T<TH>F<TH>S");
   document.write("<TR>");
   column = 0;
   for (i=0; i<startDay; i++) {
      document.write("<TD width=15>");
      column++;
   }
   for (i=1; i<=nDays; i++) {
//      document.write("<TD width=15 align=center>");
      if (i == thisDay){
      document.write("<TD width=15 align=center bgcolor=#323182>");
         document.write("<span class=\'clsToday\'>")
      }else{
         document.write("<TD width=15 align=center>");
      }
      document.write(i);
      if (i == thisDay){
         document.write("</span>")
      }
      column++;
      if (column == 7) {
         document.write("<TR>"); 
         column = 0;
      }
   }
   document.write("</TABLE>");
   document.writeln("</CENTER>");
}

function OrgChartDir(){
   if (DetectBrowser()=="IE"){ 
      loc = rootpath+'committee/orgie.htm'
   }else{
      loc = rootpath+'committee/orgnn.htm'
   }
 window.location = loc;
}

//Build leader links
function BuildLeaders(){
document.write('<a href="javascript:Pop(\''+rootpath+'committee/pcm\')" class="clsMenu"><b>'+cm+'</b></a><br>')
document.write('<span class="clsTitle">Cubmaster</span><br>')
document.write('<a href="javascript:Pop(\''+rootpath+'committee/pacm\')" class="clsMenu"><b>'+acm+'</b></a><br>')
document.write('<span class="clsTitle">Assistant Cubmaster</span><br>')
document.write('<a href="javascript:Pop(\''+rootpath+'committee/pcc\')" class="clsMenu"><b>'+cc+'</b></a><br>')
document.write('<span class="clsTitle">Committee Chairperson</span><br>')
document.write('<a href="javascript:Pop(\''+rootpath+'committee/pt\')" class="clsMenu"><b>'+pt+'</b></a><br>')
document.write('<span class="clsTitle">Pack Trainer</span><br>')
document.write('<a href="javascript:Pop(\''+rootpath+'committee/pcor\')" class="clsMenu"><b>'+cor+'</b></a><br>')
document.write('<span class="clsTitle">Charter Organ. Representative</span><br>')
document.write('<a href="javascript:Pop(\''+rootpath+'committee/ps\')" class="clsMenu"><b>'+sec+'</b></a><br>')
document.write('<span class="clsTitle">Secretary</span><br>')
document.write('<a href="javascript:Pop(\''+rootpath+'committee/ptr\')" class="clsMenu"><b>'+tre+'</b></a><br>')
document.write('<span class="clsTitle">Treasurer</span><br>')
document.write('<a href="javascript:Pop(\''+rootpath+'committee/pac\')" class="clsMenu"><b>'+ac+'</b></a><br>')
document.write('<span class="clsTitle">Awards Chairperson</span>')
}

//Build page navigation links
function BuildNavigation(){
document.write('<a href="'+rootpath+'index.htm" class="clsMenu"><b>Home</b></a>')
document.write('<img src="'+rootpath+'images/blank.gif" border="0" height="1" width="10">')
document.write('<a href="'+rootpath+'parents/parents.htm" class="clsMenu"><b>Parents</b></a>')
document.write('<img src="'+rootpath+'images/blank.gif" border="0" height="1" width="10">')
document.write('<a href="'+rootpath+'tigers/tigers.htm" class="clsMenu"><b>Tigers</b></a>')
document.write('<img src="'+rootpath+'images/blank.gif" border="0" height="1" width="10">')
document.write('<a href="'+rootpath+'wolves/wolves.htm" class="clsMenu"><b>Wolves</b></a>')
document.write('<img src="'+rootpath+'images/blank.gif" border="0" height="1" width="10">')
document.write('<a href="'+rootpath+'bears/bears.htm" class="clsMenu"><b>Bears</b></a>')
document.write('<img src="'+rootpath+'images/blank.gif" border="0" height="1" width="10">')
document.write('<a href="'+rootpath+'webelos/webelos.htm" class="clsMenu"><b>Webelos</b></a>')
document.write('<img src="'+rootpath+'images/blank.gif" border="0" height="1" width="10">')
document.write('<a href="'+rootpath+'pipermail/committee_pearlandpack468.org" class="clsMenu"><b>Meeting Minutes</b></a>')
document.write('<hr color="#93a4c8" noshade>')
}

function BuildNavigationb(){
document.write('<a href="'+rootpath+'index.htm" class="clsMenu"><b>Home</b></a>')
document.write('<img src="'+rootpath+'images/blank.gif" border="0" height="1" width="10">')
document.write('<a href="'+rootpath+'parents/parents.htm" class="clsMenu"><b>Parents</b></a>')
document.write('<img src="'+rootpath+'images/blank.gif" border="0" height="1" width="10">')
document.write('<a href="'+rootpath+'tigers/tigers.htm" class="clsMenu"><b>Tigers</b></a>')
document.write('<img src="'+rootpath+'images/blank.gif" border="0" height="1" width="10">')
document.write('<a href="'+rootpath+'wolves/wolves.htm" class="clsMenu"><b>Wolves</b></a>')
document.write('<img src="'+rootpath+'images/blank.gif" border="0" height="1" width="10">')
document.write('<a href="'+rootpath+'bears/bears.htm" class="clsMenu"><b>Bears</b></a>')
document.write('<img src="'+rootpath+'images/blank.gif" border="0" height="1" width="10">')
document.write('<a href="'+rootpath+'webelos/webelos.htm" class="clsMenu"><b>Webelos</b></a>')
document.write('<img src="'+rootpath+'images/blank.gif" border="0" height="1" width="10">')
document.write('<a href="'+rootpath+'pipermail/committee_pearlandpack468.org/" class="clsMenu"><b>Meeting Minutes</b></a>')
document.write('<img src="'+rootpath+'images/blank.gif" border="0" height="1" width="10">')
document.write('<a href="http://www.standrewspearland.org/" target="_new" class="clsMenu"><b>St. Andrews</b></a><br>')
document.write('<hr color="#93a4c8" noshade>')
}

function BuildMainLeft(){
document.write('<center>'+
'<span class="clsCapWh">Pack Calendar</span><br><br>')
if(DetectBrowser()=="IE"){
   BuildCalendar()
}
document.write('<a href="http://www.calsnet.net/pearlandpack468" target="_new">View Pack Calendar</a><br>')
document.write('<br><span class="clsCapWh">Pack Membership</span><br><br>')
BuildMemberTable()
document.write('<br><img src="'+rootpath+'images/committee.gif" border="0" height="110" width="110"><br>'+
   '<span class="clsCapWh"></span></center><br>'+
   '<a href="javascript:OrgChartDir()" class="clsMenu">Pack Organization</a><br>'+
   '<a href="'+rootpath+'duties.htm" class="clsMenu">Pack Meeting Duty Roster</a><br>'+
   '<a href="'+rootpath+'common/p468lg.htm" class="clsMenu">Pack 468 Leaders Guide</a><br>'+
   '<a href="'+rootpath+'common/training.htm" class="clsMenu">Leader Training</a><br>'+
   '<a href="'+rootpath+'forms/forms.htm" class="clsMenu">Awards and Forms</a><br><br>'+
   '<center><span class="clsCapWh">Pack Committee</span></center><br>')
BuildLeaders()
document.write('<br><br>')
}

function BuildMainRight(){
document.write('<center><img src="'+rootpath+'images/scoutorgs2.gif" border="0" height="135" width="105">'+
   '</center><br>'+
   '<a href="http://www.scout.org/" target="_new" class="clsMenu">World Scouting</a><br>'+
   '<a href="http://www.scouting.org/" target="_new" class="clsMenu">Boy Scouts of America</a><br>'+
   '<a href="http://www.bacbsa.org/" target="_new" class="clsMenu">Bay Area Council</a><br>'+
   '<a href="http://www.bacbsa.org/cgi/bac/main.cgi?cfg=northernstar" target="_new" class="clsMenu">Northern Star District</a>'+
   '<br><br><center>'+
   '<a href="http://www.scout.org/" target="_new"><img src="'+rootpath+'images/wso.gif" border="0" height="24" width="120"></a>'+
   '</center><br><br><center><span class="clsCapBu">Our Sponsors</span><br>'+
   '<span class="clsSm">Support our sponsors</span><br><br>')
BuildSponsors()
document.write('<br><span class="clsSm">Visit our <a href="'+rootpath+'sponsors.htm" class="clsSm">'+
   'sponsors page</a> for<br>details about our sponsors</span></center><br>')
document.write('<a href="http://www.getnetwise.org" target="new">'+
   '<img height=31 width=150 src="'+rootpath+'images/getnetwiselogo150.gif" '+
   'alt="GetNetWise You\'re One Click Away" border="0"></a>')
}

function BuildRankLeft(){
document.write('<center><span class="clsCapWh">Pack Calendar</span><br><br>')
if(DetectBrowser()=="IE"){
   BuildCalendar()
}
document.write('<a href="http://www.calsnet.net/pearlandpack468" class="clsMenu"  target="_new">View Pack Calendar</a>')
document.write('<br><br><span class="clsCapWh">'+txtRank+' Dens and Leaders</span><br><br>')

//cycle for dens here
if(txtRank=="Tiger"){
intDenNo=arrTigers.length
for(i=0;i<intDenNo;i++){
document.write('<a href="#" onclick="window.open(\'den'+i+'.htm\',\'Pop\',\'width=300,height=500,scrollbars=1\')" class="clsMenu">'+arrTigers[i]+'</a><br>')
}
}else if(txtRank=="Wolf"){
intDenNo=arrWolves.length
for(i=0;i<intDenNo;i++){
document.write('<a href="#" onclick="window.open(\'den'+i+'.htm\',\'Pop\',\'width=300,height=500,scrollbars=1\')" class="clsMenu">'+arrWolves[i]+'</a><br>')
}
}else if(txtRank=="Bear"){
intDenNo=arrBears.length
for(i=0;i<intDenNo;i++){
document.write('<a href="#" onclick="window.open(\'den'+i+'.htm\',\'Pop\',\'width=300,height=500,scrollbars=1\')" class="clsMenu">'+arrBears[i]+'</a><br>')
}
}else if(txtRank=="Webelos"){
intDenNo=arrWebelos.length
for(i=0;i<intDenNo;i++){
document.write('<a href="#" onclick="window.open(\'den'+i+'.htm\',\'Pop\',\'width=300,height=500,scrollbars=1\')" class="clsMenu">'+arrWebelos[i]+'</a><br>')
}
}
//end cycle

document.write('<br><span class="clsCapWh">For Scouts</span><br><br>')
document.write('<a href="#" onclick="window.open(\''+rootpath+'common/bobcat.htm\',\'PopB\',\'width=450,height=600\')" class="clsMenu">Bobcat Tracks</a><br>')
document.write('<a href="#" onclick="window.open(\''+rootpath+'common/cp.htm\',\'Pop\',\'width=300,height=200\')" class="clsMenu">Cub Scout Promise</a><br>')

//Test for Tigers
if (txtRank=="Tiger"){
   document.write('<a href="#" onclick="window.open(\''+rootpath+'common/tm.htm\',\'Pop\',\'width=200,height=150\')" class="clsMenu">Tiger Cub Motto</a><br>')
}else{
   document.write('<a href="#" onclick="window.open(\''+rootpath+'common/sm.htm\',\'Pop\',\'width=200,height=150\')" class="clsMenu">Cub Scout Motto</a><br>')
}
//End Tiger test

document.write('<a href="#" onclick="window.open(\''+rootpath+'common/lp.htm\',\'Pop\',\'width=300,height=200\')" class="clsMenu">Law of the Pack</a><br>')

//Test for Webelos
if(txtRank=="Webelos"){
document.write('<a href="#" onclick="window.open(\''+rootpath+'common/bsm.htm\',\'Pop\',\'width=300,height=450\')" class="clsMenu">Boy Scout Motto</a><br>')
document.write('<a href="#" onclick="window.open(\''+rootpath+'common/bso.htm\',\'Pop\',\'width=300,height=400\')" class="clsMenu">Boy Scout Oath</a><br>')
document.write('<a href="#" onclick="window.open(\''+rootpath+'common/bsl.htm\',\'Pop\',\'width=300,height=525,scrollbars=1\')" class="clsMenu">Boy Scout Law</a><br>')
document.write('<a href="#" onclick="window.open(\''+rootpath+'common/bss.htm\',\'Pop\',\'width=300,height=500\')" class="clsMenu">Boy Scout Slogan</a><br>')
document.write('<a href="#" onclick="window.open(\''+rootpath+'common/bsoc.htm\',\'Pop\',\'width=300,height=525\')" class="clsMenu">Boy Scout Outdoor Code</a><br>')

}
//End Webelos Test


document.write('<br><span class="clsCapWh">For the Leaders</span><br><br></center>')
document.write('<a href="'+rootpath+'common/p468lg.htm" class="clsMenu">Pack 468 Leaders Guide</a><br>')

//Test for rank appropriate faststart
if(txtRank=="Tiger"){
   document.write('<a href="'+rootpath+'common/tlfaststart.pdf" class="clsMenu">Fast Start Training</a><br>')
}else if(txtRank=="Webelos"){
   document.write('<a href="'+rootpath+'common/wlfaststart.pdf" class="clsMenu">Fast Start Training</a><br>')
}else{
   document.write('<a href="'+rootpath+'common/dlfaststart.pdf" class="clsMenu">Fast Start Training</a><br>')
}
//End test for faststart

document.write('<a href="#" onclick="window.open(\'http://www.bsa.scouting.org/cubscouts/faststart/fset.htm\',\'cstrain\',\'width=600,height=400\')" class="clsMenu">BSA Computer-Based Fast Start Training</a><br>')
document.write('<a href="'+rootpath+'common/advtrck.htm" class="clsMenu">Achievement Tracking Spreadsheet (Excel)</a><br>')
document.write('<a href="'+rootpath+'forms/forms.htm" class="clsMenu">Awards and Forms</a><br>')
document.write('<br><center><span class="clsCapWh">Useful Resources</span><br></center><br>')
document.write('<a href="http://www.geocities.com/~pack215/home.html" target="_new" class="clsMenu">The Virtual Cub Scout Leader\'s Handbook</a><br><br>')
}

















