<%@ page language = "java" %>
<%@ page import = "gov.vha.edb.rules.web.builder.WebBuilder" %>
<%! String version = ilog.rules.tools.IlrVersion.getDescription(); %>
<% 
	WebBuilder builder = WebBuilder.getInstance(request);
	String confirmDelete = builder.getMessage("Messages.ConfirmDelete"); 
	String confirmExit = builder.getMessage("Messages.ConfirmExit"); 
%>
<script>

/**
 * About / About ILOG Web Rule Builder
 */
function about(action) {
  alert("JRules Web Rule Builder\n<%= ilog.webui.dhtml.IlxWUtil.escape(version)%>");
}

/*
 * Confirmation for the Edit / Delete action
 */ 
function confirmDelete(action) {
  var agree=confirm("<%= ilog.webui.dhtml.IlxWUtil.escape(confirmDelete)%>");
  if (agree) {
    action.perform();
  }
}

/**
 * Get one of the input values of the "clientProperties" form.
 * See ClientProperty.java
 */
function getClientProperty(name) {
  var form = document.forms["clientProperties"];
  if (form[name]) {
    return form[name].value;
  } else {
    return null;
  }
}

function confirmExit(action) {
  var agree = true;
  var ismodified = getClientProperty("modified");
  if (ismodified == "true") {
    agree = confirm("<%= ilog.webui.dhtml.IlxWUtil.escape(confirmExit)%>");  
  }
  if (agree) {
    action.perform();
  }
}

</script>