//-----------------------------------------------------------------------//
function daysInMonth(sMonth,sYear)                                       //
//-----------------------------------------------------------------------//
//          function name: daysInMonth()                                 //
//             created by: Dustin Brown                                  //
//             created on: 2/20/2001                                     //
//                purpose: given a month and a year, determine how many  //
//                         days are in that month.                       //
//             parameters: sMonth - a number from 1-12 which represents  //
//                                  the month to be evaluated.           //
//                         sYear  - the 4 digit year of the month to be  //
//                                  evaluated.                           //
//                returns: the number of days in the month for the given //
//                         month/year combo if they are both valid;      //
//                         otherwise 0 is returned.                      //
// include files required: validMonth.js, validYear.js, isLeapYear.js    //
//-----------------------------------------------------------------------//
{
	//check for valid month and year
	if(!validMonth(sMonth))return 0;
	if(!validYear(sYear))return 0;
	
	var days;
	
	//determine the month and corresponding days
	switch(sMonth){
		case "1":days=31;break;                             //january
		case "2":(isLeapYear(sYear))?days=29:days=28;break; //february
		case "3":days=31;break;                             //march
		case "4":days=30;break;                             //april
		case "5":days=31;break;                             //may
		case "6":days=30;break;                             //june
		case "7":days=31;break;                             //july
		case "8":days=31;break;                             //august
		case "9":days=30;break;                             //september
		case "10":days=31;break;                            //october
		case "11":days=30;break;                            //november
		case "12":days=31;break;                            //december
	}
	
	//return days in month
	return days;
}
//End function daysInMonth()---------------------------------------------//

function include(sFile){document.write("<script language='JavaScript' src='../IncludeFiles/"+sFile+"'></script>");}