// observe the hole page when it is loaded.
$j(document).ready(function() {	
		
	$j("#cancel").click(function(){		
		var form = $j(this).parents('form:first');
		var fallback = $j("input#fallback");		
		if(fallback.val() == null) {
			return handleConfirmDialog(form, "ADMIN_ALERT_CONFIRM_CANCEL", "index.php?page="+form.attr("name"), null);
		}
		var fallback_path = $j("input#fallback_path");
		return handleConfirmDialog(form, "ADMIN_ALERT_CONFIRM_CANCEL", "index.php?"+ (((fallback_path.val() == null) || (fallback_path.val() == "")) ? "" : "path=" + fallback_path.val() + "&") + "page="+fallback.val(), null);
	});	 
		
	$j("input[name=delete]").each(function() {
		$j(this).click(function(){	
			var form = $j(this).parents('form:first');
			return handleConfirmDialog(form, "ADMIN_ALERT_CONFIRM_DELETE", null, null);
		});	 
	});
	
	$j("input:text:visible:first").focus();
	
});
