/* printRow options

   0::none 1::html 2::pdf 3::annotated agenda

    0  1    '-'               minutes.html
    0  2    '-'               minutes.pdf

    1  0    agenda.html       '-'
    1  1    agenda.html       minutes.html
    1  2    agenda.html       minutes.pdf

    2  0    agenda.pdf        '-'
    2  1    agenda.pdf        minutes.html
    2  2    agenda.pdf        minutes.pdf

    3  0    agenda.pdf        '-'               (annotated)                  
    3  1    agenda.pdf        minutes.html
    3  2    agenda.pdf        minutes.pdf
*/

function printRow(meetingDate,agendaCode,minutesCode,description) {

   document.write("<tr><td align=center>" + meetingDate.substring(0,10) + "</td>");

   switch(agendaCode) {
      case 0:  document.write("<TD align=center>-</TD>"); break;
      case 1:  document.write("<TD align=center><a href='agenda_" + meetingDate + ".html'>Agenda</A></TD>"); break;
      case 2:
      case 3:  document.write("<TD align=center><a href='agenda_" + meetingDate + ".pdf'>Agenda</A></TD>"); break;
   }

   switch(minutesCode) {
      case 0:  document.write("<TD align=center>-</TD>"); break;
      case 1:  document.write("<TD align=center><a href='minutes_" + meetingDate + ".html'>Minutes</A></TD>"); break;
      case 2:  document.write("<TD align=center><a href='minutes_" + meetingDate + ".pdf'>Minutes</A></TD>"); break;
   }

   if ( description ) document.write("<TD align=left>(" + description + ")</TD>"); else document.write("<TD>&nbsp;</TD>");

   document.writeln("</TR>");
   ++rowCount;
   return true;
}

// print years from current back to 1998.
// current year is specified as argument -  bolded.  
// all other years reference links to indexYYYY.html

function printYears(y) {
	document.write("<table border='0'><tr><td width='80pt'><b>Archives</b></td>\n");
	for ( var i=2010; i>=1998; i-- ) {
		if ( i == y ) {
			document.write("<td width='40pt' style='text-align:center;font-weight:bold;' >");
			document.write( i + "</td>\n");
		} else {
			document.write("<td width='40pt' style='text-align:center;font-weight:normal'>");
			document.write("<a href=\"index" + i + ".html\">" + i + "</a></td>\n");
		}
	}
	document.write("<td width='40pt' style='text-align:center;font-weight:normal'>");
			document.write("<a href='ccindex.html'>&nbsp;ALL&nbsp;</a></td>\n");

	document.writeln("</tr></table><br>");
	return true;
}

function printHeader(){
	document.writeln("<h1>Lomita City Council Agendas and Minutes<br>" + thisYear + "</h1>");
	document.writeln("<TABLE border=0 cellspacing=0 cellpadding=0 align=left style='margin-left:15px;'>");
	document.writeln("<TR><TD width=15%></TD><TD width=15%></TD><TD width=15%></TD><TD></TD></TR>");
	document.writeln("<TR><TD colspan=4>");
	document.writeln("<div id='tabs' style='margin: 0 0 0 10px ; width:100%;'><ul>");
	
	for ( var Y=2010;Y>1997;Y--) {
		if (thisYear == Y) {document.writeln("<li id=\"currentYear\"><A href='#'>" + Y + "</A></li>");} 
		else {document.writeln("<li><A href='index"+Y+".html'>" + Y + "</A></li>");}
	}
	document.writeln("<li><A href='ccindex.html' style='font-variant:small-caps;'>All</A></li>");
	document.writeln("</ul></div></TD></TR>");
	document.writeln("<TR id=cardheader>");
	document.writeln("<TD style='padding: 2px 0 2px' align=center>MEETING<br>DATE</TD>");
	document.writeln("	<TD style='padding: 2px 0 2px;' align=center colspan=2>DOCUMENTS</TD>");
	document.writeln("	<TD>&nbsp;</TD>");
	document.writeln("</TR>");
	return true;
}

function printTail(){
	document.writeln("</TD></TR>");
	for (var i=rowCount; i<25;i++) 	document.writeln("<TR><TD colspan=4>&nbsp;</TD></TR>");
	document.writeln("<TR><TD colspan=4><hr width=100%></TD></TR>");
	document.writeln("</TABLE>");
}
