<!--

function confirmDelete(entity, entityValue) 
{
	return confirm("Are you sure you want to delete this " + entity + " (" + entityValue + ")?");
}

function validateForgottenPassword()
{
	fv = new formValidator();

	if (fv.isEmpty("username"))
		fv.raiseError("Please enter a username.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}

function validateChangePassword()
{
	fv = new formValidator();

	if (fv.isEmpty("current_password"))
		fv.raiseError("Please enter your current password.");
		
	if (fv.isEmpty("new_password"))
		fv.raiseError("Please enter your new password.");
		
	if (fv.isEmpty("confirm_new_password"))
		fv.raiseError("Please confirm your new password.");
		
	if (fv.findObj("confirm_new_password").value != fv.findObj("new_password").value)
		fv.raiseError("The new password and the confirmed new password does not match.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}

function resetAvailabilityForm()
{
	fv = new formValidator();
	
	var d = new Date();
	var curr_date = new String(d.getDate());
	var curr_month = new String(d.getMonth()+1);
	var curr_year = new String(d.getFullYear());
	
	var toDate=new Date();
	toDate.setDate(toDate.getDate()+4)	
	var next_date = new String(toDate.getDate());
	var next_month = new String(toDate.getMonth()+1);
	var next_year = new String(toDate.getFullYear());
	
	if (curr_date.length == 1)
		curr_date = "0"+curr_date;
		
	if (curr_month.length == 1)
		curr_month = "0"+curr_month;
		
	if (next_date.length == 1)
		next_date = "0"+next_date;
		
	if (next_month.length == 1)
		next_month = "0"+next_month;		
	
	fv.findObj("from_date").value = curr_date + "-" + curr_month + "-" + curr_year;
	fv.findObj("to_date").value = next_date + "-" + next_month + "-" + next_year;
}

-->