// =============================
// this javascript will setup the calendar navigation buttons
//
//	12 months will be displayed
//		last month, this month and the next 10 months
//
// to use this, the _fcalendar.js module must be included BEFORE this module
//
//	then, in the page place the following code where you want the buttons to appear
//	<div id=calnav></div>
//	<script type="text/javascript">document.write(fCalButtons())</script>
// =============================
function fCalButtons()
{
br = "" ;	// start each year on a new line - except 1st year

// get today's date

tD = new Date() ;	// get today's date
tD.y = tD.getFullYear() ;	// get the year
tD.m = tD.getMonth() ;	// get the month

wD = new Date() ;	// get another date field
wD.setFullYear(tD.y, tD.m, 0) ;	// go back 1 month
wD.setDate(1) ;	// set day to the 1st
wD.py = 0 ;	// used to see if changed year

// now - build the navigation area
// remember - date sets month relative to 0
a = "<center><hr />" ;	// center the navigation
a += "<button onClick=\"fCalDspMonth(" + (tD.m+1) + ", " + tD.y + ")\" >" ;
a += "<span class=calButton>Current Month</span></button><br />" ;

for ( idx = 0 ; idx <=20 ; idx++)
	{
	if ( wD.py != wD.getFullYear() )
		{
		wD.py = wD.getFullYear() ;
		a += br + "&nbsp;<b>" + wD.py + "</b>&nbsp;" ;
		br = "<br />" ;
		}
	a += "<button onClick=\"fCalDspMonth(" + (wD.getMonth()+1) + ", " + wD.getFullYear() + ");\" >" ;
	a += "<span class=calButton>" + mNamesShort[wD.getMonth()] + "</span></button>" ;
	wM = wD.getMonth() ;
	wD.setMonth(wM+1,1) ;	// bump month by 1 and force day to 1
	}
a+= "<hr /></center>" ;	// end display block
var x = document.getElementById("calNav") ;
x.innerHTML = a ;
return "";
}
