function isValidEmail(str) 
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str))
	{
		return true;
	}
	return false;
}

function isValidPassword(pass1, pass2)
{
	if (pass1 == pass2)
	{
		return true;
	}
	return false;
}

function isValidPostcode(str)
{
	if(/^(\d{4})$/.test(str))
	{
		return true;
	}	
	return false;
}

function isValidPrice(str)
{
	if(/^(\d)*([\.-]?\d{0,2})$/.test(str))
	{
		return true;
	}	
	return false;
}

function isValidRego(str)
{
	if(/^(\w{1,8})$/.test(str))
	{
		return true;
	}	
	return false;
}

function isValidISBN(str)
{
	if(/^(\d{10})$/.test(str))
	{
		return true;
	}	
	return false;
}

function isValidDate(year,month,date)
{
	var aDate = new Date();
	var thisYear = year * 1;
	var thisMonth = 0;
	var thisDate = 0;
	switch (month)
	{
		case "01":
			thisMonth = 1;
			break;
		case "02":
			thisMonth = 2;
			break;
		case "03":
			thisMonth = 3;
			break;
		case "04":
			thisMonth = 4;
			break;
		case "05":
			thisMonth = 5;
			break;
		case "06":
			thisMonth = 6;
			break;
		case "07":
			thisMonth = 7;
			break;
		case "08":
			thisMonth = 8;
			break;
		case "09":
			thisMonth = 9;
			break;
		case "10":
			thisMonth = 10;
			break;
		case "11":
			thisMonth = 11;
			break;
		case "12":
			thisMonth = 12;
			break;
	}
	
	switch (date)
	{
		case "01":
			thisDate = 1;
			break;
		case "02":
			thisDate = 2;
			break;
		case "03":
			thisDate = 3;
			break;
		case "04":
			thisDate = 4;
			break;
		case "05":
			thisDate = 5;
			break;
		case "06":
			thisDate = 6;
			break;
		case "07":
			thisDate = 7;
			break;
		case "08":
			thisDate = 8;
			break;
		case "09":
			thisDate = 9;
			break;
		default:
			thisDate = date * 1;
	}
	var currentYear = aDate.getFullYear();
	var currentMonth = aDate.getMonth() + 1;
	var currentDate = aDate.getDate();
	
	if (thisYear < currentYear)
	{
		return false;
	}
	else
	{
		if(thisYear == currentYear)
		{
			if (thisMonth < currentMonth)
			{
				return false;
			}
			else
			{
				if (thisMonth == currentMonth)
				{
					if (thisDate < currentDate)
						return false;
				}
				
			}
		}
	}
	
	return true;
	
}

function isValidTime(starthour,startmin,endhour,endmin)
{
	if((endhour*1) < (starthour*1))
	{
		return false;
	}
	else
	{
		if((starthour*1) == (endhour*1))
		{
			if((endmin*1) < (startmin*1))
			{
				return false;
			}
		}
	}
	return true;
}