
////////////////////////////////////////////////////////////////////////////////////
// ARRAY CONFIGURATION
////////////////////////////////////////////////////////////////////////////////////

    var Today         = new Date();
    var ThisDate      = Today.getDate();        //date
    var ThisDay       = Today.getDay();	        //numeric index of Day
    var ThisMonth     = Today.getMonth()+1;   	//numeric index of Month
    var ThisHour      = Today.getHours();
    var ThisMinute    = Today.getMinutes();
    var ThisYear      = Today.getYear();

    var months = new Array("", 
        "January", "February", "March", "April", "May", "June",
        "July", "August", "September", "October", "November", "December"
    );
    var days=
    ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]
    

    function leapYear(year) {
     if (year % 4 == 0) {// basic rule
       return true; // is leap year
     }
     /* else */ // else not needed when statement is "return"
    return false; // is not leap year
    }

    function getDays(month, year) {
      // create array to hold number of days in each month
      var ar = new Array(12);
      ar[0] = 31; // January
      ar[1] = (leapYear(year)) ? 29 : 28; // February
      ar[2] = 31; // March
      ar[3] = 30; // April
      ar[4] = 31; // May
      ar[5] = 30; // June
      ar[6] = 31; // July
      ar[7] = 31; // August
      ar[8] = 30; // September
      ar[9] = 31; // October
      ar[10] = 30; // November
      ar[11] = 31; // December

      // return number of days in the specified month (parameter)
      return ar[month];
    }

    var ThisDayofWeek = days[ThisDay];
    var DaysInThisMonth = getDays(ThisMonth, ThisYear);
    var DaysInNextMonth = getDays(ThisMonth+1, ThisYear);


function getNextBoardMeeting1(){
   // NYSA Board Meetings are the first Monday of each Month;
   var testForMondayDate;
   var testForMondayDOW;
   var MonthWithFirstMonday;
   var MondayMonth;
   var i=0;
   var foundMonday;
    
   if (ThisYear < 1900)
   {
      ThisYear = ThisYear+1900;
   }

   if (ThisDate > 7)    // already passed the first Monday of this month
   {
      MonthWithFirstMonday=ThisMonth+1;
   }
   else				 // within the first week of the month - check if passed the first Monday.
   {
      MonthWithFirstMonday = ThisMonth;
      foundMonday=0;
      // If this month have we already passed the first Monday?
      for (i=ThisDate; i <=7; i++){
          testForMondayDate = new Date(ThisYear, MonthWithFirstMonday-1, i);  // TBD: dont forget to wrap at end of year
          testForMondayDOW   = testForMondayDate.getDay();
          if  (days[testForMondayDOW] == "Monday") {foundMonday =  1;}
      }
      if (foundMonday==0){MonthWithFirstMonday=ThisMonth+1;}
   }

   // At this point we know which month we are dealing with -- Find first Monday
   for (i=1; i <=7; i++){
       testForMondayDate = new Date(ThisYear, MonthWithFirstMonday-1, i);  // TBD: dont forget to wrap at end of year
       testForMondayDOW   = testForMondayDate.getDay();

       if  (days[testForMondayDOW] == "Monday")
       {
          MondayMonth =  testForMondayDate.getMonth();
   	      MondayYear  =  testForMondayDate.getYear();
          if (MondayYear < 1900)
          {
             MondayYear = MondayYear+1900;
          }

		  MondayDay   =  i;
      }
   }
   document.write("Next Board Meeting<br> is Monday, " + months[MondayMonth+1] + " " + MondayDay + ", " + MondayYear + "<br>");
 }




    var specialdate   = new Array();
    var specialmsg    = new Array();
    specialdate[0]    = "April 22, 2005";
    specialmsg[0]     = "Happy Anniversary Brian & Carol!";




// ------------------ Quote of the Day --------------------------------------------
    var quotes = new Array()
    quotes[0] =   "A fisherman does not bait his hook with food he likes.  He uses food the fish likes.  So with boys."
    quotes[1] =   "Scouting is a man\'s job cut down to a boy\'s size."  
    quotes[2] =   "Scouting is a game for boys under the leadership of boys under the direction of a man."  
    quotes[3] =   "Where is there a boy to whom the call of the wild and the open road does not appeal?"
    quotes[4] =   "We are not a club or a Sunday school class, but a school of the woods."
    quotes[5] =   "Fun, fighting, and feeding!  These are the three indispensable elements of the boy\'s world."
    quotes[6] =   "Scoutmasters need to enter into boys\' ambitions."
    quotes[7] =   "A boy is supremely confident of his own power, and dislikes being treated as a child."
    quotes[8] =   "Boys can see the adventure in a dirty old duck puddle, and--if the Scoutmaster is a boys\' man--he can see it, too."
    quotes[9] =   "A boy can see the smoke rising from Sioux villages under the shadow of the Albert memorial."
    quotes[10] =  "Teach scouts not how to get a living, but how to live."
    quotes[11] =  "We must change boys from a \'What can I get\' to a \'What can I give\' attitude."
    quotes[12] =  "The code of the knight is still the code of the gentleman today."
    quotes[13] =  "The real way to gain happiness is to give it to others."
    quotes[14] =  "In Scouting, you are combating the brooding of selfishness."
    quotes[15] =  "Scoutmasters deal with the individual boy, rather than with the mass."
    quotes[16] =  "It\'s the spirit within, not the veneer without, that makes a man."
    quotes[17] =  "It is risky to order a boy <i>not</i> to do something; it immediately opens to him the adventure of doing it."
    quotes[18] =  "You can only get discipline in the mass by discipline in the individual."
    quotes[19] =  "The Scoutmaster must be alert to check badge hunting as compared to badge earning."
    quotes[20] =  "The Scout Oath and Law are our binding disciplinary force."
    quotes[21] =  "A week of camp life is worth six months of theoretical teaching in the meeting room."
    quotes[22] =  "A boy is not a sitting-down animal."
    quotes[23] =  "Vigorous scout games are the best form of physical education, because most of them bring in moral education."
    quotes[24] =  "An invaluable step in character training is to put responsibility on the individual."
    quotes[25] =  "When a boy finds someone who takes an interest in him, he responds and follows."
    quotes[26] =  "The sport in Scouting is to find the good in every boy and develop it."
    quotes[27] =  "Show me a poorly uniformed troop and I\'ll show you a poorly uniformed leader."
    quotes[28] =  "The more responsibility the Scoutmaster gives his patrol leaders, the more they will respond."
    quotes[29] =  "It should be the thing never to mention unfairness of judging when defeated in a contest."
    quotes[30] =  "The Scoutmaster teaches boys to play the game by doing so himself."
    quotes[31] =  "O God, help me to win; but in thy wisdom, if Thou willest me not to win, then, O God, make me a good loser."
    quotes[32] =  "There is no teaching to compare with example."
    quotes[33] =  "We do not want to make scout training too soft."
    quotes[34] =  "The Good Turn will educate the boy out of the groove of selfishness."
    quotes[35] =  "When you want a thing done, \'Don\'t do it yourself\' is a good motto for Scoutmasters."
    quotes[36] =  "Loyalty is a feature in a boy\'s character that inspires boundless hope."
    quotes[37] =  "The boy is not governed by <i>don\'t</i>, but is led by <i>do</i>."
    quotes[38] =  "The object of the patrol method is not so much saving the Scoutmaster trouble as to give responsibility to the boy."
    quotes[39] =  "The most important object in Boy Scout training is to educate, not instruct."
    quotes[40] =  "Scoutmasters need the capacity to enjoy the out-of-doors."
    quotes[41] =  "A boy is naturally full of humor."
    quotes[42] =  "If you make listening and observation your occupation, you will gain much more than you can by talk."
    quotes[43] =  "A boy carries out suggestions more wholeheartedly when he understands their aim."
    quotes[44] =  "The Scoutmaster guides the boy in the spirit of an older brother."
    quotes[45] =  "To get a hold on boys, you must be their friend."
    quotes[46] =  "In Scouting, a boy is encouraged to educate himself, instead of being instructed."
    quotes[47] =  "The spirit is there in every boy; it has to be discovered and brought to light."
    quotes[48] =  "The most worth-while thing is to try to put happiness into the lives of others."
    quotes[49] =  "Trust should be the basis for all our moral training."
    quotes[50] =  "The uniform makes for brotherhood, since--when universally adopted--it covers up all differences of class and country."
    quotes[51] =  "An individual step in character training is to put responsibility on the individual."
    quotes[52] =  "Scouts of the World - Brothers Together!"
    quotes[53] =  "The patrol system leads each boy to see that he has some individual responsibility for the good of his patrol."
    quotes[54] =  "Scouting is not an abstruse or difficult science; rather it is a jolly game if you take it in the right light.  In the same time it is educative, and--like mercy--it is apt to benefit him that giveth as well as him that receives." 
    quotes[55] =  "It is the patrol system that makes the troop, and all Scouting, for that matter, a real co-operative matter."
    quotes[56] =  "If a man cannot make his point to keen boys in ten minutes, he ought to be shot!"
    quotes[57] =  "Scouting is a game with a purpose."

















//  Add more quotes here
// ------------------ Quote of the Day --------------------------------------------




////////////////////////////////////////////////////////////////////////////////////
// PUBLIC FUNCTIONS
////////////////////////////////////////////////////////////////////////////////////





// -------------------------- Special message on specific date --------------------
    function specialMsg() {     
      for (i = 0; i < specialdate.length; i++) {
         tempdate  = new Date(specialdate[i]);
         tempmonth = months[tempdate.getMonth() + 1];
		 tempmonth = tempdate.getMonth()+1;
         tempday   = tempdate.getDate();
         tempyear  = tempdate.getYear();
         if (ThisMonth == tempmonth && ThisDate == tempday)
            document.write("<br><b> " + specialmsg[i] + "</b><br>"); 
      }
    }
// -------------------------- Special message on specific date --------------------


// -------------------------- Quote of the Day message ------- --------------------
    function quoteMsg() {     
      var num = Math.round(Math.random() * quotes.length );
      document.write("<b>Baden-Powell thought for the day:<br> &nbsp;&nbsp;</b>");
      document.write(quotes[num]);
	}
// -------------------------- Quote of the Day message ------- --------------------




       function dateNotExpired(testDate) { 
            var Today         = new Date();
            var tempdate      = new Date(testDate);
            var diff          = tempdate.getTime() - Today.getTime();
            var days          = Math.floor(diff / (1000 * 60 * 60 * 24));
            if (days > -2) {
               days++;                                                
               return("true");
            }
            return("false");
       }

       function externalnavto(where) {
            window.location = where;
       }

       function getPage(page){
          var xmlhttp=false; //Clear our fetching variable
          try {
             xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object&#8230;
          } 
          catch (e) {
              try {
                 xmlhttp = new
                 ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
              } catch (E) {
                    xmlhttp = false;
              }
          }
          if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                  xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
          }

          var file = 'text.php?page='; //This is the path to the file we just finished making *

          xmlhttp.open('GET', file + page, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **

          xmlhttp.onreadystatechange=function() {
            if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
               var content = xmlhttp.responseText; //The content data which has been retrieved ***
               if( content ){ //Make sure there is something in the content variable
                  document.getElementById('content').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
               }
            }
          }
          xmlhttp.send(null) //Nullify the XMLHttpRequest
          return;
       }


// -------------------------- Gradual HighLighting ----------- --------------------
// Gradual Highlight image script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
// This notice MUST stay intact for legal use
// Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code

   var baseopacity=75

   function slowhigh(which2){
      imgobj=which2
      browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
      instantset(baseopacity)
      highlighting=setInterval("gradualfade(imgobj)",50)
   }

   function slowlow(which2){
      cleartimer()
      instantset(baseopacity)
   }

   function instantset(degree){
      if (browserdetect=="mozilla")
         imgobj.style.MozOpacity=degree/100
      else if (browserdetect=="ie")
         imgobj.filters.alpha.opacity=degree
   }

   function cleartimer(){
      if (window.highlighting) clearInterval(highlighting)
   }

   function gradualfade(cur2){
      if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
         cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
      else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
         cur2.filters.alpha.opacity+=10
      else if (window.highlighting)
         clearInterval(highlighting)
   }

// -------------------------- Gradual HighLighting ----------- --------------------







