function timed_text(tstring,y,m,d){
				 var todayis = new Date;
				 var edate = new Date;
				 edate.setFullYear(y,m-1,d);
				 //document.write(edate);
				 //document.write(tstring);
				 if (todayis <= edate){
				 		document.write(tstring);
						}
					}
					
function commented_textA(y,m,d){
				 var todayis = new Date;
				 var edate = new Date;
				 edate.setFullYear(y,m-1,d);
				 //document.write(edate);
				 //document.write(tstring);
				 if (todayis >= edate){
				 		document.write("<!-- ");
						}
					}
					
function commented_textB(y,m,d){
				 var todayis = new Date;
				 var edate = new Date;
				 edate.setFullYear(y,m-1,d);
				 //document.write(edate);
				 //document.write(tstring);
				 if (todayis >= edate){
				 		document.write(" -->");
						}
					}
					
function prior_commented_textA(y,m,d){
				 var todayis = new Date;
				 var edate = new Date;
				 edate.setFullYear(y,m-1,d);
				 //document.write(edate);
				 //document.write(tstring);
				 if (todayis < edate){
				 		document.write("<!-- ");
						}
					}
					
function prior_commented_textB(y,m,d){
				 var todayis = new Date;
				 var edate = new Date;
				 edate.setFullYear(y,m-1,d);
				 //document.write(edate);
				 //document.write(tstring);
				 if (todayis < edate){
				 		document.write(" -->");
						}
					}

function meet_date(){
				 mydates = new Array();
				 mydates[0] = new Array(5);
				 mydates[1] = new Array(5);
				 mydates[2] = new Array(5);
				 mydates[3] = new Array(5);
				 mydates[4] = new Array(5);
				 mydates[5] = new Array(5);
				 mydates[6] = new Array(5);
				 mydates[7] = new Array(5);
				 mydates[8] = new Array(5);
				 mydates[0][0] = "Tuesday, February 24th, 4:30 p.m.";
				 mydates[0][1] = 1;
				 mydates[0][2] = 18;
				 mydates[0][3] = 1;
				 mydates[0][4] = 24;                        
				 mydates[1][0] = "Tuesday, March 3rd, 4:30 p.m.";
				 mydates[1][1] = 1;
				 mydates[1][2] = 25;
				 mydates[1][3] = 2;
				 mydates[1][4] = 3;
				 mydates[2][0] = "Wednesday, March 11th, 9 a.m.";
				 mydates[2][1] = 2;
				 mydates[2][2] = 4;
				 mydates[2][3] = 2;
				 mydates[2][4] = 11;
				 mydates[3][0] = "Dec 4th";
				 mydates[3][1] = 10;
				 mydates[3][2] = 21;
				 mydates[3][3] = 11;
				 mydates[3][4] = 4;
				 mydates[4][0] = "Dec. 11th";
				 mydates[4][1] = 11;
				 mydates[4][2] = 5;
				 mydates[4][3] = 11;
				 mydates[4][4] = 11;
				 mydates[5][0] = "Dec. 18th";
				 mydates[5][1] = 11;
				 mydates[5][2] = 12;
				 mydates[5][3] = 11;
				 mydates[5][4] = 18;
				 mydates[6][0] = "January 8th";
				 mydates[6][1] = 11;
				 mydates[6][2] = 19;
				 mydates[6][3] = 0;
				 mydates[6][4] = 8;
				 mydates[7][0] = "January 22th";
				 mydates[7][1] = 0;
				 mydates[7][2] = 9;
				 mydates[7][3] = 0;
				 mydates[7][4] = 22; 				 //document.write("Number of records "+mydates.length);
				 var todayis = new Date;
				 //todayis.setMonth(1)
				//todayis.setDate(16);
				 var begday = new Date;
				 var endday = new Date;
				 var found = false;
				 //document.write(todayis);
				 
				 for (i = 0; i <= 7; i++){
				 	 //document.write(mydates[i][0]);
  				 begday.setFullYear(2009,mydates[i][1],mydates[i][2]);
  				 endday.setFullYear(2009,mydates[i][3],mydates[i][4]);						 
    				 if ( todayis >= begday && todayis <= endday ){
    				 document.write(mydates[i][0]);
						 found = true;
						 break;
    				 }
  				 }					 
						 if (!found) {
						 document.write("  ***No Meetings Scheduled***");
						 }
				 }
				 
				 function email_hide(){
				 var _u   = "info";
								var _d = "massapequawater.com";
								var _l   = _u + "@" + _d;
								var _m = _u + "@" + _d;
			document.write("<a href='mailto:"+_l+"'>"+_m+"</a>");
			}
			
			

var Count = 0;
//var Text = "<!--#include file='musicdb.php?fld=4' -->";
if (thefile != "index.shtml"){
var Text = "";
}
var Speed = 90;
var timerID = null;
var TimerRunning = false;

var i = 0;
while (i ++ < 140)
Text = " " + Text;

function Scroll(){
window.status = Text.substring(Count++, Text.length);
if (Count == Text.length)
Count = 0;
timerID = setTimeout("Scroll()", Speed);
TimerRunning = true;
}

function Start(){
Stop();
Scroll();
}

function Stop(){
if(TimerRunning)
clearTimeout(timerID);
TimerRunning = false;
}

//Start(); 






var audioOn = false;
var mplay = 'stop'
function audioDo(doWhat,toWhat){
   if(audioOn){
      var A = eval('document.'+toWhat);
      if (A != null){
         if (mplay=='stop') {
            A.stop();
            document.all.btnmusic.value="Play the Music!";
            mplay = 'play';
             }
         else{
            if (navigator.appName == 'Netscape') A.play();
            else{
               if (document.M == null){
                  document.M = false; var m;
                  for(m in A) if (m == "ActiveMovie"){
                     document.M = true; break;
                     }
                  }
               if (document.M) A.SelectionStart = 0;
               if (mplay=='play') {
                  A.play();
                  mplay = 'stop';
                  document.all.btnmusic.value="Stop the Music!";
                  }
            }
         }
      }
   }
}
function audioDoL(doWhat,toWhat){
   if(audioOn){
      var A = eval('document.'+toWhat);
      if (A != null){
         if (doWhat=='stop') {
            A.stop();
			mplay = 'play';
            document.all.btnmusic.value="Play the Music!";
             }
         else{
            if (navigator.appName == 'Netscape') A.play();
            else{
               if (document.M == null){
                  document.M = false; var m;
                  for(m in A) if (m == "ActiveMovie"){
                     document.M = true; break;
                     }
                  }
               if (document.M) A.SelectionStart = 0;
               if (doWhat=='play') {
                  A.play();
                  mplay = 'stop';
                  document.all.btnmusic.value="Stop the Music!";
                  }
            }
         }
      }
   }
}


function musicOff() {
document.mediaPlayer.stop()
Stop();
window.status = "";
}function musicOn() {
document.mediaPlayer.play()
Scroll();
}


function changeButton() {
if (document.onoff.B1.value=='Turn music off') {
document.onoff.B1.value='Turn music on';
musicOff()
}
else {
document.onoff.B1.value='Turn music off';
musicOn()
}
}



function music_onunload() {
	if (music_play == null)
		{
		createCookie('stjoemusic','no music',1);
		}
}





function newwindow(win) 
{ 
window.open(win,'jav','width=1000,height=600,resizable=yes,scrollbars=yes'); 
} 


function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
};


music_play = readCookie('stjoemusic');
//eraseCookie('stjoemusic');
//alert(music_play);
if (music_play == null) {
Start();
}

function winpop(loc)
{
window.open(loc,"","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=300,height=475");
}


function meet_dateM(){
				 mydates = new Array();
				 mydates[0] = new Array(5);
				 mydates[1] = new Array(5);
				 mydates[2] = new Array(5);
				 mydates[3] = new Array(5);
				 mydates[4] = new Array(5);
				 mydates[5] = new Array(5);
				 mydates[6] = new Array(5);
				 mydates[7] = new Array(5);
				 mydates[8] = new Array(5);
				 mydates[0][0] = "JANUARY 27TH";
				 mydates[0][1] = 0;
				 mydates[0][2] = 20;
				 mydates[0][3] = 0;
				 mydates[0][4] = 27;                        
				 mydates[1][0] = "FEBRUARY 3RD";
				 mydates[1][1] = 0;
				 mydates[1][2] = 28;
				 mydates[1][3] = 1;
				 mydates[1][4] = 3;
				 mydates[2][0] = "FEBRUARY 10TH";
				 mydates[2][1] = 1;
				 mydates[2][2] = 4;
				 mydates[2][3] = 1;
				 mydates[2][4] = 10;
				 mydates[3][0] = "Dec 4th";
				 mydates[3][1] = 10;
				 mydates[3][2] = 21;
				 mydates[3][3] = 11;
				 mydates[3][4] = 4;
				 mydates[4][0] = "Dec. 11th";
				 mydates[4][1] = 11;
				 mydates[4][2] = 5;
				 mydates[4][3] = 11;
				 mydates[4][4] = 11;
				 mydates[5][0] = "Dec. 18th";
				 mydates[5][1] = 11;
				 mydates[5][2] = 12;
				 mydates[5][3] = 11;
				 mydates[5][4] = 18;
				 mydates[6][0] = "January 8th";
				 mydates[6][1] = 11;
				 mydates[6][2] = 19;
				 mydates[6][3] = 0;
				 mydates[6][4] = 8;
				 mydates[7][0] = "January 22th";
				 mydates[7][1] = 0;
				 mydates[7][2] = 9;
				 mydates[7][3] = 0;
				 mydates[7][4] = 22; 				 //document.write("Number of records "+mydates.length);
				 var todayis = new Date;
				 //todayis.setMonth(1)
				//todayis.setDate(16);
				 var begday = new Date;
				 var endday = new Date;
				 var found = false;
				 //document.write(todayis);
				 
				 for (i = 0; i <= 7; i++){
				 	 //document.write(mydates[i][0]);
  				 begday.setFullYear(2009,mydates[i][1],mydates[i][2]);
  				 endday.setFullYear(2009,mydates[i][3],mydates[i][4]);						 
    				 if ( todayis >= begday && todayis <= endday ){
    				 document.write(mydates[i][0]);
						 found = true;
						 break;
    				 }
  				 }					 
						 if (!found) {
						 document.write("  ***No Meetings Scheduled***");
						 }
				 }


function nextmeetdateXX(){
//does nothing
}

function nextmeetdate(){

var compDate = new Date();
var meetDate = new Date();


compDate.setFullYear(2009,2,3);
//document.write("<br />" + compDate.getMonth() + " " + compDate.getDate() + " " + compDate.getFullYear() + "<br />");

//meetDate.setFullYear(2009,2,4);  //Every Tuesday
var mday = meetDate.getDay();
var mdate = meetDate.getDate();

if (meetDate <= compDate){
var dow = "Tuesday";
var tom = "4:30 p.m.";
while (meetDate.getDay() != 2){
			meetDate.setDate(meetDate.getDate()+ 1);
			}
			}
			else {					 
var dow = "Wednesday";
var tom = "9 a.m.";
compDate.setFullYear(2009,2,4);
//document.write(meetDate.getDate() + " " + compDate.getDate());
if (meetDate.getDate() == compDate.getDate()&& meetDate.getFullYear() == compDate.getFullYear() && meetDate.getMonth() == compDate.getMonth()){
	 meetDate.setDate(11);
	 //document.write("<br />Hurray!");
	 }
	 else {
while (meetDate.getDay() != 3){
			meetDate.setDate(meetDate.getDate()+ 1);
			}
	}		
		}	
			//document.write("<br />" + meetDate.getDay());
	monthname = new Array(11);
	monthname[0]= "January";
	monthname[1]= "February";
	monthname[2]= "March";
	monthname[3]= "April";
	monthname[4]= "May";
	monthname[5]= "June";
	monthname[6]= "July";
	monthname[7]= "August";
	monthname[8]= "September";
	monthname[9]= "October";
	monthname[10]= "November";
	monthname[11]= "December";
	
	tickmark = new Array(32);
	tickmark[0] = "";
	tickmark[1] = "st";
	tickmark[2] = "nd";
	tickmark[3] = "rd";
	tickmark[4] = "th";
	tickmark[5] = "th";
	tickmark[6] = "th";
	tickmark[7] = "th";
	tickmark[8] = "th";
	tickmark[9] = "th";
	tickmark[10] = "th";
	tickmark[11] = "th";
	tickmark[12] = "th";
	tickmark[13] = "th";
	tickmark[14] = "th";
	tickmark[15] = "th";
	tickmark[16] = "th";
	tickmark[17] = "th";
	tickmark[18] = "th";
	tickmark[19] = "th";
	tickmark[20] = "th";
	tickmark[21] = "st";
	tickmark[22] = "th";
	tickmark[23] = "th";
	tickmark[24] = "th";
	tickmark[25] = "th";
	tickmark[26] = "th";
	tickmark[27] = "th";
	tickmark[28] = "th";
	tickmark[29] = "th";
	tickmark[30] = "th";
	tickmark[31] = "st";
			
document.write(dow + ", " + monthname[meetDate.getMonth()]+ " " + meetDate.getDate() + tickmark[meetDate.getDate()] + ", " + tom);
}

function meeting_list(){

var compDate = new Date();
var meetDate = new Date();


compDate.setFullYear(2009,2,3);
//document.write("<br />" + compDate.getMonth() + " " + compDate.getDate() + " " + compDate.getFullYear() + "<br />");

//meetDate.setFullYear(2009,2,4);  //Every Tuesday
var mday = meetDate.getDay();
var mdate = meetDate.getDate();
meetDate.setFullYear(2012,0,1);
var cnt = 0;

monthname = new Array(11);
	monthname[0]= "January";
	monthname[1]= "February";
	monthname[2]= "March";
	monthname[3]= "April";
	monthname[4]= "May";
	monthname[5]= "June";
	monthname[6]= "July";
	monthname[7]= "August";
	monthname[8]= "September";
	monthname[9]= "October";
	monthname[10]= "November";
	monthname[11]= "December";
	
	
	
while (meetDate.getFullYear() < 2013){
cnt = cnt + 1;
if (meetDate <= compDate){
var dow = "Tuesday";
var tom = "4:30 p.m.";

while (meetDate.getDay() != 2){
			meetDate.setDate(meetDate.getDate()+ 1);
			}
			}
			else {					 
var dow = "Wednesday";
var tom = "9 a.m.";
compDate.setFullYear(2009,2,4);
//document.write(meetDate.getDate() + " " + compDate.getDate());
if (meetDate.getDate() == compDate.getDate()&& meetDate.getFullYear() == compDate.getFullYear() && meetDate.getMonth() == compDate.getMonth()){
	 meetDate.setDate(11);
	 //document.write("<br />Hurray!");
	 }
	 else {
while (meetDate.getDay() != 3){
			meetDate.setDate(meetDate.getDate()+ 1);
			}
	}		
		}	
			//document.write("<br />" + meetDate.getDay());
	
			
document.write("<tr><td align='left'>" + dow + ", " + monthname[meetDate.getMonth()]+ " " + meetDate.getDate() + ", " + meetDate.getFullYear() + "</td>" + "<td align='left'>" + tom + "</td></tr>");

meetDate.setDate(meetDate.getDate()+ 7);
}

}

