// JavaScript Document

/* ****************************************************************  */
/* Scripts © 2010 Paul E. Royes
Authored by paul e royes, proyes@georgebrown.ca 
January - May 2010 
Use Only With Permission. Thank you.
*/
/* ****************************************************************  */

/* CALENDAR SCRIPTS */
function myHref(){
	
	/* 	FUNCTION DESCRIPTION
		For the purpose of displaying the correct month when the calendar button is pressed
		Monthly file names are calendar/012010.html, 
				calendar is the folder where the monthly calendar files are located, 
				01 is the current month, 
				2010 is the current year,
				
				
		CALLING STATEMENT LOOKS LIKE THE FOLLOWING:
				<td>
			<a id="myCal" href="" target="_top" onclick="myHref(); 			MM_nbGroup('down','group1','UPCalendarHome','images/DOWN_CalendarHome.jpg',1)" onmouseover="MM_nbGroup('over','UPCalendarHome','images/OVER_CalendarHome.jpg','',1)" onmouseout="MM_nbGroup('out')"><img src="images/UP_CalendarHome.jpg"  alt="" name="UPCalendarHome" width="170" height="241" border="0"/></a></td>
		<td>
		
		
	*/
	
	var tDate = new Date(); 							/* date object 	*/
	var theCalYear = tDate.getFullYear();				/* full year 	*/
	
	
	var theCalMonth = tDate.getMonth() + 1; 			/* set to 1;  as 01 is January 012010*/
 	
	
 	if(theCalMonth.toString().length == 1){
		holder = "0";
		theCalMonth = holder +  theCalMonth.toString();	/* build up the month leading zero if single digit 	*/
		
	}
  	var MonthToLoad = "calendar" + "/" + theCalMonth.toString() + theCalYear.toString() + ".html";
  	
    document.getElementById('myCal').href=MonthToLoad; /* the button ID BASICS: <a id="myCal" href="" target="_top" onclick="myHref() </a>*/
}

/* ------------------------------------------------------------------- */
function GetDate(){
  var month=new Array();
  month[0]="JANUARY";month[1]="FEBRUARY";month[2]="MARCH";month[3]="APRIL";month[4]="MAY";month[5]="JUNE";month[6]="JULY";month[7]="AUGUST";month[8]="SEPTEMBER";month[9]="OCTOBER";month[10]="NOVEMBER";month[11]="DECEMBER";
 
  var tDate = new Date();
  var day = tDate.getDate();
  
  var divMonth = document.getElementById('divMonth');
  if (divMonth){
   divMonth.innerHTML = month[tDate.getMonth()];
  }
 
 var divDay = document.getElementById('divDay');
  if (divDay){
   divDay.innerHTML = day;
  }
}
 /* ------------------------------------------------------------------- */
