
////////////////////////////////////////////////////////////////////////////////////
// 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!";






















////////////////////////////////////////////////////////////////////////////////////
// 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 --------------------






       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 ----------- --------------------






