//-------FUNCTION: verifyDate()--------------------------------------------
//
//	Description:	Checks a string to represent a valid date in the format
//					"dd/mm/yyyy".
//	Arguments:		sDate, string in the format "dd/mm/yyyy"
//	Returns:		Boolean
//
//-------------------------------------------------------------------------
function verifyDate(sDate)
{
	var iDay = 0;
	var iMonth = 0;
	var iYear = 0;
	var iCount = 0;

	if(sDate.indexOf("/") == 0 || sDate.lastIndexOf("/") == 0 || sDate.indexOf("/") == sDate.lastIndexOf("/"))
	{
		return false;
		//Fail due to string date not containing with two / seperaters in the format "-/-/-"
	}

	iDay = sDate.substring(0, sDate.indexOf("/"));
	iYear = sDate.substring(sDate.lastIndexOf("/") +1);
	iMonth = sDate.substring(sDate.indexOf("/") +1, sDate.lastIndexOf("/"))

	if(isNaN(iDay) || isNaN(iMonth) || isNaN(iYear))
	{
		return false;
		//Fail due to non-numeric date part value
	}

	if(iDay < 1 || iMonth < 1 || iYear < 1)
	{
		return false;
		//Fail due to date part value below 1
	}

	if(iMonth > 12)
	{
		return false
		//Fail due to invalid month
	}

	if(iMonth == 1 || iMonth == 3 || iMonth == 5 || iMonth == 7 || iMonth == 8 || iMonth == 10 || iMonth == 12)
	{
		if(iDay > 31)
		{
			return false
			//Fail due to invalid day in a 31 day month
		}
	}
	else if(iMonth == 2)
	{
		if(iYear % 4 == 0)
		{
			if(iDay > 29)
			{
				return false
				//Fail due to invalid day in a leap year February
			}
		}
		else
		{
			if(iDay > 28)
			{
				return false
				//Fail due to invalid day in a normal February
			}
		}
	}
	else
	{
		if(iDay > 30)
		{
			return false
			//Fail due to invalid day in a 30 day month
		}
	}

	//NOTE: No year part checking is performed, year may be any number greater than 1

	return true;
}
