//-----------------------------------------------------------------------//
function getDay(sDate)                                                   //
//-----------------------------------------------------------------------//
//          function name: getDay()                                      //
//             created by: Dustin Brown                                  //
//             created on: 2/20/2001                                     //
//                purpose: given a date ('sDate'), return the day        //
//                         portion of the date.                          //
//             parameters: sDate - the date from which the day will be   //
//                         extracted.                                    //
//                returns: the day portion of 'sDate'                    //
// include files required: none                                          //
//-----------------------------------------------------------------------//
{
	//find the positions of the delimiters(if they are there)
	var pos1=-1;
	var pos2=-1;
	for(var x=0;x<sDate.length;x++){
		if(isNaN(sDate.charAt(x))){
			if(pos1==-1)pos1=x+1;
			else{
				pos2=x;
				break;
			}
		}
	}
	
	//make sure the first delimiter isn't the first character
	if(pos1==0)return "";
	
	//if there are no delimeters, set the position variables
	if(pos1==-1){
		pos1=2;
		pos2=4;
	}
	
	//break apart 'sDate' to get the day
	sDate=sDate.substring(pos1,pos2);
	if(sDate.length>1){
		if(sDate.charAt(0)=="0")sDate=sDate.substring(1,2);
	}
	
	//return the day
	return sDate;
}
//End function getDay----------------------------------------------------//