function IsValidDate(Year, Month, Day)
{
	Year	= parseInt(Year);
	Month	= parseInt(Month);
	Day		= parseInt(Day);

	if (Year < 1900 || Month < 1 || Month > 12 || Day < 1 || Day > 31) 
		return false;

	switch(Month)
	{
	case 4: case 6: case 9: case 11: 
		if (Day > 30) return false;
		else break;		

	case 2:
		if (Day > 29) return false;
		
		// if this is not a leap year
		if (	(Year % 4 != 0) ||
				((Year % 100 == 0)&&(Year % 400 != 0))
			)
		{
			if (Day > 28) return false;
		} // end of if

	} // end of switch

	return true;
}





function IsValidEMailAddress(emailAddress)
{
	// an emailaddress is valid if it is in the form xxx@xxx.xxx where xxx is an alphanumeric string
	var objRegExp = new RegExp("[\\w]+@[\\w]+\\.[\\w]+");
	
	if (emailAddress.search(objRegExp) == -1) return false;
	else return true;
	
}






function IsValidIdentifier(Identifier)
{
	// an identifier is valid if it has a minimum of 5 and a maximum of 15 characters
	// and contains only alphabets, digits, underscore (_), hyphen (-) or period (.)

	// check for length
	if ((Identifier.length > 15) || (Identifier.length < 5)) return false;

	// check for chars
	var objRegExp = new RegExp("[^a-zA-Z0-9_\\-.]+");
	
	var matchIndex = Identifier.search(objRegExp);
//	alert(matchIndex);
	if (matchIndex != -1) return false;
	else return true;
}



function IsValidString(str)
{
	// a string is valid if it has atleast one non-whitespace character
	var objRegExp = new RegExp("\\S+");
	
	if (str.search(objRegExp) == -1) return false;
	else return true;
	
}

