function chkEmptyTxt (theObj, msg)
{
	if ( theObj.value == "" )
	{
		alert("Please enter " + msg + "!");
		theObj.focus();
		theObj.select();
		return true;
	}
}

function chkEmptySel( theObj, msg )
{
	if( theObj[theObj.selectedIndex].value == "" )
	{
		alert("Please select " + msg + "!");
		theObj.focus();
		return true;
	}
}

function chkEmptySelM( theObj, msg )
{
	var errFlag = false;
	
	if( theObj.selectedIndex == -1 )
		errFlag = true;
	else
		if( theObj[theObj.selectedIndex].value == "" )
			errFlag = true;
		else
		{
			errFlag = true;
			for( i=0; i<theObj.length; i++ )
			{
				if( theObj[i].selected )
				{
					errFlag = false;
					break;
				}
			}
		}

	if( errFlag )
	{
		alert("Please select " + msg + "!");
		theObj.focus();
		return true;
	}
}


function chkEmptyOpt( theObj, msg )
{
	for( i=0; i<theObj.length; i++ )
		if( theObj[i].checked )
			return false;
	
	alert("Please select " + msg + "!");
	theObj[0].focus();
	return true;
}


function chkDate(year, month, day)
{
	if ( year == "" && month == "" && day == "" )
		return false;

	combineDate = new Date(year + "/" + month + "/" + day)
	if ( eval(combineDate.getMonth()) != eval(month - 1) )
		return false;

	if (eval(year) < 1000)
		return false;

	return true;
}
