<%@ page language="java" contentType="text/html; charset=UTF-8"		%>
<%@ taglib uri="/WEB-INF/struts-bean.tld"		prefix="bean"		%>
<%@ taglib uri="/WEB-INF/struts-html.tld"		prefix="html"		%>
<%@ taglib uri="/WEB-INF/displaytag-12.tld"		prefix="display"	%>
<%@ taglib uri="/WEB-INF/struts-logic.tld"		prefix="logic" 		%>
<jsp:include page="/ampiere/jsp/common/includeYAHOOUI.jsp" flush="true" /> 
<html>
<head>
	<title><bean:write name="ChargeAccountForm" property="pageTitle"/></title>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/ampiere/css/import.css" />
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/ampiere/css/window.css"/>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/ampiere/css/displaytag.css" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/ampiere/js/window.js"></script>
	<script type="text/javascript">
		top.document.title='<bean:write name="ChargeAccountForm" property="mainWindowTitle"/>';

		function check() {
			if( document.ChargeAccountForm.keyValue.value == "" ) {
				return false;
			}

			if( document.ChargeAccountForm.keyName.value == "" ) {
				return false;
			}

			document.ChargeAccountForm.changedColumn.value='new';
		    document.ChargeAccountForm.submit();
		}
	</script>
</head>

<body id="popup" onload="" onunload="closeMyChildren();">

<html:form	style	= "margin:0;"
			target	= "_self"
			action	= "/ampiere/ChargeAccountAction.do"
			enctype	= "application/x-www-form-urlencoded"
			method	= "POST"
			onsubmit="document.getElementById('progressMsg').style.display='block'">

<html:hidden name="ChargeAccountForm" property="changedColumn"/>
<input type="hidden" name="PCommand" value="MenuOnOff">

<table cellspacing="5" width="100%" class="windowTable" border="0" cellpadding="0">
<tr>
<td>
	<table cellspacing="0" width="100%" border="0" cellpadding="0">
	<tr>
		<td class="windowHeader">
<div id="header">
			<h1><bean:write name="ChargeAccountForm" property="pageTitle"/></h1>
</div>
		</td>
	    <td valign="top" width="18">
	    	<div id="progressMsg" style="padding-top:1px;display:none;">
				<html:img alt="Wait a moment..." align="right" page = "/ampiere/images/Loading-0.gif"/>
	    	</div>
	    </td>
    </tr>
    <tr>
		<td><img	src="/compiere/ampiere/images/MenuOnOff24.gif"
					onmouseout="btnMouseOut('MenuOnOff');"
					class="imgButton"
					id="MenuOnOff"
					name="MenuOnOff"
					onclick="document.ChargeAccountForm.PCommand.value='MenuOnOff';menuSwitch();"
					alt="MenuOnOff"
					onmouseover="btnMouseOver('MenuOnOff');"/>
		</td>
    </tr>
	</table>
</td>
</tr>

<tr>
<td align="center">
    <table border="1" cellspacing="0" cellpadding="3" width="100%">
    <tr>
	    <th align="left" valign="middle">
	    	<bean:write name='ChargeAccountForm' property='chargeNewLabel'/>
	    </th>
    </tr>
    <tr>
    	<td align="center">
		    <table class="windowTable" align="center">
		    <tr>
			    <td align="right" valign="middle">
			    	<bean:write name='ChargeAccountForm' property='keyLabel'/>
			    </td>
			    <td align="left" valign="middle">
			    	<html:text	name="ChargeAccountForm"
			    				property="keyValue"
			    				size="10"
			    				/>
			    </td>
			    <td align="right" valign="middle" nowrap>
			    	<html:checkbox  name='ChargeAccountForm' property='expense'>
			    		<bean:write name='ChargeAccountForm' property='expenseLabel'/>
			    	</html:checkbox>
			    </td>
		    </tr>
		    <tr>
			    <td align="right" valign="middle">
			    	<bean:write name='ChargeAccountForm' property='nameLabel'/>
			    </td>
			    <td align="left" valign="middle">
			    	<html:text	name="ChargeAccountForm"
			    				property="keyName"
			    				size="40"
			    				/>
			    </td>
			    <td align="left" valign="middle">
			    	<html:button	property='generate'
			    					onclick="check();">
				    	<bean:write name='ChargeAccountForm' property='generateLabel'/>
					</html:button>
			    </td>
		    </tr>
		    </table>
		</td>
    </tr>
    <tr>
	    <th align="left" valign="middle">
	    	<bean:write name='ChargeAccountForm' property='chargeFromLabel'/>
	    </th>
    </tr>
    <tr>
    	<td align="center">
		    <table align="center" cellspacing="0" class="displaytag">
			<logic:iterate	name="ChargeAccountForm"
							id="data"
							property="accountList"
							scope="request"
							type="java.util.HashMap">
				<logic:equal name="data" property="RowType" value="title">
				<tr>
					<th><bean:write name="data" property="Select"/></th>
					<th><bean:write name="data" property="Value"/></th>
					<th><bean:write name="data" property="Name"/></th>
					<th><bean:write name="data" property="Expense"/></th>
				</tr>
				</logic:equal>
				<logic:equal name="data" property="RowType" value="data">
				<tr>
					<td align="center">
						<html:multibox	name="ChargeAccountForm" property="keyList">
							<bean:write name="data" property="Select"/>|<bean:write name="data" property="Name"/>
						</html:multibox>
					</td>
					<td><bean:write name="data" property="Value"/></td>
					<td><bean:write name="data" property="Name"/></td>
					<td align="center">
						<html:checkbox	name="data" property="Expense" disabled="true">
						</html:checkbox>
					</td>
				</tr>
				</logic:equal>
			</logic:iterate>
				<tr>
			    <td align="right" valign="middle" colspan="4">
			    	<html:button	property='generate'
			    					onclick="document.ChargeAccountForm.changedColumn.value='from';
										     document.ChargeAccountForm.submit();
											"
									>
				    	<bean:write name='ChargeAccountForm' property='generateLabel'/>
					</html:button>
			    </td>
				</tr>
			</table>
    	</td>
    </tr>
    </table>
</td>
</tr>
</table>
</html:form>
<script type="text/javascript">
	if ( '<bean:write name="ChargeAccountForm" property="resultInfo"/>' != '' ) {
		alert('<bean:write name="ChargeAccountForm" property="resultInfo"/>');
	}
</script>
</body>
</html>
