<!--
var currentMonthNum = 11;
var currentYear = "08";
var prevLink = "oct_08.html";
var thisLink = "nov_08.html";
var nextLink = "dec_08.html";

function getIndexPage(prefix, monthNum)
{
	var linkPage = prefix + "_";
	
	if (monthNum == 1)
	{
		linkPage += "jan";
	}
	else if (monthNum == 2)
	{
		linkPage += "feb";
	}
	else if (monthNum == 3)
	{
		linkPage += "mar";
	}
	else if (monthNum == 4)
	{
		linkPage += "apr";
	}
	else if (monthNum == 5)
	{
		linkPage += "may";
	}
	else if (monthNum == 6)
	{
		linkPage += "jun";
	}
	else if (monthNum == 7)
	{
		linkPage += "jul";
	}
	else if (monthNum == 8)
	{
		linkPage += "aug";
	}
	else if (monthNum == 9)
	{
		linkPage += "sep";
	}
	else if (monthNum == 10)
	{
		linkPage += "oct";
	}
	else if (monthNum == 11)
	{
		linkPage += "nov";
	}
	else if (monthNum == 12)
	{
		linkPage += "dec";
	}
	
	linkPage += "_" + currentYear + ".html";
	return linkPage;
}

function getNavigationByMonth(prefix, monthNum)
{
	var html = "";
	/* If monthNum is really the previous month */
	if (monthNum == (currentMonthNum - 1))
	{
		/* This month is first and selected */
		html += "<tr><td width='200' height='35' bgcolor='#666666' class='currText'>Previous Month</td></tr>";	
		
		/* Put links to the next two months for */
		html += "<tr><td width='200' height='35'><a href='" + prefix + thisLink + "' class='navText'>Current Month</a></td></tr>";	
		html += "<tr><td width='200' height='35'><a href='" + prefix + nextLink + "' class='navText'>Next Month</a></td></tr>";	
	}
	else if (monthNum == currentMonthNum)
	{
		html += "<tr><td width='200' height='35'><a href='" + prefix + prevLink + "' class='navText'>Previous Month</a></td></tr>";
		html += "<tr><td width='200' height='35' bgcolor='#666666' class='currText'>Current Month</td></tr>";	
		html += "<tr><td width='200' height='35'><a href='" + prefix + nextLink + "' class='navText'>Next Month</a></td></tr>";
	}
	else if (monthNum == (currentMonthNum + 1))
	{
		html += "<tr><td width='200' height='35'><a href='" + prefix + prevLink + "' class='navText'>Previous Month</a></td></tr>";
		html += "<tr><td width='200' height='35'><a href='" + prefix + thisLink + "' class='navText'>Current Month</a></td></tr>";
		html += "<tr><td width='200' height='35' bgcolor='#666666' class='currText'>Next Month</td></tr>";
	}
	else if (monthNum == 1 && (currentMonthNum ==12 ))
	{
		html += "<tr><td width='200' height='35'><a href='" + prefix + prevLink + "' class='navText'>Previous Month</a></td></tr>";
		html += "<tr><td width='200' height='35'><a href='" + prefix + thisLink + "' class='navText'>Current Month</a></td></tr>";
		html += "<tr><td width='200' height='35' bgcolor='#666666' class='currText'>Next Month</td></tr>";
	}
	else
	{
		/* Put links to the next two months for */
		html += "<tr><td width='200' height='35'><a href='" + prefix + prevLink + "' class='navText'>Previous Month</a></td></tr>";	
		html += "<tr><td width='200' height='35'><a href='" + prefix + thisLink + "' class='navText'>Current Month</a></td></tr>";	
		html += "<tr><td width='200' height='35'><a href='" + prefix + nextLink + "' class='navText'>Next Month</a></td></tr>";	
	}

	return html;
}

function getMonthName(monthNum, year)
{
	var monthName = "";
	if (monthNum == 1)
	{
		monthName = "January";
	}
	else if (monthNum == 2)
	{
		monthName = "February";
	}
	else if (monthNum == 3)
	{
		monthName = "March";
	}
	else if (monthNum == 4)
	{
		monthName = "April";
	}
	else if (monthNum == 5)
	{
		monthName = "May";
	}
	else if (monthNum == 6)
	{
		monthName = "June";
	}
	else if (monthNum == 7)
	{
		monthName = "July";
	}
	else if (monthNum == 8)
	{
		monthName = "August";
	}
	else if (monthNum == 9)
	{
		monthName = "September";
	}
	else if (monthNum == 10)
	{
		monthName = "October";
	}
	else if (monthNum == 11)
	{
		monthName = "November";
	}
	else if (monthNum == 12)
	{
		monthName = "December";
	}
	
	monthName = monthName + " " + year;
	
	return monthName;		
}

function getTabHtml(name, homepath)
{
    var htmlLine = "<td valign=bottom height=50>";
    if (name == "home")
    {
       htmlLine += "    <a href='"+ homepath + "index.html' >"
    }
    else if (name == "cantor" || name == "music")
    {
		htmlLine += "<a href='"+ homepath + name + "_schedules/";
//		htmlLine += name + "_index.html"
	    htmlLine += getIndexPage(name, currentMonthNum);
		htmlLine += "' >";
	}
	else if (name == "liturgy")
	{
		htmlLine += "<a href='"+ homepath + name + "/"+ name + "_index.html' >"
	}
	else
	{
       htmlLine += "<a href='"+ homepath + name + "_index.html' >"
    }

    /** If the URL is the index for the specified tab, show it as 
        down and don't put in mouse over functionality 
    */
    if (document.URL.indexOf(name) > 0 || 
        (document.URL.indexOf("_index.html") < 1 && document.URL.indexOf("index.html") > 0 && name == "home") ||
        (document.URL == "http://www.mrpiano17.com/" && name == "home")) 
    {
       htmlLine += "<img name='"+name+"' src='" + homepath + "images/"+name+"_down.gif' border = 0 ";
       htmlLine += ">";
       htmlLine += "</td>";
    }
    else 
    {
       htmlLine += "<img name='"+name+"' src='" + homepath + "images/"+name+"_up.gif' border = 0 ";
       htmlLine += "onMouseOver='document.images(\""+name+"\").src = \"" + homepath + "images/"+name+"_over.gif\"; return true;' ";
       htmlLine += "onMouseOut='document.images(\""+name+"\").src = \"" + homepath + "images/"+name+"_up.gif\"; return true;' ";
       htmlLine += "></a>";
       htmlLine += "</td>";
    }
    return htmlLine;
}

/* Returns the html for the header of the page */
function getHeaderHtml(homepath)
{
    var line = "";
    line += "<table align = center width = '100%' cellspacing='0' cellpadding='0' border=0>";
    line += "<tr>";
    line += "<td rowspan=2 width = '20%'>";
	line += "<a href='"+homepath+"index.html'>";
	line += "<img src='" + homepath + "images/piano1.jpg' width = 200 height=125 border=0>";
	line += "</a>";
	line += "</td>";
    line += "<td width = '80%'><font class='title1'> Mike's Music</font>";
    line += "</td>";
    line += "</tr>";
    line += "</table>";
    line += "<table  cellspacing='0' cellpadding='0'>";
    line += "<tr>";
//    line += getTabHtml("home", homepath);
    line += getTabHtml("cantor", homepath); 
    line += getTabHtml("music", homepath);
    line += getTabHtml("liturgy", homepath);	
    line += getTabHtml("personal", homepath);   
    line += "</tr>";
    line += "</table>";
    return line;
}

/* Returns the html for the footer of the page */
function getFooterHtml()
{
    var line = "<br><br><hr><h6>Designed by Amy - ©2005</h6>";
    return line;
}

/* Method to generate the cantor schedule */
function generateCantorCalendar(schedule, innerRows, musicPage, month, year)
{
    var monthdays=new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    var days=monthdays[month-1];
		var thisDate = new Date();
		thisDate.setMonth(month-1);
		thisDate.setDate(1);
		thisDate.setFullYear(year);
    var day = thisDate.getDay(); /* day from 0 to 6 for day of week */
    var htmlLine = "";
    
    /* Determine if it is a leap year and the month is Feb */
    if (month == 2)
    {
    	if ((year%4==0 && year%100!=0) || year%400==0)
    		days=29;
    }
    
		/* Determine which day to start at */
    var start = day - (1 % 7) + 1;
    if (start < 0)
    {
			start += 7;
	}
    
		/* Determine number of weeks to show */
    var weeks=parseInt((start + days)/7);
    if ((start+days) % 7 != 0)
		{
    	weeks++;
		}

		/* Counters for array access */
		var row = 0;
		var innerRowCount = 0;
		
    /* Counter for number of days inserted */
		var currentDay = 1;
    
    /* Output for each week */
		for (var i = weeks; i > 0; i--)
    {
		  /* There is one row per week */
    	htmlLine += "<tr>";
    
		  /* Output for each day in the week */
    	for (var dayCount=7; dayCount > 0; dayCount--)
    	{
    
				/* Check if there should be an empty space for a placeholder */
    		if (currentDay <= start || currentDay > days)
    		{
    			htmlLine += "<td>&nbsp;</td>";
    			start--;
    		}
     		else
    		{
				  /* Get the current date from the array [row][0] location */
					var arrayDate = "";
					if (schedule.length > row)
					{
					  arrayDate = parseInt(schedule[row][0]);
					}
					
					/* Print the current date */
       		htmlLine += "<td width = '10%' valign = 'top'>";
				  htmlLine += "<table width = '100%'>";
					htmlLine += "<tr><td class='calendarDate'>" + currentDay + "</td></tr>";

					/* Check if there is data for the current data */
					if (arrayDate == currentDay)
					{
					  var detailsArray = schedule[row][1];
						for (var arrIndex = 0; arrIndex < detailsArray.length; arrIndex ++)
						{
  						htmlLine += "<tr><td class='calendarBody'>";
							htmlLine += "<a href='" + musicPage + "#" + currentDay + "'>";
							htmlLine += detailsArray[arrIndex];
							htmlLine += "</a></td></tr>";
							innerRowCount = innerRowCount + 1;
						}
						row = row + 1;
					}

					/* Pad the inner tables with enough rows to match the max rows */
  				while (innerRowCount < innerRows)
	  			{
  					htmlLine += "<tr><td class='calendarBody'>&nbsp;</td></tr>";
						innerRowCount = innerRowCount + 1;
					}
					innerRowCount = 0;
					htmlLine += "</tr></table>"
					htmlLine += "</td>";

					/* Increment the number of days already inserted */
    		  currentDay++;
    		}
    
    		htmlLine += "</td>";
    	}
    
    	htmlLine += "</tr>";
    } /* End of each week */
		
		return htmlLine;
}

/* Method to generate the music data table */
function generateMusicTable(schedule)
{
		var htmlLine = "";

    /* Output for each entry */
		for (var i = 0; i < schedule.length; i++)
    {
		  var dateDetails = schedule[i];
			/* dateDetails[0] is the numeric date i.e. 5
			   dateDetails[1] is the title for the date
				 the remaining entries are arrays of data */
			htmlLine += "<br><a name='" + dateDetails[0] + "'>";
			htmlLine += "<font class = 'musicDetailTitle'>" + dateDetails[1] + "</font>";
      htmlLine += "<table align='center' width = '50%' border='1'>";

		  /* Output the details for the date */
    	for (var j = 2; j < dateDetails.length; j++)
    	{
    			htmlLine += "<tr>";
					var entryDetails = dateDetails[j];
			    for (var k = 0; k < entryDetails.length; k++)
					{
					   htmlLine += "<td>" + entryDetails[k] + "</td>";
					}
      		htmlLine += "</tr>";
    	}
      htmlLine += "</table>";

    } 

		return htmlLine;
}


/* Method to generate the music schedule */
function generateMusicCalendar(schedule, innerRows, month, year)
{
    var monthdays=new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    var days=monthdays[month-1];
		var thisDate = new Date();
		thisDate.setMonth(month-1);
		thisDate.setDate(1);
		thisDate.setFullYear(year);
    var day = thisDate.getDay();
    var dayN=thisDate.getDate();

    /* Determine if it is a leap year and the month is Feb */
    if (month == 2)
    {
    	if ((year%4==0 && year%100!=0) || year%400==0)
    		days=29;
    }
    
		var htmlLine = "";
    
		/* Determine which day to start at */
    var start = day - dayN % 7 + 1;
    if (start < 0)
    {
			start += 7;
		}

		/* Determine number of weeks to show */
    var weeks=parseInt((start + days)/7);
    if ((start+days) % 7 != 0)
		{
    	weeks++;
		}

		/* Counters for array access */
		var entry = 0;
		
    /* Counter for number of days inserted */
		var currentDay = 1;
    
    /* Output for each week */
		for (var i = weeks; i > 0; i--)
    {
		  /* There is one row per week */
    	htmlLine += "<tr>";
    
		  /* Output for each day in the week */
    	for (var dayCount=7; dayCount > 0; dayCount--)
    	{
    
				/* Check if there should be an empty space for a placeholder */
    		if (currentDay <= start || currentDay > days)
    		{
    			htmlLine += "<td>&nbsp;</td>";
    			start--;
    		}
     		else
    		{
				  /* Get the current date from the array [row][0] location */
					var arrayDate = "";
					if (schedule.length > entry)
					{
					  arrayDate = parseInt(schedule[entry][0]);
					}
					
					/* Print the current date */
       		htmlLine += "<td width = '10%' valign = 'top'>";
				  htmlLine += "<table width = '100%'>";
					htmlLine += "<tr><td class='calendarDate'>";
					
					if (arrayDate == currentDay)
					{
					   htmlLine += "<a href='#" + currentDay + "'>";
						 htmlLine += currentDay + "</a>";
             entry = entry + 1;
					}
					else 
					{
					   htmlLine += currentDay;
					}
					htmlLine += "</td></tr>";

					/* Pad the inner tables with enough rows to match the max rows */
					var counter = 0;
  				while (counter < innerRows)
	  			{
  					htmlLine += "<tr><td class='calendarBody'>&nbsp;</td></tr>";
						counter = counter + 1;
					}
					htmlLine += "</tr></table>"
					htmlLine += "</td>";

					/* Increment the number of days already inserted */
    		  currentDay++;
    		}
    
    		htmlLine += "</td>";
    	}
    
    	htmlLine += "</tr>";
    } /* End of each week */
		
		return htmlLine;
}

function openNewWindow(urlString) 
{
  popupWin = window.open(urlString,
  'open_window',
  'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=640, height=480, left=0, top=0')
}
-->
