<!--
	// Globals for dynamic show content scripts
	var dom=document.getElementById&&!document.all?1:0;
	function toggle_element(elem)
	{
		var div;
	
		try
		{
			div=dom?document.getElementById(elem).style:document.all[elem].style;
			///alert(div.display);
			if( div.display != null && div.display == "none")
				div.display="";
			else
				div.display="none";
		}
		catch(e)
		{
			alert(e.description + ' Caught error in toggle_element');
		}
	}

	function setImage(imgName, imgSrc) 
	{
		var imgElement;
	
		try
		{
			imgElement=dom?document.getElementById(imgName):document.all[imgName];
			imgElement.src=imgSrc;
		}
		catch(e)
		{
			alert(e.description + ' Caught error in in_menu');
		}
	}

	function in_menu(elem1, elem2)
	{
		var className1;
		var className2;
	
		try
		{
			className1=dom?document.getElementById(elem1):document.all[elem1];
			className2=dom?document.getElementById(elem2):document.all[elem2];

			className1.className="jds_menuitem2";
			className2.className="jds_menuitem2";
		}
		catch(e)
		{
			alert(e.description + ' Caught error in in_menu');
		}
	}

	function out_menu(elem1, elem2)
	{
		var className1;
		var className2;
	
		try
		{
			className1=dom?document.getElementById(elem1):document.all[elem1];
			className2=dom?document.getElementById(elem2):document.all[elem2];

			className1.className="jds_menuitem";
			className2.className="jds_menuitem";
		}
		catch(e)
		{
			alert(e.description + ' Caught error in out_menu');
		}
	}
	function numDaysIn(mth,yr)
	{
		if(mth==3 || mth==5 || mth==8 || mth==10) return 30;
		else if ((mth==1) && leapYear(yr)) return 29;
		else if (mth==1) return 28;
		else return 31;
	}
	
	function leapYear(yr)
	{
		if(((yr % 4 == 0) && yr % 100 != 0) || yr % 400 == 0)
			return true;
		else
			return false;
	}
	
	function checkdate(eMonth, eDay, eYear, eWeekDay )
	{
		var nMonth = 0;
		var nYear = 0;
		var nDay = 0;
		
		if( eMonth == null || eDay == null || eYear==null )
		{
			alert('Missing a required paramenter to the check date function.');
			return false;
		}
		
		var ctlMonth=dom?document.getElementById(eMonth):document.all[eMonth];
		var ctlYear=dom?document.getElementById(eYear):document.all[eYear];
		var ctlDay=dom?document.getElementById(eDay):document.all[eDay];
		
		if( ctlMonth == null || ctlYear == null || ctlDay==null )
		{
			alert('Could not find one of the date controls passed into the check date function.');
			return false;
		}

		nMonth = ctlMonth.value;
		nYear = ctlYear.value;
		nDay = ctlDay.value;

		var numDays = numDaysIn(nMonth,nYear);
		
		if( nDay > numDays )
		{
			alert('The day portion of the date you selected will be reset \nto the last day of the selected month because the month/year \nthat was just selected does not have ' + nDay + ' days.');
			ctlDay.value = numDays;
		}
			
		ctlDay.options.length=numDays;
		for(i=27;i<numDays;i++)
		{
			ctlDay.options[i].value=i+1;
			ctlDay.options[i].text=i+1;
		}
		
		if( eWeekDay != null )
		{
			var weekdays = new arr("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
			var ctlWeekDay=dom?document.getElementById(eWeekDay):document.all[eWeekDay];
			ctlWeekDay.innerHTML = weekdays[getWeekDay(nMonth,ctlDay.value,nYear)];
		}
		
		return true;
	}	

//-->
