// =====================================================
//
function f_tidings()
{
var maxcols = 3 ;	// max columns in internal display table
// Tidings available online
i1 = -1 ;
aTidings = new Array() ;
// add new issue here - (reverse date order)
i1+=1;aTidings[i1] = new f_tidings_add("Jun-10","tidings/2010-06-00-Tidings.pdf") ;		// Summer 2010 issue
i1+=1;aTidings[i1] = new f_tidings_add("Apr-10","tidings/2010-04-00-Tidings.pdf") ;
i1+=1;aTidings[i1] = new f_tidings_add("Feb-10","tidings/2010-02-00-Tidings.pdf") ;
i1+=1;aTidings[i1] = new f_tidings_add("Sep-09","tidings/2009-09-00-Tidings.pdf") ;
i1+=1;aTidings[i1] = new f_tidings_add("Jul-09","tidings/2009-07-00-Tidings.pdf") ;
i1+=1;aTidings[i1] = new f_tidings_add("May-09","tidings/2009-05-00-Tidings.pdf") ;
i1+=1;aTidings[i1] = new f_tidings_add("Mar-09","tidings/2009-03-00-Tidings.pdf") ;
i1+=1;aTidings[i1] = new f_tidings_add("Nov-08","tidings/2008-11-00-Tidings.pdf") ;
i1+=1;aTidings[i1] = new f_tidings_add("Sep-08","tidings/2008-09-00-Tidings.pdf") ;
i1+=1;aTidings[i1] = new f_tidings_add("Jul-08","tidings-200807.htm") ;
i1+=1;aTidings[i1] = new f_tidings_add("May-08","tidings-200805.htm") ;
i1+=1;aTidings[i1] = new f_tidings_add("Mar-08","tidings-200803.htm") ;
i1+=1;aTidings[i1] = new f_tidings_add("Nov-07","tidings-200711.htm") ;

nTidings = ++i1 ;	// set # of tidings (relative to 1)
// ----
t = "" ;
t += "<center><p class=tidingshdr>Tidings Available Online<p>" ;
t += "<table>" ;

// --------------------------------
// Calculate and display whole rows
tmp = Math.floor((nTidings+0) / (maxcols-0)) ;	
nwr = ((tmp*maxcols)===nTidings) ? tmp : tmp -1 ;
nwr = --tmp ;
idx = 0 ;

// document.write("nTidings=" + nTidings + "..nwr=" + nwr + "..tmp=" + tmp + "<br />") ;

// loop to display the whole rows
for ( j = 0; j <= nwr ; j++ )
	{
	for ( k = 0 ; k < maxcols ; k++ )
		{
// document.write("<br />l1idx=" + idx + "..") ;
		if ( k == 0 ) { t += "<tr>" ; }
		t += "<td align=center>&nbsp;<a class=tidingstxt href=" ;
		t += aTidings[idx].href ;
		t += "  target=_blank>" ;
		t += aTidings[idx].issue ;
		t += "</a>&nbsp;</td>" ;
		if ( k == (maxcols-1) ) { t += "</tr>" ; }
		idx++ ;
		}
	}

// ------------------------------------------------------
// Now calculate any remaining issues to display (if any)
npr = (nTidings) % maxcols ;	// See if any remaining

// document.write("<br />nTidings=" + nTidings + "..npr=" + npr + "<br />") ;

if ( npr > 0 )
	{
	t += "<tr>" ;
	for ( j = 0 ; j < npr ; j++ )
		{
// document.write("<br />l2idx=" + idx + "..") ;
		t += "<td align=center>&nbsp;<a class=tidingstxt href=" ;
		t += aTidings[idx].href ;
		t += "  target=_blank>" ;
		t += aTidings[idx].issue ;
		t += "</a>&nbsp;</td>" ;
		idx++ ;
		}
	t += "</tr>" ;
	}

t += "</table></center>" ;

// alert ("t=" + t ) ;

return t ;
}

// =====================================================
//
//
function f_tidings_add(pIssue, pHref) 
{
this.issue = pIssue ;
this.href = pHref ;

return ;
}

