function subsearch(theform)
{
		if(theform.searchterm.value == "" || theform.searchterm.value == "Search")	return false;
		else	return true;
}
	
function cleanbox(textbox)
{
		textbox.value = "";
}
	
// updates the number of days of the week, based on the month selected
// note: leap year is ignored
function updateDay(dateType)
{
	 var daysInMonth = Array(31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 31, 31); // days in month w/ zero index being "Select Month" option
	 var month = document.getElementById('cbo' + dateType + 'Month'); // month select box
	 var day = document.getElementById('cbo' + dateType + 'Day'); // day select box

	 // hide or show day options - no matter what month it is, we will have at least 28 days, so start counting at 29 
	 for(var i=29; i <= 31 ; i++)
	 {
	   if(daysInMonth[month.selectedIndex] >= i) // show day
	   {
	     day.options[i].style.display = "block";
	   }
	   else // hide day
	   {
	     day.options[i].style.display = "none";
	   }
	 }
}

function subcoursesrch(theform){
	var i = 0;
	var ischecked = false;
	var boxval = "";
	var str_statelist = "";
	var str_tt = "";
	var retval = false;
	for(i=1;i<=53;i++){
		ischecked = eval("theform.chkState_" + i + ".checked;");
		if(ischecked){
			boxval = eval("theform.chkState_" + i + ".value;");
			if(str_statelist == ""){
				str_statelist = boxval;
			}
			else{
				str_statelist = str_statelist + "," + boxval;
			}
		}
	}
	theform.as_statelist.value = str_statelist;
	//alert(str_statelist);
	
	for(i=1;i<=5;i++){
		ischecked = eval("theform.chkTT_" + i + ".checked;");
		if(ischecked){
			boxval = eval("theform.chkTT_" + i + ".value;");
			if(str_tt == ""){
				str_tt = boxval;
			}
			else{
				str_tt = str_tt + "," + boxval;
			}
		}
	}
	theform.as_ttlist.value = str_tt;
	
	
	//alert(str_tt);
	
	//check and compile start date
	startdate = "";
	startmonth = theform.cboStartMonth[theform.cboStartMonth.selectedIndex].value;
	startday = theform.cboStartDay[theform.cboStartDay.selectedIndex].value;
	startyear = theform.cboStartYear[theform.cboStartYear.selectedIndex].value;
	if(startmonth != "0" && startday != "0" && startyear != "0"){
		if(startmonth != "0" || startday != "0" || startyear != "0"){
			startdate = startday + "-" + startmonth + "-" + startyear;
		}
	}
	
	theform.as_startdate.value = startdate;
	
	//check and compile end date
	
	enddate = "";
	endmonth = theform.cboEndMonth[theform.cboEndMonth.selectedIndex].value;
	endday = theform.cboEndDay[theform.cboEndDay.selectedIndex].value;
	endyear = theform.cboEndYear[theform.cboEndYear.selectedIndex].value;
	if(endmonth != "0" && endday != "0" && endyear != "0"){
		if(endmonth != "0" || endday != "0" || endyear != "0"){
			enddate = endday + "-" + endmonth + "-" + endyear;
		}
	}
	theform.as_enddate.value = enddate;
	

	return true;
}



