<?component name="addProductCategory" 
	macroURI="/view/store/macros/add_product_category.zul" 
	class="ez.store.common.macro.AddProductCategoryMacro"?>
<?component name="addProductUnit" 
	macroURI="/view/store/macros/add_product_unit.zul" 
	class="ez.store.common.macro.AddProductUnitMacro"?>
<?component name="addManufacture" 
	macroURI="/view/store/macros/add_manufacture.zul" 
	class="ez.store.common.macro.AddManufactureMacro"?>
<window title="${c:l('msg_cdProducts_lbl_add_title')}" border="normal"
	closable="true" width="850px" onOK='self.onSubmit(event)' id="windowCommonAddProduct"
	use="ez.store.common.handle.window.AddProductWindow">
	
	<!--  
   <script type="text/javascript"><![CDATA[
			zk.afterMount(function () {
				$(function() {
					jq("$dbxSellPrice").keyup(function(e){
						jq("$dbxSellPrice").blur();	
						jq("$dbxSellPrice").focus();	
					});	
					jq("$dbxWholesalePrice").keyup(function(e){
						jq("$dbxWholesalePrice").blur();	
						jq("$dbxWholesalePrice").focus();	
					});	
				});
			});		
	]]></script>
	-->
	
	<div sclass="message-error" id="divNoticeMessage"/>
	<separator height = "10px" />
	<hbox style="margin-left: 10px">
		<vbox width="350px">
			<hbox style="margin-top:10px;" id="hboxProductCode">
				<div width="120px">
					<label
						value="${c:l ('msg_lbl_product_code') }"
						sclass="label-title" />
				</div>
				<textbox focus="true" id="tbxProductCode" sclass="form-control"
					 width="200px" maxlength="25"/>
			</hbox>
			<hbox style="margin-top:10px;">
				<div width="120px">
					<label
						value="${c:l ('msg_lbl_product_name') }"
						sclass="label-title" />
				</div>
				<textbox focus="true" id="tbxProductName" sclass="form-control"
					 width="200px"/>
				<label value="*" style="color:#FF0000" />
			</hbox>
			<hbox style="margin-top:10px;">
				<div width="120px">
					<label
						value="${c:l ('msg_lbl_product_category') }"
						sclass="label-title" />
				</div>
				<vbox>
					<hbox>
						<combobox readonly="true" id="cbxProductCategory" width="200px" tabindex="3" style="margin-top:5px" 
							use="ez.store.common.handle.combobox.ComboboxProductCategory">
							<comboitem label = "${c:l ('msg_lbl_product_category') }"/>
						</combobox>
						<button id="btnAddProductCate" label="${c:l('msg_btn_add_product_category')}" width="200px" sclass="btn" forward="onClick=onClickAddCategory"/>
					</hbox>
					<addProductCategory id="addProductCategoryMacro" tabindex="4"/>
				</vbox>
			</hbox>
			
			<hbox style="margin-top:10px;">
				<div width="120px">
					<label
						value="${c:l ('msg_lbl_product_unit') }"
						sclass="label-title" />
				</div>
				<vbox>
					<hbox>
						<combobox readonly="true" id="combobxProductUnit" width="200px" style="margin-top:5px"
							 use="ez.store.common.handle.combobox.ComboboxProductUnit" >
						</combobox>	
						<button id="btnAddProductUnit" label="${c:l('msg_btn_add_unit')}" width="200px" sclass="btn" forward="onClick=onClickAddUnit"/>
					</hbox>
					<addProductUnit id="addProductUnitMacro"/>
				</vbox>
			</hbox>
			
			<hbox style="margin-top:10px;">
				<div width="120px">
					<label
						value="${c:l ('msg_lbl_manufacture') }"
						sclass="label-title" />
				</div>
				<vbox>					
					<hbox>
					 	<combobox readonly="true" id="combobxManufacture" width="200px" height="25px" style="margin-top:5px" 
					 		use="ez.store.common.handle.combobox.ComboboxManufacture" forward="onOK=onSearch">
						</combobox>								
						<button id="btnAddManufacture" label="${c:l('msg_btn_add_manufacture')}" width="200px" sclass="btn" forward="onClick=onClickAddManufacture"/>
					</hbox>
					<addManufacture id="addManufactureMacro"/>	
				</vbox>
			</hbox>
			
			<hbox style="margin-top:10px;" id="hboxWholasalePrice">
				<div width="120px">
					<label
						value="${c:l ('msg_lbl_product_wholesale_price') }"
						sclass="label-title" />
				</div>
				<doublebox id="dbxWholesalePrice" width="200px"  format="#,###"/>
			</hbox>
			<hbox style="margin-top:10px;">
				<div width="120px">
					<label
						value="${c:l ('msg_lbl_product_sell_price') }"
						sclass="label-title" />
				</div>
				<doublebox id="dbxSellPrice" width="200px"  format="#,###"/>
			</hbox>
			
			<hbox style="margin-top:10px;" id="hbxStatus" visible="false">
				<div width="120px">
					<label
						value="${c:l ('msg_lbl_status') }"
						sclass="label-title" />
				</div>
				<radiogroup id="radioStatus">		            
		            <hlayout>
		                <radio label="${c:l ('msg_lbl_status_active') }" value="1" checked="true"/>
		                <radio label="${c:l ('msg_lbl_status_inactive') }" value="7" />
		            </hlayout>
		        </radiogroup>
			</hbox>
			
				<hbox style="margin-top:10px;">
				<div width="120px">
					<label
						value="${c:l ('msg_lbl_description') }"
						sclass="label-title" />
				</div>
				<textbox id="tbxDescription" width="200px" rows="3" sclass="form-control"/>
			</hbox>
			
			<hbox style="margin-top:10px; margin-bottom:10px;">
				<div width="450px" align="center">
					<button label="${c:l('msg_btn_save')}" width="100px" sclass="btn btn-primary" forward="onClick=onSubmit"/>
					<button label="${c:l('msg_btn_reset')}" width="100px" sclass="btn" forward="onClick=onReset"/>
				</div>
			</hbox>
		</vbox>
		<vbox width="300px" align="center">
				<hbox width="202px" height="202px" align="center"
					style="border:1px solid #C1C1C1;">
					<div width="200px" align="center">
						<button id="btnUpload" width="128px"
							height="128px" image="/media/images/256x256/add-user_128x128.png"
							forward="onUpload=onUploadImage" upload="true,maxsize=5000" sclass="btnTrans" />
						<image id="image" width="200px" height="200px" style="margin-left:0px;" visible="false" />
					</div>
				</hbox>
				<button id="btnRemoveAvatar" image="/media/images/IconTest/delete_btn_28x28.png" visible="false"
					sclass="btnTrans" forward="onClick=onRemoveImage" />
			</vbox>
	</hbox>
</window>
