<HTML><MIVA STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">

<MvIF EXPR = "{ s.version LT 3.91 }">
	<HEAD><TITLE>Miva Engine Version Mismatch</TITLE></HEAD>
	<BODY BGCOLOR = "#ffffff">
	<FONT FACE = "Arial, Helvetica" SIZE = "-1">
	Miva Merchant requires the Miva Engine, version <B>3.91</B> or higher.<BR>
	You are running version <B><MvEVAL EXPR = "{ s.version }"></B><BR>
	<BR>
	Please contact <A HREF = "http://www.miva.com">Miva Corporation</A> for upgrade information.
	</FONT>
	</BODY>

	<MvEXIT>
</MvIF>

<MvCOMMENT>
|
| Miva Merchant v4.x
|
| This file and the source codes contained herein are the property
| of Miva Corporation.  Use of this file is restricted to the specific
| terms and conditions in the License Agreement associated with this
| file.  Distribution of this file or portions of this file for uses
| not covered by the License Agreement is not allowed without a written
| agreement signed by an officer of Miva Corporation.
|
| Copyright 1998-2001 Miva Corporation.  All rights reserved.
| http://www.miva.com/
|
| Miva Merchant Administration
| $Source: /home/cvs/merchant/Merchant/admin.mv,v $
|
| Prefix         : MER-ADM-
| Next Error Code: 6    
| Next Text ID   : 1615 
|
</MvCOMMENT>

<MvIF EXPR = "{ g.Error }">
	<MvASSIGN NAME = "l.ok" VALUE = 0>
<MvELSE>
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvIF EXPR = "{ NOT g.Data_Opened }">
	
		<MvDO FILE = "lib/config.mv">

		<MvASSIGN NAME = "g.Version_Mismatch" VALUE = 0>
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ OpenDataFiles( g.Merchant_Version ) }">
		<MvIF EXPR = "{ NOT l.ok }">
			<MvIF EXPR = "{ NOT g.Version_Mismatch }">
				<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00001">
					<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ encodeentities( g.Module_Root $ Modules.d.module ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Miva Merchant has not been initialized.  Please use the Miva Merchant Setup script to initialize the required data files.</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-ADM-00001', l.error_message ) }">
			</MvIF>
		<MvELSE>
			<MvASSIGN NAME = "g.Data_Opened" VALUE = 1>
		</MvIF>
	</MvIF>
</MvIF>

<MvIF EXPR = "{ l.ok }">
	<MvDO FILE = "{ g.Library_Utilities }" NAME = "g.Admin_User_ID" VALUE = "{ DetermineAdminUser() }">
	<MvIF EXPR = "{ NOT g.Admin_User_ID }">
		<MvEVAL EXPR = "{ Screen_Login() }">
	<MvELSE>
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ User_Find_ID( g.Admin_User_ID ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "g.Admin_User_Administrator" VALUE = "{ Users.d.admin }">
			
			<MvIF EXPR = "{ NOT( g.Admin_User_PageLen ) }">
				<MvASSIGN NAME = "g.Admin_User_PageLen" VALUE = "{ Users.d.page_len }">
			</MvIF>

			<MvASSIGN NAME = "g.Admin_User_Create" VALUE = "{ Users.d.create }">
			
			<MvIF EXPR = "{ g.Provision EQ 'Yes' }">
				<MvDO FILE = "{ g.Feature_PRV_AD }" NAME = "l.null" VALUE = "{ PRV_ProvisionAsNeeded() }">
				<MvDO FILE = "{ g.Filename_Upgrade }" NAME = "l.ok" VALUE = "{ Upgrade_Intercept() }"> 

				<MvIF EXPR = "{ g.Admin_User_Administrator }">
					<MvDO FILE = "{ g.Feature_NOT_AD }" NAME = "l.ok" VALUE = "{ NOT_FindCurrent_Notes( 0 ) }">				
				</MvIF>
			</MvIF>
			

			<MvDO FILE = "{ g.Feature_STP_AD }" NAME = "g.IsSimpleMode" VALUE = "{ IsSimpleMode() }">
			

			<MvIF EXPR = "{ NOT g.Screen }">
				<HEAD><TITLE>
					<MvLOCALIZED ID = "MER-ADM-00002">
						<MvLOCALIZED-TOKEN NAME = "user-name" VALUE = "{ encodeentities( Users.d.name ) }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Miva Merchant Administration: %user-name%</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</TITLE></HEAD>
		
				<MvIF EXPR = "{ g.IsSimpleMode }">
					<MvDO FILE = "{ g.Feature_STP_AD }" NAME = "l.null" VALUE = "{ STP_Frameset( g.Store_Code, g.Admin_User_ID ) }">
				<MvELSE>
					<MvDO FILE = "site/frameset.mv">
				</MvIF>
			<MvELSE>
				<MvASSIGN NAME = "l.ok" VALUE = 1>

				<MvIF EXPR = "{ len( g.Action ) }">
					<MvASSIGN NAME = "l.pos" VALUE = 1>
					<MvASSIGN NAME = "l.current" VALUE = "{ gettoken( g.Action, ',', l.pos ) }">
					<MvWHILE EXPR = "{ l.ok AND l.current }">
						<MvASSIGN NAME = "l.current" VALUE = "{ toupper( l.current ) }">

						<MvIF EXPR = "{ l.current EQ 'FUPL' }">
							<MvASSIGN NAME = "l.ok" VALUE = "{ Action_FileUpload() }">
						</MvIF>

						<MvIF EXPR = "{ g.Admin_User_Administrator }">
							<MvIF EXPR = "{ NOT Domain.d.d_set }">
								<MvIF EXPR = "{ l.current EQ 'UDMN' }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Domain_Update() }">
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'USSL' }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_StoreSelection_Update() }">
								</MvIF>
							</MvIF>
						</MvIF>
						
						<MvIF EXPR = "{ NOT Domain.d.d_usr }">
							<MvIF EXPR = "{ l.current EQ 'IUSR' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Action_User_Insert() }">
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'UUSR' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Action_User_Update() }">
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'DUSR' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Action_User_Delete() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Admin_User_Administrator }">
							<MvIF EXPR = "{ NOT Domain.d.d_mod }">
								<MvIF EXPR = "{ l.current EQ 'IMOD' }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Module_Insert() }">
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'UMOD' }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Module_Update() }">
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'DMOD' }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Module_Delete() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'ISTR' }">
								<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.store_count" VALUE = "{ Store_Count() }">
								<MvIF EXPR = "{ ( Domain.d.maxstores GT l.store_count ) OR ( NOT Domain.d.maxstores ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Store_Insert() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'DSTR' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Store_Delete() }">
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'PACK' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Domain_Pack() }">
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'WIZZ' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Wizard() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ l.current EQ 'USTR' }">
							<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Store_Update() }">
						</MvIF>

						<MvIF EXPR = "{ g.Admin_User_Administrator }">
							<MvIF EXPR = "{ l.current EQ 'NOTL' }">
								<MvDO FILE = "{ g.Feature_NOT_AD }" NAME = "l.ok" VALUE = "{ NOT_FindCurrent_Notes( 1 ) }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ l.current EQ 'DLDN' }">
							<MvDO FILE = "{ g.Feature_NOT_AD }" NAME = "l.ok" VALUE = "{ Action_Delete_DomainNote() }">
						</MvIF>

						<MvIF EXPR = "{ ( l.current EQ 'IGRP' ) OR
										( l.current EQ 'RSTA' ) OR
										( l.current EQ 'UGRP' ) OR
										( l.current EQ 'DGRP' ) OR
										( l.current EQ 'UGUS' ) OR
										( l.current EQ 'STAT' ) OR
										( l.current EQ 'STCT' ) OR
										( l.current EQ 'CBED' ) OR
										( l.current EQ 'CSRT' ) OR
										( l.current EQ 'ICGY' ) OR
										( l.current EQ 'UCGY' ) OR
										( l.current EQ 'SCGY' ) OR
										( l.current EQ 'SDEL' ) OR
										( l.current EQ 'DCGY' ) OR
										( l.current EQ 'CAEP' ) OR
										( l.current EQ 'PGAP' ) OR
										( l.current EQ 'CREP' ) OR
										( l.current EQ 'PGRE' ) OR
										( l.current EQ 'GREC' ) OR
										( l.current EQ 'PBED' ) OR
										( l.current EQ 'PSRT' ) OR
										( l.current EQ 'IPRD' ) OR
										( l.current EQ 'UPRD' ) OR
										( l.current EQ 'DPRD' ) OR
										( l.current EQ 'IUSL' ) OR
										( l.current EQ 'UUSL' ) OR
										( l.current EQ 'DUSL' ) OR
										( l.current EQ 'UUST' ) OR
										( l.current EQ 'SMOD' ) OR
										( l.current EQ 'IAGP' ) OR
										( l.current EQ 'UAGP' ) OR
										( l.current EQ 'DAGP' ) OR
										( l.current EQ 'PEAP' ) OR
										( l.current EQ 'PEGR' ) OR
										( l.current EQ 'CSBD' ) OR
										( l.current EQ 'ICST' ) OR
										( l.current EQ 'UCST' ) OR
										( l.current EQ 'DCST' ) OR
										( l.current EQ 'IPCG' ) OR
										( l.current EQ 'UPCG' ) OR
										( l.current EQ 'DPCG' ) OR
										( l.current EQ 'CBCH' ) OR
										( l.current EQ 'BRPT' ) OR
										( l.current EQ 'PORD' ) OR
										( l.current EQ 'DBCH' ) OR
										( l.current EQ 'MORD' ) OR
										( l.current EQ 'UORD' ) OR
										( l.current EQ 'DORD' ) OR
										( l.current EQ 'SUTL' ) OR
										( l.current EQ 'IMPT' ) OR
										( l.current EQ 'EXPT' ) OR
										( l.current EQ 'SPCK' ) OR
										( l.current EQ 'ACST' ) OR
										( l.current EQ 'SWIZ' ) OR
										( l.current EQ 'INVT' ) OR
										( l.current EQ 'AAFU' ) OR
										( l.current EQ 'AAIU' ) OR
										( l.current EQ 'AAIS' ) OR
										( l.current EQ 'AAPO' ) OR
										( l.current EQ 'AADL' ) OR
										( l.current EQ 'AAVU' ) OR
										( l.current EQ 'AAPN' ) OR
										( l.current EQ 'AAVA' ) OR
										( l.current EQ 'AAPU' ) OR
										( l.current EQ 'AAPI' ) OR 
										( l.current EQ 'RSTA' ) OR 
										( l.current EQ 'AAPD' ) OR
										( l.current EQ 'ATBE' ) OR
										( l.current EQ 'ATMP' ) OR
										( l.current EQ 'IATA' ) OR
										( l.current EQ 'UATA' ) OR
										( l.current EQ 'DATA' ) OR
										( l.current EQ 'DLNT' ) }">

							<MvASSIGN NAME = "l.ok" VALUE = "{ Admin_Open_Store( g.Store_Code ) }">
						</MvIF>

						<MvIF EXPR = "{ l.ok }">
							<MvIF EXPR = "{ g.Admin_User_Administrator OR ( g.Admin_User_ID EQ Stores.d.manager_id ) }">
								<MvIF EXPR = "{ l.current EQ 'IGRP' }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Group_Insert() }">
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'UGRP' }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Group_Update() }">
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'DGRP' }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Group_Delete() }">
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'DLNT' }">
									<MvDO FILE = "{ g.Feature_NOT_AD }" NAME = "l.ok" VALUE = "{ Action_Delete_StoreNote() }">
								</MvIF>
							</MvIF>
							
							<MvIF EXPR = "{ l.current EQ 'RSTA' }">
								<MvDO FILE = "{ g.Module_Feature_STA }" NAME = "l.ok" VALUE = "{ Action_Store_ResetStats()}">
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'STAT' }">
								<MvIF EXPR = "{ CanI( 'STAT', 0, 0, 1, 0 ) OR CanI( 'STAT', 0, 1, 0, 0 ) OR CanI( 'STAT', 0, 0, 0, 1 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_State_Update() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'STCT' }">
								<MvIF EXPR = "{ CanI( 'STCT', 0, 1, 0, 0 ) OR CanI( 'STCT', 0, 0, 0, 1 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Countries_Update() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'CBED' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Category_BatchEdit() }">
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'CSRT' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Category_BatchSort() }">
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'ICGY' }">
								<MvIF EXPR = "{ CanI( 'CTGY', 0, 1, 0, 0 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Category_Insert() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'UCGY' }">
								<MvIF EXPR = "{ CanI( 'CTGY', 0, 0, 1, 0 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Category_Update() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'SCGY' }">
								<MvIF EXPR = "{ CanI( 'CTGY', 0, 0, 1, 0 ) AND CanI( 'PROD', 1, 0, 0, 0 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Category_Sort() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'DCGY' }">
								<MvIF EXPR = "{ CanI( 'CTGY', 0, 0, 0, 1 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Category_Delete() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'PBED' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Product_BatchEdit() }">
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'PSRT' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Product_BatchSort() }">
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'IPRD' }">
								<MvIF EXPR = "{ CanI( 'PROD', 0, 1, 0, 0 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Product_Insert() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'UPRD' }">
								<MvIF EXPR = "{ CanI( 'PROD', 0, 0, 1, 0 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Product_Update() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'DPRD' }">
								<MvIF EXPR = "{ CanI( 'PROD', 0, 0, 0, 1 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Product_Delete() }">
								</MvIF>
							</MvIF>

							<MvCOMMENT> Upsale </MvCOMMENT>
							<MvIF EXPR = "{ g.Features:Upsale:Enabled }">
								<MvIF EXPR = "{ ( l.current EQ 'IUSL' ) }">
									<MvIF EXPR = "{ CanI( 'UPSL', 0, 1, 0, 0 ) }">
										<MvDO FILE = "{ g.Module_Feature_USL_AD }" NAME = "l.ok" VALUE = "{ Action_Upsell_Insert() }">
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ ( l.current EQ 'UUSL' ) }">
									<MvIF EXPR = "{ CanI( 'UPSL', 0, 0, 1, 0 ) }">
										<MvDO FILE = "{ g.Module_Feature_USL_AD }" NAME = "l.ok" VALUE = "{ Action_Upsell_Update() }">
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ ( l.current EQ 'DUSL' ) }">
									<MvIF EXPR = "{ CanI( 'UPSL', 0, 0, 0, 1 ) }">
										<MvDO FILE = "{ g.Module_Feature_USL_AD }" NAME = "l.ok" VALUE = "{ Action_Upsell_Delete() }">
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ ( l.current EQ 'UUST' ) }">
									<MvIF EXPR = "{ CanI( 'UPSL', 0, 0, 1, 0 ) }">
										<MvDO FILE = "{ g.Module_Feature_USL_AD }" NAME = "l.ok" VALUE = "{ Action_UpsellOptions_Update() }">
									</MvIF>
								</MvIF>
							</MvIF>
							
							<MvIF EXPR = "{ l.current EQ 'SMOD' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Action_StoreModules_Update() }">
							</MvIF>

							<MvCOMMENT> Inventory </MvCOMMENT>
							<MvIF EXPR = "{ g.Features:Inventory:Enabled }">
								<MvIF EXPR = "{ l.current EQ 'INVT' }">
									<MvDO FILE = "{ g.Module_Feature_INV_AD }" NAME = "l.ok" VALUE = "{ INV_Action_UpdateInventorySettings() }">
								</MvIF>	
							</MvIF>
							
							<MvCOMMENT> Affiliate </MvCOMMENT>
							<MvIF EXPR = "{ g.Features:Affiliates:Enabled }">
								<MvIF EXPR = "{ l.current EQ 'AAIS' }">
									<MvIF EXPR = "{ CanI( 'AFLT', 0, 1, 0, 0 ) }">
										<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Action_Affiliate_Insert() }">
									</MvIF>
								</MvIF>
								
								<MvIF EXPR = "{ l.current EQ 'AADL' }">
									<MvIF EXPR = "{ CanI( 'AFLT', 0, 0, 0, 1 ) }">
										<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Action_Affiliate_Delete() }">
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'AAFU' }">
									<MvIF EXPR = "{ CanI( 'AFLT', 0, 0, 1, 0 ) }">
										<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Action_AffiliateBatchEdit_Update() }">
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'AAIU' }">
									<MvIF EXPR = "{ CanI( 'AFLT', 0, 0, 1, 0 ) }">
										<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Action_Affiliate_Update() }">
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'AAPO' }">
									<MvIF EXPR = "{ CanI( 'MONY', 0, 0, 1, 0 ) }">
										<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Action_Affiliate_Payout() }">
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'AAPN' }">
									<MvIF EXPR = "{ CanI( 'MONY', 0, 0, 1, 0 ) }">
										<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Action_Affiliate_PayoutNow() }">
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'AAVU' }">
									<MvIF EXPR = "{ CanI( 'MONY', 0, 0, 1, 0 ) }">
										<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Action_AffiliateEarningsVoid_Update() }">
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'AAVA' }">
									<MvIF EXPR = "{ CanI( 'MONY', 0, 0, 1, 0 ) }">
										<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Action_AffiliateEarningsVoid_Insert() }">
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'AAPU' }">
									<MvIF EXPR = "{ CanI( 'MONY', 0, 0, 1, 0 ) }">
										<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Action_AffiliatePayouts_Update() }">
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'AAPD' }">
									<MvIF EXPR = "{ CanI( 'MONY', 0, 0, 0, 1 ) }">
										<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Action_AffiliatePayouts_Delete() }">
									</MvIF>
								</MvIF>
							</MvIF>
							
							<MvCOMMENT> Customers </MvCOMMENT>
							<MvIF EXPR = "{ g.Features:Customers:Enabled }">
								<MvIF EXPR = "{ l.current EQ 'CSBD' }">
									<MvDO FILE = "{ g.Module_Feature_CUS }" NAME = "l.ok" VALUE = "{ Action_Customer_BatchEdit() }">
								</MvIF>
								<MvIF EXPR = "{ l.current EQ 'ICST' }">
									<MvIF EXPR = "{ CanI( 'CUST', 0, 1, 0, 0 ) }">
										<MvDO FILE = "{ g.Module_Feature_CUS }" NAME = "l.ok" VALUE = "{ Action_Customer_Insert() }">
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'UCST' }">
									<MvIF EXPR = "{ CanI( 'CUST', 0, 0, 1, 0 ) }">
										<MvDO FILE = "{ g.Module_Feature_CUS }" NAME = "l.ok" VALUE = "{ Action_Customer_Update() }">
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'DCST' }">
									<MvIF EXPR = "{ CanI( 'CUST', 0, 0, 0, 1 ) }">
										<MvDO FILE = "{ g.Module_Feature_CUS }" NAME = "l.ok" VALUE = "{ Action_Customer_Delete() }">
									</MvIF>
								</MvIF>
								
								<MvCOMMENT> Availability Group </MvCOMMENT>
								<MvIF EXPR = "{ g.Features:AvailabilityGroups:Enabled }">
									<MvIF EXPR = "{ l.current EQ 'IAGP' }">
										<MvIF EXPR = "{ CanI( 'AGRP', 0, 1, 0, 0 ) }">
											<MvDO FILE = "{ g.Module_Feature_AGR_AD }" NAME = "l.ok" VALUE = "{ Action_AvailabilityGroup_Insert() }">
										</MvIF>
									</MvIF>

									<MvIF EXPR = "{ l.current EQ 'UAGP' }">
										<MvIF EXPR = "{ CanI( 'AGRP', 0, 0, 1, 0 ) }">
											<MvDO FILE = "{ g.Module_Feature_AGR_AD }" NAME = "l.ok" VALUE = "{ Action_AvailabilityGroup_Update() }">
										</MvIF>
									</MvIF>

									<MvIF EXPR = "{ l.current EQ 'DAGP' }">
										<MvIF EXPR = "{ CanI( 'AGRP', 0, 0, 0, 1 ) }">
											<MvDO FILE = "{ g.Module_Feature_AGR_AD }" NAME = "l.ok" VALUE = "{ Action_AvailabilityGroup_Delete() }">
										</MvIF>
									</MvIF>
								</MvIF>
								
								<MvCOMMENT> Price Group </MvCOMMENT>
								<MvIF EXPR = "{ g.Features:PriceGroups:Enabled }">
									<MvIF EXPR = "{ l.current EQ 'IPCG' }">
										<MvIF EXPR = "{ CanI( 'PGRP', 0, 1, 0, 0 ) }">
											<MvDO FILE = "{ g.Module_Feature_PGR_AD }" NAME = "l.ok" VALUE = "{ Action_PriceGroup_Insert() }">
										</MvIF>
									</MvIF>

									<MvIF EXPR = "{ l.current EQ 'UPCG' }">
										<MvIF EXPR = "{ CanI( 'PGRP', 0, 0, 1, 0 ) }">
											<MvDO FILE = "{ g.Module_Feature_PGR_AD }" NAME = "l.ok" VALUE = "{ Action_PriceGroup_Update() }">
										</MvIF>
									</MvIF>

									<MvIF EXPR = "{ l.current EQ 'DPCG' }">
										<MvIF EXPR = "{ CanI( 'PGRP', 0, 0, 0, 1 ) }">
											<MvDO FILE = "{ g.Module_Feature_PGR_AD }" NAME = "l.ok" VALUE = "{ Action_PriceGroup_Delete() }">
										</MvIF>
									</MvIF>
								</MvIF>
							</MvIF>
							
							<MvIF EXPR = "{ g.Admin_User_Administrator OR ( g.Admin_User_ID EQ Stores.d.manager_id ) }">
								<MvIF EXPR = "{ l.current EQ 'SDEL' }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Store_DeleteBaskets() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'CBCH' }">
								<MvIF EXPR = "{ CanI( 'ORDR', 0, 1, 0, 0 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Create_Batch() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'BRPT' }">
								<MvIF EXPR = "{ CanI( 'ORDR', 1, 0, 0, 0 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Run_BatchReport() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'PORD' }">
								<MvIF EXPR = "{ CanI( 'ORDR', 0, 0, 1, 0 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Process_Order() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'DBCH' }">
								<MvIF EXPR = "{ CanI( 'ORDR', 0, 0, 0, 1 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Batch_Delete() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'MORD' }">
								<MvIF EXPR = "{ CanI( 'ORDR', 0, 0, 1, 0 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Mark_Order() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'UORD' }">
								<MvIF EXPR = "{ CanI( 'ORDR', 0, 0, 1, 0 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Order_Update() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ l.current EQ 'DORD' }">
								<MvIF EXPR = "{ CanI( 'ORDR', 0, 0, 0, 1 ) }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Order_Delete() }">
								</MvIF>
							</MvIF>
							
							<MvCOMMENT> Attribute Template </MvCOMMENT>
							<MvIF EXPR = "{ g.Features:AttributeTemplates:Enabled }">
								<MvIF EXPR = "{ l.current EQ 'ATBE' }">
									<MvDO FILE = "{ g.Feature_ATT }" NAME = "l.ok" VALUE = "{ Action_AttributeTemplates_BatchEdit_Update() }">
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'IATA' }">
									<MvIF EXPR = "{ CanI( 'ATMP', 0, 1, 0, 0 ) }">
										<MvDO FILE = "{ g.Feature_ATT }" NAME = "l.ok" VALUE = "{ Action_AttributeTemplate_Insert() }">
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'UATA' }">
									<MvIF EXPR = "{ CanI( 'ATMP', 0, 0, 1, 0 ) }">
										<MvDO FILE = "{ g.Feature_ATT }" NAME = "l.ok" VALUE = "{ Action_AttributeTemplate_Update() }">
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'DATA' }">
									<MvIF EXPR = "{ CanI( 'ATMP', 0, 0, 0, 1 ) }">
										<MvDO FILE = "{ g.Feature_ATT }" NAME = "l.ok" VALUE = "{ Action_AttributeTemplate_Delete() }">
									</MvIF>
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ g.Admin_User_Administrator OR ( g.Admin_User_ID EQ Stores.d.manager_id ) OR CanI( 'SUTL', 0, 1, 0, 0 ) OR
											CanI( 'SUTL', 0, 0, 1, 0 ) OR CanI( 'SUTL', 0, 0, 0, 1 ) }">
								<MvIF EXPR = "{ l.current EQ 'SUTL' }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_StoreUtility() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ g.Admin_User_Administrator OR ( g.Admin_User_ID EQ Stores.d.manager_id ) }">
								<MvIF EXPR = "{ l.current EQ 'IMPT' }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Import() }">
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'EXPT' }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Export() }">
								</MvIF>

								<MvIF EXPR = "{ l.current EQ 'SPCK' }">
									<MvASSIGN NAME = "l.ok" VALUE = "{ Action_Store_Pack() }">
								</MvIF>
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ l.current EQ 'SWIZ' }">
							<MvASSIGN NAME = "l.ok" VALUE = "{ Action_StoreWizard() }">
						</MvIF>

						<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
						<MvASSIGN NAME = "l.current" VALUE = "{ gettoken( g.Action, ',', l.pos ) }">
					</MvWHILE>
				</MvIF>

				<MvIF EXPR = "{ l.ok }">
					<MvIF EXPR = "{ g.Data_Entry_Error OR g.Have_Fields }">
						<MvASSIGN NAME = "g.Load_Fields" VALUE = 0>
					<MvELSE>
						<MvASSIGN NAME = "g.Load_Fields" VALUE = 1>
					</MvIF>

					<MvCOMMENT> Begin STP Screens </MvCOMMENT>
					<MvIF EXPR = "{ g.IsSimpleMode }">
						<MvIF EXPR = "{ g.Screen EQ 'TTOP' }">
							<MvDO FILE = "{ g.Feature_STP_AD }" NAME = "l.ok" VALUE = "{ STP_Screen_TaskTop() }">
						</MvIF>
						
						<MvIF EXPR = "{ g.Screen EQ 'TLST' }">
							<MvDO FILE = "{ g.Feature_STP_AD }" NAME = "l.ok" VALUE = "{ STP_Screen_TaskList() }">
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'WLCM' }">
							<MvDO FILE = "{ g.Feature_STP_AD }" NAME = "l.ok" VALUE = "{ STP_Screen_Welcome() }">							
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'FNSH' }">
							<MvDO FILE = "{ g.Feature_STP_AD }" NAME = "l.ok" VALUE = "{ STP_Screen_Finished() }">							
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'STPR' }">
							<MvDO FILE = "{ g.Feature_STP_AD }" NAME = "l.ok" VALUE = "{ STP_Screen_Reload() }">							
						</MvIF>
					</MvIF>
					<MvCOMMENT> End STP Screens</MvCOMMENT>

					<MvIF EXPR = "{ g.Screen EQ 'COLT' }">
						<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_ColorTable() }">
					</MvIF>

					<MvIF EXPR = "{ g.Screen EQ 'COLR' }">
						<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_ColorSelector() }">
					</MvIF>

					<MvIF EXPR = "{ g.Screen EQ 'FUPL' }">
						<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_FileUpload() }">
					</MvIF>

					<MvIF EXPR = "{ g.Screen EQ 'TNAV' }">
						<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_TopNavigation() }">
					</MvIF>

					<MvIF EXPR = "{ g.Screen EQ 'LNAV' }">
						<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_LeftNavigation() }">
					</MvIF>

					<MvIF EXPR = "{ g.Screen EQ 'BLNK' }">
						<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Blank() }">
					</MvIF>

					<MvIF EXPR = "{ g.Screen EQ 'MAIN' }">
						<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_QuickStart() }">
					</MvIF>

					<MvIF EXPR = "{ g.Screen EQ 'ABOU' }">
						<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_About() }">
					</MvIF>

					<MvIF EXPR = "{ g.Admin_User_Administrator }">
						<MvIF EXPR = "{ NOT Domain.d.d_set }">
							<MvIF EXPR = "{ g.Screen EQ 'DOMN' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Domain() }">
							</MvIF>
						</MvIF>
						
						<MvIF EXPR = "{ g.Screen EQ 'SSMP' }">
							<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_StoreSelection_Preview() }">
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'SSMD' }">
							<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_StoreSelection() }">
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'DLNT' }">
							<MvDO FILE = "{ g.Feature_NOT_AD }" NAME = "l.ok" VALUE = "{ Screen_Deleted_Note() }">
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'WIZZ' }">
							<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Wizard() }">
						</MvIF>
					</MvIF>

					<MvIF EXPR = "{ g.Screen EQ 'DNOT' }">
						<MvDO FILE = "{ g.Feature_NOT_AD }" NAME = "l.ok" VALUE = "{ Screen_Domain_Note() }">
					</MvIF>

					<MvIF EXPR = "{ g.Screen EQ 'CRDT' }">
						<MvDO FILE = "{ g.Module_Version }" NAME = "l.ok" VALUE = "{ Screen_MivaMerchant_Credits() }">
					</MvIF>

					<MvIF EXPR = "{ NOT Domain.d.d_usr }">
						<MvIF EXPR = "{ g.Screen EQ 'ULKP' }">
							<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_User_Lookup() }">
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'USER' }">
							<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Users() }">
						</MvIF>
					</MvIF>

					<MvIF EXPR = "{ g.Admin_User_Administrator }">
						<MvIF EXPR = "{ NOT Domain.d.d_mod }">
							<MvIF EXPR = "{ g.Screen EQ 'DMOD' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_DeleteModule() }">
							</MvIF>

							<MvIF EXPR = "{ g.Screen EQ 'MODS' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Modules() }">
							</MvIF>
						</MvIF>
					</MvIF>

					<MvIF EXPR = "{ g.Screen EQ 'STMP' }">
						<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Store_Preview() }">
					</MvIF>

					<MvIF EXPR = "{ g.Screen EQ 'STOR' }">
						<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Stores() }">
					</MvIF>

					<MvIF EXPR = "{ g.Screen EQ 'DSTR' }">
						<MvIF EXPR = "{ g.Admin_User_Administrator }">
							<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_DeleteStore() }">
						</MvIF>
					</MvIF>
					
					<MvIF EXPR = "{ ( g.Screen EQ 'LINK' ) OR
									( g.Screen EQ 'CLKP' ) OR
									( g.Screen EQ 'PLKP' ) OR
									( g.Screen EQ 'GROP' ) OR
									( g.Screen EQ 'STAT' ) OR
									( g.Screen EQ 'STCT' ) OR
									( g.Screen EQ 'CBED' ) OR
									( g.Screen EQ 'CTGY' ) OR
									( g.Screen EQ 'PBED' ) OR
									( g.Screen EQ 'PROD' ) OR
									( g.Screen EQ 'CUST' ) OR
									( g.Screen EQ 'UPSL' ) OR
									( g.Screen EQ 'UPBE' ) OR
									( g.Screen EQ 'PMNT' ) OR
									( g.Screen EQ 'ASMD' ) OR
									( g.Screen EQ 'CSMD' ) OR
									( g.Screen EQ 'PRFY' ) OR
									( g.Screen EQ 'SMOD' ) OR
									( g.Screen EQ 'CSBD' ) OR
									( g.Screen EQ 'CUST' ) OR
									( g.Screen EQ 'AGRP' ) OR
									( g.Screen EQ 'CAEP' ) OR
									( g.Screen EQ 'PCGR' ) OR
									( g.Screen EQ 'PCGP' ) OR
									( g.Screen EQ 'PEAP' ) OR
									( g.Screen EQ 'BRPT' ) OR
									( g.Screen EQ 'PORD' ) OR
									( g.Screen EQ 'CBCH' ) OR
									( g.Screen EQ 'DBCH' ) OR
									( g.Screen EQ 'ORDR' ) OR
									( g.Screen EQ 'SUTL' ) OR
									( g.Screen EQ 'IMPT' ) OR
									( g.Screen EQ 'EXPT' ) OR
									( g.Screen EQ 'SWIZ' ) OR
									( g.Screen EQ 'DELC' ) OR
									( g.screen EQ 'INVT' ) OR
									( g.screen EQ 'AFLT' ) OR
									( g.screen EQ 'AFIF' ) OR
									( g.screen EQ 'AFPO' ) OR
									( g.screen EQ 'AFVD' ) OR
									( g.Screen EQ 'AFPR' ) OR
									( g.Screen EQ 'DSTS' ) OR
									( g.Screen EQ 'AFAP' ) OR
									( g.Screen EQ 'ATBE' ) OR
									( g.Screen EQ 'ATMP' ) OR
									( g.Screen EQ 'IATA' ) OR
									( g.Screen EQ 'UATA' ) OR
									( g.Screen EQ 'DATA' ) OR
									( g.Screen EQ 'NOTE' ) }">
									
						<MvASSIGN NAME = "l.ok" VALUE = "{ Admin_Open_Store( g.Store_Code ) }">
					</MvIF>

					<MvIF EXPR = "{ l.ok }">
						<MvIF EXPR = "{ g.Screen EQ 'NOTE' }">
							<MvDO FILE = "{ g.Feature_NOT_AD }" NAME = "l.ok" VALUE = "{ Screen_Store_Note() }">
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'DSTS' }">
							<MvIF EXPR = "{ CanI( 'STOR', 0, 0, 1, 0 ) }">
								<MvDO FILE = "{ g.Module_Feature_STA }" NAME = "l.ok" VALUE = "{ Screen_ResetStats() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Features:AttributeTemplates:Enabled }">
							<MvIF EXPR = "{ g.Screen EQ 'ATBE' }">
								<MvIF EXPR = "{ CanI( 'ATMP', 1, 0, 0, 0 ) }">
									<MvDO FILE = "{ g.Feature_ATT }" NAME = "l.ok" VALUE = "{ Screen_AttributeTemplates_BatchEdit() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ g.Screen EQ 'ATMP' }">
								<MvIF EXPR = "{ CanI( 'ATMP', 1, 0, 0, 0 ) }">
									<MvDO FILE = "{ g.Feature_ATT }" NAME = "l.ok" VALUE = "{ Screen_AttributeTemplates() }">
								</MvIF>
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'LINK' }">
							<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Links() }">
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'PLKP' }">
							<MvIF EXPR = "{ CanI( 'PROD', 1, 0, 0, 0 ) }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Product_Lookup() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'CLKP' }">
							<MvIF EXPR = "{ CanI( 'CTGY', 1, 0, 0, 0 ) }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Category_Lookup() }">
							</MvIF>
						</MvIF>

 						<MvIF EXPR = "{ g.Screen EQ 'PRFY' }">
 							<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Order_Information() }">
 						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'GROP' }">
							<MvIF EXPR = "{ g.Admin_User_Administrator OR ( g.Admin_User_ID EQ Stores.d.manager_id ) }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Groups() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'STAT' }">
							<MvIF EXPR = "{ CanI( 'STAT', 1, 0, 0, 0 ) }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_States() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'STCT' }">
							<MvIF EXPR = "{ CanI( 'STCT', 1, 0, 0, 0 ) }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Countries() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'CBED' }">
							<MvIF EXPR = "{ CanI( 'CTGY', 1, 0, 0, 0 ) }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Category_BatchEdit() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'CTGY' }">
							<MvIF EXPR = "{ CanI( 'CTGY', 1, 0, 0, 0 ) }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Categories() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'PBED' }">
							<MvIF EXPR = "{ CanI( 'PROD', 1, 0, 0, 0 ) }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Product_BatchEdit() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'PROD' }">
							<MvIF EXPR = "{ CanI( 'PROD', 1, 0, 0, 0 ) }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Products() }">
							</MvIF>
						</MvIF>
						<MvCOMMENT> Upsale </MvCOMMENT>
						<MvIF EXPR = "{ g.Features:Upsale:Enabled }">
							<MvIF EXPR = "{ g.Screen EQ 'UPSL' }">
								<MvIF EXPR = "{ CanI( 'UPSL', 1, 0, 0, 0 ) AND CanI( 'PROD', 1, 0, 0, 0 ) }">
									<MvDO FILE = "{ g.Module_Feature_USL_AD }" NAME = "l.ok" VALUE = "{ Screen_Upsell() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ g.Screen EQ 'UPBE' }">
								<MvIF EXPR = "{ CanI( 'UPSL', 1, 0, 0, 0 ) AND CanI( 'PROD', 1, 0, 0, 0 ) }">
									<MvDO FILE = "{ g.Module_Feature_USL_AD }" NAME = "l.ok" VALUE = "{ Screen_Upsale_BatchEdit() }">
								</MvIF>
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'SMOD' }">
							<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_StoreModules() }">
						</MvIF>

						<MvCOMMENT> Inventory </MvCOMMENT>
						<MvIF EXPR = "{ g.Features:Inventory:Enabled }">
							<MvIF EXPR = "{ g.screen EQ 'INVT' }">
								<MvIF EXPR = "{ CanI( 'INVT', 1, 0, 0, 0 ) }">
									<MvDO FILE = "{ g.Module_Feature_INV_AD }" NAME = "l.ok" VALUE = "{ INV_Screen_Inventory() }">
								</MvIF>
							</MvIF>
						</MvIF>
						
						<MvCOMMENT> Affiliate </MvCOMMENT>
						<MvIF EXPR = "{ g.Features:Affiliates:Enabled }">
							<MvIF EXPR = "{ g.Screen EQ 'AFLT' }">
								<MvIF EXPR = "{ CanI( 'AFLT', 1, 0, 0, 0 ) }">
									<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Screen_AffiliateOptions() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ g.Screen EQ 'AFIF' }">
								<MvIF EXPR = "{ CanI( 'AFLT', 1, 0, 0, 0 ) }">
									<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Screen_AffiliateInfo() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ g.Screen EQ 'AFAP' }">
								<MvIF EXPR = "{ CanI( 'MONY', 0, 1, 0, 0 ) }">
									<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Screen_AffiliateAddPayout() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ g.Screen EQ 'AFPO' }">
								<MvIF EXPR = "{ CanI( 'MONY', 1, 0, 0, 0 ) }">
									<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Screen_AffiliatePayout() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ g.Screen EQ 'AFVD' }">
								<MvIF EXPR = "{ CanI( 'MONY', 1, 0, 0, 0 ) }">
									<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Screen_AffiliateVoid() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ g.Screen EQ 'AFPR' }">
								<MvDO FILE = "{ g.Module_Feature_AFF }" NAME = "l.ok" VALUE = "{ Screen_AffiliatePayout_Print() }">
							</MvIF>
						</MvIF>
						
						<MvCOMMENT> Customers </MvCOMMENT>
						<MvIF EXPR = "{ g.Features:Customers:Enabled }">
							<MvIF EXPR = "{ g.Screen EQ 'CSBD' }">
								<MvIF EXPR = "{ CanI( 'CUST', 1, 0, 0, 0 ) }">
									<MvDO FILE = "{ g.Module_Feature_CUS }" NAME = "l.ok" VALUE = "{ Screen_Customer_BatchEdit() }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ g.Screen EQ 'CUST' }">
								<MvIF EXPR = "{ CanI( 'CUST', 1, 0, 0, 0 ) }">
									<MvDO FILE = "{ g.Module_Feature_CUS }" NAME = "l.ok" VALUE = "{ Screen_Customers() }">
								</MvIF>
							</MvIF>
							
							<MvCOMMENT> Availablity Group </MvCOMMENT>
							<MvIF EXPR = "{ g.Features:AvailabilityGroups:Enabled }">
								<MvIF EXPR = "{ g.Screen EQ 'AGRP' }">
									<MvIF EXPR = "{ CanI( 'AGRP', 1, 0, 0, 0 ) }">
										<MvDO FILE = "{ g.Module_Feature_AGR_AD }" NAME = "l.ok" VALUE = "{ Screen_AvailabilityGroups() }">
									</MvIF>
								</MvIF>
							</MvIF>
							
							<MvCOMMENT> Price Group </MvCOMMENT>
							<MvIF EXPR = "{ g.Features:PriceGroups:Enabled }">
								<MvIF EXPR = "{ g.Screen EQ 'PCGP' }">
									<MvIF EXPR = "{ CanI( 'PGRP', 1, 0, 0, 0 ) }">
										<MvDO FILE = "{ g.Module_Feature_PGR_AD }" NAME = "l.ok" VALUE = "{ Screen_PriceGroups() }">
									</MvIF>
								</MvIF>
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'CBCH' }">
							<MvIF EXPR = "{ CanI( 'ORDR', 0, 1, 0, 0 ) }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_CreateBatch() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'BRPT' }">
							<MvIF EXPR = "{ CanI( 'ORDR', 1, 0, 0, 0 ) }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_BatchReport() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'PORD' }">
							<MvIF EXPR = "{ CanI( 'ORDR', 0, 0, 1, 0 ) }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_ProcessOrders() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'DBCH' }">
							<MvIF EXPR = "{ CanI( 'ORDR', 0, 0, 0, 1 ) }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_DeleteBatch() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Admin_User_Administrator OR ( g.Admin_User_ID EQ Stores.d.manager_id ) }">
							<MvIF EXPR = "{ g.Screen EQ 'DELC' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_DeleteShoppingBaskets() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'ORDR' }">
							<MvIF EXPR = "{ CanI( 'ORDR', 1, 0, 0, 0 ) }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Printable() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Admin_User_Administrator OR ( g.Admin_User_ID EQ Stores.d.manager_id ) OR CanI( 'SUTL', 1, 0, 0, 0 ) }">
							<MvIF EXPR = "{ g.Screen EQ 'SUTL' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_StoreUtility() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Admin_User_Administrator OR ( g.Admin_User_ID EQ Stores.d.manager_id ) }">
							<MvIF EXPR = "{ g.Screen EQ 'IMPT' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Import() }">
							</MvIF>

							<MvIF EXPR = "{ g.Screen EQ 'EXPT' }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_Export() }">
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Screen EQ 'SWIZ' }">
							<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_StoreWizard() }">
						</MvIF>
					</MvIF>

					<MvIF EXPR = "{ g.Screen EQ 'LOGO' }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ AdminSession_Delete( g.Session_ID ) }">
						<MvEVAL EXPR = "{ Screen_Login() }">
					</MvIF>
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>
</MvIF>

<MvIF EXPR = "{ NOT l.ok }">
	<MvIF EXPR = "{ len( g.Error_Message ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00004">
			<MvLOCALIZED-TOKEN NAME = "action" VALUE = "{ encodeentities( g.Action ) }">
			<MvLOCALIZED-TOKEN NAME = "screen" VALUE = "{ encodeentities( g.Screen ) }">

			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				<B>Unknown Error</B><BR><BR>&nbsp;&nbsp;Action = %action%<BR>&nbsp;&nbsp;Screen = %screen%
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-ADM-00005', l.error_message) }">
	</MvIF>

	<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.ok" VALUE = "{ Screen_Error() }">
</MvIF>

</HTML>
<MvEXIT>

<MvFUNCTION NAME = "Admin_Open_Store" PARAMETERS = "store_code">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ ( len( g.Admin_Open_Store ) ) AND ( l.store_code NE g.Admin_Open_Store ) }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Store_Close( g.Admin_Open_Store ) }">
		<MvASSIGN NAME = "g.Admin_Open_Store" VALUE = "">
	</MvIF>

	<MvIF EXPR = "{ len( g.Admin_Open_Store ) NE 0 }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Store_Find_Code( l.store_code ) }">
	<MvELSE>
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Store_Open( l.store_code ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvIF EXPR = "{ l.ok }">
				<MvIF EXPR = "{ Stores.d.tax_id }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID_Admin( Stores.d.tax_id ) }">
					<MvIF EXPR = "{ l.found }">
						<MvASSIGN NAME = "g.Store_Module_Tax" VALUE = "{ Modules.d.module }">
					</MvIF>
				<MvELSE>
					<MvASSIGN NAME = "g.Store_Module_Tax" VALUE = "">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvIF EXPR = "{ Stores.d.currncy_id }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID_Admin( Stores.d.currncy_id ) }">
					<MvIF EXPR = "{ l.found }">
						<MvASSIGN NAME = "g.Store_Module_Currency" VALUE = "{ Modules.d.module }">
					</MvIF>
				<MvELSE>
					<MvASSIGN NAME = "g.Store_Module_Currency" VALUE = "">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID_Admin( Stores.d.ui_id ) }">
				<MvIF EXPR = "{ l.found }">
					<MvASSIGN NAME = "g.Store_Module_UI" VALUE = "{ Modules.d.module }">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvASSIGN NAME = "g.Admin_Open_Store" VALUE = "{ Stores.d.code }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Admin_Close_Store">
	<MvIF EXPR = "{ len( g.Admin_Open_Store ) }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Store_Close( g.Admin_Open_Store ) }">
		<MvASSIGN NAME = "g.Admin_Open_Store" VALUE = "">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "CanI" PARAMETERS = "privilege, view, add, modify, delete">
	<MvIF EXPR = "{ ( l.privilege EQ toupper( 'MANGR' ) ) AND ( Stores.d.manager_id EQ g.Admin_User_ID ) }">
		<MvASSIGN NAME = "l.can" VALUE = "1">	
	<MvELSE>
		<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.can" VALUE = "{ CanI( g.Admin_User_Administrator, g.Admin_User_ID, l.privilege, l.view, l.add, l.modify, l.delete ) }">

		<MvIF EXPR = "{ l.privilege EQ 'PMNT' }">
			<MvIF EXPR = "{ Domain.d.d_pay }">
				<MvASSIGN NAME = "l.can" VALUE = 0>
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.privilege EQ 'SHIP' }">
			<MvIF EXPR = "{ Domain.d.d_ship }">
				<MvASSIGN NAME = "l.can" VALUE = 0>
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.privilege EQ 'FUFL' }">
			<MvIF EXPR = "{ Domain.d.d_ful }">
				<MvASSIGN NAME = "l.can" VALUE = 0>
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.privilege EQ 'LOGM' }">
			<MvIF EXPR = "{ Domain.d.d_log }">
				<MvASSIGN NAME = "l.can" VALUE = 0>
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.privilege EQ 'SYSM' }">
			<MvIF EXPR = "{ Domain.d.d_sys }">
				<MvASSIGN NAME = "l.can" VALUE = 0>
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.privilege EQ 'SUTL' }">
			<MvIF EXPR = "{ Domain.d.d_utl }">
				<MvASSIGN NAME = "l.can" VALUE = 0>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.can }">
</MvFUNCTION>

<MvCOMMENT>
|
| Login Screen
|
</MvCOMMENT>

<MvFUNCTION NAME = "Screen_Login">
	<HEAD>
	<TITLE>
		<MvLOCALIZED ID = "MER-ADM-00005">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Miva Merchant Administration: Login</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
	</TITLE>
	<MvIF EXPR = "{ g.Secure }">
		<BASE HREF = "{ g.secure_baseurl }">
	<MvELSE>
		<BASE HREF = "{ g.baseurl }">
	</MvIF>
	</HEAD>

	<BODY BGCOLOR = "#ffffff">
	<BR>
	<IMG SRC = "{ g.AdminGraphics_Path $ 'login4x.gif' }">
	<P><FONT FACE = "Arial, Helvetica"><B><I>
		<MvLOCALIZED ID = "MER-ADM-00006">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Welcome!&nbsp;</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

	</I></B></FONT></P>

	<MvIF EXPR = "{ ( NOT g.Secure ) AND ( Domain.d.admin_surl ) }">
		<P>
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<A HREF = "{ g.secure_sessionurl }">
			<MvLOCALIZED ID = "MER-ADM-00007">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Log in securely</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</A>
		</FONT>
		</P>
	</MvIF>

	<P>
	<FORM ACTION = "{ g.sessionurl }" METHOD = "post" TARGET = "_top">
	<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
	<TR><TD ALIGN = "right" VALIGN = "middle">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
		<MvLOCALIZED ID = "MER-ADM-00008">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Login:</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B></FONT>
	</TD><TD ALIGN = "left" VALIGN = "middle">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<INPUT TYPE = "text" SIZE = 25 NAME = "UserName">
		</FONT>
	</TD></TR>

	<TR><TD ALIGN = "right" VALIGN = "middle">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
		<MvLOCALIZED ID = "MER-ADM-00009">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Password:</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B></FONT>
	</TD><TD ALIGN = "left" VALIGN = "middle">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<INPUT TYPE = "password" SIZE = "25" NAME = "Password">
		</FONT>
	</TD></TR>

	<TR><TD>
		&nbsp;
	</TD><TD ALIGN = "left" VALIGN = "middle">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvLOCALIZED ID = "MER-ADM-00010">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				<INPUT TYPE = "submit" VALUE = "Login">
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</FONT>
	</TD></TR>
	</TABLE>
	
	<INPUT TYPE = "hidden" NAME = "Provision" VALUE = "Yes">
	</FORM>
	</BODY>
</MvFUNCTION>

<MvCOMMENT>
|
| Color Selector
|
</MvCOMMENT>

<MvFUNCTION NAME = "Screen_ColorTable">
	<HEAD>
	<TITLE>
		<MvLOCALIZED ID = "MER-ADM-00011">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Color Table</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
	</TITLE>
	<MvIF EXPR = "{ g.Secure }">
		<BASE HREF = "{ g.secure_baseurl }">
	<MvELSE>
		<BASE HREF = "{ g.baseurl }">
	</MvIF>
	</HEAD>
	<BODY BGCOLOR = "#ffffff">
	<TABLE BORDER = 0 CELLPADDING = 0 CELLSPACING = 0>
	<TR><TD BGCOLOR = "#000000">
	<TABLE BORDER = 0 CELLPADDING = 0 CELLSPACING = 1>
	<TR>
	<TD BGCOLOR = "white"><A HREF = "JavaScript:parent.ColorSelected( 'white' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "ivory"><A HREF = "JavaScript:parent.ColorSelected( 'ivory' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lightyellow"><A HREF = "JavaScript:parent.ColorSelected( 'lightyellow' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "yellow"><A HREF = "JavaScript:parent.ColorSelected( 'yellow' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "snow"><A HREF = "JavaScript:parent.ColorSelected( 'snow' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "floralwhite"><A HREF = "JavaScript:parent.ColorSelected( 'floralwhite' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lemonchiffon"><A HREF = "JavaScript:parent.ColorSelected( 'lemonchiffon' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "cornsilk"><A HREF = "JavaScript:parent.ColorSelected( 'cornsilk' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "seashell"><A HREF = "JavaScript:parent.ColorSelected( 'seashell' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lavenderblush"><A HREF = "JavaScript:parent.ColorSelected( 'lavenderblush' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "papayawhip"><A HREF = "JavaScript:parent.ColorSelected( 'papayawhip' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "blanchedalmond"><A HREF = "JavaScript:parent.ColorSelected( 'blanchedalmond' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "mistyrose"><A HREF = "JavaScript:parent.ColorSelected( 'mistyrose' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	</TR><TR>
	<TD BGCOLOR = "bisque"><A HREF = "JavaScript:parent.ColorSelected( 'bisque' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "moccasin"><A HREF = "JavaScript:parent.ColorSelected( 'moccasin' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "navajowhite"><A HREF = "JavaScript:parent.ColorSelected( 'navajowhite' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "peachpuff"><A HREF = "JavaScript:parent.ColorSelected( 'peachpuff' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "gold"><A HREF = "JavaScript:parent.ColorSelected( 'gold' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "pink"><A HREF = "JavaScript:parent.ColorSelected( 'pink' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lightpink"><A HREF = "JavaScript:parent.ColorSelected( 'lightpink' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "orange"><A HREF = "JavaScript:parent.ColorSelected( 'orange' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lightsalmon"><A HREF = "JavaScript:parent.ColorSelected( 'lightsalmon' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkorange"><A HREF = "JavaScript:parent.ColorSelected( 'darkorange' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "coral"><A HREF = "JavaScript:parent.ColorSelected( 'coral' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "hotpink"><A HREF = "JavaScript:parent.ColorSelected( 'hotpink' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "tomato"><A HREF = "JavaScript:parent.ColorSelected( 'tomato' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	</TR><TR>
	<TD BGCOLOR = "orangered"><A HREF = "JavaScript:parent.ColorSelected( 'orangered' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "deeppink"><A HREF = "JavaScript:parent.ColorSelected( 'deeppink' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "magenta"><A HREF = "JavaScript:parent.ColorSelected( 'magenta' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "fuchsia"><A HREF = "JavaScript:parent.ColorSelected( 'fuchsia' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "red"><A HREF = "JavaScript:parent.ColorSelected( 'red' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "oldlace"><A HREF = "JavaScript:parent.ColorSelected( 'oldlace' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lightgoldenrodyellow"><A HREF = "JavaScript:parent.ColorSelected( 'lightgoldenrodyellow' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "linen"><A HREF = "JavaScript:parent.ColorSelected( 'linen' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "antiquewhite"><A HREF = "JavaScript:parent.ColorSelected( 'antiquewhite' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "salmon"><A HREF = "JavaScript:parent.ColorSelected( 'salmon' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "ghostwhite"><A HREF = "JavaScript:parent.ColorSelected( 'ghostwhite' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "mintcream"><A HREF = "JavaScript:parent.ColorSelected( 'mintcream' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "whitesmoke"><A HREF = "JavaScript:parent.ColorSelected( 'whitesmoke' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	</TR><TR>
	<TD BGCOLOR = "beige"><A HREF = "JavaScript:parent.ColorSelected( 'beige' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "wheat"><A HREF = "JavaScript:parent.ColorSelected( 'wheat' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "sandybrown"><A HREF = "JavaScript:parent.ColorSelected( 'sandybrown' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "azure"><A HREF = "JavaScript:parent.ColorSelected( 'azure' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "honeydew"><A HREF = "JavaScript:parent.ColorSelected( 'honeydew' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "aliceblue"><A HREF = "JavaScript:parent.ColorSelected( 'aliceblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "khaki"><A HREF = "JavaScript:parent.ColorSelected( 'khaki' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lightcoral"><A HREF = "JavaScript:parent.ColorSelected( 'lightcoral' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "palegoldenrod"><A HREF = "JavaScript:parent.ColorSelected( 'palegoldenrod' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "violet"><A HREF = "JavaScript:parent.ColorSelected( 'violet' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darksalmon"><A HREF = "JavaScript:parent.ColorSelected( 'darksalmon' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lavender"><A HREF = "JavaScript:parent.ColorSelected( 'lavender' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lightcyan"><A HREF = "JavaScript:parent.ColorSelected( 'lightcyan' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	</TR><TR>
	<TD BGCOLOR = "burlywood"><A HREF = "JavaScript:parent.ColorSelected( 'burlywood' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "plum"><A HREF = "JavaScript:parent.ColorSelected( 'plum' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "gainsboro"><A HREF = "JavaScript:parent.ColorSelected( 'gainsboro' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "crimson"><A HREF = "JavaScript:parent.ColorSelected( 'crimson' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "palevioletred"><A HREF = "JavaScript:parent.ColorSelected( 'palevioletred' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "goldenrod"><A HREF = "JavaScript:parent.ColorSelected( 'goldenrod' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "orchid"><A HREF = "JavaScript:parent.ColorSelected( 'orchid' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "thistle"><A HREF = "JavaScript:parent.ColorSelected( 'thistle' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lightgrey"><A HREF = "JavaScript:parent.ColorSelected( 'lightgrey' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "tan"><A HREF = "JavaScript:parent.ColorSelected( 'tan' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "chocolate"><A HREF = "JavaScript:parent.ColorSelected( 'chocolate' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "peru"><A HREF = "JavaScript:parent.ColorSelected( 'peru' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "indianred"><A HREF = "JavaScript:parent.ColorSelected( 'indianred' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	</TR><TR>
	<TD BGCOLOR = "mediumvioletred"><A HREF = "JavaScript:parent.ColorSelected( 'mediumvioletred' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "silver"><A HREF = "JavaScript:parent.ColorSelected( 'silver' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkkhaki"><A HREF = "JavaScript:parent.ColorSelected( 'darkkhaki' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "rosybrown"><A HREF = "JavaScript:parent.ColorSelected( 'rosybrown' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "mediumorchid"><A HREF = "JavaScript:parent.ColorSelected( 'mediumorchid' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkgoldenrod"><A HREF = "JavaScript:parent.ColorSelected( 'darkgoldenrod' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "firebrick"><A HREF = "JavaScript:parent.ColorSelected( 'firebrick' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "powderblue"><A HREF = "JavaScript:parent.ColorSelected( 'powderblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lightsteelblue"><A HREF = "JavaScript:parent.ColorSelected( 'lightsteelblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "paleturquoise"><A HREF = "JavaScript:parent.ColorSelected( 'paleturquoise' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "greenyellow"><A HREF = "JavaScript:parent.ColorSelected( 'greenyellow' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lightblue"><A HREF = "JavaScript:parent.ColorSelected( 'lightblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkgray"><A HREF = "JavaScript:parent.ColorSelected( 'darkgray' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	</TR><TR>
	<TD BGCOLOR = "brown"><A HREF = "JavaScript:parent.ColorSelected( 'brown' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "sienna"><A HREF = "JavaScript:parent.ColorSelected( 'sienna' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "yellowgreen"><A HREF = "JavaScript:parent.ColorSelected( 'yellowgreen' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkorchid"><A HREF = "JavaScript:parent.ColorSelected( 'darkorchid' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "palegreen"><A HREF = "JavaScript:parent.ColorSelected( 'palegreen' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkviolet"><A HREF = "JavaScript:parent.ColorSelected( 'darkviolet' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "mediumpurple"><A HREF = "JavaScript:parent.ColorSelected( 'mediumpurple' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lightgreen"><A HREF = "JavaScript:parent.ColorSelected( 'lightgreen' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkseagreen"><A HREF = "JavaScript:parent.ColorSelected( 'darkseagreen' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "saddlebrown"><A HREF = "JavaScript:parent.ColorSelected( 'saddlebrown' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkmagenta"><A HREF = "JavaScript:parent.ColorSelected( 'darkmagenta' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkred"><A HREF = "JavaScript:parent.ColorSelected( 'darkred' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "blueviolet"><A HREF = "JavaScript:parent.ColorSelected( 'blueviolet' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	</TR><TR>
	<TD BGCOLOR = "lightskyblue"><A HREF = "JavaScript:parent.ColorSelected( 'lightskyblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "skyblue"><A HREF = "JavaScript:parent.ColorSelected( 'skyblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "gray"><A HREF = "JavaScript:parent.ColorSelected( 'gray' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "olive"><A HREF = "JavaScript:parent.ColorSelected( 'olive' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "purple"><A HREF = "JavaScript:parent.ColorSelected( 'purple' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "maroon"><A HREF = "JavaScript:parent.ColorSelected( 'maroon' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "aquamarine"><A HREF = "JavaScript:parent.ColorSelected( 'aquamarine' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "chartreuse"><A HREF = "JavaScript:parent.ColorSelected( 'chartreuse' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lawngreen"><A HREF = "JavaScript:parent.ColorSelected( 'lawngreen' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "mediumslateblue"><A HREF = "JavaScript:parent.ColorSelected( 'mediumslateblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lightslategray"><A HREF = "JavaScript:parent.ColorSelected( 'lightslategray' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "slategray"><A HREF = "JavaScript:parent.ColorSelected( 'slategray' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "olivedrab"><A HREF = "JavaScript:parent.ColorSelected( 'olivedrab' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	</TR><TR>
	<TD BGCOLOR = "slateblue"><A HREF = "JavaScript:parent.ColorSelected( 'slateblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "dimgray"><A HREF = "JavaScript:parent.ColorSelected( 'dimgray' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "mediumaquamarine"><A HREF = "JavaScript:parent.ColorSelected( 'mediumaquamarine' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "cornflowerblue"><A HREF = "JavaScript:parent.ColorSelected( 'cornflowerblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "cadetblue"><A HREF = "JavaScript:parent.ColorSelected( 'cadetblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkolivegreen"><A HREF = "JavaScript:parent.ColorSelected( 'darkolivegreen' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "indigo"><A HREF = "JavaScript:parent.ColorSelected( 'indigo' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "mediumturquoise"><A HREF = "JavaScript:parent.ColorSelected( 'mediumturquoise' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkslateblue"><A HREF = "JavaScript:parent.ColorSelected( 'darkslateblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "steelblue"><A HREF = "JavaScript:parent.ColorSelected( 'steelblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "royalblue"><A HREF = "JavaScript:parent.ColorSelected( 'royalblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "turquoise"><A HREF = "JavaScript:parent.ColorSelected( 'turquoise' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "mediumseagreen"><A HREF = "JavaScript:parent.ColorSelected( 'mediumseagreen' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	</TR><TR>
	<TD BGCOLOR = "limegreen"><A HREF = "JavaScript:parent.ColorSelected( 'limegreen' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkslategray"><A HREF = "JavaScript:parent.ColorSelected( 'darkslategray' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "seagreen"><A HREF = "JavaScript:parent.ColorSelected( 'seagreen' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "forestgreen"><A HREF = "JavaScript:parent.ColorSelected( 'forestgreen' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lightseagreen"><A HREF = "JavaScript:parent.ColorSelected( 'lightseagreen' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "dodgerblue"><A HREF = "JavaScript:parent.ColorSelected( 'dodgerblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "midnightblue"><A HREF = "JavaScript:parent.ColorSelected( 'midnightblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "cyan"><A HREF = "JavaScript:parent.ColorSelected( 'cyan' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "aqua"><A HREF = "JavaScript:parent.ColorSelected( 'aqua' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "springgreen"><A HREF = "JavaScript:parent.ColorSelected( 'springgreen' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "lime"><A HREF = "JavaScript:parent.ColorSelected( 'lime' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "mediumspringgreen"><A HREF = "JavaScript:parent.ColorSelected( 'mediumspringgreen' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkturquoise"><A HREF = "JavaScript:parent.ColorSelected( 'darkturquoise' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	</TR><TR>
	<TD BGCOLOR = "deepskyblue"><A HREF = "JavaScript:parent.ColorSelected( 'deepskyblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkcyan"><A HREF = "JavaScript:parent.ColorSelected( 'darkcyan' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "teal"><A HREF = "JavaScript:parent.ColorSelected( 'teal' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "green"><A HREF = "JavaScript:parent.ColorSelected( 'green' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkgreen"><A HREF = "JavaScript:parent.ColorSelected( 'darkgreen' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "blue"><A HREF = "JavaScript:parent.ColorSelected( 'blue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "mediumblue"><A HREF = "JavaScript:parent.ColorSelected( 'mediumblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "darkblue"><A HREF = "JavaScript:parent.ColorSelected( 'darkblue' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "navy"><A HREF = "JavaScript:parent.ColorSelected( 'navy' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "black"><A HREF = "JavaScript:parent.ColorSelected( 'black' );"><IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" BORDER = 0 WIDTH = 20 HEIGHT = 20></A></TD>
	<TD BGCOLOR = "#ffffff">&nbsp;</TD>
	<TD BGCOLOR = "#ffffff">&nbsp;</TD>
	<TD BGCOLOR = "#ffffff">&nbsp;</TD>
	</TR>
	</TABLE>
	</TD></TR>
	</TABLE>
	</BODY>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_ColorSelector">
	<HEAD>
	<TITLE>
	<MvLOCALIZED ID = "MER-ADM-00740">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Color Selector</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	</TITLE>
	<MvIF EXPR = "{ g.Secure }">
		<BASE HREF = "{ g.secure_baseurl }">
	<MvELSE>
		<BASE HREF = "{ g.baseurl }">
	</MvIF>

	<MvLOCALIZED NAME = "g.red_text" ID = "MER-ADM-00794">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Red:</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvLOCALIZED NAME = "g.green_text" ID = "MER-ADM-00795">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Green:</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvLOCALIZED NAME = "g.blue_text" ID = "MER-ADM-00796">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Blue:</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvLOCALIZED NAME = "g.color_text" ID = "MER-ADM-00797">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Color:</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvLOCALIZED NAME = "g.save_text" ID = "MER-ADM-00798">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Save</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvLOCALIZED NAME = "g.cancel_text" ID = "MER-ADM-00799">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Cancel</MvLOCALIZED-TEXT>
	</MvLOCALIZED>


	<MvEVAL EXPR = "{ JavaScript_SetVariables( 's', 'miva_language' ) }">
	<MvEVAL EXPR = "{ JavaScript_SetVariables( 'g', 'red_text, green_text, blue_text, color_text, save_text, cancel_text, Form, Field' ) }">


	<SCRIPT LANGUAGE = "JavaScript">
	<!--
	var i = 0;
	var Colors = new Array( 140 );
	var Red = new Array( 140 );
	var Green = new Array( 140 );
	var Blue = new Array( 140 );

	Colors[ i ] = 'white';					Red[ i ] = 255;	Green[ i ] = 255;	Blue[ i++ ] = 255;
	Colors[ i ] = 'ivory';					Red[ i ] = 255;	Green[ i ] = 255;	Blue[ i++ ] = 240;
	Colors[ i ] = 'lightyellow';			Red[ i ] = 255;	Green[ i ] = 255;	Blue[ i++ ] = 224;
	Colors[ i ] = 'yellow';					Red[ i ] = 255;	Green[ i ] = 255;	Blue[ i++ ] = 0;
	Colors[ i ] = 'snow';					Red[ i ] = 255;	Green[ i ] = 250;	Blue[ i++ ] = 250;
	Colors[ i ] = 'floralwhite';			Red[ i ] = 255;	Green[ i ] = 250;	Blue[ i++ ] = 240;
	Colors[ i ] = 'lemonchiffon';			Red[ i ] = 255;	Green[ i ] = 250;	Blue[ i++ ] = 205;
	Colors[ i ] = 'cornsilk';				Red[ i ] = 255;	Green[ i ] = 248;	Blue[ i++ ] = 220;
	Colors[ i ] = 'seashell';				Red[ i ] = 255;	Green[ i ] = 245;	Blue[ i++ ] = 238;
	Colors[ i ] = 'lavenderblush';			Red[ i ] = 255;	Green[ i ] = 240;	Blue[ i++ ] = 245;
	Colors[ i ] = 'papayawhip';				Red[ i ] = 255;	Green[ i ] = 239;	Blue[ i++ ] = 213;
	Colors[ i ] = 'blanchedalmond';			Red[ i ] = 255; Green[ i ] = 235;	Blue[ i++ ] = 205;
	Colors[ i ] = 'mistyrose';				Red[ i ] = 255; Green[ i ] = 228;	Blue[ i++ ] = 225;
	Colors[ i ] = 'bisque';					Red[ i ] = 255; Green[ i ] = 228;	Blue[ i++ ] = 196;
	Colors[ i ] = 'moccasin';				Red[ i ] = 255; Green[ i ] = 228;	Blue[ i++ ] = 181;
	Colors[ i ] = 'navajowhite';			Red[ i ] = 255; Green[ i ] = 222;	Blue[ i++ ] = 173;
	Colors[ i ] = 'peachpuff';				Red[ i ] = 255; Green[ i ] = 218;	Blue[ i++ ] = 185;
	Colors[ i ] = 'gold';					Red[ i ] = 255; Green[ i ] = 215;	Blue[ i++ ] = 0;
	Colors[ i ] = 'pink';					Red[ i ] = 255; Green[ i ] = 192;	Blue[ i++ ] = 203;
	Colors[ i ] = 'lightpink';				Red[ i ] = 255; Green[ i ] = 182;	Blue[ i++ ] = 193;
	Colors[ i ] = 'orange';					Red[ i ] = 255;	Green[ i ] = 165;	Blue[ i++ ] = 0;
	Colors[ i ] = 'lightsalmon';			Red[ i ] = 255; Green[ i ] = 160;	Blue[ i++ ] = 122;
	Colors[ i ] = 'darkorange';				Red[ i ] = 255; Green[ i ] = 140;	Blue[ i++ ] = 0;
	Colors[ i ] = 'coral';					Red[ i ] = 255; Green[ i ] = 127;	Blue[ i++ ] = 80;
	Colors[ i ] = 'hotpink';				Red[ i ] = 255; Green[ i ] = 105;	Blue[ i++ ] = 180;
	Colors[ i ] = 'tomato';					Red[ i ] = 255; Green[ i ] = 99;	Blue[ i++ ] = 71;
	Colors[ i ] = 'orangered';				Red[ i ] = 255; Green[ i ] = 69;	Blue[ i++ ] = 0;
	Colors[ i ] = 'deeppink';				Red[ i ] = 255; Green[ i ] = 20;	Blue[ i++ ] = 147;
	Colors[ i ] = 'magenta';				Red[ i ] = 255; Green[ i ] = 0;		Blue[ i++ ] = 255;
	Colors[ i ] = 'fuchsia';				Red[ i ] = 255; Green[ i ] = 0;		Blue[ i++ ] = 255;
	Colors[ i ] = 'red';					Red[ i ] = 255; Green[ i ] = 0;		Blue[ i++ ] = 0;
	Colors[ i ] = 'oldlace';				Red[ i ] = 253; Green[ i ] = 245;	Blue[ i++ ] = 230;
	Colors[ i ] = 'lightgoldenrodyellow';	Red[ i ] = 250;	Green[ i ] = 250;	Blue[ i++ ] = 210;
	Colors[ i ] = 'linen';					Red[ i ] = 250; Green[ i ] = 240;	Blue[ i++ ] = 230;
	Colors[ i ] = 'antiquewhite';			Red[ i ] = 250; Green[ i ] = 235;	Blue[ i++ ] = 215;
	Colors[ i ] = 'salmon';					Red[ i ] = 250; Green[ i ] = 128;	Blue[ i++ ] = 114;
	Colors[ i ] = 'ghostwhite';				Red[ i ] = 248; Green[ i ] = 248;	Blue[ i++ ] = 255;
	Colors[ i ] = 'mintcream';				Red[ i ] = 245; Green[ i ] = 255;	Blue[ i++ ] = 250;
	Colors[ i ] = 'whitesmoke';				Red[ i ] = 245; Green[ i ] = 245;	Blue[ i++ ] = 245;
	Colors[ i ] = 'beige';					Red[ i ] = 245; Green[ i ] = 245;	Blue[ i++ ] = 220;
	Colors[ i ] = 'wheat';					Red[ i ] = 245; Green[ i ] = 222;	Blue[ i++ ] = 179;
	Colors[ i ] = 'sandybrown';				Red[ i ] = 244; Green[ i ] = 164;	Blue[ i++ ] = 96;
	Colors[ i ] = 'azure';					Red[ i ] = 240; Green[ i ] = 255;	Blue[ i++ ] = 255;
	Colors[ i ] = 'honeydew';				Red[ i ] = 240; Green[ i ] = 255;	Blue[ i++ ] = 240;
	Colors[ i ] = 'aliceblue';				Red[ i ] = 240; Green[ i ] = 248;	Blue[ i++ ] = 255;
	Colors[ i ] = 'khaki';					Red[ i ] = 240; Green[ i ] = 230;	Blue[ i++ ] = 140;
	Colors[ i ] = 'lightcoral';				Red[ i ] = 240;	Green[ i ] = 128;	Blue[ i++ ] = 128;
	Colors[ i ] = 'palegoldenrod';			Red[ i ] = 238; Green[ i ] = 232;	Blue[ i++ ] = 170;
	Colors[ i ] = 'violet';					Red[ i ] = 238; Green[ i ] = 130;	Blue[ i++ ] = 238;
	Colors[ i ] = 'darksalmon';				Red[ i ] = 233; Green[ i ] = 150;	Blue[ i++ ] = 122;
	Colors[ i ] = 'lavender';				Red[ i ] = 230; Green[ i ] = 230;	Blue[ i++ ] = 250;
	Colors[ i ] = 'lightcyan';				Red[ i ] = 224; Green[ i ] = 255;	Blue[ i++ ] = 255;
	Colors[ i ] = 'burlywood';				Red[ i ] = 222; Green[ i ] = 184;	Blue[ i++ ] = 135;
	Colors[ i ] = 'plum';					Red[ i ] = 221; Green[ i ] = 160;	Blue[ i++ ] = 221;
	Colors[ i ] = 'gainsboro';				Red[ i ] = 220; Green[ i ] = 220;	Blue[ i++ ] = 220;
	Colors[ i ] = 'crimson';				Red[ i ] = 220; Green[ i ] = 20;	Blue[ i++ ] = 60;
	Colors[ i ] = 'palevioletred';			Red[ i ] = 219; Green[ i ] = 112;	Blue[ i++ ] = 147;
	Colors[ i ] = 'goldenrod';				Red[ i ] = 218; Green[ i ] = 165;	Blue[ i++ ] = 32;
	Colors[ i ] = 'orchid';					Red[ i ] = 218; Green[ i ] = 112;	Blue[ i++ ] = 214;
	Colors[ i ] = 'thistle';				Red[ i ] = 216; Green[ i ] = 191;	Blue[ i++ ] = 216;
	Colors[ i ] = 'lightgrey';				Red[ i ] = 211; Green[ i ] = 211;	Blue[ i++ ] = 211;
	Colors[ i ] = 'tan';					Red[ i ] = 210; Green[ i ] = 180;	Blue[ i++ ] = 140;
	Colors[ i ] = 'chocolate';				Red[ i ] = 210; Green[ i ] = 105;	Blue[ i++ ] = 30;
	Colors[ i ] = 'peru';					Red[ i ] = 205; Green[ i ] = 133;	Blue[ i++ ] = 63;
	Colors[ i ] = 'indianred';				Red[ i ] = 205; Green[ i ] = 92;	Blue[ i++ ] = 92;
	Colors[ i ] = 'mediumvioletred';		Red[ i ] = 199; Green[ i ] = 21;	Blue[ i++ ] = 133;
	Colors[ i ] = 'silver';					Red[ i ] = 192; Green[ i ] = 192;	Blue[ i++ ] = 192;
	Colors[ i ] = 'darkkhaki';				Red[ i ] = 189; Green[ i ] = 183;	Blue[ i++ ] = 107;
	Colors[ i ] = 'rosybrown';				Red[ i ] = 188; Green[ i ] = 143;	Blue[ i++ ] = 143;
	Colors[ i ] = 'mediumorchid';			Red[ i ] = 186; Green[ i ] = 85;	Blue[ i++ ] = 211;
	Colors[ i ] = 'darkgoldenrod';			Red[ i ] = 184; Green[ i ] = 134;	Blue[ i++ ] = 11;
	Colors[ i ] = 'firebrick';				Red[ i ] = 178; Green[ i ] = 34;	Blue[ i++ ] = 34;
	Colors[ i ] = 'powderblue';				Red[ i ] = 176; Green[ i ] = 224;	Blue[ i++ ] = 230;
	Colors[ i ] = 'lightsteelblue';			Red[ i ] = 176; Green[ i ] = 196;	Blue[ i++ ] = 222;
	Colors[ i ] = 'paleturquoise';			Red[ i ] = 175; Green[ i ] = 238;	Blue[ i++ ] = 238;
	Colors[ i ] = 'greenyellow';			Red[ i ] = 173; Green[ i ] = 255;	Blue[ i++ ] = 47;
	Colors[ i ] = 'lightblue';				Red[ i ] = 173; Green[ i ] = 216;	Blue[ i++ ] = 230;
	Colors[ i ] = 'darkgray';				Red[ i ] = 169; Green[ i ] = 169;	Blue[ i++ ] = 169;
	Colors[ i ] = 'brown';					Red[ i ] = 165; Green[ i ] = 42;	Blue[ i++ ] = 42;
	Colors[ i ] = 'sienna';					Red[ i ] = 160; Green[ i ] = 82;	Blue[ i++ ] = 45;
	Colors[ i ] = 'yellowgreen';			Red[ i ] = 154; Green[ i ] = 205;	Blue[ i++ ] = 50;
	Colors[ i ] = 'darkorchid';				Red[ i ] = 153; Green[ i ] = 50;	Blue[ i++ ] = 204;
	Colors[ i ] = 'palegreen';				Red[ i ] = 152; Green[ i ] = 251;	Blue[ i++ ] = 152;
	Colors[ i ] = 'darkviolet';				Red[ i ] = 148; Green[ i ] = 0;		Blue[ i++ ] = 211;
	Colors[ i ] = 'mediumpurple';			Red[ i ] = 147; Green[ i ] = 112;	Blue[ i++ ] = 219;
	Colors[ i ] = 'lightgreen';				Red[ i ] = 144; Green[ i ] = 238;	Blue[ i++ ] = 144;
	Colors[ i ] = 'darkseagreen';			Red[ i ] = 143; Green[ i ] = 188;	Blue[ i++ ] = 143;
	Colors[ i ] = 'saddlebrown';			Red[ i ] = 139; Green[ i ] = 69;	Blue[ i++ ] = 19;
	Colors[ i ] = 'darkmagenta';			Red[ i ] = 139; Green[ i ] = 0;		Blue[ i++ ] = 139;
	Colors[ i ] = 'darkred';				Red[ i ] = 139; Green[ i ] = 0;		Blue[ i++ ] = 0;
	Colors[ i ] = 'blueviolet';				Red[ i ] = 138; Green[ i ] = 43;	Blue[ i++ ] = 226;
	Colors[ i ] = 'lightskyblue';			Red[ i ] = 135; Green[ i ] = 206;	Blue[ i++ ] = 250;
	Colors[ i ] = 'skyblue';				Red[ i ] = 135; Green[ i ] = 206;	Blue[ i++ ] = 235;
	Colors[ i ] = 'gray';					Red[ i ] = 128; Green[ i ] = 128;	Blue[ i++ ] = 128;
	Colors[ i ] = 'olive';					Red[ i ] = 128; Green[ i ] = 128;	Blue[ i++ ] = 0;
	Colors[ i ] = 'purple';					Red[ i ] = 128; Green[ i ] = 0;		Blue[ i++ ] = 128;
	Colors[ i ] = 'maroon';					Red[ i ] = 128; Green[ i ] = 0;		Blue[ i++ ] = 0;
	Colors[ i ] = 'aquamarine';				Red[ i ] = 127; Green[ i ] = 255;	Blue[ i++ ] = 212;
	Colors[ i ] = 'chartreuse';				Red[ i ] = 127; Green[ i ] = 255;	Blue[ i++ ] = 0;
	Colors[ i ] = 'lawngreen';				Red[ i ] = 124; Green[ i ] = 252;	Blue[ i++ ] = 0;
	Colors[ i ] = 'mediumslateblue';		Red[ i ] = 123; Green[ i ] = 104;	Blue[ i++ ] = 238;
	Colors[ i ] = 'lightslategray';			Red[ i ] = 119; Green[ i ] = 136;	Blue[ i++ ] = 153;
	Colors[ i ] = 'slategray';				Red[ i ] = 112; Green[ i ] = 128;	Blue[ i++ ] = 144;
	Colors[ i ] = 'olivedrab';				Red[ i ] = 107; Green[ i ] = 142;	Blue[ i++ ] = 35;
	Colors[ i ] = 'slateblue';				Red[ i ] = 106; Green[ i ] = 90;	Blue[ i++ ] = 205;
	Colors[ i ] = 'dimgray';				Red[ i ] = 105; Green[ i ] = 105;	Blue[ i++ ] = 105;
	Colors[ i ] = 'mediumaquamarine';		Red[ i ] = 102; Green[ i ] = 205;	Blue[ i++ ] = 170;
	Colors[ i ] = 'cornflowerblue';			Red[ i ] = 100; Green[ i ] = 149;	Blue[ i++ ] = 237;
	Colors[ i ] = 'cadetblue';				Red[ i ] = 95; 	Green[ i ] = 158;	Blue[ i++ ] = 160;
	Colors[ i ] = 'darkolivegreen';			Red[ i ] = 85; 	Green[ i ] = 107;	Blue[ i++ ] = 47;
	Colors[ i ] = 'indigo';					Red[ i ] = 75; 	Green[ i ] = 0;		Blue[ i++ ] = 130;
	Colors[ i ] = 'mediumturquoise';		Red[ i ] = 72; 	Green[ i ] = 209;	Blue[ i++ ] = 204;
	Colors[ i ] = 'darkslateblue';			Red[ i ] = 72; 	Green[ i ] = 61;	Blue[ i++ ] = 139;
	Colors[ i ] = 'steelblue';				Red[ i ] = 70; 	Green[ i ] = 130;	Blue[ i++ ] = 180;
	Colors[ i ] = 'royalblue';				Red[ i ] = 65; 	Green[ i ] = 105;	Blue[ i++ ] = 225;
	Colors[ i ] = 'turquoise';				Red[ i ] = 64; 	Green[ i ] = 224;	Blue[ i++ ] = 208;
	Colors[ i ] = 'mediumseagreen';			Red[ i ] = 60; 	Green[ i ] = 179;	Blue[ i++ ] = 113;
	Colors[ i ] = 'limegreen';				Red[ i ] = 50; 	Green[ i ] = 205;	Blue[ i++ ] = 50;
	Colors[ i ] = 'darkslategray';			Red[ i ] = 47; 	Green[ i ] = 79;	Blue[ i++ ] = 79;
	Colors[ i ] = 'seagreen';				Red[ i ] = 46; 	Green[ i ] = 139;	Blue[ i++ ] = 87;
	Colors[ i ] = 'forestgreen';			Red[ i ] = 34; 	Green[ i ] = 139;	Blue[ i++ ] = 34;
	Colors[ i ] = 'lightseagreen';			Red[ i ] = 32; 	Green[ i ] = 178;	Blue[ i++ ] = 170;
	Colors[ i ] = 'dodgerblue';				Red[ i ] = 30; 	Green[ i ] = 144;	Blue[ i++ ] = 255;
	Colors[ i ] = 'midnightblue';			Red[ i ] = 25; 	Green[ i ] = 25;	Blue[ i++ ] = 112;
	Colors[ i ] = 'cyan';					Red[ i ] = 0; 	Green[ i ] = 255;	Blue[ i++ ] = 255;
	Colors[ i ] = 'aqua';					Red[ i ] = 0; 	Green[ i ] = 255;	Blue[ i++ ] = 255;
	Colors[ i ] = 'springgreen';			Red[ i ] = 0; 	Green[ i ] = 255;	Blue[ i++ ] = 127;
	Colors[ i ] = 'lime';					Red[ i ] = 0; 	Green[ i ] = 255;	Blue[ i++ ] = 0;
	Colors[ i ] = 'mediumspringgreen';		Red[ i ] = 0; 	Green[ i ] = 250;	Blue[ i++ ] = 154;
	Colors[ i ] = 'darkturquoise';			Red[ i ] = 0; 	Green[ i ] = 206;	Blue[ i++ ] = 209;
	Colors[ i ] = 'deepskyblue';			Red[ i ] = 0; 	Green[ i ] = 191;	Blue[ i++ ] = 255;
	Colors[ i ] = 'darkcyan';				Red[ i ] = 0; 	Green[ i ] = 139;	Blue[ i++ ] = 139;
	Colors[ i ] = 'teal';					Red[ i ] = 0; 	Green[ i ] = 128;	Blue[ i++ ] = 128;
	Colors[ i ] = 'green';					Red[ i ] = 0; 	Green[ i ] = 128;	Blue[ i++ ] = 0;
	Colors[ i ] = 'darkgreen';				Red[ i ] = 0; 	Green[ i ] = 100;	Blue[ i++ ] = 0;
	Colors[ i ] = 'blue';					Red[ i ] = 0; 	Green[ i ] = 0;		Blue[ i++ ] = 255;
	Colors[ i ] = 'mediumblue';				Red[ i ] = 0;	Green[ i ] = 0;		Blue[ i++ ] = 205;
	Colors[ i ] = 'darkblue';				Red[ i ] = 0;	Green[ i ] = 0;		Blue[ i++ ] = 139;
	Colors[ i ] = 'navy';					Red[ i ] = 0; 	Green[ i ] = 0;		Blue[ i++ ] = 128;
	Colors[ i ] = 'black';					Red[ i ] = 0; 	Green[ i ] = 0;		Blue[ i++ ] = 0;

	function DrawColorTable()
	{
		window.ColorTable.document.open();
		window.ColorTable.document.writeln( '<HTML><HEAD><TITLE>Color Table</TITLE></HEAD>' );
		window.ColorTable.document.writeln( '<BODY BGCOLOR = "#ffffff">' );
		window.ColorTable.document.writeln( '<TABLE BORDER = 0 CELLPADDING = 0 CELLSPACING = 0>' );
		window.ColorTable.document.writeln( '<TR><TD BGCOLOR = "#000000">' );
		window.ColorTable.document.writeln( '<TABLE BORDER = 0 CELLPADDING = 0 CELLSPACING = 1>' );
		window.ColorTable.document.writeln( '<TR>' );

		for ( i = 0; i < Colors.length; i++)
		{
			if ( ( i && ( i % 13 ) == 0 ) )
			{
				window.ColorTable.document.writeln( '</TR><TR>' );
			}

			window.ColorTable.document.writeln( '<TD BGCOLOR = "' + Colors[ i ] + '">' );
			window.ColorTable.document.writeln( '<A HREF = "JavaScript:parent.ColorSelected( \'' + Colors[ i ] + '\', ' + Red[ i ] + ', ' + Green[ i ] + ', ' + Blue[ i ] + ' );">' );
			window.ColorTable.document.writeln( '<IMG SRC = "graphics/' + miva_language + '/admin/blank.gif" BORDER = 0 WIDTH = 20 HEIGHT = 20></A>' );
			window.ColorTable.document.writeln( '</TD>' );
		}

		if ( i % 13 )
		{
			for ( j = 0; j < ( 13 - ( i % 13 ) ); j++ )
			{
				window.ColorTable.document.writeln( '<TD BGCOLOR = "#ffffff">&nbsp;</TD>' );
			}
		}

		window.ColorTable.document.writeln( '</TR>' );
		window.ColorTable.document.writeln( '</TABLE>' );
		window.ColorTable.document.writeln( '</TD></TR>' );
		window.ColorTable.document.writeln( '</TABLE>' );
		window.ColorTable.document.writeln( '</BODY>' );
		window.ColorTable.document.writeln( '</HTML>' );
		window.ColorTable.document.close();
	}

	function DrawColorExample( color )
	{
		window.ColorExample.document.open();
		window.ColorExample.document.writeln( '<HTML>' );
		window.ColorExample.document.writeln( '<HEAD><TITLE>T</TITLE></HEAD>' );
		window.ColorExample.document.writeln( '<BODY BGCOLOR = "#ffffff">' );
		window.ColorExample.document.writeln( '<TABLE BORDER = 0 WIDTH = "100%" HEIGHT = "50%">' );
		window.ColorExample.document.writeln( '<TR HEIGHT = "50%"><TD WIDTH = "100%" BGCOLOR = "' + color + '">&nbsp;</TD></TR>' );
		window.ColorExample.document.writeln( '</TABLE>' );
		window.ColorExample.document.writeln( '</BODY>' );
		window.ColorExample.document.writeln( '</HTML>' );
		window.ColorExample.document.close();
	}

	function DrawColorForm( color )
	{
		var red = 0;
		var green = 0;
		var blue = 0;

		for ( i = 0; i < Colors.length; i++ )
		{
			if ( Colors[ i ] == color )
			{
				red = Red[ i ];
				green = Green[ i ];
				blue = Blue[ i ];

				break;
			}
		}

		if ( i >= Colors.length )
		{
			if ( color.charAt( 0 ) == '#' )
			{
				red = parseInt( color.substring( 1, 3 ), 16 );
				green = parseInt( color.substring( 3, 5 ), 16 );
				blue = parseInt( color.substring( 5, 7 ), 16 );
			}
		}

		window.ColorForm.document.open();
		window.ColorForm.document.writeln( '<HTML>' );
		window.ColorForm.document.writeln( '<HEAD><TITLE>E</TITLE></HEAD>' );
		window.ColorForm.document.writeln( '<BODY BGCOLOR = "#ffffff">' );
		window.ColorForm.document.writeln( '<FORM NAME = "ColorForm">' );
		window.ColorForm.document.writeln( '<TABLE BORDER = 0>' );
		window.ColorForm.document.writeln( '<TR><TD><FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>' + red_text + '</B></FONT></TD><TD><FONT FACE = "Arial, Helvetica" SIZE = "-1"><INPUT SIZE = 4 TYPE = "text" NAME = "Red" VALUE = "' + red + '" ONCHANGE = "parent.ColorFormChange();"></FONT></TD></TR>' );
		window.ColorForm.document.writeln( '<TR><TD><FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>' + green_text + '</B></FONT></TD><TD><FONT FACE = "Arial, Helvetica" SIZE = "-1"><INPUT SIZE = 4 TYPE = "text" NAME = "Green" VALUE = "' + green + '" ONCHANGE = "parent.ColorFormChange();"></FONT></TD></TR>' );
		window.ColorForm.document.writeln( '<TR><TD><FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>' + blue_text + '</B></FONT></TD><TD><FONT FACE = "Arial, Helvetica" SIZE = "-1"><INPUT SIZE = 4 TYPE = "text" NAME = "Blue" VALUE = "' + blue + '" ONCHANGE = "parent.ColorFormChange();"></FONT></TD></TR>' );
		window.ColorForm.document.writeln( '<TR><TD><FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>' + color_text + '</B></FONT></TD><TD><FONT FACE = "Arial, Helvetica" SIZE = "-1"><INPUT SIZE = 10 TYPE = "text" NAME = "Color" VALUE = "' + color + '" ONCHANGE = "parent.ColorFieldChange();"></FONT></TD></TR>' );
		window.ColorForm.document.writeln( '<TR><TD COLSPAN = 2 ALIGN = "right"><INPUT TYPE = "button" VALUE = "' + save_text + '" ONCLICK = "parent.SendColor();"> <INPUT TYPE = "button" VALUE = "' + cancel_text + '" ONCLICK = "parent.close();"></TD></TR>' );
		window.ColorForm.document.writeln( '</TABLE>' );
		window.ColorForm.document.writeln( '</FORM>' );
		window.ColorForm.document.writeln( '</BODY>' );
		window.ColorForm.document.writeln( '</HTML>' );
		window.ColorForm.document.close();
	}

	function DrawFrames()
	{
		DrawColorTable();
		DrawColorExample( '#ffffff' );
		DrawColorForm( 'colorname', 255, 255, 255 );
	}

	function ColorSelected( color )
	{
		var red = 0;
		var green = 0;
		var blue = 0;

		for ( i = 0; i < Colors.length; i++ )
		{
			if ( Colors[ i ] == color )
			{
				red = Red[ i ];
				green = Green[ i ];
				blue = Blue[ i ];

				break;
			}
		}

		DrawColorExample( color );

		window.ColorForm.document.ColorForm.Red.value = red;
		window.ColorForm.document.ColorForm.Green.value = green;
		window.ColorForm.document.ColorForm.Blue.value = blue;
		window.ColorForm.document.ColorForm.Color.value = color;
	}

	function ColorFormChange()
	{
		var color;
		var value;

		color = '#';

		value = parseInt( window.ColorForm.document.ColorForm.Red.value ).toString( 16 );
		if ( value.length == 1 )
		{
			color += '0';
		}

		color += value;

		value = parseInt( window.ColorForm.document.ColorForm.Green.value ).toString( 16 );
		if ( value.length == 1 )
		{
			color += '0';
		}

		color += value;

		value = parseInt( window.ColorForm.document.ColorForm.Blue.value ).toString( 16 );
		if ( value.length == 1 )
		{
			color += '0';
		}

		color += value;

		window.ColorForm.document.ColorForm.Color.value = color;
		DrawColorExample( color );
	}

	function ColorFieldChange()
	{
		var red = 0;
		var green = 0;
		var blue = 0;
		var color = window.ColorForm.document.ColorForm.Color.value;

		for ( i = 0; i < Colors.length; i++ )
		{
			if ( Colors[ i ] == color )
			{
				red = Red[ i ];
				green = Green[ i ];
				blue = Blue[ i ];

				break;
			}
		}

		if ( i >= Colors.length )
		{
			if ( color.charAt( 0 ) == '#' )
			{
				red = parseInt( color.substring( 1, 3 ), 16 );
				green = parseInt( color.substring( 3, 5 ), 16 );
				blue = parseInt( color.substring( 5, 7 ), 16 );
			}
		}

		window.ColorForm.document.ColorForm.Red.value = red;
		window.ColorForm.document.ColorForm.Green.value = green;
		window.ColorForm.document.ColorForm.Blue.value = blue;

		DrawColorExample( color );
	}

	function SendColor()
	{
		parent.opener.document.forms[ Form ].elements[ Field ].value = window.ColorForm.document.ColorForm.Color.value;
		parent.close();
	}
	//-->
	</SCRIPT>
	</HEAD>

	<FRAMESET ROWS = "325, *" BGCOLOR = "#ffffff" BORDER = 0>
			<NOFRAMES>
				This page requires a browser that supports frames.
			</NOFRAMES>
			<FRAME NAME = "ColorTable" SRC = "{ g.sessionurl $ 'Screen=COLT' }" SCROLLING = "no" NORESIZE FRAMEBORDER = 0>
			<MvASSIGN NAME = "l.onload_var" VALUE = "{ ' DrawColorForm( \'' $ g.Color $ '\' );DrawColorExample( \'' $ g.Color $ '\' );' }"> 
			<FRAMESET COLS = "40%, 60%" ONLOAD = "{ l.onload_var }">
				<MvASSIGN NAME = "l.src_var" VALUE = "{ 'JavaScript: parent.DrawColorExample( \'' $ g.Color $ '\');' }">
				<FRAME NAME = "ColorExample" SRC = "JavaScript:' ' " SCROLLING = "no" NORESIZE FRAMEBORDER = 0>
				<FRAME NAME = "ColorForm" SRC = "JavaScript:' ' " SCROLLING = "no" NORESIZE FRAMEBORDER = 0>
			</FRAMESET>
	</FRAMESET>
	
	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>

<MvCOMMENT>
|
| File Upload
|
</MvCOMMENT>

<MvFUNCTION NAME = "Miva_ValidateFileUpload" PARAMETERS = "field, filename, content_type" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvASSIGN NAME = "l.maxfilesize" VALUE = "-1">

	<MvIF EXPR = "{ NOT g.Data_Opened }">
		<MvDO FILE = "lib/config.mv">

		<MvASSIGN NAME = "g.Version_Mismatch" VALUE = 0>
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ OpenDataFiles( g.Merchant_Version ) }">
		<MvIF EXPR = "{ NOT l.ok }">
			<MvIF EXPR = "{ NOT g.Version_Mismatch }">
				<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00013">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Miva Merchant has not been initialized.  Please use the Miva Merchant Setup script to initialize the required data files.</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-ADM-00003', l.error_message) }">
			</MvIF>
		<MvELSE>
			<MvASSIGN NAME = "g.Data_Opened" VALUE = 1>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.user_id" VALUE = "{ DetermineAdminUser() }">
		<MvIF EXPR = "{ l.user_id }">
			<MvIF EXPR = "{ ( g.FileUpload_Type EQ 'Module' ) OR
							( g.FileUpload_Type EQ 'Image' ) OR
							( g.FileUpload_Type EQ 'Data' ) OR
							( g.FileUpload_Type EQ 'Module_Data' ) }">
				<MvASSIGN NAME = "l.maxfilesize" VALUE = 0>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.maxfilesize }">
</MvFUNCTION>

<MvFUNCTION NAME = "Miva_ProcessFileUpload" PARAMETERS = "field, filename, status, tempfile, content_type, size" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ l.status EQ 'COMPLETE' }">
		<MvASSIGN NAME = "l.filename_nopath" VALUE = "{ glosub( l.filename, '\\', '/' ) }">
		<MvASSIGN NAME = "l.pos" VALUE = "{ '/' IN l.filename_nopath }">
		<MvASSIGN NAME = "l.len" VALUE = "{ len( l.filename_nopath ) }">

		<MvWHILE EXPR = "{ l.pos }">
			<MvASSIGN NAME = "l.filename_nopath" VALUE = "{ substring( l.filename_nopath, l.pos + 1, len( l.filename_nopath ) - l.pos ) }">

			<MvASSIGN NAME = "l.pos" VALUE = "{ '/' IN l.filename_nopath }">
			<MvASSIGN NAME = "l.len" VALUE = "{ len( l.filename_nopath ) }">
		</MvWHILE>

		<MvIF EXPR = "{ l.size EQ 0 }">
			<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-01531">
				<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ l.filename_nopath }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">The file '%module%' does not exist</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>

		<MvIF EXPR = "{ NOT g.FileUpload_Error }">
			<MvIF EXPR = "{ g.FileUpload_Type EQ 'Module' }">
				<MvASSIGN NAME = "l.ok" VALUE = "{ ProcessFileUpload_Module( l.tempfile, l.filename_nopath ) }">
			</MvIF>

			<MvIF EXPR = "{ g.FileUpload_Type EQ 'Image' }">
				<MvASSIGN NAME = "l.ok" VALUE = "{ ProcessFileUpload_Image( l.tempfile, l.filename_nopath ) }">
			</MvIF>

			<MvIF EXPR = "{ g.FileUpload_Type EQ 'Data' }">
				<MvASSIGN NAME = "l.ok" VALUE = "{ ProcessFileUpload_Data( l.tempfile, l.filename_nopath ) }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ g.FileUpload_Type EQ 'Module_Data' }">
			<MvIF EXPR = "{ g.FileUpload_Data }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code( g.FileUpload_Data ) }">
				<MvIF EXPR = "{ NOT l.ok }">
					<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00014">
						<MvLOCALIZED-TOKEN NAME = "fileupload_data" VALUE = "{ encodeentities( g.FileUpload_Data ) }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module code '%fileupload_data%' not found</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				<MvELSE>
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.mod_version" VALUE = "{ Module_API_Version() }">
					<MvIF EXPR = "{ l.mod_version GE 2.1 }">
						<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_ProcessFileUpload( l.tempfile, l.filename_nopath ) }">
					<MvELSE>
						<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00015">
							<MvLOCALIZED-TOKEN NAME = "module_data" VALUE = "{ encodeentities( Module_Data ) }">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Upload data type '%module_data%' requires API version 2.1 or better</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
					</MvIF>
				</MvIF>
			<MvELSE>
				<MvASSIGN NAME = "g.FileUpload_Error" VALUE = "">
				<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00016">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module code not specified for Module_Data upload</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ NOT l.ok }">
		<MvASSIGN NAME = "g.Error" VALUE = 1>
	</MvIF>
</MvFUNCTION>

<MvFUNCTION NAME = "ProcessFileUpload_Module" PARAMETERS = "tempfile, filename_nopath" STANDARDOUTPUTLEVEL = "text,html">
	<MvASSIGN NAME = "l.ok" VALUE = "{ fscopy( l.tempfile, g.Module_Root $ l.tempfile ) }">
	<MvIF EXPR = "{ NOT l.ok }">
		<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00017">
			<MvLOCALIZED-TOKEN NAME = "tempfile" VALUE = "{ l.tempfile }">
			<MvLOCALIZED-TOKEN NAME = "modulefile" VALUE = "{ g.Module_Root $ l.tempfile }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unable to copy '%tempfile%' to '%modulefile%'</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
	<MvELSE>
		<MvDO FILE = "{ g.Module_Root $ l.tempfile }" NAME = "l.module_type" VALUE = "{ Module_Type() }">
		<MvDO FILE = "{ g.Module_Root $ l.tempfile }" NAME = "l.module_code" VALUE = "{ Module_Code() }">
		<MvDO FILE = "{ g.Module_Root $ l.tempfile }" NAME = "l.module_name" VALUE = "{ Module_Name() }">
		<MvDO FILE = "{ g.Module_Root $ l.tempfile }" NAME = "l.module_provider" VALUE = "{ Module_Provider() }">
		<MvDO FILE = "{ g.Module_Root $ l.tempfile }" NAME = "l.module_api_version" VALUE = "{ Module_API_Version() }">
		<MvDO FILE = "{ g.Module_Root $ l.tempfile }" NAME = "l.module_version_number" VALUE = "{ Module_Version() }">

		<MvIF EXPR = "{ NOT g.FileUpload_Error }">
			<MvIF EXPR = "{ len( g.FileUpload_Data ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_Code( g.FileUpload_Data ) }">
				<MvIF EXPR = "{ l.found }">
					<MvIF EXPR = "{ Modules.d.code NE l.module_code }">
						<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00018">
							<MvLOCALIZED-TOKEN NAME = "modulename" VALUE = "{ Modules.d.name }">
							<MvLOCALIZED-TOKEN NAME = "filename" VALUE = "{ l.filename_nopath }">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module '%modulesname%' cannot be upgraded by '%filename%'</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
					<MvELSE>
						<MvIF EXPR = "{ Modules.d.version GT l.module_version_number }">
							<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00019">
								<MvLOCALIZED-TOKEN NAME = "filename" VALUE = "{ l.filename_nopath }">
								<MvLOCALIZED-TOKEN NAME = "moduleversion" VALUE = "{ l.module_version_number }">
								<MvLOCALIZED-TOKEN NAME = "installedversion" VALUE = "{ Modules.d.version }">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">The file '%filename%' is version %moduleversion%, which is older than the installed version, %installedversion%</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
						</MvIF>
					</MvIF>
				</MvIF>
			<MvELSE>
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_Code( l.module_code ) }">
				<MvIF EXPR = "{ l.found }">
					<MvIF EXPR = "{ Modules.d.version GT l.module_version_number }">
						<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00020">
							<MvLOCALIZED-TOKEN NAME = "filename" VALUE = "{ l.filename_nopath }">
							<MvLOCALIZED-TOKEN NAME = "moduleversion" VALUE = "{ l.module_version_number }">
							<MvLOCALIZED-TOKEN NAME = "installedversion" VALUE = "{ Modules.d.version }">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">The file '%filename%' is version %moduleversion%, which is older than the installed version, %installedversion%</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
					</MvIF>
				</MvIF>
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ NOT g.FileUpload_Error }">
			<MvASSIGN NAME = "l.path" VALUE = "{ g.Module_Path }">

			<MvIF EXPR = "{ l.module_type EQ 'UI' }">
				<MvASSIGN NAME = "l.path" VALUE = "{ l.path $ 'ui/' }">
			</MvIF>

			<MvIF EXPR = "{ l.module_type EQ 'CURRENCY' }">
				<MvASSIGN NAME = "l.path" VALUE = "{ l.path $ 'currency/' }">
			</MvIF>

			<MvIF EXPR = "{ l.module_type EQ 'TAX' }">
				<MvASSIGN NAME = "l.path" VALUE = "{ l.path $ 'tax/' }">
			</MvIF>

			<MvIF EXPR = "{ l.module_type EQ 'SHIPPING' }">
				<MvASSIGN NAME = "l.path" VALUE = "{ l.path $ 'shipping/' }">
			</MvIF>

			<MvIF EXPR = "{ l.module_type EQ 'PAYMENT' }">
				<MvASSIGN NAME = "l.path" VALUE = "{ l.path $ 'payment/' }">
			</MvIF>

			<MvIF EXPR = "{ l.module_type EQ 'FULFILLMENT' }">
				<MvASSIGN NAME = "l.path" VALUE = "{ l.path $ 'fulfill/' }">
			</MvIF>

			<MvIF EXPR = "{ l.module_type EQ 'BATCHREPORT' }">
				<MvASSIGN NAME = "l.path" VALUE = "{ l.path $ 'batch/' }">
			</MvIF>

			<MvIF EXPR = "{ l.module_type EQ 'IMPORT' }">
				<MvASSIGN NAME = "l.path" VALUE = "{ l.path $ 'import/' }">
			</MvIF>

			<MvIF EXPR = "{ l.module_type EQ 'EXPORT' }">
				<MvASSIGN NAME = "l.path" VALUE = "{ l.path $ 'export/' }">
			</MvIF>

			<MvIF EXPR = "{ l.module_type EQ 'LOG' }">
				<MvASSIGN NAME = "l.path" VALUE = "{ l.path $ 'log/' }">
			</MvIF>

			<MvIF EXPR = "{ l.module_type EQ 'SYSTEM' }">
				<MvASSIGN NAME = "l.path" VALUE = "{ l.path $ 'system/' }">
			</MvIF>

			<MvIF EXPR = "{ l.module_type EQ 'STOREUTIL' }">
				<MvASSIGN NAME = "l.path" VALUE = "{ l.path $ 'util/' }">
			</MvIF>

			<MvIF EXPR = "{ l.module_type EQ 'WIZARD' OR l.module_type EQ 'STOREWIZARD' }">
				<MvASSIGN NAME = "l.path" VALUE = "{ l.path $ 'wizard/' }">
			</MvIF>

			<MvIF EXPR = "{ NOT( sexists( g.Module_Root $ l.path ) ) }">
				<MvASSIGN NAME = "l.ok" VALUE = "{ smkdir( g.Module_Root $ l.path ) }">
				<MvIF EXPR = "{ NOT l.ok }">
					<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00021">
						<MvLOCALIZED-TOKEN NAME = "directory" VALUE = "{ g.Module_Root $ l.path }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unable to create directory '%directory%'</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvIF EXPR = "{ sexists( g.Module_Root $ l.path $ l.filename_nopath ) AND ( g.FileUpload_Overwrite NE 'Yes' ) }">
					<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00741">
						<MvLOCALIZED-TOKEN NAME = "file" VALUE = "{ g.Module_Root $ l.path $ l.filename_nopath }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">The file %file% already exists</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				<MvELSE>
					<MvASSIGN NAME = "l.ok" VALUE = "{ scopy( g.Module_Root $ l.tempfile, g.Module_Root $ l.path $ l.filename_nopath ) }">
					<MvIF EXPR = "{ NOT l.ok }">
						<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00022">
							<MvLOCALIZED-TOKEN NAME = "source" VALUE = "{ g.Module_Root $ l.tempfile }">
							<MvLOCALIZED-TOKEN NAME = "destination" VALUE = "{ g.Module_Root $ l.path $ l.filename_nopath }">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unable to copy '%source%' to '%destination%'</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
					<MvELSE>
						<MvASSIGN NAME = "g.FileUpload_Path" VALUE = "{ l.path $ l.filename_nopath }">
					</MvIF>
				</MvIF>
			</MvIF>
		</MvIF>

		<MvASSIGN NAME = "l.deleted" VALUE = "{ sdelete( g.Module_Root $ l.tempfile ) }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "ProcessFileUpload_Image" PARAMETERS = "tempfile, filename_nopath" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvASSIGN NAME = "l.imagedir" VALUE = "{ 'graphics/' }">

	<MvIF EXPR = "{ len( g.Store_Code ) }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Store_Find_Code( g.Store_Code ) }">
		<MvIF EXPR = "{ l.found }">
			<MvASSIGN NAME = "l.imagedir" VALUE = "{ l.imagedir $ padl( Stores.d.id, 8, '0' ) $ '/' }">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ NOT sexists( Domain.d.image_root $ l.imagedir ) }">
		<MvASSIGN NAME = "l.ok" VALUE = "{ smkdir( Domain.d.image_root $ l.imagedir ) }">
		<MvIF EXPR = "{ NOT l.ok }">
			<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00023">
				<MvLOCALIZED-TOKEN NAME = "destination" VALUE = "{ Domain.d.image_root $ l.imagedir }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unable to create directory '%destination%'</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "l.ok" VALUE = "{ schmod( Domain.d.image_root $ l.imagedir, 0755 ) }">
			<MvIF EXPR = "{ NOT l.ok }">
				<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00024">
					<MvLOCALIZED-TOKEN NAME = "destination" VALUE = "{ Domain.d.image_root $ l.imagedir }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unable to change permissions on directory '%destination%'</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvASSIGN NAME = "l.valid" VALUE = "{ Validate_Image_Extension( l.filename_nopath, l.image_ext ) }">

	<MvIF EXPR = "{ NOT l.valid }">
		<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-01532">	
			<MvLOCALIZED-TOKEN NAME = "ext" VALUE = "{ l.image_ext }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">The image extension '.%ext%' is not valid</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		
		<MvASSIGN NAME = "l.ok" VALUE = 0>
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.imagefilepath" VALUE = "{ l.imagedir $ l.filename_nopath }">
		<MvASSIGN NAME = "l.exists" VALUE = "{ sexists( Domain.d.image_root $ l.imagefilepath ) }">
		<MvIF EXPR = "{ ( NOT l.exists ) OR g.FileUpload_Overwrite }">
			<MvASSIGN NAME = "l.ok" VALUE = "{ fscopy( l.tempfile, Domain.d.image_root $ l.imagefilepath ) }">
			<MvIF EXPR = "{ NOT l.ok }">
				<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00025">
					<MvLOCALIZED-TOKEN NAME = "source" VALUE = "{ l.tempfile }">
					<MvLOCALIZED-TOKEN NAME = "destination" VALUE = "{ Domain.d.image_root $ l.imagefilepath }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unable to copy '%source%' to '%destination%'</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			<MvELSE>
				<MvASSIGN NAME = "g.FileUpload_Path" VALUE = "{ l.imagefilepath }">
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvASSIGN NAME = "l.ok" VALUE = "{ schmod( Domain.d.image_root $ l.imagefilepath, 0644 ) }">
				<MvIF EXPR = "{ NOT l.ok }">
					<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00026">
						<MvLOCALIZED-TOKEN NAME = "destination" VALUE = "{ Domain.d.image_root $ l.imagefilepath }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unable to change permissions on '%destination%'</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>
			</MvIF>
		<MvELSE>
			<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00027">
				<MvLOCALIZED-TOKEN NAME = "filename" VALUE = "{ l.filename_nopath }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Image '%filename%' already exists, not overwritten</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "ProcessFileUpload_Data" PARAMETERS = "tempfile, filename_nopath" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvASSIGN NAME = "l.upload_directory" VALUE = "{ g.MerchantPath }">
	
	<MvIF EXPR = "{ len( g.Store_Code ) }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Store_Find_Code( g.Store_Code ) }">
		<MvIF EXPR = "{ l.found }">
			<MvASSIGN NAME = "l.upload_directory" VALUE = "{ l.upload_directory $ padl( Stores.d.id, 8, '0' ) $ '/' }">
		</MvIF>
	</MvIF>

	<MvASSIGN NAME = "l.upload_directory" VALUE = "{ l.upload_directory $ 'uploads/' }">

	<MvIF EXPR = "{ NOT fexists( l.upload_directory ) }">
		<MvASSIGN NAME = "l.ok" VALUE = "{ fmkdir( l.upload_directory ) }">
		<MvIF EXPR = "{ NOT l.ok }">
			<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-01533">
				<MvLOCALIZED-TOKEN NAME = "destination" VALUE = "{ l.upload_directory }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unable to create directory '%destination%'</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
	</MvIF>
	
	<MvIF EXPR = "{ NOT fexists( l.upload_directory ) }">
		<MvASSIGN NAME = "l.ok" VALUE = "{ fmkdir( l.upload_directory ) }">
		<MvIF EXPR = "{ NOT l.ok }">
			<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-01534">
				<MvLOCALIZED-TOKEN NAME = "destination" VALUE = "{ l.upload_directory }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unable to create directory '%destination%'</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "l.ok" VALUE = "{ fchmod( l.upload_directory, 0755 ) }">
			<MvIF EXPR = "{ NOT l.ok }">
				<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-01535">
					<MvLOCALIZED-TOKEN NAME = "destination" VALUE = "{ l.upload_directory }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unable to change permissions on directory '%destination%'</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.exists" VALUE = "{ fexists( l.upload_directory $ l.filename_nopath ) }">
		<MvIF EXPR = "{ ( NOT l.exists ) OR g.FileUpload_Overwrite }">
			<MvASSIGN NAME = "l.ok" VALUE = "{ fcopy( l.tempfile, l.upload_directory $ l.filename_nopath ) }">
			<MvIF EXPR = "{ NOT l.ok }">
				<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00028">
					<MvLOCALIZED-TOKEN NAME = "source" VALUE = "{ l.tempfile }">
					<MvLOCALIZED-TOKEN NAME = "destination" VALUE = "{ l.filename_nopath }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unable to copy '%source%' to '%destination%'</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			<MvELSE>
				<MvASSIGN NAME = "g.FileUpload_Path" VALUE = "{ l.filename_nopath }">
			</MvIF>
		<MvELSE>
			<MvLOCALIZED NAME = "g.FileUpload_Error" ID = "MER-ADM-00029">
				<MvLOCALIZED-TOKEN NAME = "destination" VALUE = "{ l.upload_directory $ l.filename_nopath }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">File '%destination%' already exists, not overwritten</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_FileUpload">
	<MvIF EXPR = "{ len( g.FileUpload_Error ) }">
		<MvASSIGN NAME = "l.error" VALUE = "{ FieldError( '', 'FileUpload_File', g.FileUpload_Error ) }">
	<MvELSE>
		<MvEVAL EXPR = "{ '<SCRIPT LANGUAGE = "JavaScript">' $ asciichar( 10 ) $
						  '<!--' $ asciichar( 10 ) $
						  'opener.document.' $ encodeattribute( g.FileUpload_Form ) $ '.elements[ \'' $ g.FileUpload_Field $ '\' ].value = \'' $ JavaScriptEncode( g.FileUpload_Path ) $ '\';' $ asciichar( 10 ) $
						  'window.close()' $ asciichar( 10 ) $
						  '//-->' $ asciichar( 10 ) $
						  '</SCRIPT>' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_FileUpload">
	<HEAD>
	
	<MvEVAL EXPR = "{ JavaScript_SetVariables( 'g', 'Screen' ) }">

	<SCRIPT LANGUAGE = "JavaScript">
<!--
function FieldError( field, message )
{
	document.forms[ Screen ].elements[ field ].select();
	document.forms[ Screen ].elements[ field ].focus();
	alert( message );
}
//-->
	</SCRIPT>
	<TITLE>
	<MvLOCALIZED ID = "MER-ADM-00742">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Upload File</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	</TITLE>

	<MvIF EXPR = "{ g.Secure }">
		<BASE HREF = "{ g.secure_baseurl }">
	<MvELSE>
		<BASE HREF = "{ g.baseurl }">
	</MvIF>
	</HEAD>

	<MvIF EXPR = "{ len( g.Error_Field ) }">
		<MvEVAL EXPR = "{ '<BODY BGCOLOR = "#ffffff" ONLOAD = "FieldError( \'' $ JavaScriptEncode( g.Error_Field ) $ '\', \'' $ JavaScriptEncode( g.Error_Field_Message ) $ '\' );">' }">
	<MvELSE>
		<BODY BGCOLOR = "#ffffff">
	</MvIF>

	<FORM NAME = "{ g.Screen }" ENCTYPE = "multipart/form-data" METHOD = "POST" ACTION = "{ g.sessionurl }">
	<INPUT TYPE = "hidden" NAME = "Screen" VALUE = "FUPL">
	<INPUT TYPE = "hidden" NAME = "Action" VALUE = "FUPL">
	<INPUT TYPE = "hidden" NAME = "Tab" VALUE = "">
	<INPUT TYPE = "hidden" NAME = "Have_Fields" VALUE = "">

	<MvIF EXPR = "{ len( g.Store_Code ) }">
		<MvHIDE FIELDS = "g.Store_Code">
	</MvIF>

	<MvCOMMENT> Title </MvCOMMENT>
	<TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
	<TR><TD BGCOLOR = "#000000">
		<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
		<TR><TD BGCOLOR = "#f0f0f0" WIDTH = "100%">
			<FONT FACE = "Arial, Helvetica"><B>
				<MvLOCALIZED ID = "MER-ADM-00030">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Upload File</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			</B></FONT>
		</TD></TR>
		</TABLE>
	</TD></TR>
	</TABLE>
	<BR>

	<MvHIDE FIELDS = "g.FileUpload_Form, g.FileUpload_Field, g.FileUpload_Type, g.FileUpload_Data">

	<MvEVAL EXPR = "{ BeginContent() }">
	<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
	<TR><TD>
		&nbsp;
	</TD><TD VALIGN = "middle">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
		<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00031">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Overwrite</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.FileUpload_Overwrite, 'FileUpload_Overwrite', 'Yes', l.text ) }">

		</B></FONT>
	</TD></TR>

	<TR><TD>
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvLOCALIZED ID = "MER-ADM-00830">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US"><B>File:</B></MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</FONT>
	</TD><TD WIDTH = "100%">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<INPUT TYPE = "file" SIZE = "40" NAME = "FileUpload_File">
		</FONT>
	</TD></TR>
	</TABLE>
	<MvEVAL EXPR = "{ EndContent() }">

	<TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
	<TR><TD BGCOLOR = "#000000">
		<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
		<TR><TD BGCOLOR = "#f0f0f0" WIDTH = "100%">
			&nbsp;
		</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED ID = "MER-ADM-00743">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US"><INPUT TYPE = "submit" VALUE = "Upload"></MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</FONT>
		</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED ID = "MER-ADM-00744">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US"><INPUT TYPE = "button" VALUE = "Cancel" ONCLICK = "window.close();"></MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</FONT>
		</TD></TR>
		</TABLE>
	</TD></TR>
	</FORM>
	</TABLE>
	<MvEVAL EXPR = "{ EndScreen() }">

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvCOMMENT>
|
| Links
|
</MvCOMMENT>

<MvFUNCTION NAME = "Screen_Links">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ g.Type EQ 'STOR' }">
		<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ UIModule_Store_Links() }">
	</MvIF>

	<MvIF EXPR = "{ g.Type EQ 'CTGY' }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Find_Code( g.Category_Code ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ UIModule_Category_Links() }">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Type EQ 'PROD' }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Find_Code( g.Product_Code ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ UIModule_Product_Links() }">
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Top Navigation Bar
|
</MvCOMMENT>

<MvFUNCTION NAME = "Screen_TopNavigation">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<HEAD>
	<MvLOCALIZED ID = "MER-ADM-00745">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US"><TITLE>Miva Merchant Administration</TITLE></MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ g.Secure }">
		<BASE HREF = "{ g.secure_baseurl }">
	<MvELSE>
		<BASE HREF = "{ g.baseurl }">
	</MvIF>
	</HEAD>

	<BODY BGCOLOR = "#999999">
		<TABLE BORDER = 0 CELLPADDING = 4 CELLSPACING = 0 WIDTH = "100%">
		<TR><TD ALIGN = "left" VALIGN = "bottom" BGCOLOR = "#999999" NOWRAP>
			<TABLE BORDER = 0 CELLPADDING = 0 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD ALIGN = "left" VALIGN = "bottom">
				<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-01525">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Miva</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<A TARGET = "new" HREF = "http://www.miva.com"><IMG SRC = "{ g.AdminGraphics_Path $ 'blades4x.gif' }" ALT = "{ l.alt }" BORDER = 0></A>
				&nbsp;&nbsp;
				<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-01526">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Main</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<A TARGET = "Main" HREF = "{ g.sessionurl $ 'Screen=MAIN' }"><IMG SRC = "{ g.AdminGraphics_Path $ 'main4x.gif' }" ALT = "{ l.alt }" BORDER = 0></A>
				&nbsp;
				<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-01527">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Documentation</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<A TARGET = "new" HREF = "http://www.miva.com/docs"><IMG SRC = "{ g.AdminGraphics_Path $ 'docs4x.gif' }" ALT = "{ l.alt }" BORDER = 0></A>
				&nbsp;
				<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-01528">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Support</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<A TARGET = "new" HREF = "http://www.miva.com/support"><IMG SRC = "{ g.AdminGraphics_Path $ 'support4x.gif' }" ALT = "{ l.alt }" BORDER = 0></A>
			</TD><TD ALIGN = "right" VALIGN = "top">
				<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-01529">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Logout</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<A TARGET = "_top" HREF = "{ g.sessionurl $ 'Screen=LOGO' }"><IMG SRC = "{ g.AdminGraphics_Path $ 'logout4x.gif' }" ALT = "{ l.alt }" BORDER = 0></A>
			</TD></TR>
			</TABLE>
		</TD></TR>
		</TABLE>
	</BODY>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Left Navigation Heirarchy
|
</MvCOMMENT>

<MvFUNCTION NAME = "LeftNavigation_Dot" PARAMETERS = "indent, href, target, anchor">
	<MvIF EXPR = "{ l.indent }">
		<MvASSIGN NAME = "l.width" VALUE = "{ l.indent * 10 }">
		<IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" WIDTH = "{ l.width }" HEIGHT = 10>
	</MvIF>

	<IMG SRC = "{ g.AdminGraphics_Path $ 'dot.gif' }" BORDER = 0>

	<MvIF EXPR="{ len( l.href ) }">
		<MvIF EXPR = "{ len( l.target ) }">
			<A HREF = "{ g.sessionurl $ l.href }" TARGET = "{ l.target }"><MvEVAL EXPR = "{ l.anchor }"></A><BR>
		<MvELSE>
			<A HREF = "{ g.sessionurl $ l.href }"><MvEVAL EXPR = "{ l.anchor }"></A><BR>
		</MvIF>
	<MvELSE>
		<FONT FACE = "Arial, Helvetica" SIZE = "-2" COLOR = "#808080">
			<MvEVAL EXPR = "{ l.anchor }"><BR>
		</FONT>
	</MvIF>
</MvFUNCTION>

<MvFUNCTION NAME = "LeftNavigation_Level" PARAMETERS = "indent, ident, href, target, anchor">
	<MvASSIGN NAME = "l.isexpanded" VALUE = 0>

	<MvIF EXPR = "{ l.indent }">
		<MvASSIGN NAME = "l.width" VALUE = "{ l.indent * 10 }">
		<IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" WIDTH = "{ l.width }" HEIGHT = 10>
	</MvIF>

	<MvIF EXPR = "{ ( l.ident $ ':' ) IN g.Expanded }">
		<MvASSIGN NAME = "l.expanded" VALUE = "{ glosub( g.Expanded, l.ident $ ':', '' ) }">
		<A NAME = "{ l.ident }" HREF = "{ g.sessionurl $ 'Screen=LNAV&Expanded=' $ encodeattribute( l.expanded ) $ '#' $ l.ident }"><IMG SRC = "{ g.AdminGraphics_Path $ 'down.gif' }" BORDER = 0></A>

		<MvASSIGN NAME = "l.isexpanded" VALUE = 1>
	<MvELSE>
		<MvASSIGN NAME = "l.expanded" VALUE = "{ g.Expanded $ l.ident $ ':' }">
		<A NAME = "{ l.ident }" HREF = "{ g.sessionurl $ 'Screen=LNAV&Expanded=' $ encodeattribute(  l.expanded ) $ '#' $ l.ident }"><IMG SRC = "{ g.AdminGraphics_Path $ 'right.gif' }" BORDER = 0></A>
	</MvIF>

	<MvIF EXPR = "{ len( l.href ) }">
		<MvIF EXPR = "{ len( l.target ) }">
			<A HREF = "{ g.sessionurl $ l.href }" TARGET = "{ l.target }"><MvEVAL EXPR = "{ l.anchor }"></A><BR>
		<MvELSE>
			<A HREF = "{ g.sessionurl $ l.href }"><MvEVAL EXPR = "{ l.anchor }"></A><BR>
		</MvIF>
	<MvELSE>
		<MvEVAL EXPR = "{ l.anchor }"><BR>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.isexpanded }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_LeftNavigation">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<HEAD>
	<MvLOCALIZED ID = "MER-ADM-00746">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US"><TITLE>Miva Merchant Administration</TITLE></MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ g.Secure }">
		<BASE HREF = "{ g.secure_baseurl }">
	<MvELSE>
		<BASE HREF = "{ g.baseurl }">
	</MvIF>
	
	<MvEVAL EXPR = "{ JavaScript_SetVariables( 'g', 'Sessionurl' ) }">

	<SCRIPT LANGUAGE = "JavaScript">
<!--
function PopupWizard( module_code )
{
	window.open( Sessionurl + 'Screen=WIZZ&Module_Code=' + module_code, 'Wizard', 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=640,height=480' ).focus();
}

function PopupStoreWizard( store_code, module_code )
{
	window.open( Sessionurl + 'Screen=SWIZ&Store_Code=' + store_code + '&Module_Code=' + module_code, 'Wizard', 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=640,height=480' ).focus();
	
}
//-->
	</SCRIPT>
	</HEAD>

	<BODY BGCOLOR = "#eeeeee">
	<TABLE BORDER = 0 CELLPADDING = 0 CELLSPACING = 0>
	<TR><TD NOWRAP>
	    <MvDO FILE = "site/h_lnav.mv">
		<FONT FACE = "Arial, Helvetica" SIZE = "-2">
		<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00034">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Refresh</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvEVAL EXPR = "{ LeftNavigation_Dot( 0, 'Screen=LNAV&Expanded=' $ encodeattribute( g.Expanded ), '', l.label ) }">

		<MvLOCALIZED NAME = "l.label"  ID = "MER-ADM-01518">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Main</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvEVAL EXPR = "{ LeftNavigation_Dot( 0, 'Screen=MAIN', 'Main', l.label) }">
		
		<MvIF EXPR = "{ g.Admin_User_Administrator }">
			<MvIF EXPR = "{ NOT Domain.d.d_set }">
				<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00035">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Domain Settings</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvEVAL EXPR = "{ LeftNavigation_Dot( 0, 'Screen=DOMN', 'Main', l.label ) }">
			</MvIF>
			<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00036">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store Selection Layout</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvEVAL EXPR = "{ LeftNavigation_Dot( 0, 'Screen=SSMD', 'Main', l.label ) }">
		</MvIF>

		<MvCOMMENT> Users </MvCOMMENT>
		<MvIF EXPR = "{ NOT Domain.d.d_usr }">
			<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00037">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Users</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvIF EXPR = "{ LeftNavigation_Level( 0, 'USER', '', '', l.label ) }">
				<MvIF EXPR = "{ g.Admin_User_Administrator OR g.Admin_User_Create }">
					<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00038">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add User</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvEVAL EXPR = "{ LeftNavigation_Dot( 1, 'Screen=USER', 'Main', l.label ) }">
				</MvIF>

				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ User_FindFirst() }">
				<MvWHILE EXPR = "{ l.found }">
					<MvEVAL EXPR = "{ LeftNavigation_Dot( 1, 'Screen=USER&Edit_User=' $ encodeattribute( Users.d.name ), 'Main', encodeentities( Users.d.name ) ) }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ User_FindNext() }">
				</MvWHILE>
			</MvIF>
		</MvIF>
		
		<MvIF EXPR = "{ g.Admin_User_Administrator }">
			<MvCOMMENT> Modules </MvCOMMENT>
			<MvIF EXPR = "{ NOT Domain.d.d_mod }">
				<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00039">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Modules</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvIF EXPR = "{ LeftNavigation_Level( 0, 'MODS', '', '', l.label ) }">
					<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00040">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Module</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvEVAL EXPR = "{ LeftNavigation_Dot( 1, 'Screen=MODS', 'Main', l.label ) }">

					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindFirst_Admin() }">
					<MvWHILE EXPR = "{ l.found }">
						<MvEVAL EXPR = "{ LeftNavigation_Dot( 1, 'Screen=MODS&Edit_Module=' $ encodeattribute( Modules.d.code ), 'Main', encodeentities( Modules.d.name ) ) }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindNext_Admin() }">
					</MvWHILE>
				</MvIF>
			</MvIF>
			<MvCOMMENT>
			| Wizards 
			|
			| Build an array of all wizards, then loop through
			| the array, putting available wizards in a new array.
			|
			| This is necessary because the WizardModule_Privileges function
			| may potentially screw up the current position for the Module_FindXXX_Type
			| functions...
			|
			</MvCOMMENT>

			<MvASSIGN NAME = "l.all_wizard_count" VALUE = 0>
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.wiz_found" VALUE = "{ Module_FindFirst_Type( 'WIZARD' ) }">
			<MvWHILE EXPR = "{ l.wiz_found }">
				<MvASSIGN NAME = "l.all_wizard_count" VALUE = "{ l.all_wizard_count + 1 }">
				<MvASSIGN NAME = "l.all_wizard" INDEX = "{ l.all_wizard_count }" MEMBER = "code" VALUE = "{ Modules.d.code }">
				<MvASSIGN NAME = "l.all_wizard" INDEX = "{ l.all_wizard_count }" MEMBER = "name" VALUE = "{ Modules.d.name }">
				<MvASSIGN NAME = "l.all_wizard" INDEX = "{ l.all_wizard_count }" MEMBER = "module" VALUE = "{ Modules.d.module }">

				<MvDO FILE = "{ g.Library_DB }" NAME = "l.wiz_found" VALUE = "{ Module_FindNext_Type( 'WIZARD' ) }">
			</MvWHILE>
			
			<MvASSIGN NAME = "l.wizard_count" VALUE = 0>
			<MvASSIGN NAME = "l.pos" VALUE = 1>

			<MvWHILE EXPR = "{ l.pos LE l.all_wizard_count }">
				<MvIF EXPR = "{ sexists( g.Module_Root $ l.all_wizard[ l.pos ]:module ) }">
					<MvDO FILE = "{ g.Module_Root $ l.all_wizard[ l.pos ]:module }" NAME = "l.can_use" VALUE = "{ WizardModule_Privileges() }">
					<MvIF EXPR = "{ l.can_use }">
						<MvASSIGN NAME = "l.wizard_count" VALUE = "{ l.wizard_count + 1 }">
						<MvASSIGN NAME = "l.wizard" VALUE = "{ l.all_wizard }">
					</MvIF>
				</MvIF>
				<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
			</MvWHILE>

			<MvCOMMENT> After check if we can add more store, if there is no sublink under 'Wizard', it won't display 'Wizard' </MvCOMMENT>
			<MvIF EXPR = "{ l.pos GT 1 }">
				<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00041">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Wizards</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvIF EXPR = "{ LeftNavigation_Level( 0, 'WIZZ', '', '', l.label ) }">
					<MvASSIGN NAME = "l.pos" VALUE = 1>
					<MvWHILE EXPR = "{ l.pos LE l.wizard_count }">
						<MvDO FILE = "{ g.Module_Root $ l.all_wizard[ l.pos ]:module }" NAME = "l.can_use" VALUE = "{ WizardModule_Privileges() }">
						<MvIF EXPR = "{ l.can_use }">
							<IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" WIDTH = 10 HEIGHT = 10>
							<IMG SRC = "{ g.AdminGraphics_Path $ 'dot.gif' }" BORDER = 0>
							<MvEVAL EXPR = "{ '<A HREF = "JavaScript:PopupWizard( \'' $ JavaScriptEncode( l.all_wizard[ l.pos ]:code ) $ '\' );">' $ l.all_wizard[ l.pos ]:name $ '</A>' }">
							<BR>
						</MvIF>

						<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
					</MvWHILE>
				</MvIF>
			</MvIF>
		</MvIF>

		<MvCOMMENT> Stores </MvCOMMENT>
		<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00042">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Stores</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvIF EXPR = "{ LeftNavigation_Level( 0, 'STOR', '', '', l.label ) }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.store_count" VALUE = "{ Store_Count() }">
			<MvIF EXPR = "{ Domain.d.maxstores GT l.store_count OR ( NOT Domain.d.maxstores ) }">
				<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00043">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Store</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvIF EXPR = "{ g.Admin_User_Administrator }">
					<MvEVAL EXPR = "{ LeftNavigation_Dot( 1, 'Screen=STOR', 'Main', l.label ) }">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ g.Admin_User_Administrator }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Store_FindFirst() }">
			<MvELSE>
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Store_FindFirst_User( g.Admin_User_ID ) }">
			</MvIF>

			<MvWHILE EXPR = "{ l.found }">
				<MvASSIGN NAME = "l.ok" VALUE = "{ Admin_Open_Store( Stores.d.code ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvIF EXPR = "{ CanI( 'STOR', 1, 0, 0, 0 ) }">
						<MvLOCALIZED NAME = "l.offline" ID = "MER-ADM-01402">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">[offline]</MvLOCALIZED-TEXT>
						</MvLOCALIZED>

						<MvIF EXPR = "{ ( Stores.d.mnt_time LE s.time_t ) AND ( Stores.d.mnt_time ) }">
							<MvASSIGN NAME = "l.expanded" VALUE = "{ LeftNavigation_Level( 1, 'STOR(' $ Stores.d.id $ ')', 'Screen=STOR&Edit_Store=' $ encodeattribute( Stores.d.code ), 'Main', encodeentities( Stores.d.name ) $ '<FONT FACE = "Arial, Helvetica" COLOR = "red"> ' $ l.offline $ '</FONT>') }">
						<MvELSE>
							<MvASSIGN NAME = "l.expanded" VALUE = "{ LeftNavigation_Level( 1, 'STOR(' $ Stores.d.id $ ')', 'Screen=STOR&Edit_Store=' $ encodeattribute( Stores.d.code ), 'Main', encodeentities( Stores.d.name ) ) }">
						</MvIF>
					<MvELSE>
						<MvIF EXPR = "{ ( Stores.d.mnt_time LE s.time_t ) AND ( Stores.d.mnt_time ) }">
							<MvASSIGN NAME = "l.expanded" VALUE = "{ LeftNavigation_Level( 1, 'STOR(' $ Stores.d.id $ ')', '', '', encodeentities( Stores.d.name ) $ '<FONT FACE = "Arial, Helvetica" COLOR = "red"> ' $ l.offline $ '</FONT>') }">
						<MvELSE>
							<MvASSIGN NAME = "l.expanded" VALUE = "{ LeftNavigation_Level( 1, 'STOR(' $ Stores.d.id $ ')', '', '', encodeentities( Stores.d.name ) ) }">
						</MvIF>
					</MvIF>

					<MvIF EXPR = "{ l.expanded }">
						<MvCOMMENT>
					 	| Store Wizards 
						|
						|
						| Build an array of all store wizards, then loop through
						| the array, putting available wizards in a new array.
						|
						| This is necessary because the StoreWizardModule_Privileges function
						| may potentially screw up the current position for the Module_FindXXX_Type
						| functions...
						|
						</MvCOMMENT>

						<MvASSIGN NAME = "l.all_store_wizard_count" VALUE = 0>
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.wiz_found" VALUE = "{ Module_FindFirst_Type( 'STOREWIZARD' ) }">
						<MvASSIGN NAME = "l.can_display" VALUE = 1>
						<MvWHILE EXPR = "{ l.wiz_found }">
							<MvCOMMENT> Affiliate </MvCOMMENT>
							<MvIF EXPR = "{ Modules.d.code EQ 'afwizard' }">
								<MvIF EXPR = "{ NOT g.Features:Affiliates:Enabled }">
									<MvASSIGN NAME = "l.can_display" VALUE = 0>
								</MvIF>
							</MvIF>

							 <MvCOMMENT> Shipping wizard </MvCOMMENT>
							<MvIF EXPR = "{ Modules.d.code EQ 'shwizard' }">
								<MvIF EXPR = "{ Domain.d.d_ship }">
									<MvASSIGN NAME = "l.can_display" VALUE = 0>
								</MvIF>
							</MvIF>
							
							<MvCOMMENT> Payment wizard </MvCOMMENT>
							<MvIF EXPR = "{ Modules.d.code EQ 'pcwizard' }">
								<MvIF EXPR = "{ Domain.d.d_pay }">
									<MvASSIGN NAME = "l.can_display" VALUE = 0>
								</MvIF>
							</MvIF>

							<MvCOMMENT> Fulfillment Configuration wizard </MvCOMMENT>
							<MvIF EXPR = "{ Modules.d.code EQ 'fcwizard' }">
								<MvIF EXPR = "{ Domain.d.d_ful }">
									<MvASSIGN NAME = "l.can_display" VALUE = 0>
								</MvIF>
							</MvIF>

							<MvCOMMENT> display only the one that is enabled </MvCOMMENT>
							<MvIF EXPR = "{ l.can_display }">
								<MvASSIGN NAME = "l.all_store_wizard_count" VALUE = "{ l.all_store_wizard_count + 1 }">
								<MvASSIGN NAME = "l.all_store_wizard" INDEX = "{ l.all_store_wizard_count }" MEMBER = "code" VALUE = "{ Modules.d.code }">
								<MvASSIGN NAME = "l.all_store_wizard" INDEX = "{ l.all_store_wizard_count }" MEMBER = "name" VALUE = "{ Modules.d.name }">
								<MvASSIGN NAME = "l.all_store_wizard" INDEX = "{ l.all_store_wizard_count }" MEMBER = "module" VALUE = "{ Modules.d.module }">
							</MvIF>
							<MvDO FILE = "{ g.Library_DB }" NAME = "l.wiz_found" VALUE = "{ Module_FindNext_Type( 'STOREWIZARD' ) }">
						</MvWHILE>
						
						<MvASSIGN NAME = "l.store_wizard_count" VALUE = 0>
						<MvASSIGN NAME = "l.pos" VALUE = 1>
						<MvWHILE EXPR = "{ l.pos LE l.all_store_wizard_count }">
							<MvDO FILE = "{ g.Module_Root $ l.all_store_wizard[l.pos]:module }" NAME = "l.can_use" VALUE = "{ StoreWizardModule_Privileges() }">
							<MvIF EXPR = "{ l.can_use }">
								<MvASSIGN NAME = "l.store_wizard_count" VALUE = "{ l.store_wizard_count + 1 }">
								<MvASSIGN NAME = "l.store_wizard" INDEX = "{ l.store_wizard_count }" VALUE = "{ l.all_store_wizard[l.pos] }">
							</MvIF>

							<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
						</MvWHILE>
						
						<MvIF EXPR = "{ l.store_wizard_count }">
							<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00044">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Wizards</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							<MvIF EXPR = "{ LeftNavigation_Level( 2, 'SWIZ(' $ Stores.d.id $ ')', '', '', l.label ) }">
								<MvASSIGN NAME = "l.pos" VALUE = 1>
								<MvWHILE EXPR = "{ l.pos LE l.store_wizard_count }">
									<IMG SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }" WIDTH = 30 HEIGHT = 10>
									<IMG SRC = "{ g.AdminGraphics_Path $ 'dot.gif' }" BORDER = 0>
									<MvEVAL EXPR = "{ '<A HREF = "JavaScript:PopupStoreWizard( \'' $ JavaScriptEncode( Stores.d.code ) $ '\', \'' $ JavaScriptEncode( l.store_wizard[ l.pos ]:code ) $ '\' );">' $ encodeentities( l.store_wizard[ l.pos ]:name ) $ '</A>' }">
									<BR>

									<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
								</MvWHILE>
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Admin_User_Administrator OR ( g.Admin_User_ID EQ Stores.d.manager_id ) }">
							<MvCOMMENT> Groups </MvCOMMENT>
							<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00045">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Groups</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							<MvIF EXPR = "{ LeftNavigation_Level( 2, 'GROP(' $ Stores.d.id $ ')', '', '', l.label ) }">
								<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00046">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Group</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<MvEVAL EXPR = "{ LeftNavigation_Dot( 3, 'Screen=GROP&Store_Code=' $ encodeattribute( Stores.d.code ), 'Main', l.label ) }">

								<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Group_FindFirst() }">
								<MvWHILE EXPR = "{ l.found }">
									<MvEVAL EXPR = "{ LeftNavigation_Dot( 3, 'Screen=GROP&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Edit_Group=' $ encodeattribute( Groups.d.name ), 'Main', encodeentities( Groups.d.name ) ) }">
									<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Group_FindNext() }">
								</MvWHILE>
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ CanI( 'STCT', 1, 0, 0, 0 ) }">
							<MvCOMMENT> Countries </MvCOMMENT>
							<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00852">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Countries</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							<MvEVAL EXPR = "{ LeftNavigation_Dot( 2, 'Screen=STCT&Store_Code=' $ encodeattribute( Stores.d.code ), 'Main', l.label ) }">
						</MvIF>

						<MvIF EXPR = "{ CanI( 'STAT', 1, 0, 0, 0 ) }">
							<MvCOMMENT> States </MvCOMMENT>
							<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00047">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">States</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							<MvEVAL EXPR = "{ LeftNavigation_Dot( 2, 'Screen=STAT&Store_Code=' $ encodeattribute( Stores.d.code ), 'Main', l.label ) }">
						</MvIF>

						<MvIF EXPR = "{ CanI( 'CTGY', 1, 0, 0, 0 ) }">
							<MvCOMMENT> Categories </MvCOMMENT>
							<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00048">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Categories</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							<MvIF EXPR = "{ LeftNavigation_Level( 2, 'CTGY(' $ Stores.d.id $ ')', 'Screen=CBED&Store_Code=' $ encodeattribute( Stores.d.code ), 'Main', l.label ) }">
								<MvIF EXPR = "{ CanI( 'CTGY', 0, 1, 0, 0 ) }">
									<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00049">
										<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Category</MvLOCALIZED-TEXT>
									</MvLOCALIZED>
									<MvEVAL EXPR = "{ LeftNavigation_Dot( 3, 'Screen=CTGY&Store_Code=' $ encodeattribute( Stores.d.code ), 'Main', l.label ) }">
								</MvIF>

								<MvASSIGN NAME = "l.depth" VALUE = 1>
								<MvASSIGN NAME = "l.id" INDEX = "{ l.depth }" VALUE = 0>
								<MvASSIGN NAME = "l.parent" INDEX = "{ l.depth }" VALUE = 0>
								<MvASSIGN NAME = "l.level" INDEX = "{ l.depth }" VALUE = 3>
								<MvASSIGN NAME = "l.lnav_code" INDEX = "{ l.depth }" VALUE = "{ Stores.d.id $ ':' }">

								<MvWHILE EXPR = "{ l.depth }">
									<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_FindFirst_Parent( l.parent[ l.depth ] ) }">
									<MvWHILE EXPR = "{ l.found }">
										<MvIF EXPR = "{ LeftNavigation_Level( l.level[ l.depth ], 'CTGY(' $ l.lnav_code[ l.depth ] $ Categories.d.id $ ')', 'Screen=CTGY&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Edit_Category=' $ encodeattribute( Categories.d.code ), 'Main', encodeentities( Categories.d.name ) ) }">
											<MvIF EXPR = "{ CanI( 'CTGY', 0, 1, 0, 0 ) }">
												<MvLOCALIZED NAME = "l.label"  ID = "MER-ADM-00853">
													<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Sub-Category</MvLOCALIZED-TEXT>
												</MvLOCALIZED>
												<MvEVAL EXPR = "{ LeftNavigation_Dot( l.level[ l.depth ] + 1, 'Screen=CTGY&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Category_Parent=' $ encodeattribute( Categories.d.code ), 'Main', l.label ) }">
											</MvIF>

											<MvIF EXPR = "{ CanI( 'PROD', 0, 1, 0, 0 ) }">
												<MvLOCALIZED NAME = "l.label"  ID = "MER-ADM-00854">
													<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Product</MvLOCALIZED-TEXT>
												</MvLOCALIZED>
												<MvEVAL EXPR = "{ LeftNavigation_Dot( l.level[ l.depth ] + 1, 'Screen=PROD&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Category_Code=' $ encodeattribute( Categories.d.code ), 'Main', l.label ) }">
											</MvIF>

											<MvASSIGN NAME = "l.id" INDEX = "{ l.depth }" VALUE = "{ Categories.d.id }">
											<MvASSIGN NAME = "l.previous_level" VALUE = "{ l.level[ l.depth ] }">
											<MvASSIGN NAME = "l.previous_lnav" VALUE = "{ l.lnav_code[ l.depth ] }">

											<MvASSIGN NAME = "l.depth" VALUE = "{ l.depth + 1 }">
											<MvASSIGN NAME = "l.id" INDEX = "{ l.depth }" VALUE = 0>
											<MvASSIGN NAME = "l.parent" INDEX = "{ l.depth }" VALUE = "{ Categories.d.id }">
											<MvASSIGN NAME = "l.level" INDEX = "{ l.depth }" VALUE = "{ l.previous_level + 1 }">
											<MvASSIGN NAME = "l.lnav_code" INDEX = "{ l.depth }" VALUE = "{ l.previous_lnav $ l.id $ ':' }">

											<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_FindFirst_Parent( Categories.d.id ) }">
										<MvELSE>
											<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_FindNext_Parent( l.parent[ l.depth ] ) }">
										</MvIF>

										<MvWHILE EXPR = "{ l.depth AND ( NOT l.found ) }">
											<MvASSIGN NAME = "l.depth" VALUE = "{ l.depth - 1 }">
											<MvIF EXPR = "{ l.depth }">
												<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_FindID_Parent( l.id[ l.depth ] ) }">
												<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_FindNext_Parent( l.parent[ l.depth ] ) }">
											</MvIF>
										</MvWHILE>
									</MvWHILE>

									<MvIF EXPR = "{ l.depth }">
										<MvASSIGN NAME = "l.depth" VALUE = "{ l.depth - 1 }">
									</MvIF>
								</MvWHILE>
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ CanI( 'PROD', 1, 0, 0, 0 ) }">
							<MvLOCALIZED NAME = "l.label"  ID = "MER-ADM-00855">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Products</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							<MvIF EXPR = "{ LeftNavigation_Level( 2, 'PROD(' $ Stores.d.id $ ')', 'Screen=PBED&Store_Code=' $ encodeattribute( Stores.d.code ), 'Main', l.label ) }">
								<MvIF EXPR = "{ CanI( 'PROD', 0, 1, 0, 0 ) }">
									<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00052">
										<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Product</MvLOCALIZED-TEXT>
									</MvLOCALIZED>
									<MvEVAL EXPR = "{ LeftNavigation_Dot( 3, 'Screen=PROD&Store_Code=' $ encodeattribute( Stores.d.code ), 'Main', l.label ) }">
								</MvIF>
							</MvIF>
						</MvIF>

						<MvCOMMENT> Attribute Templates </MvCOMMENT>
						<MvIF EXPR = "{ g.Features:AttributeTemplates:Enabled }">
							<MvIF EXPR = "{ CanI( 'ATMP', 1, 0, 0, 0 ) }">
								<MvDO FILE = "{ g.Module_Feature_ATT }" NAME = "l.ok" VALUE = "{ ATT_Navigation() }">
							</MvIF>
						</MvIF>
						
						<MvCOMMENT> Upsale </MvCOMMENT>
						<MvIF EXPR = "{ g.Features:Upsale:Enabled }">
							<MvIF EXPR = "{ CanI( 'UPSL', 1, 0, 0, 0 ) AND CanI( 'PROD', 1, 0, 0, 0 ) }">
								<MvDO FILE = "{ g.Module_Feature_USL_AD }" NAME = "l.ok" VALUE = "{ USL_Navigation() }">
							</MvIF>
						</MvIF>

						<MvCOMMENT> Inventory </MvCOMMENT>
						<MvIF EXPR = "{ g.Features:Inventory:Enabled }">
							<MvDO FILE = "{ g.Module_Feature_INV_AD }" NAME = "l.ok" VALUE = "{ INV_LeftNavigation() }">
						</MvIF>

						<MvCOMMENT> Affiliate </MvCOMMENT>
						<MvIF EXPR = "{ g.Features:Affiliates:Enabled }">
							<MvIF EXPR = "{ CanI( 'AFLT', 1, 0, 0, 0 ) }">
								<MvDO FILE = "{ g.Feature_AFF }" NAME = "l.ok" VALUE = "{ Affiliate_Navigation() }">
							</MvIF>
						</MvIF>

						<MvCOMMENT> Shipping Modules </MvCOMMENT>
						<MvIF EXPR = "{ CanI( 'SHIP', 1, 0, 0, 0 ) }">
							<MvIF EXPR = "{ NOT Domain.d.d_ship }">							
								<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00055">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Shipping Configuration</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<MvEVAL EXPR = "{ LeftNavigation_Dot( 2, 'Screen=SMOD&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Module_Type=SHIPPING', 'Main', l.label ) }">
							</MvIF>
						</MvIF>

						<MvCOMMENT> Payment Modules </MvCOMMENT>
						<MvIF EXPR = "{ CanI( 'PMNT', 1, 0, 0, 0 ) }">
							<MvIF EXPR = "{ NOT Domain.d.d_pay }">
								<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00056">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Payment Configuration</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<MvEVAL EXPR = "{ LeftNavigation_Dot( 2, 'Screen=SMOD&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Module_Type=PAYMENT', 'Main', l.label ) }">
							</MvIF>
						</MvIF>

						<MvCOMMENT> Order fulfillment Configuration Modules </MvCOMMENT>
						<MvIF EXPR = "{ CanI( 'FUFL', 1, 0, 0, 0 ) }">
							<MvIF EXPR = "{ NOT Domain.d.d_ful }">
								<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00057">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Order Fulfillment Configuration</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<MvEVAL EXPR = "{ LeftNavigation_Dot( 2, 'Screen=SMOD&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Module_Type=FULFILLMENT', 'Main', l.label ) }">
							</MvIF>
						</MvIF>

						<MvCOMMENT> Logging Modules </MvCOMMENT>
						<MvIF EXPR = "{ CanI( 'LOGM', 1, 0, 0, 0 ) }">
							<MvIF EXPR = "{ NOT Domain.d.d_log }">
								<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00058">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Logging Configuration</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<MvEVAL EXPR = "{ LeftNavigation_Dot( 2, 'Screen=SMOD&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Module_Type=LOG', 'Main', l.label ) }">
							</MvIF>
						</MvIF>

						<MvCOMMENT> System Extension Modules </MvCOMMENT>
						<MvIF EXPR = "{ CanI( 'SYSM', 1, 0, 0, 0 ) }">
							<MvIF EXPR = "{ NOT Domain.d.d_sys }">
								<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00059">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">System Extension Configuration</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<MvEVAL EXPR = "{ LeftNavigation_Dot( 2, 'Screen=SMOD&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Module_Type=SYSTEM', 'Main', l.label ) }">
							</MvIF>
						</MvIF>

						<MvCOMMENT> Customers </MvCOMMENT>
						<MvIF EXPR = "{ g.Features:Customers:Enabled }">
							<MvIF EXPR = "{ CanI( 'CUST', 1, 0, 0, 0 ) }">
								<MvDO FILE = "{ g.Module_Feature_CUS }" NAME = "l.ok" VALUE = "{ Customer_Navigation() }">
							</MvIF>

							<MvCOMMENT> Availability Groups </MvCOMMENT>
							<MvIF EXPR = "{ g.Features:AvailabilityGroups:Enabled }">
								<MvIF EXPR = "{ CanI( 'AGRP', 1, 0, 0, 0 ) }">
									<MvDO FILE = "{ g.Module_Feature_AGR_AD }" NAME = "l.ok" VALUE = "{ AGR_Navigation() }">
								</MvIF>
							</MvIF>

							<MvCOMMENT> Price Groups </MvCOMMENT>
							<MvIF EXPR = "{ g.Features:PriceGroups:Enabled }">
								<MvIF EXPR = "{ CanI( 'PGRP', 1, 0, 0, 0 ) }">
									<MvDO FILE = "{ g.Module_Feature_PGR_AD }" NAME = "l.ok" VALUE = "{ PGR_Navigation() }">
								</MvIF>
							</MvIF>
						</MvIF>

						<MvCOMMENT> Order Processing </MvCOMMENT>
						<MvIF EXPR = "{ CanI( 'ORDR', 1, 0, 0, 0 ) }">
							<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00066">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Order Processing</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							<MvIF EXPR = "{ LeftNavigation_Level( 2, 'OPRC(' $ Stores.d.id $ ')', '', '', l.label ) }">
								<MvIF EXPR = "{ CanI( 'ORDR', 0, 1, 0, 0 ) }">
									<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00067">
										<MvLOCALIZED-TEXT LANGUAGE = "en-US">Create Batch</MvLOCALIZED-TEXT>
									</MvLOCALIZED>
									<MvEVAL EXPR = "{ LeftNavigation_Dot( 3, 'Screen=CBCH&Store_Code=' $ encodeattribute( Stores.d.code ), 'Main', l.label ) }">
								</MvIF>

								<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Batch_FindFirst( 0 ) }">
								<MvWHILE EXPR = "{ l.found }">
									<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.date" VALUE = "{ Format_Date( Batches.d.date, s.miva_language ) }">
									<MvIF EXPR = "{ LeftNavigation_Level( 3, 'BTCH(' $ Stores.d.id $ ':' $ Batches.d.id $ ')', '', '', l.date $ ': ' $ encodeentities( Batches.d.name ) ) }">
										<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00068">
											<MvLOCALIZED-TEXT LANGUAGE = "en-US">Run Report</MvLOCALIZED-TEXT>
										</MvLOCALIZED>
										<MvEVAL EXPR = "{ LeftNavigation_Dot( 4, 'Screen=BRPT&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Batch_ID=' $ Batches.d.id, 'Main', l.label ) }">

										<MvIF EXPR = "{ CanI( 'ORDR', 0, 0, 1, 0 ) }">
											<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00069">
												<MvLOCALIZED-TEXT LANGUAGE = "en-US">Process Orders</MvLOCALIZED-TEXT>
											</MvLOCALIZED>
											<MvEVAL EXPR = "{ LeftNavigation_Dot( 4, 'Screen=PORD&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Batch_ID=' $ Batches.d.id, 'Main', l.label ) }">
										</MvIF>

										<MvIF EXPR = "{ CanI( 'ORDR', 0, 0, 0, 1 ) }">
											<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00070">
												<MvLOCALIZED-TEXT LANGUAGE = "en-US">Delete Batch</MvLOCALIZED-TEXT>
											</MvLOCALIZED>
											<MvEVAL EXPR = "{ LeftNavigation_Dot( 4, 'Screen=DBCH&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Batch_ID=' $ Batches.d.id, 'Main', l.label ) }">
										</MvIF>

										<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00071">
											<MvLOCALIZED-TEXT LANGUAGE = "en-US">Orders</MvLOCALIZED-TEXT>
										</MvLOCALIZED>
										<MvIF EXPR = "{ LeftNavigation_Level( 4, 'ORDR(' $ Stores.d.id $ ':' $ Batches.d.id $ ')', '', '', l.label ) }">
											<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Order_FindFirst_Batch( Batches.d.id ) }">
											<MvWHILE EXPR = "{ l.found }">
												<MvIF EXPR = "{ g.Store_Module_Currency }">
													<MvDO FILE = "{ g.Store_Module_Currency }" NAME = "l.formatted_total" VALUE = "{ CurrencyModule_AddFormatting( Orders.d.total ) }">
												<MvELSE>
													<MvASSIGN NAME = "l.formatted_total" VALUE = "{ Orders.d.total }">
												</MvIF>

												<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.date" VALUE = "{ Format_Date( Orders.d.date, s.miva_language ) }">
												<MvEVAL EXPR = "{ LeftNavigation_Dot( 5, 'Screen=ORDR&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Edit_Order=' $ Orders.d.id, 'Main', Orders.d.id $ ': ' $ l.date $ ': ' $ encodeentities( Orders.d.ship_fname ) $ ' ' $ encodeentities( Orders.d.ship_lname ) $ ': ' $ l.formatted_total ) }">

												<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Order_FindNext_Batch( Batches.d.id ) }">
											</MvWHILE>
										</MvIF>
									</MvIF>

									<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Batch_FindNext( 0 ) }">
								</MvWHILE>

								<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00072">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Un-batched Orders</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<MvIF EXPR = "{ LeftNavigation_Level( 3, 'ORDR(' $ Stores.d.id $ ':0)', '', '', l.label ) }">
									<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Order_FindFirst_Batch( 0 ) }">
									<MvWHILE EXPR = "{ l.found }">
										<MvIF EXPR = "{ g.Store_Module_Currency }">
											<MvDO FILE = "{ g.Store_Module_Currency }" NAME = "l.formatted_total" VALUE = "{ CurrencyModule_AddFormatting( Orders.d.total ) }">
										<MvELSE>
											<MvASSIGN NAME = "l.formatted_total" VALUE = "{ Orders.d.total }">
										</MvIF>

										<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.date" VALUE = "{ Format_Date( Orders.d.date, s.miva_language ) }">
										<MvEVAL EXPR = "{ LeftNavigation_Dot( 4, 'Screen=ORDR&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Edit_Order=' $ Orders.d.id, 'Main', Orders.d.id $ ': ' $ l.date $ ': ' $ encodeentities( Orders.d.ship_fname ) $ ' ' $ encodeentities( Orders.d.ship_lname ) $ ': ' $ l.formatted_total ) }">

										<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Order_FindNext_Batch( 0 ) }">
									</MvWHILE>
								</MvIF>
							</MvIF>
						</MvIF>

						<MvIF EXPR = "{ g.Admin_User_Administrator OR ( g.Admin_User_ID EQ Stores.d.manager_id ) OR CanI( 'SUTL', 1, 0, 0, 0 ) }">
							<MvIF EXPR = "{ NOT Domain.d.d_utl }">
								<MvCOMMENT> Utilities </MvCOMMENT>
								<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00073">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Utilities</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<MvIF EXPR = "{ LeftNavigation_Level( 2, 'UTIL(' $ Stores.d.id $ ')', 'Screen=SMOD&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Module_Type=STOREUTIL', 'Main', l.label ) }">
									<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst_Type( 'STOREUTIL' ) }">
									<MvWHILE EXPR = "{ l.found }">
										<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.api" VALUE = "{ Module_API_Version() }">
										<MvIF EXPR = "{ l.api LT 2.1 }">
											<MvEVAL EXPR = "{ LeftNavigation_Dot( 3, 'Screen=SUTL&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Module_Code=' $ encodeattribute( Modules.d.code ), 'Main', Modules.d.name ) }">
										<MvELSE>
											<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ StoreUtilityModule_LeftNavigation( '3' ) }">
										</MvIF>
										<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext_Type( 'STOREUTIL' ) }">
									</MvWHILE>

									<MvIF EXPR = "{ g.Admin_User_Administrator OR ( g.Admin_User_ID EQ Stores.d.manager_id ) }">
										<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00074">
											<MvLOCALIZED-TEXT LANGUAGE = "en-US">Import Data</MvLOCALIZED-TEXT>
										</MvLOCALIZED>
										<MvIF EXPR = "{ LeftNavigation_Level( 3, 'IMPT(' $ Stores.d.id $ ')', '', '', l.label ) }">
											<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindFirst_Type( 'IMPORT' ) }">
											<MvWHILE EXPR = "{ l.found }">
												<MvEVAL EXPR = "{ LeftNavigation_Dot( 4, 'Screen=IMPT&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Module_Code=' $ encodeattribute( Modules.d.code ), 'Main', Modules.d.name ) }">
												<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindNext_Type( 'IMPORT' ) }">
											</MvWHILE>
										</MvIF>

										<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00075">
											<MvLOCALIZED-TEXT LANGUAGE = "en-US">Export Data</MvLOCALIZED-TEXT>
										</MvLOCALIZED>
										<MvIF EXPR = "{ LeftNavigation_Level( 3, 'EXPT(' $ Stores.d.id $ ')', '', '', l.label ) }">
											<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindFirst_Type( 'EXPORT' ) }">
											<MvWHILE EXPR = "{ l.found }">
												<MvEVAL EXPR = "{ LeftNavigation_Dot( 4, 'Screen=EXPT&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Module_Code=' $ encodeattribute( Modules.d.code ), 'Main', Modules.d.name ) }">
												<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindNext_Type( 'EXPORT' ) }">
											</MvWHILE>
										</MvIF>

										<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00860">
											<MvLOCALIZED-TEXT LANGUAGE = "en-US">Delete Shopping Baskets</MvLOCALIZED-TEXT>
										</MvLOCALIZED>
										<MvEVAL EXPR = "{ LeftNavigation_Dot( 3, 'Screen=DELC&Store_Code=' $ encodeattribute( Stores.d.code ), 'Main', l.label ) }">

										<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00077">
											<MvLOCALIZED-TEXT LANGUAGE = "en-US">Pack Data Files</MvLOCALIZED-TEXT>
										</MvLOCALIZED>
										<MvEVAL EXPR = "{ LeftNavigation_Dot( 3, 'Screen=BLNK&Action=SPCK&&Store_Code=' $ encodeattribute( Stores.d.code ), 'Main', l.label ) }">
									</MvIF>
								</MvIF>
							</MvIF>	
						</MvIF>
					</MvIF>
				</MvIF>

				<MvIF EXPR = "{ g.Admin_User_Administrator }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Store_FindNext() }">
				<MvELSE>
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Store_FindNext_User( g.Admin_User_ID ) }">
				</MvIF>
			</MvWHILE>
		</MvIF>

		<MvIF EXPR = "{ g.Admin_User_Administrator }">
			<MvCOMMENT> Utilities </MvCOMMENT>
			<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00078">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Utilities</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvIF EXPR = "{ LeftNavigation_Level( 0, 'UTIL', '', '', l.label ) }">
				<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00079">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Pack Data Files</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvEVAL EXPR = "{ LeftNavigation_Dot( 1, 'Screen=BLNK&Action=PACK', 'Main', l.label ) }">
			</MvIF>
		</MvIF>

		<MvDO FILE = "{ g.Feature_STP_AD }" NAME = "l.ok" VALUE = "{ Simple_Navigation() }">

		<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00080">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">About Miva Merchant</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvEVAL EXPR = "{ LeftNavigation_Dot( 0, 'Screen=ABOU', 'Main', l.label) }">
		
		<MvLOCALIZED NAME = "l.label"  ID = "MER-ADM-01519">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Logout</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvEVAL EXPR = "{ LeftNavigation_Dot( 0, 'Screen=LOGO', '_top', l.label) }">
		</FONT>
		<MvDO FILE = "site/f_lnav.mv">

	</TD></TR>
	</TABLE>
	</BODY>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Update_LeftNavigation" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<SCRIPT LANGUAGE = "JavaScript">
<!--
var HaveLoadFinishedHandler = 1;

function LoadFinishedHandler()
{
	if ( parent.LeftNavigation )
	{
		parent.LeftNavigation.location.reload();
	}
}
//-->
	</SCRIPT>
</MvFUNCTION>

<MvFUNCTION NAME = "Wizard_Update_Frames" PARAMETERS = "screens, close" STANDARDOUTPUTLEVEL = "text,html,compresswhitespace">
	<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.foo" VALUE = "{ User_Find_ID( g.Admin_User_ID ) }">
	<MvIF EXPR = "{ l.foo }">
		<MvIF EXPR = "{ Users.d.smod }">
			<MvIF EXPR = "{ g.New_Store }">
				<MvASSIGN NAME = "l.store_code" VALUE = "{ g.New_Store }">
			</MvIF>
			<MvEVAL EXPR = "{ JavaScript_SetVariables( 'g', 'New_Store' ) }">
			<MvIF EXPR = "{ NOT l.close }">
					<SCRIPT LANGUAGE = "JavaScript">
				<!--
						parent.TaskList.FinishCurrent(1, New_Store ,0);
				//-->
					</SCRIPT>
			<MvELSE>
				<MvASSIGN NAME = "g.Screen" VALUE = "STPR">
			</MvIF>
		<MvELSE>
			<MvASSIGN NAME = "l.update_leftnav" VALUE = 0>
			<MvASSIGN NAME = "l.update_main" VALUE = 0>

			<MvASSIGN NAME = "l.pos" VALUE = 1>
			<MvASSIGN NAME = "l.current" VALUE = "{ gettoken( l.screens, ',', l.pos ) }">
			<MvWHILE EXPR = "{ l.current }">
				<MvIF EXPR = "{ l.current EQ 'leftnav' }">
					<MvASSIGN NAME = "l.update_leftnav" VALUE = 1>
				</MvIF>

				<MvIF EXPR = "{ l.current EQ 'main' }">
					<MvASSIGN NAME = "l.update_main" VALUE = 1>
				</MvIF>

				<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
				<MvASSIGN NAME = "l.current" VALUE = "{ gettoken( l.screens, ',', l.pos ) }">
			</MvWHILE>
			
			<MvASSIGN NAME = "g.JavaUpdateLeftNav" VALUE = "{ l.update_leftnav }">
			<MvASSIGN NAME = "g.JavaUpdateMain" VALUE = "{ l.update_main }">
			<MvASSIGN NAME = "g.JavaClose" VALUE = "{ l.close }">
			
			<MvEVAL EXPR = "{ JavaScript_SetVariables('g', 'JavaUpdateLeftNav, JavaUpdateMain, JavaClose') }">

	<SCRIPT LANGUAGE = "JavaScript">
<!--
	if ( parseInt( JavaUpdateLeftNav ) && opener.parent.LeftNavigation )
	{
		opener.parent.LeftNavigation.location.reload();
	}

	if ( parseInt( JavaUpdateMain ) && opener.parent.Main )
	{
		if ( String( opener.parent.Main.location ).indexOf( 'Screen=MAIN' ) != -1 )
		{
			opener.parent.Main.location.reload();
		}
	}

	if ( parseInt( JavaClose ) )
	{
		window.close();
	}
//-->
	</SCRIPT>

		</MvIF>	
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Blank">

	<HEAD>
	<TITLE>
		<MvLOCALIZED ID = "MER-ADM-00081">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Miva Merchant Administration: Information</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
	</TITLE>
	<SCRIPT LANGUAGE = "JavaScript">
<!--
function LoadFinished()
{
	Loaded = 1;
	
	if ( (typeof HaveLoadFinishedHandler) == 'undefined' ) return;
	LoadFinishedHandler();
}
//-->
	</SCRIPT>
	</HEAD>
	<BODY BGCOLOR = "#ffffff" ONLOAD = "LoadFinished();">
	<MvIF EXPR = "{ len( g.Message ) }">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#0000FF"><MvEVAL EXPR = "{ g.Message }"></FONT><BR><BR>
	</MvIF>
	</BODY>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_QuickStart">
	<HEAD>

	<TITLE>
		<MvLOCALIZED ID = "MER-ADM-00082">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Miva Merchant Administration: Quick Start</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
	</TITLE>
	<MvIF EXPR = "{ g.Secure }">
		<BASE HREF = "{ g.secure_baseurl }">
	<MvELSE>
		<BASE HREF = "{ g.baseurl }">
	</MvIF>

	<MvEVAL EXPR = "{ JavaScript_SetVariables( 'g', 'Sessionurl' ) }">

	<SCRIPT LANGUAGE = "JavaScript">
<!--
function PopupWizard( module_code )
{
	window.open( Sessionurl + 'Screen=WIZZ&Module_Code=' + module_code, 'Wizard', 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=640,height=480' ).focus();
}

function PopupStoreWizard( store_code, module_code )
{
	window.open( Sessionurl + 'Screen=SWIZ&Store_Code=' + store_code + '&Module_Code=' + module_code, 'Wizard', 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=640,height=480' ).focus();

}
//-->
	</SCRIPT>
	</HEAD>

	<BODY BGCOLOR = "#ffffff">
	<MvDO FILE = "site/h_main.mv">

	<MvDO FILE = "{ g.Filename_Main }" NAME = "l.ok" VALUE = "{ Merchant_QuickStart() }">
	<MvDO FILE = "site/f_main.mv">

	</BODY>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_About">
	<HEAD>

	<MvLOCALIZED ID = "MER-ADM-00831">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US"><TITLE>Miva Merchant Administration: About Miva Merchant</TITLE></MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ g.Secure }">
		<BASE HREF = "{ g.secure_baseurl }">
	<MvELSE>
		<BASE HREF = "{ g.baseurl }">
	</MvIF>
	</HEAD>

	<BODY BGCOLOR = "#ffffff">
	<MvDO FILE = "site/h_about.mv">

	<MvDO FILE = "{ g.Filename_Version }" NAME = "l.ok" VALUE = "{ Merchant_About() }">
	<MvDO FILE = "site/f_about.mv">

	</BODY>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvCOMMENT>
|
| Domain
|
</MvCOMMENT>

<MvFUNCTION NAME = "Domain_Validate">
	<MvASSIGN NAME = "g.Domain_Name" VALUE = "{ ltrim( rtrim( g.Domain_Name ) ) }">
	<MvASSIGN NAME = "g.Domain_Owner" VALUE = "{ ltrim( rtrim( g.Domain_Owner ) ) }">
	<MvASSIGN NAME = "g.Domain_Email" VALUE = "{ ltrim( rtrim( g.Domain_Email ) ) }">
	<MvASSIGN NAME = "g.Domain_Company" VALUE = "{ ltrim( rtrim( g.Domain_Company ) ) }">
	<MvASSIGN NAME = "g.Domain_Address" VALUE = "{ ltrim( rtrim( g.Domain_Address ) ) }">
	<MvASSIGN NAME = "g.Domain_City" VALUE = "{ ltrim( rtrim( g.Domain_City ) ) }">
	<MvASSIGN NAME = "g.Domain_State" VALUE = "{ ltrim( rtrim( g.Domain_State ) ) }">
	<MvASSIGN NAME = "g.Domain_Zip" VALUE = "{ ltrim( rtrim( g.Domain_Zip ) ) }">
	<MvASSIGN NAME = "g.Domain_Country" VALUE = "{ ltrim( rtrim( g.Domain_Country ) ) }">
	<MvASSIGN NAME = "g.Domain_Phone" VALUE = "{ ltrim( rtrim( g.Domain_Phone ) ) }">
	<MvASSIGN NAME = "g.Domain_Fax" VALUE = "{ ltrim( rtrim( g.Domain_Fax ) ) }">
	<MvASSIGN NAME = "g.Domain_MivaMerchantURL" VALUE = "{ ltrim( rtrim( g.Domain_MivaMerchantURL ) ) }">
	<MvASSIGN NAME = "g.Domain_MivaMerchantSecureURL" VALUE = "{ ltrim( rtrim( g.Domain_MivaMerchantSecureURL ) ) }">
	<MvASSIGN NAME = "g.Domain_AdminSecureURL" VALUE = "{ ltrim( rtrim( g.Domain_AdminSecureURL ) ) }">
	<MvASSIGN NAME = "g.Domain_BaseURL" VALUE = "{ ltrim( rtrim( g.Domain_BaseURL ) ) }">
	<MvASSIGN NAME = "g.Domain_ImageRoot" VALUE = "{ ltrim( rtrim( g.Domain_ImageRoot ) ) }">
	<MvASSIGN NAME = "g.Domain_SecureBaseURL" VALUE = "{ ltrim( rtrim( g.Domain_SecureBaseURL ) ) }">
	<MvASSIGN NAME = "g.Domain_AdminTimeout" VALUE = "{ ltrim( rtrim( g.Domain_AdminTimeout ) ) }">
	<MvASSIGN NAME = "g.Domain_ModuleRoot" VALUE = "{ ltrim( rtrim( g.Domain_ModuleRoot ) ) }">
	<MvASSIGN NAME = "g.Domain_SecureModuleRoot" VALUE = "{ ltrim( rtrim( g.Domain_SecureModuleRoot ) ) }">
	<MvASSIGN NAME = "g.Domain_MailHost" VALUE = "{ ltrim( rtrim( g.Domain_MailHost ) ) }">
	<MvASSIGN NAME = "g.Domain_MailMethod" VALUE = "{ ltrim( rtrim( g.Domain_MailMethod ) ) }">
	<MvASSIGN NAME = "g.Domain_Mail_AddAngleBrackets" VALUE = "{ ltrim( rtrim( g.Domain_Mail_AddAngleBrackets ) ) }">
	<MvASSIGN NAME = "g.Domain_LockoutTime" VALUE = "{ ltrim( rtrim( g.Domain_LockoutTime ) ) }">
	<MvASSIGN NAME = "g.Domain_LoginTrys" VALUE = "{ ltrim( rtrim( g.Domain_LoginTrys ) ) }">

	<MvIF EXPR = "{ len( g.Domain_Name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00083">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a domain name</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'INFO', 'Domain_Name', l.error_msg ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Domain_Owner ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00084">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter the name of the Domain Administrator</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'REGI', 'Domain_Owner', l.error_msg ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_Email( g.Domain_Email ) }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00085">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter the email address of the Domain Administrator</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'REGI', 'Domain_Email', l.error_msg ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Domain_Address ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00086">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter the address of the Domain Administrator</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'REGI', 'Domain_Address', l.error_msg ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Domain_City ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00087">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter the city of the Domain Administrator</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'REGI', 'Domain_City', l.error_msg ) }">
	</MvIF>

	<MvIF EXPR = "{ ( len( g.Domain_State ) EQ 0 ) AND ( g.Domain_Country EQ 'US' ) }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00088">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter the state/province of the Domain Administrator</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'REGI', 'Domain_State', l.error_msg ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_Zip( g.Domain_Zip, g.Domain_Country ) }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00089">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter the Zip/Postal code of the Domain Administrator</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'REGI', 'Domain_Zip', l.error_msg ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Domain_Country ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00090">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please select the country of the Domain Administrator</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'REGI', '', l.error_msg ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_Phone( g.Domain_Phone, g.Domain_Country ) }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00091">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter the phone number of the Domain Administrator</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'REGI', 'Domain_Phone', l.error_msg ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Domain_MivaMerchantURL ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00801">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a non-secure URL to Miva Merchant</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SITE', 'Domain_MivaMerchantURL', l.error_msg ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Domain_ImageRoot ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00094">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter the root directory for graphics</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SITE', 'Domain_ImageRoot', l.error_msg ) }">
	<MvELSE>
		<MvIF EXPR = "{ ( '/' IN g.Domain_ImageRoot ) NE 1 }">
			<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00095">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">The root directory for graphics MUST be an absolute path.  (i.e. it MUST start with /)</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SITE', 'Domain_ImageRoot', l.error_msg ) }">
		<MvELSE>
			<MvIF EXPR = "{ substring( g.Domain_ImageRoot, len( g.Domain_ImageRoot ), 1 ) NE '/' }">
				<MvASSIGN NAME = "g.Domain_ImageRoot" VALUE = "{ g.Domain_ImageRoot $ '/' }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ len( g.Domain_BaseURL ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00093">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter the base URL for graphics</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SITE', 'Domain_BaseURL', l.error_msg ) }">
	</MvIF>

	<MvIF EXPR = "{ ( len( g.Domain_MivaMerchantSecureURL ) OR len( g.Domain_AdminSecureURL ) ) AND len( g.Domain_SecureBaseURL ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00096">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify the secure base URL for graphics</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SITE', 'Domain_SecureBaseURL', l.error_msg ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Domain_ModuleRoot ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00097">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter the root directory for modules</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SITE', 'Domain_ModuleRoot', l.error_msg ) }">
	<MvELSE>
		<MvIF EXPR = "{ ( '/' IN g.Domain_ModuleRoot ) NE 1 }">
			<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00098">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">The root directory for modules MUST be an absolute path.  (i.e. it MUST start with /)</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SITE', 'Domain_ModuleRoot', l.error_msg ) }">
		<MvELSE>
			<MvIF EXPR = "{ substring( g.Domain_ModuleRoot, len( g.Domain_ModuleRoot ), 1 ) NE '/' }">
				<MvASSIGN NAME = "g.Domain_ModuleRoot" VALUE = "{ g.Domain_ModuleRoot $ '/' }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ len( g.Domain_SecureModuleRoot ) NE 0 }">
		<MvIF EXPR = "{ ( '/' IN g.Domain_SecureModuleRoot ) NE 1 }">
			<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00099">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">The root directory for modules MUST be an absolute path.  (i.e. it MUST start with /)</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SITE', 'Domain_SecureModuleRoot', l.error_msg ) }">
		<MvELSE>
			<MvIF EXPR = "{ substring( g.Domain_SecureModuleRoot, len( g.Domain_SecureModuleRoot ), 1 ) NE '/' }">
				<MvASSIGN NAME = "g.Domain_SecureModuleRoot" VALUE = "{ g.Domain_SecureModuleRoot $ '/' }">
			</MvIF>
		</MvIF>
	<MvELSE>
		<MvIF EXPR = "{ len( g.Domain_MivaMerchantSecureURL ) OR len( g.Domain_AdminSecureURL ) }">
			<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00100">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify the secure root directory for modules</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SITE', 'Domain_SecureModuleRoot', l.error_msg ) }">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ len( g.Domain_MailHost ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00101">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a mail server</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SITE', 'Domain_MailHost', l.error_msg ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_WholeNumber_Range_Required( g.Domain_AdminTimeout, 1, 1440) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'TIME', 'Domain_AdminTimeout', g.Validation_Message ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_WholeNumber_Positive_Required( g.Domain_LockoutTime ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'TIME', 'Domain_LockoutTime', g.Validation_Message ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_WholeNumber_Positive_Required( g.Domain_LoginTrys ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'TIME', 'Domain_LoginTrys', g.Validation_Message ) }">
	</MvIF>

	<MvIF EXPR = "{ '.' IN g.Domain_ImageExtension }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-01536">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please do not use '.' in your extensions</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'UPST', 'Domain_ImageExtension', l.error_msg ) }">
	</MvIF>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindFirst() }">
	<MvWHILE EXPR = "{ l.found AND l.ok }">
		<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_api_version" VALUE = "{ Module_API_Version() }">
		<MvIF EXPR = "{ l.module_api_version GE 4.00 }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.valid" VALUE = "{ Module_Domain_Validate() }">
			<MvIF EXPR = "{ NOT l.valid }">
				<MvFUNCTIONRETURN VALUE = 0>
			</MvIF>
		</MvIF>
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindNext() }">
	</MvWHILE>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Domain_Update">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvASSIGN NAME = "l.valid" VALUE = 1>

	<MvIF EXPR = "{ Domain_Validate() }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Domain_Update( g.Domain_Name, Domain.d.license, Domain.d.version,
																				g.Domain_Owner, g.Domain_Email, g.Domain_Company,
																				g.Domain_Address, g.Domain_City, g.Domain_State,
																				g.Domain_Zip, g.Domain_Country, g.Domain_Phone,
																				g.Domain_Fax, g.Domain_MivaMerchantURL, g.Domain_MivaMerchantSecureURL,
																			    g.Domain_AdminSecureURL, g.Domain_ImageRoot, g.Domain_BaseURL,
																				g.Domain_SecureBaseURL, g.Domain_ModuleRoot, g.Domain_SecureModuleRoot,
																				g.Domain_AdminTimeout, g.Domain_MailHost, g.Domain_MailMethod, g.Domain_Mail_AddAngleBrackets,
																				Domain.d.ui_id, g.Domain_LockoutTime, g.Domain_LoginTrys, g.Domain_ImageExtension ) }">

		<MvDO FILE = "{ g.Feature_NOT_AD }" NAME = "l.valid" VALUE = "{ NoteSettings_Validate() }">

		<MvIF EXPR = "{ l.valid }">
			<MvDO FILE = "{ g.Feature_NOT_DB }" NAME = "l.ok" VALUE = "{ Domain_NoteSettings_Update( g.Domain_NoteSettings_Security, g.Domain_NoteSettings_Updates, g.Domain_NoteSettings_Offers,
																											g.Domain_NoteSettings_Poll, g.Domain_NoteSettings_PollURL ) }">

		</MvIF>

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindFirst() }">
		<MvWHILE EXPR = "{ l.found AND l.ok }">
			<MvIF EXPR = "{ sexists( g.Module_Root $ Modules.d.module ) }">
				<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_api_version" VALUE = "{ Module_API_Version() }">
				<MvIF EXPR = "{ l.module_api_version GE 4.00 }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Domain_Update() }">
					<MvIF EXPR = "{ NOT l.ok }">
						<MvWHILESTOP>
					</MvIF>
				</MvIF>
			</MvIF>
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindNext() }">
		</MvWHILE>

		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00103">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Domain settings updated</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Domain_Pack">
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ PackDataFiles() }">
	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindFirst() }">
		<MvWHILE EXPR = "{ l.ok AND l.found }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Pack_Domain() }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindNext() }">
		</MvWHILE>
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00104">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Domain Data Files Packed</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Domain">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ g.Load_Fields }">
		<MvASSIGN NAME = "g.Domain_Name" VALUE = "{ Domain.d.name }">
		<MvASSIGN NAME = "g.Domain_Owner" VALUE = "{ Domain.d.owner }">
		<MvASSIGN NAME = "g.Domain_Email" VALUE = "{ Domain.d.email }">
		<MvASSIGN NAME = "g.Domain_Company" VALUE = "{ Domain.d.company }">
		<MvASSIGN NAME = "g.Domain_Address" VALUE = "{ Domain.d.address }">
		<MvASSIGN NAME = "g.Domain_City" VALUE = "{ Domain.d.city }">
		<MvASSIGN NAME = "g.Domain_State" VALUE = "{ Domain.d.state }">
		<MvASSIGN NAME = "g.Domain_Zip" VALUE = "{ Domain.d.zip }">
		<MvASSIGN NAME = "g.Domain_Country" VALUE = "{ Domain.d.country }">
		<MvASSIGN NAME = "g.Domain_Phone" VALUE = "{ Domain.d.phone }">
		<MvASSIGN NAME = "g.Domain_Fax" VALUE = "{ Domain.d.fax }">
		<MvASSIGN NAME = "g.Domain_MivaMerchantURL" VALUE = "{ Domain.d.mm_url }">
		<MvASSIGN NAME = "g.Domain_MivaMerchantSecureURL" VALUE = "{ Domain.d.mm_surl }">
		<MvASSIGN NAME = "g.Domain_AdminSecureURL" VALUE = "{ Domain.d.admin_surl }">
		<MvASSIGN NAME = "g.Domain_BaseURL" VALUE = "{ Domain.d.base_url }">
		<MvASSIGN NAME = "g.Domain_ImageRoot" VALUE = "{ Domain.d.image_root }">
		<MvASSIGN NAME = "g.Domain_SecureBaseURL" VALUE = "{ Domain.d.base_surl }">
		<MvASSIGN NAME = "g.Domain_ModuleRoot" VALUE = "{ Domain.d.mod_root }">
		<MvASSIGN NAME = "g.Domain_SecureModuleRoot" VALUE = "{ Domain.d.mod_sroot }">
		<MvASSIGN NAME = "g.Domain_AdminTimeout" VALUE = "{ Domain.d.admexp }">
		<MvASSIGN NAME = "g.Domain_MailHost" VALUE = "{ Domain.d.mailhost }">
		<MvASSIGN NAME = "g.Domain_MailMethod" VALUE = "{ Domain.d.mailmeth }">
		<MvASSIGN NAME = "g.Domain_Mail_AddAngleBrackets" VALUE = "{ Domain.d.mail_angl }">
		<MvASSIGN NAME = "g.Domain_LockoutTime" VALUE = "{ Domain.d.lo_time }">
		<MvASSIGN NAME = "g.Domain_LoginTrys" VALUE = "{ Domain.d.li_trys }">
		<MvASSIGN NAME = "g.Domain_ImageExtension" VALUE = "{ Domain.d.img_ext }">

		<MvIF EXPR = "{ Domain.d.mail_angl }">
			<MvASSIGN NAME = "g.Domain_Mail_AddAngleBrackets" VALUE = "Yes">
		<MvELSE>
			<MvASSIGN NAME = "g.Domain_Mail_AddAngleBrackets" VALUE = "No">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvLOCALIZED NAME = "l.screen_label" ID = "MER-ADM-00105">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Domain Settings</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvEVAL EXPR = "{ BeginScreen( l.screen_label, 'UDMN', 'Help:domn.html' ) }">

		<MvLOCALIZED NAME = "l.tab_list" ID = "MER-ADM-00106">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">INFO:Information,REGI:Registration,SITE:Site Configuration,TIME:Timeouts,UPST:Upload Settings</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		
		<MvDO FILE = "{ g.Feature_NOT_AD }" NAME = "l.note_tab" VALUE = "{ Notification_Settings_Tab() }">

		<MvASSIGN NAME = "l.tab_list" VALUE = "{ l.tab_list $ ',' $ l.note_tab }">
		
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindFirst() }">
		<MvWHILE EXPR = "{ l.found }">
			<MvIF EXPR = "{ sexists( g.Module_Root $ Modules.d.module ) }">
				<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_api_version" VALUE = "{ Module_API_Version() }">
				<MvIF EXPR = "{ l.module_api_version GE 4.00 }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_tabs" VALUE = "{ Module_Domain_Tabs() }">
					<MvIF EXPR = "{ len( l.module_tabs ) }">
						<MvASSIGN NAME = "l.tab_list" VALUE = "{ l.tab_list $ ',' $ l.module_tabs }">
					</MvIF>
				</MvIF>
			</MvIF>
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindNext() }">
		</MvWHILE>
		
		<MvEVAL EXPR = "{ DrawTabs( 'INFO', l.tab_list ) }">

		<MvEVAL EXPR = "{ BeginContent() }">
		<MvIF EXPR = "{ g.Tab EQ 'INFO' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00107">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Domain Name:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_Name" VALUE = "{ encodeentities( g.Domain_Name ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00108">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">License #:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ encodeentities( Domain.d.license ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00109">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Version:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ encodeentities( Domain.d.version ) }">
				</FONT>
			</TD></TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Domain_Name, g.Domain_License, g.Domain_Version">
		</MvIF>

		<MvIF EXPR = "{ g.Tab EQ 'REGI' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00110">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Owner:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_Owner" VALUE = "{ encodeentities( g.Domain_Owner ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00111">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Email Address:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B>
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_Email" VALUE = "{ encodeentities( g.Domain_Email ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00112">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Company:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_Company" VALUE = "{ encodeentities( g.Domain_Company ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00113">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Address:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_Address" VALUE = "{ encodeentities( g.Domain_Address ) }">
				</FONT>
			</TD></TR>

			<MvIF EXPR = "{ s.miva_language EQ 'de-DE' }">
				<TR><TD NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-ADM-00116">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Zip/Postal Code:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_Zip" VALUE = "{ encodeentities( g.Domain_Zip ) }">
					</FONT>
				</TD></TR>

				<TR><TD NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-ADM-00114">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">City:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_City" VALUE = "{ encodeentities( g.Domain_City ) }">
					</FONT>
				</TD></TR>

				<TR><TD NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvIF EXPR = "{ Domain.d.country NE 'US' }">
						<MvLOCALIZED ID = "MER-ADM-00115">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">State/Province:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
					<MvELSE>
						<B>
						<MvLOCALIZED ID = "MER-ADM-00115">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">State/Province:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</B>
					</MvIF>
					</FONT>
				</TD><TD WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_State" VALUE = "{ encodeentities( g.Domain_State ) }">
					</FONT>
				</TD></TR>
			<MvELSE>
				<TR><TD NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-ADM-00114">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">City:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_City" VALUE = "{ encodeentities( g.Domain_City ) }">
					</FONT>
				</TD></TR>

				<TR><TD NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvIF EXPR = "{ Domain.d.country NE 'US' }">
						<MvLOCALIZED ID = "MER-ADM-00115">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">State/Province:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
					<MvELSE>
						<B>
						<MvLOCALIZED ID = "MER-ADM-00115">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">State/Province:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</B>
					</MvIF>
					</FONT>
				</TD><TD WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_State" VALUE = "{ encodeentities( g.Domain_State ) }">
					</FONT>
				</TD></TR>

				<TR><TD NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-ADM-00116">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Zip/Postal Code:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_Zip" VALUE = "{ encodeentities( g.Domain_Zip ) }">
					</FONT>
				</TD></TR>
			</MvIF>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00117">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Country:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.ok" VALUE = "{ Country_Select( 'Domain_Country', g.Domain_Country ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00118">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Phone:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_Phone" VALUE = "{ encodeentities( g.Domain_Phone ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00119">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Fax:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_Fax" VALUE = "{ encodeentities( g.Domain_Fax ) }">
				</FONT>
			</TD></TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Domain_Owner, g.Domain_Email, g.Domain_Company, g.Domain_Address, g.Domain_City, g.Domain_State, g.Domain_Zip, g.Domain_Country, g.Domain_Phone, g.Domain_Fax">
		</MvIF>

		<MvIF EXPR = "{ g.Tab EQ 'SITE' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00120">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Non-secure URL to Miva Merchant:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_MivaMerchantURL" VALUE = "{ encodeentities( g.Domain_MivaMerchantURL ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00121">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Secure URL to Miva Merchant:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_MivaMerchantSecureURL" VALUE = "{ encodeentities( g.Domain_MivaMerchantSecureURL ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00122">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Secure URL to Administration:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_AdminSecureURL" VALUE = "{ encodeentities( g.Domain_AdminSecureURL ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00123">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Root Directory for Graphics:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_ImageRoot" VALUE = "{ encodeentities( g.Domain_ImageRoot ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00124">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Base URL for Graphics:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_BaseURL" VALUE = "{ encodeentities( g.Domain_BaseURL ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00125">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Secure Base URL for Graphics:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_SecureBaseURL" VALUE = "{ encodeentities( g.Domain_SecureBaseURL ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00126">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Root Directory for Modules:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_ModuleRoot" VALUE = "{ encodeentities( g.Domain_ModuleRoot ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00127">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Secure Root Directory for Modules:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_SecureModuleRoot" VALUE = "{ encodeentities( g.Domain_SecureModuleRoot ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00128">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Mail Server:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_MailHost" VALUE = "{ encodeentities( g.Domain_MailHost ) }">
				</FONT>
			</TD></TR>

			<TR><TD ALIGN = "left" VALIGN = "middle">
				&nbsp;
			</TD><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00129">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Angle Brackets to Email Addresses</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Domain_Mail_AddAngleBrackets EQ 'Yes', 'Domain_Mail_AddAngleBrackets', 'Yes', l.text ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00128">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Mail Method:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_MailMethod" VALUE = "{ encodeentities( g.Domain_MailMethod ) }">
				</FONT>
			</TD></TR>


			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Domain_MivaMerchantURL, g.Domain_MivaMerchantSecureURL, g.Domain_AdminSecureURL, g.Domain_BaseURL, g.Domain_ImageRoot, g.Domain_SecureBaseURL, g.Domain_ModuleRoot, g.Domain_SecureModuleRoot, g.Domain_MailHost, g.Domain_MailMethod, g.Domain_Mail_AddAngleBrackets">
		</MvIF>

		<MvIF EXPR = "{ g.Tab EQ 'TIME' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00130">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Administration Session Timeout:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 10 NAME = "Domain_AdminTimeout" VALUE = "{ encodeentities( g.Domain_AdminTimeout ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED  ID = "MER-ADM-01522">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Failed Login Lockout Time:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 10 NAME = "Domain_LockoutTime" VALUE = "{ encodeentities( g.Domain_LockoutTime ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED  ID = "MER-ADM-01523">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Failed Login Attempts Allowed:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 10 NAME = "Domain_LoginTrys" VALUE = "{ encodeentities( g.Domain_LoginTrys ) }">
				</FONT>
			</TD></TR>

			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Domain_AdminTimeout, g.Domain_LockoutTime, g.Domain_LoginTrys">
		</MvIF>
		
		<MvIF EXPR = "{ g.Tab EQ 'UPST' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-01537">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Image Extension Types:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_ImageExtension" VALUE = "{ encodeentities( g.Domain_ImageExtension ) }">
				</FONT>
			</TD></TR>

			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Domain_ImageExtension">
		</MvIF>

		<MvDO FILE = "{ g.Feature_NOT_AD }" NAME = "l.note_tab" VALUE = "{ Screen_Notification_Settings() }">

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindFirst() }">
		<MvWHILE EXPR = "{ l.found AND l.ok }">
			<MvIF EXPR = "{ sexists( g.Module_Root $ Modules.d.module ) }">
				<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_api_version" VALUE = "{ Module_API_Version() }">
				<MvIF EXPR = "{ l.module_api_version GE 4.00 }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Domain_Content( g.Tab, g.Load_Fields ) }">
				</MvIF>
			</MvIF>

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindNext() }">
		</MvWHILE>

		<MvEVAL EXPR = "{ EndContent() }">
		<MvEVAL EXPR = "{ DrawButtons( 'UDMN:[UPDATE]' ) }">
		<MvEVAL EXPR = "{ EndScreen() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Store Selection Layout
|
</MvCOMMENT>

<MvFUNCTION NAME = "StoreSelection_Validate">
	<MvASSIGN NAME = "g.StoreSelection_Module" VALUE = "{ ltrim( rtrim( g.StoreSelection_Module ) ) }">

	<MvIF EXPR = "{ len( g.StoreSelection_Module ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-ADM-00131">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please select a layout</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'LAYO', '', l.error_msg ) }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_StoreSelection_Update" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ StoreSelection_Validate() }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code( g.StoreSelection_Module ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvIF EXPR = "{ g.StoreSelection_Module EQ g.StoreSelection_Original_Module }">
				<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.valid" VALUE = "{ UIModule_StoreSelection_Validate() }">
			<MvELSE>
				<MvASSIGN NAME = "l.valid" VALUE = 1>
			</MvIF>

			<MvIF EXPR = "{ l.valid }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Domain_Update( Domain.d.name, Domain.d.license, Domain.d.version,
																						Domain.d.owner, Domain.d.email, Domain.d.company,
																						Domain.d.address, Domain.d.city, Domain.d.state,
																						Domain.d.zip, Domain.d.country, Domain.d.phone,
																						Domain.d.fax, Domain.d.mm_url, Domain.d.mm_surl,
																						Domain.d.admin_surl, Domain.d.image_root,
																						Domain.d.base_url, Domain.d.base_surl, Domain.d.mod_root,
																						Domain.d.mod_sroot, Domain.d.admexp, Domain.d.mailhost,
																						Domain.d.mailmeth, Domain.d.mail_angl, Modules.d.id, 
																						Domain.d.lo_time, Domain.d.li_trys, Domain.d.img_ext ) }">
				<MvIF EXPR = "{ l.ok AND ( g.StoreSelection_Module EQ g.StoreSelection_Original_Module ) }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ UIModule_StoreSelection_Update() }">
				</MvIF>
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.ok AND l.valid }">
			<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00132">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store Selection Layout settings updated</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_StoreSelection_Preview">
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code( g.Module_Code ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ UIModule_StoreSelection_Preview() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_StoreSelection">
	<MvIF EXPR = "{ g.Load_Fields }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID_Admin( Domain.d.ui_id ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "g.StoreSelection_Original_Module" VALUE = "{ Modules.d.code }">
			<MvASSIGN NAME = "g.StoreSelection_Module" VALUE = "{ Modules.d.code }">

			<MvASSIGN NAME = "g.StoreSelection_UIModified" VALUE = 0>
			<MvASSIGN NAME = "g.Have_UI_Fields" VALUE = 0>
		</MvIF>
	<MvELSE>
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code( g.StoreSelection_Module ) }">
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvLOCALIZED NAME = "l.screen_label" ID = "MER-ADM-00133">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store Selection Layout</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvEVAL EXPR = "{ BeginScreen( l.screen_label, 'USSL', 'Help:ssmp.html' ) }">
		<SCRIPT LANGUAGE = "JavaScript">
<!--
function SetUIModified()
{
	document.SSMD.StoreSelection_UIModified.value = 1;
}

function PopupUIStoreSelectionPreview( module_code )
{
	window.open( Sessionurl + 'Screen=SSMP&Module_Code=' + module_code, 'UIStoreSelectionPreview', 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=640,height=480' ).focus();
}

function StoreSelection_Update()
{
	var submit = 1;

	if ( document.SSMD.StoreSelection_Original_Module.length && !document.SSMD.StoreSelection_Module.hidden )
	{
		if ( !confirm( 'You have changed layout modules.\nIf you continue, all changes made since the last update will be discarded.\n\nContinue?' ) )
		{
			submit = 0;
		}
	}

	if ( submit )
	{
		SubmitForm( 'SSMD', 'USSL' );
	}
}
//-->
		</SCRIPT>

		<MvLOCALIZED ID = "MER-ADM-00832">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				<SCRIPT LANGUAGE = "JavaScript">
<!--
	var layout_modules_changed = 'You have changed layout modules.\nIf you continue, all changes made since the last update will be discarded.\n\nContinue?';
//-->
				</SCRIPT>
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvHIDE FIELDS = "g.StoreSelection_Original_Module, g.StoreSelection_UIModified">
		
		<INPUT TYPE = "hidden" NAME = "Have_UI_Fields" VALUE = 1>

		<MvLOCALIZED NAME = "l.tabs" ID = "MER-ADM-00134">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">LAYO:Layout</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvASSIGN NAME = "l.module" VALUE = "{ Modules.d.module }">
		<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.module_tabs" VALUE = "{ UIModule_StoreSelection_Tabs() }">
		<MvIF EXPR = "{ len( l.module_tabs ) }">
			<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.module_tabs }">
		</MvIF>

		<MvEVAL EXPR = "{ DrawTabs( 'LAYO', l.tabs ) }">

		<MvEVAL EXPR = "{ BeginContent() }">
		<MvIF EXPR = "{ g.Tab EQ 'LAYO' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR>
			<MvASSIGN NAME = "l.column" VALUE = 0>
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindFirst_Type( 'UI' ) }">
			<MvWHILE EXPR = "{ l.found }">
				<MvASSIGN NAME = "l.column" VALUE = "{ l.column + 1 }">
				<MvIF EXPR = "{ l.column GT 2 }">
					</TR><TR>
					<MvASSIGN NAME = "l.column" VALUE = 1>
				</MvIF>

				<TD BGCOLOR = "#f0f0f0" ALIGN = "center" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.image" VALUE = "{ UIModule_StoreSelection_Thumbnail() }">
					<MvLOCALIZED NAME = "l.alt_text" ID = "MER-ADM-00802">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Preview</MvLOCALIZED-TEXT>
					</MvLOCALIZED>

					<A HREF = "{ 'JavaScript:PopupUIStoreSelectionPreview( \'' $ encodeentities( Modules.d.code ) $ '\');' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ encodeentities( l.image ) }"></A>
					<BR>
					<MvIF EXPR = "{ Modules.d.code EQ g.StoreSelection_Module }">
						<INPUT TYPE = "radio" NAME = "StoreSelection_Module" VALUE = "{ encodeentities( Modules.d.code ) }" CHECKED>
					<MvELSE>
						<INPUT TYPE = "radio" NAME = "StoreSelection_Module" VALUE = "{ encodeentities( Modules.d.code ) }">
					</MvIF>
					<MvEVAL EXPR = "{ Modules.d.name }">
					</FONT>
				</TD>

				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindNext_Type( 'UI' ) }">
			</MvWHILE>
			</TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.StoreSelection_Module">
		</MvIF>

		<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.ok" VALUE = "{ UIModule_StoreSelection_Content( g.Tab, NOT g.Have_UI_Fields ) }">
		<MvEVAL EXPR = "{ EndContent() }">

		<MvEVAL EXPR = "{ DrawButtons( 'USSL:[UPDATE];StoreSelection_Update()' ) }">

		<MvEVAL EXPR = "{ EndScreen() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Users
|
</MvCOMMENT>

<MvFUNCTION NAME = "User_Validate">
	<MvASSIGN NAME = "g.User_Name" VALUE = "{ ltrim( rtrim( g.User_Name ) ) }">

	<MvIF EXPR = "{ len( g.User_Name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00135">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a user name</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'USER', 'User_Name', l.error_message ) }">
	<MvELSE>
		<MvIF EXPR = "{ ( NOT g.Edit_User ) OR ( toupper( g.User_Name ) NE toupper( g.Edit_User ) ) }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ User_Find_Name( g.User_Name ) }">
			<MvIF EXPR = "{ l.found }">
				<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00136">
					<MvLOCALIZED-TOKEN NAME = "user_name" VALUE = "{ g.User_Name }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">A user with the name '%user_name%' already exists</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'USER', 'User_Name', l.error_message ) }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ ( NOT g.Edit_User ) AND ( len( g.User_Password ) EQ 0 ) }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00137">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a password</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'USER', 'User_Password', l.error_message ) }">
	<MvELSE>
		<MvIF EXPR = "{ g.User_Password NE g.User_VerifyPassword }">
			<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00138">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Passwords do not match</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'USER', 'User_Password', l.error_message ) }">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_WholeNumber_Positive_Required(g.Admin_User_PageLen) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PLEN', 'Admin_User_PageLen', g.Validation_Message ) }">
	</MvIF>


	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_User_Insert">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ g.Admin_User_Administrator OR g.Admin_User_Create }">
		<MvIF EXPR = "{ User_Validate() }">
			<MvIF EXPR = "{ g.Admin_User_Administrator }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ User_Insert( g.Admin_User_ID, g.Admin_User_PageLen, g.User_Name, g.User_Password, g.User_Administrator, g.User_Create, 1, 0, 0, 0 ) }">
			<MvELSE>
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ User_Insert( g.Admin_User_ID, g.Admin_User_PageLen, g.User_Name, g.User_Password, 0, 0, 1, 0, 0, 0 ) }">
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00139">
					<MvLOCALIZED-TOKEN NAME = "user_name" VALUE = "{ encodeentities( g.User_Name ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">User '%user_name%' added</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvEVAL EXPR = "{ Update_LeftNavigation() }">
				
				<MvASSIGN NAME = "g.Tab" VALUE = "USER">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_User_Update" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ User_Find_Name( g.Edit_User ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvIF EXPR = "{ g.Admin_User_Administrator OR ( g.Admin_User_Create AND ( Users.d.parent_id EQ g.Admin_User_ID ) ) OR
					    ( g.Admin_User_ID EQ Users.d.id ) }">
			<MvASSIGN NAME = "l.valid" VALUE = "{ User_Validate() }">

			<MvIF EXPR = "{ l.valid }">
				<MvIF EXPR = "{ Users.d.admin AND ( NOT g.User_Administrator ) }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.count" VALUE = "{ User_Count_Admin() }">
					<MvIF EXPR = "{ l.count EQ 1 }">
						<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00140">
							<MvLOCALIZED-TOKEN NAME = "user_name" VALUE = "{ g.User_Name }">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">User '%user_name%' is the only administrator, and cannot have those privileges removed</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						<MvASSIGN NAME = "l.valid" VALUE = "{ FieldError( 'USER', '', l.error_message ) }">
					</MvIF>
				</MvIF>
			</MvIF>

<MvCOMMENT>Get it again, because User_Count_Admin Screwed it up</MvCOMMENT>

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ User_Find_Name( g.Edit_User ) }">

			<MvIF EXPR = "{ l.valid }">
				<MvIF EXPR = "{ g.User_Unlock }">
					<MvASSIGN NAME = "l.c_fails" VALUE = 0>
					<MvASSIGN NAME = "l.lo_date" VALUE = 0>
				</MvIF>
				<MvIF EXPR = "{ g.Admin_User_Administrator }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ User_Update( Users.d.id, Users.d.parent_id, g.Admin_User_PageLen, g.User_Name, g.User_Password, g.User_Administrator, g.User_Create, Users.d.t_fails, l.c_fails, l.lo_date, Users.d.smod ) }">
				<MvELSE>
					<MvIF EXPR = "{ g.Admin_User_ID EQ Users.d.parent_id }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ User_Update( Users.d.id, Users.d.parent_id, g.Admin_User_PageLen, g.User_Name, g.User_Password, Users.d.admin, Users.d.create, Users.d.t_fails, l.c_fails, l.lo_date, Users.d.smod ) }">
					<MvELSE>
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ User_Update( Users.d.id, Users.d.parent_id, g.Admin_User_PageLen, Users.d.name, g.User_Password, Users.d.admin, Users.d.create, Users.d.t_fails, l.c_fails, l.lo_date, Users.d.smod ) }">
					</MvIF>
				</MvIF>

				<MvIF EXPR = "{ l.ok }">
					<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00141">
						<MvLOCALIZED-TOKEN NAME = "user_name" VALUE = "{ encodeentities( g.Edit_User ) }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">User '%user_name%' updated</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvASSIGN NAME = "g.Edit_User" VALUE = "{ g.User_Name }">

					<MvEVAL EXPR = "{ Update_LeftNavigation() }">
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_User_Delete">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvASSIGN NAME = "l.valid" VALUE = 1>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ User_Find_Name( g.User_Name ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.user_id" VALUE = "{ Users.d.id }">
		<MvASSIGN NAME = "l.parent_id" VALUE = "{ Users.d.parent_id }">

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.admin" VALUE = "{ User_Is_Admin( l.user_id ) }">
		<MvIF EXPR = "{ l.admin }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.count" VALUE = "{ User_Count_Admin() }">
			<MvIF EXPR = "{ l.count EQ 1 }">
				<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00142">
					<MvLOCALIZED-TOKEN NAME = "user_name" VALUE = "{ g.User_Name }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">User '%user_name%' is the only administrator, and cannot be deleted</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvASSIGN NAME = "l.valid" VALUE = "{ FieldError( 'USER', '', l.error_message ) }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.valid }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.manager" VALUE = "{ User_Is_Manager( l.user_id ) }">
			<MvIF EXPR = "{ l.manager }">
				<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00143">
					<MvLOCALIZED-TOKEN NAME = "user_name" VALUE = "{ g.User_Name }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">User '%user_name%' is the manager of one or more stores, and cannot be deleted</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvASSIGN NAME = "l.valid" VALUE = "{ FieldError( 'USER', '', l.error_message) }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.valid }">
			<MvIF EXPR = "{ g.Admin_User_Administrator OR ( g.Admin_User_Create AND ( g.Admin_User_ID EQ l.parent_id ) ) }">
				<MvIF EXPR = "{ g.Admin_User_ID EQ l.user_id }">
					<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00863">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Sorry, you are currently using this user</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvASSIGN NAME = "l.valid" VALUE = "{ FieldError( 'USER', '', l.error_message) }">
				<MvELSE>
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ User_Delete( l.user_id ) }">

					<MvIF EXPR = "{ l.ok }">
						<MvASSIGN NAME = "g.Edit_User" VALUE = "">
						<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00144">
							<MvLOCALIZED-TOKEN NAME = "user_name" VALUE = "{ encodeentities( g.User_Name ) }">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">User '%user_name%' deleted</MvLOCALIZED-TEXT>
						</MvLOCALIZED>

						<MvEVAL EXPR = "{ Update_LeftNavigation() }">
					</MvIF>
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Users">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00145">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add User</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvASSIGN NAME = "l.action" VALUE = "IUSR">
	<MvASSIGN NAME = "l.can_view" VALUE = 1>

	<MvIF EXPR = "{ len( g.Edit_User ) }">
		<MvASSIGN NAME = "l.action" VALUE = "UUSR">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ User_Find_Name( g.Edit_User ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00146">
				<MvLOCALIZED-TOKEN NAME = "user_name" VALUE = "{ encodeentities( g.Edit_User ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Edit User: %user_name%</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvIF EXPR = "{ g.Load_Fields }">
				<MvASSIGN NAME = "g.User_Name" VALUE = "{ Users.d.name }">
				<MvASSIGN NAME = "g.User_Administrator" VALUE = "{ Users.d.admin }">
				<MvASSIGN NAME = "g.User_Create" VALUE = "{ Users.d.create }">
				<MvASSIGN NAME = "g.Admin_User_PageLen" VALUE = "{ Users.d.page_len }">
			</MvIF>
		</MvIF>
	<MvELSE>
		<MvASSIGN NAME = "l.can_view" VALUE = "{ g.Admin_User_Administrator OR g.Admin_User_Create }">

		<MvIF EXPR = "{ g.Load_Fields }">
			<MvASSIGN NAME = "g.User_Name" VALUE = "">
			<MvASSIGN NAME = "g.User_Administrator" VALUE = 0>
			<MvASSIGN NAME = "g.User_Create" VALUE = 0>
			<MvASSIGN NAME = "g.Admin_User_PageLen" VALUE = "10">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ NOT l.can_view }">
		<MvFUNCTIONRETURN VALUE = "{ Screen_Blank() }">
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvEVAL EXPR = "{ BeginScreen( l.title, l.action, 'Help:user.html' ) }">

		<MvIF EXPR = "{ len( g.Edit_User ) }">
			<MvHIDE FIELDS = "g.Edit_User">
		</MvIF>

		<MvLOCALIZED NAME = "l.tab_list" ID = "MER-ADM-00147">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">USER:User,PLEN:Preferences</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvEVAL EXPR = "{ DrawTabs( 'USER', l.tab_list ) }">

		<MvEVAL EXPR = "{ BeginContent() }">
		<MvIF EXPR = "{ g.Tab EQ 'USER' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00148">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">User Name:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "User_Name" VALUE = "{ encodeentities( g.User_Name ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00149">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Password:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "password" SIZE = 30 NAME = "User_Password">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00150">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Verify Password:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "password" SIZE = 30 NAME = "User_VerifyPassword">
				</FONT>
			</TD></TR>

			<MvIF EXPR = "{ g.Admin_User_Administrator }">
				<TR><TD NOWRAP>
					&nbsp;
				</TD><TD WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00151">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Administrator</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.User_Administrator, 'User_Administrator', 'Yes', l.text ) }">
					</FONT>
				</TD></TR>

				<TR><TD NOWRAP>
					&nbsp;
				</TD><TD WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00152">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">User May Create Additional Users</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.User_Create, 'User_Create', 'Yes', l.text ) }">
					</FONT>
				</TD></TR>
				<MvIF EXPR = "{ Users.d.lo_date }">
					<TR><TD NOWRAP>
						&nbsp;
					</TD><TD WIDTH = "100%">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-01505">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unlock User</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.User_Unlock, 'User_Unlock', 'Yes', l.text ) }">
						</FONT>
					</TD></TR>
				</MvIF>
			</MvIF>

			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.User_Name, g.User_Password, g.User_VerifyPassword, g.User_Administrator, g.User_Create">
			<MvIF EXPR = "{ Users.d.lo_date }">
				<MvHIDE FIELDS = "g.User_Unlock">
			</MvIF>
		</MvIF>
		
		<MvIF EXPR = "{ g.Tab EQ 'PLEN' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00148">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Items per Page:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 5 NAME = "Admin_User_PageLen" VALUE = "{ encodeentities( g.Admin_User_PageLen ) }">
				</FONT>
			</TD></TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Admin_User_PageLen">
		</MvIF>
		
		<MvEVAL EXPR = "{ EndContent() }">

		<MvIF EXPR = "{ len( g.Edit_User ) }">
			<MvIF EXPR = "{ g.Admin_User_Administrator OR
							( g.Admin_User_Create AND ( Users.d.parent_id EQ g.Admin_User_ID ) ) OR
							( Users.d.id EQ g.Admin_User_ID ) }">
				<MvIF EXPR = "{ g.Admin_User_Administrator OR ( g.Admin_User_Create AND ( Users.d.parent_id EQ g.Admin_User_ID ) ) }">
					<MvEVAL EXPR = "{ DrawButtons( 'UUSR:[UPDATE],DUSR:[DELETE]' ) }">
				<MvELSE>
					<MvEVAL EXPR = "{ DrawButtons( 'UUSR:[UPDATE]' ) }">
				</MvIF>
			<MvELSE>
				<MvEVAL EXPR = "{ DrawButtons( '' ) }">
			</MvIF>
		<MvELSE>
			<MvIF EXPR = "{ g.Admin_User_Administrator OR g.Admin_User_Create }">
				<MvEVAL EXPR = "{ DrawButtons( 'IUSR:[ADD]' ) }">
			<MvELSE>
				<MvEVAL EXPR = "{ DrawButtons( '' ) }">
			</MvIF>
		</MvIF>
		<MvEVAL EXPR = "{ EndScreen() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Modules
|
</MvCOMMENT>

<MvFUNCTION NAME = "Module_Validate">
	<MvASSIGN NAME = "g.Module_Module" VALUE = "{ ltrim( rtrim( g.Module_Module ) ) }">

	<MvASSIGN NAME = "g.Module_Module" VALUE = "{ glosub( g.Module_Module, '\\', '/' ) }">

	<MvIF EXPR = "{ len( g.Module_Module ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00153">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a module</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'FILE', 'Module_Module', l.error_message ) }">
	<MvELSE>
		<MvIF EXPR = "{ substring( g.Module_Module, 1, 1 ) EQ '/' }">
			<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-01538">
				<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ g.Module_Module }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">The module path '%module%' may not begin with '/'</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'FILE', 'Module_Module', l.error_message ) }">
		<MvELSE>
			<MvIF EXPR = "{ NOT sexists( g.Module_Root $ g.Module_Module ) }">
				<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00154">
					<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ g.Module_Root $ g.Module_Module }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">The file '%module%' does not exist</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'FILE', 'Module_Module', l.error_message ) }">
			<MvELSE>
				<MvDO FILE = "{ g.Module_Root $ g.Module_Module }" NAME = "g.Module_Type" VALUE = "{ Module_Type() }">
				<MvDO FILE = "{ g.Module_Root $ g.Module_Module }" NAME = "g.Module_Code" VALUE = "{ Module_Code() }">
				<MvDO FILE = "{ g.Module_Root $ g.Module_Module }" NAME = "g.Module_Name" VALUE = "{ Module_Name() }">
				<MvDO FILE = "{ g.Module_Root $ g.Module_Module }" NAME = "g.Module_Provider" VALUE = "{ Module_Provider() }">
				<MvDO FILE = "{ g.Module_Root $ g.Module_Module }" NAME = "g.Module_API_Version" VALUE = "{ Module_API_Version() }">
				<MvDO FILE = "{ g.Module_Root $ g.Module_Module }" NAME = "g.Module_Version_number" VALUE = "{ Module_Version() }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Module_Insert">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ Module_Validate() }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_Code_Admin( g.Module_Code ) }">
		<MvIF EXPR = "{ l.found }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00155">
				<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ g.Module_Name }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module '%module%' is already installed</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvASSIGN NAME = "l.error" VALUE = "{ FieldError( 'FILE', 'Module_Module', l.error ) }">
		<MvELSE>
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.module_id" VALUE = "{ Module_Insert( g.Module_Type, g.Module_Code, g.Module_Name, g.Module_Provider, g.Module_Version_number, g.Module_Module, 1 ) }">
			<MvIF EXPR = "{ NOT l.module_id }">
				<MvASSIGN NAME = "l.ok" VALUE = 0>
			<MvELSE>
				<MvDO FILE = "{ g.Module_Root $ g.Module_Module }" NAME = "l.error" VALUE = "{ Module_Install() }">
				<MvIF EXPR = "{ l.error }">
					<MvASSIGN NAME = "g.Edit_Module" VALUE = "{ g.Module_Code }">
				<MvELSE>
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.foo" VALUE = "{ Module_Delete( l.module_id ) }">
					<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00803">
						<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ g.Module_Name }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Installation of Module '%module%' failed</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvASSIGN NAME = "l.error" VALUE = "{ FieldError( 'FILE', 'Module_Module', l.error ) }">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00156">
					<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ g.Module_Name }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module '%module%' installed</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvEVAL EXPR = "{ Update_LeftNavigation() }">
			</MvIF>
		</MvIF>
	</MvIF>
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Module_Update">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code_Admin( g.Edit_Module ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvIF EXPR = "{ Module_Validate() }">
			<MvIF EXPR = "{ g.Module_Code NE Modules.d.code }">
				<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00157">
					<MvLOCALIZED-TOKEN NAME = "oldmodule" VALUE = "{ Modules.d.name }">
					<MvLOCALIZED-TOKEN NAME = "newmodule" VALUE = "{ g.Module_Module }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module '%oldmodule%' cannot be upgraded by '%newmodule%'</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvASSIGN NAME = "l.error" VALUE = "{ FieldError( 'FILE', 'Module_Module', l.error_message ) }">
			<MvELSE>
				<MvASSIGN NAME = "l.module_id" VALUE = "{ Modules.d.id }">
				<MvASSIGN NAME = "l.module_code" VALUE = "{ Modules.d.code }">
				<MvASSIGN NAME = "l.module_version_number" VALUE = "{ Modules.d.version }">
				<MvASSIGN NAME = "l.module_refcount" VALUE = "{ Modules.d.refcount }">

				<MvIF EXPR = "{ l.module_version_number LT g.Module_Version_number }">
					<MvDO FILE = "{ g.Module_Module }" NAME = "l.ok" VALUE = "{ Module_Upgrade( l.module_version_number ) }">
					<MvIF EXPR = "{ l.ok }">
						<MvIF EXPR = "{ l.module_refcount }">
							<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Store_FindFirst() }">
							<MvWHILE EXPR = "{ l.ok AND l.found }">
								<MvASSIGN NAME = "l.ok" VALUE = "{ Admin_Open_Store( Stores.d.code ) }">
								<MvIF EXPR = "{ l.ok }">
									<MvASSIGN NAME = "l.update" VALUE = 0>

									<MvIF EXPR = "{ ( l.module_id EQ Stores.d.ui_id ) OR
													( l.module_id EQ Stores.d.tax_id ) OR
													( l.module_id EQ Stores.d.currncy_id ) }">
										<MvASSIGN NAME = "l.update" VALUE = 1>
									<MvELSE>
										<MvDO FILE = "{ g.Library_DB }" NAME = "l.update" VALUE = "{ StoreModule_Find_ID( l.module_id ) }">
									</MvIF>

									<MvIF EXPR = "{ l.update }">
										<MvDO FILE = "{ g.Module_Root $ g.Module_Module }" NAME = "l.ok" VALUE = "{ Module_Upgrade_Store( l.module_version_number ) }">
									</MvIF>
								</MvIF>

								<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Store_FindNext() }">
							</MvWHILE>
						</MvIF>
					</MvIF>
				<MvELSE>
					<MvIF EXPR = "{ l.module_version_number GT g.Module_Version_number }">
						<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00158">
							<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ g.Module_Module }">
							<MvLOCALIZED-TOKEN NAME = "oldversion" VALUE = "{ l.module_version_number }">
							<MvLOCALIZED-TOKEN NAME = "newversion" VALUE = "{ g.Module_Version_number }">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">The file '%module%' is version '%newversion%', which is older than the installed version, '%oldversion%'</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						<MvASSIGN NAME = "l.error" VALUE = "{ FieldError( 'FILE', 'Module_Module', l.error_message) }">
					</MvIF>
				</MvIF>

				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Update( l.module_id, l.module_code, g.Module_Name, g.Module_Provider, g.Module_Version_number, g.Module_Module, g.Module_Active ) }">
				</MvIF>

				<MvIF EXPR = "{ l.ok }">
					<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00159">
						<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ encodeentities( Modules.d.name ) }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module '%module%' updated</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Module_Delete_Validate">
	<MvIF EXPR = "{ Modules.d.id EQ Domain.d.ui_id }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00160">
			<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ Modules.d.name }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module '%module%' is the Store Selection Layout module and cannot be deleted</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'INFO', '', l.error_message ) }">
	</MvIF>

	<MvIF EXPR = "{ Modules.d.refcount GT 0 }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00161">
			<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ Modules.d.name }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module '%module%' is in use by one or more stores, and cannot be deleted</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'INFO', '', l.error_message ) }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Module_Delete" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code_Admin( g.Edit_Module ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvIF EXPR = "{ Module_Delete_Validate() }">
			<MvIF EXPR = "{ Modules.d.active }">
				<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Uninstall() }">
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvASSIGN NAME = "l.name" VALUE = "{ Modules.d.name }">

				<MvIF EXPR = "{ g.Delete_Module_File }">
					<MvIF EXPR = "{ NOT sdelete( g.Module_Root $ Modules.d.module ) }">
						<MvIF EXPR = "{ Modules.d.active }">
							<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00162">
								<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ encodeentities( g.Module_Root $ Modules.d.module ) }">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unable to delete '%module%'</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-ADM-00004', l.error_message ) }">
						</MvIF>
					</MvIF>
				</MvIF>

				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Delete( Modules.d.id ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvASSIGN NAME = "g.Edit_Module" VALUE = "">
					<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00163">
						<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ Modules.d.name }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module '%module%' deleted</MvLOCALIZED-TEXT>
					</MvLOCALIZED>

					<MvASSIGN NAME = "g.Tab" VALUE = "FILE">
					
					<MvEVAL EXPR = "{ Update_LeftNavigation() }">
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_DeleteModule">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code_Admin( g.Edit_Module ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvLOCALIZED NAME = "l.screen_label" ID = "MER-ADM-00164">
			<MvLOCALIZED-TOKEN NAME = "module_name" VALUE = "{ encodeentities( Modules.d.name ) }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Delete Module: %module_name%</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvEVAL EXPR = "{ BeginScreen( l.screen_label, '', 'Help:dmod.html' ) }">
		<MvHIDE FIELDS = "g.Edit_Module">

		<MvEVAL EXPR = "{ BeginContent() }">
		<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0>
		<TR><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED ID = "MER-ADM-00165">
				<MvLOCALIZED-TOKEN NAME = "module_name" VALUE = "{ encodeentities( Modules.d.name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Remove module <B>%module_name%</B>?</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			</FONT>
		</TD></TR>

		<TR><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<INPUT TYPE = "checkbox" NAME = "Delete_Module_File" VALUE = "Yes" CHECKED>
			<MvLOCALIZED ID = "MER-ADM-00789">
				<MvLOCALIZED-TOKEN NAME = "module_code" VALUE = "{ encodeentities( g.Module_Root $ Modules.d.module ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Delete module file <B>%module_code%</B></MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</FONT>
		</TD></TR>
		</TABLE>
		<MvEVAL EXPR = "{ EndContent() }">

		<TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
		<TR><TD BGCOLOR = "#000000">
			<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD BGCOLOR = "#f0f0f0" WIDTH = "100%">
				&nbsp;
			</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00738">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">
						<INPUT TYPE = "button" VALUE = "Delete" ONCLICK = "SubmitForm( 'MODS', 'DMOD' );">
					</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00747">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US"><INPUT TYPE = "button" VALUE = "Cancel" ONCLICK = "SubmitForm( 'MODS', '' );"></MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD></TR>
			</TABLE>
		</TD></TR>

		</TABLE>
		
		<MvHIDE FIELDS = "g.Module_Active, g.Module_Module">

		<MvEVAL EXPR = "{ EndScreen() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Modules">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00167">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Module</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvASSIGN NAME = "l.action" VALUE = "IMOD">

	<MvIF EXPR = "{ len( g.Edit_Module ) }">
		<MvASSIGN NAME = "l.action" VALUE = "UMOD">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code_Admin( g.Edit_Module ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00168">
				<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ encodeentities( Modules.d.name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Edit Module: %module%</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvIF EXPR = "{ g.Load_Fields }">
				<MvASSIGN NAME = "g.Module_Module" VALUE = "{ Modules.d.module }">
				<MvASSIGN NAME = "g.Module_Active" VALUE = "{ Modules.d.active }">
			</MvIF>
		</MvIF>
	<MvELSE>
		<MvIF EXPR = "{ g.Load_Fields }">
			<MvASSIGN NAME = "g.Module_Module" VALUE = "">
			<MvASSIGN NAME = "g.Module_Active" VALUE = "1">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvEVAL EXPR = "{ BeginScreen( l.title, l.action, 'Help:mods.html' ) }">

		<MvIF EXPR = "{ len( g.Edit_Module ) }">
			<MvHIDE FIELDS = "g.Edit_Module">
		</MvIF>

		<MvIF EXPR = "{ len( g.Edit_Module ) }">
			<MvLOCALIZED NAME = "l.tab_list" ID = "MER-ADM-00169">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">INFO:Information,FILE:Files</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvEVAL EXPR = "{ DrawTabs( 'INFO', l.tab_list ) }">
		<MvELSE>
			<MvLOCALIZED NAME = "l.tab_list" ID = "MER-ADM-00170">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">FILE:Files</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvEVAL EXPR = "{ DrawTabs( 'FILE', l.tab_list ) }">
		</MvIF>

		<MvEVAL EXPR = "{ BeginContent() }">

		<MvIF EXPR = "{ g.Tab EQ 'INFO' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00171"><B>
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Type of Module:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ Modules.d.type EQ 'UI' }">
					<MvLOCALIZED ID = "MER-ADM-00172">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">User Interface</MvLOCALIZED-TEXT>
					</MvLOCALIZED>

				</MvIF>

				<MvIF EXPR = "{ Modules.d.type EQ 'CURRENCY' }">
					<MvLOCALIZED ID = "MER-ADM-00173">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Currency</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ Modules.d.type EQ 'TAX' }">
					<MvLOCALIZED ID = "MER-ADM-00174">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Tax</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ Modules.d.type EQ 'SHIPPING' }">
					<MvLOCALIZED ID = "MER-ADM-00175">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Shipping</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ Modules.d.type EQ 'PAYMENT' }">
					<MvLOCALIZED ID = "MER-ADM-00176">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Payment Processing</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ Modules.d.type EQ 'FULFILLMENT' }">
					<MvLOCALIZED ID = "MER-ADM-00177">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Fulfillment</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ Modules.d.type EQ 'BATCHREPORT' }">
					<MvLOCALIZED ID = "MER-ADM-00178">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Order Reporting</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ Modules.d.type EQ 'IMPORT' }">
					<MvLOCALIZED ID = "MER-ADM-00179">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Data Import</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ Modules.d.type EQ 'EXPORT' }">
					<MvLOCALIZED ID = "MER-ADM-00180">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Data Export</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ Modules.d.type EQ 'LOG' }">
					<MvLOCALIZED ID = "MER-ADM-00181">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Logging</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ Modules.d.type EQ 'SYSTEM' }">
					<MvLOCALIZED ID = "MER-ADM-00182">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">System Extension</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ Modules.d.type EQ 'STOREUTIL' }">
					<MvLOCALIZED ID = "MER-ADM-00183">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store Utility</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ Modules.d.type EQ 'WIZARD' }">
					<MvLOCALIZED ID = "MER-ADM-00184">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Wizard</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ Modules.d.type EQ 'STOREWIZARD' }">
					<MvLOCALIZED ID = "MER-ADM-00185">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store Wizard</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00186">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ encodeentities( Modules.d.code ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00187">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ encodeentities( Modules.d.name ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00188">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Provider:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ encodeentities( Modules.d.provider ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00189">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Version:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ encodeentities( Modules.d.version ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00190">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Usage Count (Number of Stores):</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ Modules.d.refcount }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					&nbsp;
				</FONT>
			</TD><TD WIDTH = "100%" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-01506">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Active</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvIF EXPR = "{ g.Module_Active }">
					<INPUT TYPE = "checkbox" NAME = "Module_Active" VALUE = "Yes" CHECKED> <MvEVAL EXPR = "{ l.text }">
				<MvELSE>
					<INPUT TYPE = "checkbox" NAME = "Module_Active" VALUE = "Yes"> <MvEVAL EXPR = "{ l.text }">
				</MvIF>
				</FONT>
			</TD></TR>
			
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Module_Active">
		</MvIF>

		<MvIF EXPR = "{ g.Tab EQ 'FILE' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00191">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" NAME = "Module_Module" VALUE = "{ g.Module_Module }" SIZE = "40">
				<MvEVAL EXPR = "{ '<A HREF = "JavaScript:PopupFileUpload( \'Module\', \'' $ JavaScriptEncode( g.Edit_Module ) $ '\', 'Module_Module' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Upload(0) }"><MvEVAL EXPR = "</A>">
				</FONT>
			</TD></TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Module_Module">
		</MvIF>

		<MvEVAL EXPR = "{ EndContent() }">

		<MvIF EXPR = "{ len( g.Edit_Module ) }">
			<MvEVAL EXPR = "{ DrawButtons( 'UMOD:[UPDATE],DMOD.:[DELETE]' ) }">
		<MvELSE>
			<MvEVAL EXPR = "{ DrawButtons( 'IMOD:[ADD]' ) }">
		</MvIF>

		<MvEVAL EXPR = "{ EndScreen() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Stores
|
</MvCOMMENT>

<MvFUNCTION NAME = "Store_Validate" PARAMETERS = "insert" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ ( NOT l.insert ) AND ( NOT CanI( 'STOR',0,0,1,0 ) ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>

	<MvASSIGN NAME = "g.Store_License" VALUE = "{ ltrim( rtrim( g.Store_License ) ) }">
	<MvASSIGN NAME = "g.Store_Manager" VALUE = "{ ltrim( rtrim( g.Store_Manager ) ) }">
	<MvASSIGN NAME = "g.Store_StoreCode" VALUE = "{ ltrim( rtrim( g.Store_StoreCode ) ) }">
	<MvASSIGN NAME = "g.Store_Name" VALUE = "{ ltrim( rtrim( g.Store_Name ) ) }">
	<MvASSIGN NAME = "g.Store_Owner" VALUE = "{ ltrim( rtrim( g.Store_Owner ) ) }">
	<MvASSIGN NAME = "g.Store_Email" VALUE = "{ ltrim( rtrim( g.Store_Email ) ) }">
	<MvASSIGN NAME = "g.Store_Company" VALUE = "{ ltrim( rtrim( g.Store_Company ) ) }">
	<MvASSIGN NAME = "g.Store_Address" VALUE = "{ ltrim( rtrim( g.Store_Address ) ) }">
	<MvASSIGN NAME = "g.Store_City" VALUE = "{ ltrim( rtrim( g.Store_City ) ) }">
	<MvASSIGN NAME = "g.Store_State" VALUE = "{ ltrim( rtrim( g.Store_State ) ) }">
	<MvASSIGN NAME = "g.Store_Zip" VALUE = "{ ltrim( rtrim( g.Store_Zip ) ) }">
	<MvASSIGN NAME = "g.Store_Country" VALUE = "{ ltrim( rtrim( g.Store_Country ) ) }">
	<MvASSIGN NAME = "g.Store_Phone" VALUE = "{ ltrim( rtrim( g.Store_Phone ) ) }">
	<MvASSIGN NAME = "g.Store_Fax" VALUE = "{ ltrim( rtrim( g.Store_Fax ) ) }">
	<MvASSIGN NAME = "g.Store_WeightUnits" VALUE = "{ ltrim( rtrim( g.Store_WeightUnits ) ) }">
	<MvASSIGN NAME = "g.Store_BasketExpiration" VALUE = "{ ltrim( rtrim( g.Store_BasketExpiration ) ) }">
	<MvASSIGN NAME = "g.Store_TaxModule" VALUE = "{ ltrim( rtrim( g.Store_TaxModule ) ) }">
	<MvASSIGN NAME = "g.Store_CurrencyModule" VALUE = "{ ltrim( rtrim( g.Store_CurrencyModule ) ) }">
	<MvASSIGN NAME = "g.Store_UserInterface" VALUE = "{ ltrim( rtrim( g.Store_UserInterface ) ) }">
	<MvASSIGN NAME = "g.Store_MaintenanceWarning" VALUE = "{ ltrim( rtrim( g.Store_MaintenanceWarning ) ) }">
	<MvASSIGN NAME = "g.Store_MaintenanceMessage" VALUE = "{ ltrim( rtrim( g.Store_MaintenanceMessage ) ) }">
	<MvASSIGN NAME = "g.Store_NoNewCustomerTime" VALUE = "{ ltrim( rtrim( g.Store_NoNewCustomerTime ) ) }">
	<MvASSIGN NAME = "g.Store_OrderMinQuantity" VALUE = "{ ltrim( rtrim( g.Store_OrderMinQuantity ) ) }">
	<MvASSIGN NAME = "g.Store_OrderMinPrice" VALUE = "{ ltrim( rtrim( g.Store_OrderMinPrice ) ) }">
	<MvASSIGN NAME = "g.Store_OrderMinMeetAll" VALUE = "{ ltrim( rtrim( g.Store_OrderMinMeetAll ) ) }">
	<MvASSIGN NAME = "g.Store_OrderMinMessage" VALUE = "{ ltrim( rtrim( g.Store_OrderMinMessage ) ) }">

	<MvIF EXPR = "{ NOT l.insert }">
		<MvASSIGN NAME = "g.CustomerEmail_From" VALUE = "{ ltrim( rtrim( g.CustomerEmail_From ) ) }">
		<MvASSIGN NAME = "g.CustomerEmail_CC" VALUE = "{ ltrim( rtrim( g.CustomerEmail_CC ) ) }">
		<MvASSIGN NAME = "g.CustomerEmail_Subject" VALUE = "{ ltrim( rtrim( g.CustomerEmail_Subject ) ) }">
	</MvIF>

	<MvIF EXPR = "{ l.insert }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.inuse" VALUE = "{ Store_License_In_Use( Domain.d.license ) }">
		<MvIF EXPR = "{ NOT l.inuse }">
			<MvASSIGN NAME = "g.Store_License" VALUE = "{ Domain.d.license }">
		<MvELSE>
			<MvIF EXPR = "{ len( g.Store_License ) EQ 0 }">
				<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00192">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a license number</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'LICE', 'Store_License', l.error ) }">
			<MvELSE>
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.inuse" VALUE = "{ Store_License_In_Use( g.Store_License ) }">
				<MvIF EXPR = "{ l.inuse }">
					<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00193">
						<MvLOCALIZED-TOKEN NAME = "license" VALUE = "{ g.Store_License }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Sorry, you are already using license number '%license%' for another storefront. Please check your records and try again.</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvFUNCTIONRETURN VALUE = "{ FieldError( 'LICE', 'Store_License', l.error ) }">
				</MvIF>

				<MvASSIGN NAME = "API" VALUE = "{ s.apitype }">
				<MvASSIGN NAME = "MERCHANT_HOST" VALUE = "{ s.server_name }">
				<MvASSIGN NAME = "LICENSE_NUMBER" VALUE = "{ g.Store_License }">
				<MvASSIGN NAME = "MERCHANT_VERSION" VALUE = "{ Domain.d.version }">
				<MvASSIGN NAME = "PRODUCT_TYPE" VALUE = "STOREFRONT">
       			<MvASSIGN NAME = "PRODUCT_LINE" VALUE = "MERCHANT">
				<MvASSIGN NAME = "OPERATIONS" VALUE = "VALIDATE">
				<MvASSIGN NAME = "LANGUAGE" VALUE = "{ s.miva_language }">
				<MvASSIGN NAME = "MERCHANT_STOREURL" VALUE = "{ Domain.d.mm_url }">

				<MvASSIGN NAME = "l.valid" VALUE = 0>

				<MvLOCALIZED NAME = "l.error_text" ID = "MER-ADM-01539">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unable to validate license number</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvCALL METHOD = "POST"
						ACTION = "http://licensemgr.miva.com/gateway/gateway.mv"
						FIELDS = "MERCHANT_HOST, API, LICENSE_NUMBER, MERCHANT_VERSION, NAME, COMPANY, ADDRESS,
								  CITY, STATE, ZIP, COUNTRY, PHONE, FAX, EMAIL, PRODUCT_LINE, PRODUCT_TYPE, LANGUAGE, MERCHANT_STOREURL">
					<MvIF EXPR = "{ s.callobjectelement EQ 'LmLICENSE' }">
						<MvASSIGN NAME = "l.attribute" VALUE = 1>
						<MvWHILE EXPR = "{ ( l.attribute LE s.callobjectnumattributes ) }">
							<MvIF EXPR = "{ s.callobjectattribute[ l.attribute ] EQ 'VALID' }">
								<MvASSIGN NAME = "l.valid_value" VALUE = "{ s.callobjectvalue[ l.attribute ] }">
							</MvIF>
							<MvIF EXPR = "{ s.callobjectattribute[ l.attribute ] EQ 'ERROR_CODE' }">
								<MvASSIGN NAME = "l.error_code_value" VALUE = "{ s.callobjectvalue[ l.attribute ] }">
							</MvIF>
							<MvIF EXPR = "{ s.callobjectattribute[ l.attribute ] EQ 'ERROR_MESSAGE' }">
								<MvASSIGN NAME = "l.error_message_value" VALUE = "{ s.callobjectvalue[ l.attribute ] }">
							</MvIF>
							<MvASSIGN NAME = "l.attribute" VALUE = "{ l.attribute + 1 }">
						</MvWHILE>
					</MvIF>
				</MvCALL>

				<MvIF EXPR = "{ toupper( l.valid_value ) EQ 'YES' }">
					<MvASSIGN NAME = "l.valid" VALUE = "1">
				<MvELSE>
					<MvASSIGN NAME = "l.error_message_value" VALUE = "{ ltrim( rtrim( l.error_message_value ) ) }">
					<MvASSIGN NAME = "l.error_code_value" VALUE = "{ ltrim( rtrim( l.error_code_value ) ) }">
					<MvIF EXPR = "{ NOT len( l.error_message_value ) }">
						<MvIF EXPR = "{ len( l.error_code_value ) }">
							<MvASSIGN NAME = "l.error_text" VALUE = "{ l.error_code_value }">
						</MvIF>
					<MvELSE>
						<MvASSIGN NAME = "l.error_text" VALUE = "{ l.error_message_value }">
					</MvIF>
				</MvIF>

				<MvIF EXPR = "{ NOT l.valid }">
					<MvFUNCTIONRETURN VALUE = "{ FieldError( 'LICE', 'Store_License', l.error_text ) }">
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ l.insert OR g.Admin_User_Administrator }">
		<MvIF EXPR = "{ NOT len( g.Store_Manager ) }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00194">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a manager</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'IDEN', 'Store_Manager', l.error ) }">
		<MvELSE>
			<MvDO FILE = "{ g.Library_DB }" NAME = "g.Store_Manager_ID" VALUE = "{ User_Find_Name( g.Store_Manager ) }">
			<MvIF EXPR = "{ g.Store_Manager_ID EQ 0 }">
				<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00195">
					<MvLOCALIZED-TOKEN NAME = "manager" VALUE = "{ g.Store_Manager }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">User '%manager%' not found</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'IDEN', 'Store_Manager', l.error ) }">
			</MvIF>
		</MvIF>
	<MvELSE>
		<MvASSIGN NAME = "g.Store_Manager_ID" VALUE = "{ Stores.d.manager_id }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_Code( g.Store_StoreCode ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'IDEN', 'Store_StoreCode', g.Validation_Message ) }">
	<MvELSE>
		<MvIF EXPR = "{ ( NOT g.Edit_Store ) OR ( toupper( g.Store_StoreCode ) NE toupper( g.Edit_Store ) ) }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Store_Find_Code( g.Store_StoreCode ) }">
			<MvIF EXPR = "{ l.found }">
				<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00197">
					<MvLOCALIZED-TOKEN NAME = "storecode" VALUE = "{ g.Store_StoreCode }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">A store with the code '%storecode%' already exists</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'IDEN', 'Store_StoreCode', l.error ) }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ len( g.Store_Name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00198">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a store name</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'IDEN', 'Store_Name', l.error ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Store_Owner ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00199">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify the store owner's name</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'OWNE', 'Store_Owner', l.error ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_Email( g.Store_Email ) }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00200">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify the store owner's email address</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'OWNE', 'Store_Email', l.error ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Store_Address ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00201">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify the store owner's address</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'OWNE', 'Store_Address', l.error ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Store_City ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00202">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify the store owner's city</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'OWNE', 'Store_City', l.error ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_Zip( g.Store_Zip, g.Store_Country ) }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00203">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify the store owner's Zip/Postal code</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'OWNE', 'Store_Zip', l.error ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Store_Country ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00748">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify the store owner's country</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'OWNE', '', l.error ) }">
	</MvIF>

	<MvIF EXPR = "{ ( len( g.Store_State ) EQ 0 ) AND ( g.Store_Country EQ 'US' ) }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00804">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify the store owner's State/Province</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'OWNE', 'Store_State', l.error ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_Phone( g.Store_Phone, g.Store_Country ) }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00206">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify the store owner's phone number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'OWNE', 'Store_Phone', l.error ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Store_Fax ) }">
		<MvIF EXPR = "{ NOT Validate_Phone( g.Store_Fax, g.Store_Country ) }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-01507">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a valid fax number</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'OWNE', 'Store_Fax', l.error ) }">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ ( g.Store_BasketExpiration LT 1 ) OR ( g.Store_BasketExpiration GT 1440 ) }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00207">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a value between 1 and 1440</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SETT', 'Store_BasketExpiration', l.error ) }">
	</MvIF>

	<MvIF EXPR = "{ l.insert AND ( NOT Validate_WholeNumber_Range_Required( g.Store_Order_Start, 1, 999999999 ) ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SETT', 'Store_Order_Start', g.Validation_Message ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Store_TaxModule ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00211">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please select a tax module</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SETT', '', l.error ) }">
	<MvELSE>
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_Code_Admin( g.Store_TaxModule ) }">
		<MvIF EXPR = "{ NOT l.found }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00212">
				<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ g.Store_TaxModule }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module '%module%' not found</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SETT', '', l.error ) }">
		<MvELSE>
			<MvASSIGN NAME = "g.Store_Module_Tax" VALUE = "{ Modules.d.module }">
			<MvASSIGN NAME = "g.Store_Module_Tax_ID" VALUE = "{ Modules.d.id }">

			<MvIF EXPR = "{ NOT l.insert AND ( g.Store_TaxModule EQ g.Store_Original_TaxModule ) AND Modules.d.active }">
				<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.valid" VALUE = "{ Module_Store_Validate() }">
				<MvIF EXPR = "{ NOT l.valid }">
					<MvFUNCTIONRETURN VALUE = 0>
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ len( g.Store_CurrencyModule ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00213">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please select a currency module</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SETT', '', l.error ) }">
	<MvELSE>
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_Code_Admin( g.Store_CurrencyModule ) }">
		<MvIF EXPR = "{ NOT l.found }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00214">
				<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ g.Store_CurrencyModule }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module '%module%' not found</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'SETT', '', l.error ) }">
		<MvELSE>
			<MvASSIGN NAME = "g.Store_Module_Currency" VALUE = "{ Modules.d.module }">
			<MvASSIGN NAME = "g.Store_Module_Currency_ID" VALUE = "{ Modules.d.id }">

			<MvIF EXPR = "{ NOT l.insert AND ( g.Store_CurrencyModule EQ g.Store_Original_CurrencyModule ) AND Modules.d.active }">
				<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.valid" VALUE = "{ Module_Store_Validate() }">
				<MvIF EXPR = "{ NOT l.valid }">
					<MvFUNCTIONRETURN VALUE = 0>
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ len( g.Store_UserInterface ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00215">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please select a layout</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'LAYO', '', l.error ) }">
	<MvELSE>
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_Code_Admin( g.Store_UserInterface ) }">
		<MvIF EXPR = "{ NOT l.found }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00216">
				<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ g.Store_UserInterface }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module '%module%' not found</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'LAYO', '', l.error ) }">
		<MvELSE>
			<MvIF EXPR = "{ (NOT Modules.d.active) AND (g.Store_UserInterface NE g.Store_Original_UIModule) }">
				<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00216">
					<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ g.Store_UserInterface }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module '%module%' has been deactivated.</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'LAYO', '', l.error ) }">
			<MvELSE>
				<MvASSIGN NAME = "g.Store_Module_UI" VALUE = "{ Modules.d.module }">
				<MvASSIGN NAME = "g.Store_Module_UI_ID" VALUE = "{ Modules.d.id }">
				<MvIF EXPR = "{ ( NOT l.insert ) AND ( g.Store_UserInterface EQ g.Store_Original_UIModule ) }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.valid" VALUE = "{ Module_Store_Validate() }">
					<MvIF EXPR = "{ NOT l.valid }">
						<MvFUNCTIONRETURN VALUE = 0>
					</MvIF>
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Store_MaintenanceType EQ 'A' }">
		<MvASSIGN NAME = "l.time_hour" VALUE = "{ gettoken( g.Store_MaintenanceTime, ':', 1 ) }">
		<MvASSIGN NAME = "l.time_min" VALUE = "{ gettoken( g.Store_MaintenanceTime, ':', 2 ) }">
	
		<MvIF EXPR = "{ NOT ( ( l.time_hour GE 0 ) AND ( l.time_hour LE '24' ) ) }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-01540">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">The hour you have entered is invalid</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'MNMD', 'Store_MaintenanceTime', l.error ) }">
		<MvELSE>
			<MvIF EXPR = "{ NOT Validate_WholeNumber( l.time_hour ) }">
				<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-01541">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a whole number</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'MNMD', 'Store_MaintenanceTime', l.error ) }">
			</MvIF>
		</MvIF>
		
		<MvIF EXPR = "{ NOT ( ( l.time_min GE 0 ) AND ( l.time_min LE '60' ) ) }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-01542">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">The minutes you have entered are invalid</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'MNMD', 'Store_MaintenanceTime', l.error ) }">
		<MvELSE>
			<MvIF EXPR = "{ NOT Validate_WholeNumber( l.time_min ) }">
				<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-01543">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a whole number</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'MNMD', 'Store_MaintenanceTime', l.error ) }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ ( g.Store_MaintenanceMonth LT '1' ) OR ( g.Store_MaintenanceMonth GT '12' ) }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-01544">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a valid month</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'MNMD', 'Store_MaintenanceMonth', l.error ) }">
		<MvELSE>
			<MvIF EXPR = "{ NOT Validate_WholeNumber( g.Store_MaintenanceMonth ) }">
				<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-01545">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a whole number</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'MNMD', 'Store_MaintenanceMonth', l.error ) }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ NOT Validate_WholeNumber( g.Store_MaintenanceDay ) }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-01546">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a whole number</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'MNMD', 'Store_MaintenanceDay', l.error ) }">
		<MvELSE>
			<MvASSIGN NAME = "l.valid_day" VALUE = 1>

			<MvIF EXPR = "{ g.Store_MaintenanceDay LT '1' }">
				<MvASSIGN NAME = "l.valid_day" VALUE = 0>
			</MvIF>

			<MvIF EXPR = "{ ( g.Store_MaintenanceMonth EQ '9' ) OR
						    ( g.Store_MaintenanceMonth EQ '11') OR
						    ( g.Store_MaintenanceMonth EQ '4' ) OR
						    ( g.Store_MaintenanceMonth EQ '6' ) }">
				<MvIF EXPR = "{ g.Store_MaintenanceDay GT '30' }">
					<MvASSIGN NAME = "l.valid_day" VALUE = 0>
				</MvIF>
			<MvELSE>
				<MvIF EXPR = "{ g.Store_MaintenanceMonth EQ '2' }">
					<MvASSIGN NAME = "l.temp_year" VALUE = "{ g.Store_MaintenanceYear / 4 }">
					<MvIF EXPR = "{ isdigit( l.temp_year ) }">
						<MvIF EXPR = "{ g.Store_MaintenanceDay GT '29' }">
							<MvASSIGN NAME = "l.valid_day" VALUE = 0>
						</MvIF>
					<MvELSE>
						<MvIF EXPR = "{ g.Store_MaintenanceDay GT '28' }">
							<MvASSIGN NAME = "l.valid_day" VALUE = 0>
						</MvIF>
					</MvIF>
				<MvELSE>
					<MvIF EXPR = "{ g.Store_Maintenance_Day GT '31' }">
						<MvASSIGN NAME = "l.valid_day" VALUE = 0>					
					</MvIF>
				</MvIF>
			</MvIF>
			
			<MvIF EXPR = "{ NOT l.valid_day }">
				<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-01547">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a valid day</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'MNMD', 'Store_MaintenanceDay', l.error ) }">
			</MvIF>
		</MvIF>
		
		<MvIF EXPR = "{ ( g.Store_MaintenanceYear LT '1970' ) OR ( g.Store_MaintenanceYear GT '2038' ) }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-01548">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a valid year</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'MNMD', 'Store_MaintenanceYear', l.error ) }">
		<MvELSE>
			<MvIF EXPR = "{ NOT Validate_WholeNumber( g.Store_MaintenanceYear ) }">
				<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-01549">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a whole number</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'MNMD', 'Store_MaintenanceYear', l.error ) }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ len( g.Store_MaintenanceWarning ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00864">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a Warning Message</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'MNMD', 'Store_MaintenanceWarning', l.error ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Store_MaintenanceMessage ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00865">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a Maintenance Message</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'MNMD', 'Store_MaintenanceMessage', l.error ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_WholeNumber_NonNegative_Optional( g.Store_NoNewCustomerTime ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'MNMD', 'Store_NoNewCustomerTime', g.Validation_Message ) }">
	</MvIF>
	
	<MvIF EXPR = "{ NOT Validate_WholeNumber_NonNegative_Optional( g.Store_NoNewCustomerTime ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'MNMD', 'Store_NoNewCustomerTime', g.Validation_Message ) }">
	</MvIF>
	
	<MvIF EXPR = "{ NOT Validate_WholeNumber_NonNegative_Optional( g.Store_OrderMinQuantity ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'OMIN', 'Store_OrderMinQuantity', g.Validation_Message ) }">
	</MvIF>
		
	<MvIF EXPR = "{ NOT Validate_Currency_NonNegative_Optional( g.Store_OrderMinPrice ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'OMIN', 'Store_OrderMinPrice', g.Validation_Message ) }">
	</MvIF>

	<MvIF EXPR = "{ ( g.Store_OrderMinPrice OR g.Store_OrderMinQuantity ) AND ( NOT len( g.Store_OrderMinMessage ) ) }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00870">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">A message must be entered if one or more minimums are set</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'OMIN', 'Store_OrderMinMessage', l.error_message ) }">
	</MvIF>

	<MvIF EXPR = "{ l.insert }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.inuse" VALUE = "{ Store_License_In_Use( Domain.d.license ) }">
		<MvIF EXPR = "{ NOT l.inuse }">
			<MvASSIGN NAME = "g.Store_License" VALUE = "{ Domain.d.license }">
		<MvELSE>
			<MvIF EXPR = "{ len( g.Store_License ) EQ 0 }">
				<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00192">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a license number</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'LICE', 'Store_License', l.error ) }">
			<MvELSE>
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.inuse" VALUE = "{ Store_License_In_Use( g.Store_License ) }">
				<MvIF EXPR = "{ l.inuse }">
					<MvLOCALIZED NAME = "l.error" ID = "MER-ADM-00193">
						<MvLOCALIZED-TOKEN NAME = "license" VALUE = "{ g.Store_License }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Sorry, you are already using license number '%license%' for another storefront. Please check your records and try again.</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvFUNCTIONRETURN VALUE = "{ FieldError( 'LICE', 'Store_License', l.error ) }">
				</MvIF>

				<MvASSIGN NAME = "API" VALUE = "{ s.apitype }">
				<MvASSIGN NAME = "MERCHANT_HOST" VALUE = "{ s.server_name }">
				<MvASSIGN NAME = "LICENSE_NUMBER" VALUE = "{ g.Store_License }">
				<MvASSIGN NAME = "MERCHANT_VERSION" VALUE = "{ Domain.d.version }">
				<MvASSIGN NAME = "NAME" VALUE = "{ g.Store_Owner }">
				<MvASSIGN NAME = "COMPANY" VALUE = "{ g.Store_Company }">
				<MvASSIGN NAME = "ADDRESS" VALUE = "{ g.Store_Address }">
				<MvASSIGN NAME = "CITY" VALUE = "{ g.Store_City }">
				<MvASSIGN NAME = "STATE" VALUE = "{ g.Store_State }">
				<MvASSIGN NAME = "ZIP" VALUE = "{ g.Store_Zip }">
				<MvASSIGN NAME = "COUNTRY" VALUE = "{ g.Store_Country }">
				<MvASSIGN NAME = "PHONE" VALUE = "{ g.Store_Phone }">
				<MvASSIGN NAME = "FAX" VALUE = "{ g.Store_Fax }">
				<MvASSIGN NAME = "EMAIL" VALUE = "{ g.Store_Email }">
				<MvASSIGN NAME = "PRODUCT_TYPE" VALUE = "STOREFRONT">
       			<MvASSIGN NAME = "PRODUCT_LINE" VALUE = "MERCHANT">
				<MvASSIGN NAME = "LANGUAGE" VALUE = "{ s.miva_language }">
				<MvASSIGN NAME = "OPERATIONS" VALUE = "REGISTER">
				<MvASSIGN NAME = "MERCHANT_STOREURL" VALUE = "{ Domain.d.mm_url }">

				<MvASSIGN NAME = "l.valid" VALUE = 0>

				<MvLOCALIZED NAME = "l.error_text" ID = "MER-ADM-01550">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unable to register license number</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvCALL METHOD = "POST"
						ACTION = "http://licensemgr.miva.com/gateway/gateway.mv"
						FIELDS = "MERCHANT_HOST, API, LICENSE_NUMBER, MERCHANT_VERSION, NAME, COMPANY, ADDRESS,
								  CITY, STATE, ZIP, COUNTRY, PHONE, FAX, EMAIL, PRODUCT_LINE, PRODUCT_TYPE, LANGUAGE, MERCHANT_STOREURL">
					<MvIF EXPR = "{ s.callobjectelement EQ 'LmLICENSE' }">
						<MvASSIGN NAME = "l.attribute" VALUE = 1>
						<MvWHILE EXPR = "{ ( l.attribute LE s.callobjectnumattributes ) }">
							<MvIF EXPR = "{ s.callobjectattribute[ l.attribute ] EQ 'VALID' }">
								<MvASSIGN NAME = "l.valid_value" VALUE = "{ s.callobjectvalue[ l.attribute ] }">
							</MvIF>
							<MvIF EXPR = "{ s.callobjectattribute[ l.attribute ] EQ 'ERROR_CODE' }">
								<MvASSIGN NAME = "l.error_code_value" VALUE = "{ s.callobjectvalue[ l.attribute ] }">
							</MvIF>
							<MvIF EXPR = "{ s.callobjectattribute[ l.attribute ] EQ 'ERROR_MESSAGE' }">
								<MvASSIGN NAME = "l.error_message_value" VALUE = "{ s.callobjectvalue[ l.attribute ] }">
							</MvIF>
							<MvASSIGN NAME = "l.attribute" VALUE = "{ l.attribute + 1 }">
						</MvWHILE>
					</MvIF>
				</MvCALL>

				<MvIF EXPR = "{ toupper( l.valid_value ) EQ 'YES' }">
					<MvASSIGN NAME = "l.valid" VALUE = "1">
				<MvELSE>
					<MvASSIGN NAME = "l.error_message_value" VALUE = "{ ltrim( rtrim( l.error_message_value ) ) }">
					<MvASSIGN NAME = "l.error_code_value" VALUE = "{ ltrim( rtrim( l.error_code_value ) ) }">
					<MvIF EXPR = "{ NOT len( l.error_message_value ) }">
						<MvIF EXPR = "{ len( l.error_code_value ) }">
							<MvASSIGN NAME = "l.error_text" VALUE = "{ l.error_code_value }">
						</MvIF>
					<MvELSE>
						<MvASSIGN NAME = "l.error_text" VALUE = "{ l.error_message_value }">
					</MvIF>
				</MvIF>

				<MvIF EXPR = "{ NOT l.valid }">
					<MvFUNCTIONRETURN VALUE = "{ FieldError( 'LICE', 'Store_License', l.error_text ) }">
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Store_Insert">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ Store_Validate( 1 ) }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.store_id" VALUE = "{ Store_Create( g.Store_Manager_ID,
																					 g.Store_StoreCode,
																					 g.Store_License,
																					 g.Store_Name, g.Store_Owner,
																					 g.Store_Email, g.Store_Company,
																					 g.Store_Address, g.Store_City,
																					 g.Store_State, g.Store_Zip,
																					 g.Store_Country, g.Store_Phone,
																					 g.Store_Fax, g.Store_WeightUnits,
																					 g.Store_BasketExpiration,
																					 g.Store_PriceGroupOverlap,
																					 g.Store_Module_UI_ID, g.Store_Module_Currency_ID,
																					 g.Store_Module_Tax_ID, g.Store_Order_Start,
																					 g.Store_MaintenanceTime, '',
																					 g.Store_MaintenanceWarning,
																					 g.Store_MaintenanceMessage,
																					 '', '', '', '' ) }">

		<MvIF EXPR = "{ NOT l.store_id }">
			<MvASSIGN NAME = "l.ok" VALUE = 0>
		<MvELSE>
			<MvASSIGN NAME = "g.Edit_Store" VALUE = "{ g.Store_StoreCode }">

			<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00217">
				<MvLOCALIZED-TOKEN NAME = "store" VALUE = "{ encodeentities( g.Store_Name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store '%store%' created</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvDO FILE = "{ g.Store_Module_Tax }" NAME = "l.ok" VALUE = "{ Module_Install_Store() }">
			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Store_Module_Currency }" NAME = "l.ok" VALUE = "{ Module_Install_Store() }">
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Store_Module_UI }" NAME = "l.ok" VALUE = "{ Module_Install_Store() }">
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvASSIGN NAME = "g.Edit_Store" VALUE = "{ g.Store_StoreCode }">

				<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00217">
					<MvLOCALIZED-TOKEN NAME = "store" VALUE = "{ encodeentities( g.Store_Name ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store '%store%' created</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvEVAL EXPR = "{ Update_LeftNavigation() }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Store_Update">
	<MvASSIGN NAME = "l.ok" VALUE = "{ Admin_Open_Store( g.Edit_Store ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.can_add"		VALUE = "{ CanI( 'STOR', 0, 1, 0, 0 ) }">
		<MvASSIGN NAME = "l.can_modify"		VALUE = "{ CanI( 'STOR', 0, 0, 1, 0 ) }">
		<MvASSIGN NAME = "l.can_delete"		VALUE = "{ CanI( 'STOR', 0, 0, 0, 1 ) }">

		<MvASSIGN NAME = "l.can_add_tax"	VALUE = "{ CanI( 'STAX', 0, 1, 0, 0 ) }">
		<MvASSIGN NAME = "l.can_modify_tax"	VALUE = "{ CanI( 'STAX', 0, 0, 1, 0 ) }">
		<MvASSIGN NAME = "l.can_delete_tax"	VALUE = "{ CanI( 'STAX', 0, 0, 0, 1 ) }">

		<MvASSIGN NAME = "l.can_add_cur"	VALUE = "{ CanI( 'CURR', 0, 1, 0, 0 ) }">
		<MvASSIGN NAME = "l.can_modify_cur"	VALUE = "{ CanI( 'CURR', 0, 0, 1, 0 ) }">
		<MvASSIGN NAME = "l.can_delete_cur"	VALUE = "{ CanI( 'CURR', 0, 0, 0, 1 ) }">

		<MvASSIGN NAME = "l.modified"		VALUE = "0">

		<MvASSIGN NAME = "l.original_name" VALUE = "{ Stores.d.name }">

		<MvIF EXPR = "{ Store_Validate( 0 ) }">
			<MvIF EXPR = "{ g.Admin_User_Administrator OR ( Stores.d.manager_id EQ g.Admin_User_ID ) }">
				<MvIF EXPR = "{ g.Store_Module_Tax_ID NE Stores.d.tax_id }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID_Admin( Stores.d.tax_id ) }">
					<MvIF EXPR = "{ l.ok }">
						<MvIF EXPR = "{ Modules.d.active }"> 
							<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Uninstall_Store() }">
						</MvIF>

						<MvIF EXPR = "{ l.ok }">
							<MvDO FILE = "{ g.Module_Root $ g.Store_Module_Tax }" NAME = "l.ok" VALUE = "{ Module_Install_Store() }">
						</MvIF>
						<MvIF EXPR = "{ l.ok }">
							<MvASSIGN	NAME = "l.modified" VALUE = "1">
						</MvIF>
					</MvIF>
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok AND ( l.can_modify_tax ) AND ( g.Store_TaxModule EQ g.Store_Original_TaxModule ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Stores.d.tax_id ) }">
				<MvIF EXPR = "{ l.found }">
					<MvDO FILE = "{ g.Module_Root $ g.Store_Module_Tax }" NAME = "l.ok" VALUE = "{ Module_Store_Update() }">
					<MvASSIGN NAME = "l.modified" VALUE = "1">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvIF EXPR = "{ g.Admin_User_Administrator OR ( Stores.d.manager_id EQ g.Admin_User_ID ) }">
					<MvIF EXPR = "{ g.Store_Module_Currency_ID NE Stores.d.currncy_id }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID_Admin( Stores.d.currncy_id ) }">
						<MvIF EXPR = "{ l.ok }">
							<MvIF EXPR = "{ Modules.d.active }">
								<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Uninstall_Store() }">
							</MvIF>

							<MvIF EXPR = "{ l.ok }">
								<MvDO FILE = "{ g.Module_Root $ g.Store_Module_Currency }" NAME = "l.ok" VALUE = "{ Module_Install_Store() }">
							</MvIF>
							<MvIF EXPR = "{ l.ok }">
								<MvASSIGN	NAME = "l.modified" VALUE = "1">
							</MvIF>
						</MvIF>
					</MvIF>
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok AND ( l.can_modify_cur ) AND ( g.Store_CurrencyModule EQ g.Store_Original_CurrencyModule ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Stores.d.currncy_id ) }">
				<MvIF EXPR = "{ l.found }">
					<MvDO FILE = "{ g.Module_Root $ g.Store_Module_Currency }" NAME = "l.ok" VALUE = "{ Module_Store_Update() }">
					<MvASSIGN NAME = "l.modified" VALUE = "1">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvIF EXPR = "{ g.Admin_User_Administrator OR ( Stores.d.manager_id EQ g.Admin_User_ID ) }">
					<MvIF EXPR = "{ g.Store_Module_UI_ID NE Stores.d.ui_id }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID_Admin( Stores.d.ui_id ) }">
						<MvIF EXPR = "{ l.ok }">
							<MvIF EXPR = "{ modules.d.active }">
								<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Uninstall_Store() }">
							</MvIF>

							<MvIF EXPR = "{ l.ok }">
								<MvDO FILE = "{ g.Module_Root $ g.Store_Module_UI }" NAME = "l.ok" VALUE = "{ Module_Install_Store() }">
							</MvIF>
							<MvIF EXPR = "{ l.ok }">
								<MvASSIGN	NAME = "l.modified" VALUE = "1">
							</MvIF>
						</MvIF>
					</MvIF>
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok AND ( l.can_modify ) AND ( g.Store_UserInterface EQ g.Store_Original_UIModule ) }">
				<MvDO FILE = "{ g.Module_Root $ g.Store_Module_UI }" NAME = "l.ok" VALUE = "{ Module_Store_Update() }">
				<MvASSIGN NAME = "l.modified" VALUE = "1">
			</MvIF>

			<MvIF EXPR = "{ g.Store_MaintenanceType EQ 'E' }">
				<MvASSIGN NAME = "l.time_temp" VALUE = "0">
			<MvELSE>
				<MvASSIGN NAME = "l.time_hour" VALUE = "{ gettoken( g.Store_MaintenanceTime, ':', 1 ) }">
				<MvASSIGN NAME = "l.time_min" VALUE = "{ gettoken( g.Store_MaintenanceTime, ':', 2 ) }">
				<MvASSIGN NAME = "l.time_temp" VALUE = "{ mktime_t( g.Store_MaintenanceYear, g.Store_MaintenanceMonth, g.Store_MaintenanceDay, l.time_hour, l.time_min, '00', timezone() ) }">
			</MvIF>

			<MvIF EXPR = "{ l.ok AND ( l.can_modify ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Store_Update( Stores.d.id, g.Store_Manager_ID,
																					   g.Store_StoreCode, Stores.d.license,
																					   g.Store_Name, g.Store_Owner,
																					   g.Store_Email,
																					   g.Store_Company, g.Store_Address,
																					   g.Store_City,
																					   g.Store_State, g.Store_Zip,
																					   g.Store_Country,
																					   g.Store_Phone, g.Store_Fax,
																					   g.Store_WeightUnits,
																					   g.Store_BasketExpiration,
																					   g.Store_PriceGroupOverlap,
																					   g.Store_Module_UI_ID,
																					   g.Store_Module_Currency_ID,
																					   g.Store_Module_Tax_ID,
																					   l.time_temp,
																					   g.Store_NoNewCustomerTime,
																					   g.Store_MaintenanceWarning,
																					   g.Store_MaintenanceMessage,
																					   g.Store_OrderMinQuantity,
																					   g.Store_OrderMinPrice,
																					   g.Store_OrderMinMeetAll,
																					   g.Store_OrderMinMessage ) }">
				<MvASSIGN NAME = "l.modified" VALUE = "1">
			</MvIF>

			<MvIF EXPR = "{ l.ok AND len( g.Store_StandardFields_billing ) AND l.can_modify }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ StandardFields_Update( g.Store_StandardFields_billing, 
																								g.Store_StandardFields_mode_fname,
																								g.Store_StandardFields_mode_lname,
																								g.Store_StandardFields_mode_email,
																								g.Store_StandardFields_mode_phone,
																								g.Store_StandardFields_mode_fax,
																								g.Store_StandardFields_mode_comp,
																								g.Store_StandardFields_mode_addr,
																								g.Store_StandardFields_mode_city,
																								g.Store_StandardFields_mode_state,
																								g.Store_StandardFields_mode_zip,
																								g.Store_StandardFields_mode_cntry ) }">

				<MvASSIGN NAME = "l.modified" VALUE = "1">
			</MvIF>

			<MvIF EXPR = "{ l.ok AND l.can_modify }">
				<MvIF EXPR = "{ l.modified }">
					<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00218">
						<MvLOCALIZED-TOKEN NAME = "store" VALUE = "{ encodeentities( l.original_name ) }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store '%store%' updated</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>
				<MvASSIGN NAME = "g.Edit_Store" VALUE = "{ g.Store_StoreCode }">

				<MvASSIGN NAME = "g.Have_Tax_Fields" VALUE = 0>
				<MvASSIGN NAME = "g.Have_Currency_Fields" VALUE = 0>
				<MvASSIGN NAME = "g.Have_UI_Fields" VALUE = 0>

				<MvEVAL EXPR = "{ Update_LeftNavigation() }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Store_Delete">
	<MvASSIGN NAME = "l.ok" VALUE = "{ Admin_Open_Store( g.Edit_Store ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.store_name" VALUE = "{ Stores.d.name }">

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Stores.d.tax_id ) }">
		<MvIF EXPR = "{ l.found }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Uninstall_Store() }">
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Stores.d.currncy_id ) }">
			<MvIF EXPR = "{ l.found }">
				<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Uninstall_Store() }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Stores.d.ui_id ) }">
			<MvIF EXPR = "{ l.found }">
				<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Uninstall_Store() }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
			<MvWHILE EXPR = "{ l.ok AND l.found }">
				<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Uninstall_Store() }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
			</MvWHILE>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "l.ok" VALUE = "{ Admin_Close_Store() }">
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Store_Delete( g.Edit_Store ) }">
			<MvIF EXPR = "{ l.ok }">
				<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00219">
					<MvLOCALIZED-TOKEN NAME = "store" VALUE = "{ encodeentities( l.store_name ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store '%store%' deleted</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvASSIGN NAME = "g.Edit_Store" VALUE = "">
				<MvASSIGN NAME = "g.Tab" VALUE = "">

				<MvEVAL EXPR = "{ Update_LeftNavigation() }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_DeleteStore">
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Store_Find_Code( g.Edit_Store ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvLOCALIZED NAME = "l.screen_label" ID = "MER-ADM-00220">
			<MvLOCALIZED-TOKEN NAME = "store_name" VALUE = "{ encodeentities( Stores.d.name ) }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Delete Store: %store_name%</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvEVAL EXPR = "{ BeginScreen( l.screen_label, '', 'Help:dstr.html' ) }">
		<MvHIDE FIELDS = "g.Edit_Store">

		<MvEVAL EXPR = "{ BeginContent() }">
		<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0>
		<TR><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED ID = "MER-ADM-00833">
				<MvLOCALIZED-TOKEN NAME = "store_name" VALUE = "{ encodeentities( Stores.d.name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Delete store <B>%store_name%</B>?</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</FONT>
		</TD></TR>

		<TR><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED ID = "MER-ADM-00222">
				<MvLOCALIZED-TOKEN NAME = "store_name" VALUE = "{ encodeentities( Stores.d.name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">This will delete the store, all product and order information, and all associated data files.</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</FONT>
		</TD></TR>
		</TABLE>
		<MvEVAL EXPR = "{ EndContent() }">

		<TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
		<TR><TD BGCOLOR = "#000000">
			<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD BGCOLOR = "#f0f0f0" WIDTH = "100%">
				&nbsp;
			</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00739">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">
						<INPUT TYPE = "button" VALUE = "Delete" ONCLICK = "SubmitForm( 'STOR', 'DSTR' );">
					</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00749">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US"><INPUT TYPE = "button" VALUE = "Cancel" ONCLICK = "SubmitForm( 'STOR', '' );"></MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD></TR>
			</TABLE>
		</TD></TR>
		</FORM>
		</TABLE>

		<MvEVAL EXPR = "{ EndScreen() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_DeleteShoppingBaskets" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvIF EXPR = "{ g.Admin_User_Administrator OR ( g.Admin_User_ID EQ Stores.d.manager_id ) }">
		<MvLOCALIZED NAME = "l.screen_label" ID = "MER-ADM-00873">
			<MvLOCALIZED-TOKEN NAME = "store_name" VALUE = "{ encodeentities( Stores.d.name ) }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Delete Shopping Baskets: %store_name%</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvEVAL EXPR = "{ BeginScreen( l.screen_label, '', 'Help:delc.html' ) }">
		<MvEVAL EXPR = "{ BeginContent() }">

		<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0>
		<TR><TD VALIGN = "top">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00875">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Delete:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ g.Delete_ExpiredBasket EQ '' }">
					<MvLOCALIZED ID = "MER-ORI-00017">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">
							<INPUT TYPE = "radio" NAME = "Delete_ExpiredBasket" VALUE = "1" CHECKED>Expired<BR>
						</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				<MvELSE>
					<MvLOCALIZED ID = "MER-ORI-00018">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">
							<INPUT TYPE = "radio" NAME = "Delete_ExpiredBasket" VALUE = "1">Expired<BR>
						</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ g.Delete_ExpiredBasket EQ '1' }">
					<MvLOCALIZED ID = "MER-ORI-00019">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">
							<INPUT TYPE = "radio" NAME = "Delete_ExpiredBasket" VALUE = "" CHECKED>All
						</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				<MvELSE>
					<MvLOCALIZED ID = "MER-ORI-00020">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">
							<INPUT TYPE = "radio" NAME = "Delete_ExpiredBasket" VALUE = "">All
						</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>
				</FONT>
			</TD></TR>
		</TABLE>

		<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0>
		<TR><TD>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-01487">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US"><B>Recover Order Numbers:</B></MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvIF EXPR = "{ g.Recover_Order_Number EQ '' }">
					<MvLOCALIZED ID = "MER-ORI-00017">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">
							<INPUT TYPE = "radio" NAME = "Recover_Order_Number" VALUE = "1" CHECKED>Yes
						</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				<MvELSE>
					<MvLOCALIZED ID = "MER-ORI-00018">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">
							<INPUT TYPE = "radio" NAME = "Recover_Order_Number" VALUE = "1">Yes
						</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ g.Recover_Order_Number EQ '1' }">
					<MvLOCALIZED ID = "MER-ORI-00019">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">
							<INPUT TYPE = "radio" NAME = "Recover_Order_Number" VALUE = "" CHECKED>No
						</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				<MvELSE>
					<MvLOCALIZED ID = "MER-ORI-00020">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">
							<INPUT TYPE = "radio" NAME = "Recover_Order_Number" VALUE = "">No
						</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>
			</FONT>
		</TD></TR>
		</TABLE>

		<MvEVAL EXPR = "{ EndContent() }">

		<TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
		<TR><TD BGCOLOR = "#000000">
			<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD BGCOLOR = "#f0f0f0" WIDTH = "100%">
				&nbsp;
			</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00875">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">
						<INPUT TYPE = "button" VALUE = "Delete" ONCLICK = "SubmitForm( 'BLNK', 'SDEL' );">
					</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>

			</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00876">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">
						<INPUT TYPE = "button" VALUE = "Cancel" ONCLICK = "SubmitForm( 'BLNK', '' );">
					</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD></TR>
			</TABLE>
		</TD></TR>
		</TABLE>

		<MvEVAL EXPR = "{ EndScreen() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Store_DeleteBaskets" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">

				<SCRIPT LANGUAGE = "JavaScript">

<!--
function Basket_Update()
{
	var submit = 1;
	var must_confirm = 0;
	var UI_consequences = '';
	var tax_consequences = '';
	var currency_consequences = '';
	var temp_value;
	var i;

	if ( document.STOR.Store_UserInterface.length & !document.STOR.Store_UserInterface.hidden)
	{
		for ( i = 0; i < document.STOR.Store_UserInterface.length; i++ )
		{
			if ( document.STOR.Store_UserInterface[ i ].checked )
			{
				temp_value = document.STOR.Store_UserInterface[ i ].value;
				break;
			}
		}
	}
	else
	{
		temp_value = document.STOR.Store_UserInterface.value;
	}


	if ( ( document.STOR.Store_Original_UIModule.value != temp_value ) )
	{
		UI_consequences = UI_consequences_const;
		must_confirm = 1;

	}

	if ( document.STOR.Store_TaxModule.length )
	{
		for ( i = 0; i < document.STOR.Store_TaxModule.length; i++ )
		{
			if ( document.STOR.Store_TaxModule[ i ].selected )
			{
				temp_value = document.STOR.Store_TaxModule[ i ].value;
				break;
			}
		}
	}
	else
	{
		temp_value = document.STOR.Store_TaxModule.value;
	}


	if ( ( document.STOR.Store_Original_TaxModule.value != temp_value ) )
	{
		tax_consequences = tax_consequences_const;
		must_confirm = 1;
	}

	if ( document.STOR.Store_CurrencyModule.length )
	{
		for ( i = 0; i < document.STOR.Store_CurrencyModule.length; i++ )
		{
			if ( document.STOR.Store_CurrencyModule[ i ].selected )
			{
				temp_value = document.STOR.Store_CurrencyModule[ i ].value;
				break;
			}
		}
	}
	else
	{
		temp_value = document.STOR.Store_CurrencyModule.value;
	}

	if ( ( document.STOR.Store_Original_CurrencyModule.value != temp_value ) )
	{
		currency_consequences = currency_consequences_const;
		must_confirm = 1;
	}

	if ( must_confirm )
	{
		consequences = consequences_begin + UI_consequences + tax_consequences + currency_consequences + consequences_end;

		if ( !confirm( consequences ) )
		{
			submit = 0;
		}
	}
	if ( submit )
	{
		SubmitForm( 'STOR', 'USTR' );
	}
}
//-->
				</SCRIPT>

		<MvLOCALIZED  ID = "MER-ADM-00877">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				<SCRIPT LANGUAGE = "JavaScript">
<!--
	var consequences_begin = 'You have selected new modules for some settings.\nIf you continue you will lose the settings for the existing modules.These modules will be effected:\n';
	var UI_consequences_const = '\tLayout\n';
	var tax_consequences_const = '\tSales Tax Calculation\n';
	var currency_consequences_const = '\tCurrency Formatting\n';
	var consequences_end = 'Do you wish to continue?';
//-->
				</SCRIPT>
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
	<MvIF EXPR = "{ g.Delete_ExpiredBasket }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Store_ExpireBaskets() }">
		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00223">
				<MvLOCALIZED-TOKEN NAME = "store_name" VALUE = "{ encodeentities( Stores.d.name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Expired Shopping Baskets for Store '%store_name%' deleted.</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
	<MvELSE>
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Store_DeleteBaskets() }">
		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00878">
				<MvLOCALIZED-TOKEN NAME = "store_name" VALUE = "{ encodeentities( Stores.d.name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">All Shopping Baskets for Store '%store_name%' deleted.</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Store_Pack" STANDARDOUTPUTLEVEL = "text,html,compresswhitespace">
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Store_Pack() }">
	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
		<MvWHILE EXPR = "{ l.ok AND l.found }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Pack_Store() }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
		</MvWHILE>
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00224">
			<MvLOCALIZED-TOKEN NAME = "store_name" VALUE = "{ encodeentities( Stores.d.name ) }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Database Files for Store '%store_name%' Packed.</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Store_Preview">
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code( g.Module_Code ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ UIModule_Store_Preview() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Stores" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00225">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Store</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvASSIGN NAME = "l.action" VALUE = "ISTR">
	<MvASSIGN NAME = "l.store_id" VALUE = 0>
	<MvASSIGN NAME = "l.buttons" VALUE = "Help:stor.html">

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.inuse" VALUE = "{ Store_License_In_Use( g.Store_License ) }">

	<MvIF EXPR = "{ len( g.Edit_Store ) }">
		<MvASSIGN NAME = "l.ok" VALUE = "{ Admin_Open_Store( g.Edit_Store ) }">

		<MvASSIGN NAME = "l.can_view"	VALUE = "{ CanI( 'STOR', 1, 0, 0, 0 ) }">
		<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'STOR', 0, 1, 0, 0 ) }">
		<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'STOR', 0, 0, 1, 0 ) }">
		<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'STOR', 0, 0, 0, 1 ) }">

		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00226">
				<MvLOCALIZED-TOKEN NAME = "store_name" VALUE = "{ encodeentities( Stores.d.name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Edit Store: %store_name%</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvASSIGN NAME = "l.store_id" VALUE = "{ Stores.d.id }">
			<MvASSIGN NAME = "l.buttons" VALUE = "{ 'Links:Screen=LINK&Type=STOR&Store_Code=' $ encodeattribute( Stores.d.code ) $ ',Help:stor.html' }">

			<MvIF EXPR = "{ g.Load_Fields }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ User_Find_ID( Stores.d.manager_id ) }">
				<MvIF EXPR = "{ l.found }">
					<MvASSIGN NAME = "g.Store_Manager" VALUE = "{ Users.d.name }">
				<MvELSE>
					<MvASSIGN NAME = "g.Store_Manager" VALUE = "">
				</MvIF>

				<MvASSIGN NAME = "g.Store_StoreCode" VALUE = "{ Stores.d.code }">
				<MvASSIGN NAME = "g.Store_Name" VALUE = "{ Stores.d.name }">
				<MvASSIGN NAME = "g.Store_Owner" VALUE = "{ Stores.d.owner }">
				<MvASSIGN NAME = "g.Store_Email" VALUE = "{ Stores.d.email }">
				<MvASSIGN NAME = "g.Store_Company" VALUE = "{ Stores.d.company }">
				<MvASSIGN NAME = "g.Store_Address" VALUE = "{ Stores.d.address }">
				<MvASSIGN NAME = "g.Store_City" VALUE = "{ Stores.d.city }">
				<MvASSIGN NAME = "g.Store_State" VALUE = "{ Stores.d.state }">
				<MvASSIGN NAME = "g.Store_Zip" VALUE = "{ Stores.d.zip }">
				<MvASSIGN NAME = "g.Store_Country" VALUE = "{ Stores.d.country }">
				<MvASSIGN NAME = "g.Store_Phone" VALUE = "{ Stores.d.phone }">
				<MvASSIGN NAME = "g.Store_Fax" VALUE = "{ Stores.d.fax }">
				<MvASSIGN NAME = "g.Store_WeightUnits" VALUE = "{ Stores.d.wtunits }">
				<MvASSIGN NAME = "g.Store_BasketExpiration" VALUE = "{ Stores.d.baskexp }">
				<MvASSIGN NAME = "g.Store_PriceGroupOverlap" VALUE = "{ Stores.d.pgrp_ovlp }">

				<MvIF EXPR = "{ Stores.d.mnt_time }">
					<MvASSIGN NAME = "g.Store_MaintenanceType" VALUE = "A">
					<MvASSIGN NAME = "g.Store_MaintenanceTime" VALUE = "{ padl( time_t_hour( Stores.d.mnt_time, timezone() ), 2, '0' ) $ ':' $ padl( time_t_min( Stores.d.mnt_time, timezone() ), 2, '0' ) }">
					<MvASSIGN NAME = "g.Store_MaintenanceMonth" VALUE = "{ padl( time_t_month( Stores.d.mnt_time, timezone() ), 2, '0' ) }">
					<MvASSIGN NAME = "g.Store_MaintenanceDay" VALUE = "{ padl( time_t_dayofmonth( Stores.d.mnt_time, timezone() ), 2, '0' ) }">
					<MvASSIGN NAME = "g.Store_MaintenanceYear" VALUE = "{ padl( time_t_year( Stores.d.mnt_time, timezone() ), 2, '0' ) }">
				<MvELSE>
					<MvASSIGN NAME = "g.Store_MaintenanceType" VALUE = "E">
					<MvASSIGN NAME = "l.time_t" VALUE = "{ s.time_t + 1800 }">

					<MvASSIGN NAME = "g.Store_MaintenanceTime" VALUE = "{ padl( time_t_hour( l.time_t, timezone() ), 2, '0' ) $ ':' $ padl( time_t_min( l.time_t, timezone() ), 2, '0' ) }">
					<MvASSIGN NAME = "g.Store_MaintenanceMonth" VALUE = "{ padl( time_t_month( l.time_t, timezone() ), 2, '0' ) }">
					<MvASSIGN NAME = "g.Store_MaintenanceDay" VALUE = "{ padl( time_t_dayofmonth( l.time_t, timezone() ), 2, '0' ) }">
					<MvASSIGN NAME = "g.Store_MaintenanceYear" VALUE = "{ padl( time_t_year( l.time_t, timezone() ), 2, '0' ) }">
				</MvIF>

				<MvIF EXPR = "{ Stores.d.mnt_no_new }">
					<MvASSIGN NAME = "g.Store_NoNewCustomerTime" VALUE = "{ Stores.d.mnt_no_new }">
				<MvELSE>
					<MvASSIGN NAME = "g.Store_NoNewCustomerTime" VALUE = "0">
				</MvIF>

				<MvASSIGN NAME = "g.Store_MaintenanceWarning" VALUE = "{ Stores.d.mnt_warn }">
				<MvASSIGN NAME = "g.Store_MaintenanceMessage" VALUE = "{ Stores.d.mnt_close }">

				<MvASSIGN NAME = "g.StoreCountries_Display" VALUE = "{ int( g.StoreCountries_Display ) }">
				<MvIF EXPR = "{ g.StoreCountries_Display LT 1 }">
					<MvASSIGN NAME = "g.StoreCountries_Display" VALUE = 1>
				</MvIF>

				<MvASSIGN NAME = "g.Store_OrderMinQuantity" VALUE = "{ Stores.d.omin_quant }">
				<MvASSIGN NAME = "g.Store_OrderMinPrice" VALUE = "{ Stores.d.omin_price }">
				<MvASSIGN NAME = "g.Store_OrderMinMeetAll" VALUE = "{ Stores.d.omin_all }">
				<MvASSIGN NAME = "g.Store_OrderMinMessage" VALUE = "{ Stores.d.omin_msg }">

				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID_Admin( Stores.d.tax_id ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvASSIGN NAME = "g.Store_TaxModule" VALUE = "{ Modules.d.code }">
					<MvASSIGN NAME = "g.Store_Original_TaxModule" VALUE = "{ Modules.d.code }">
				</MvIF>

				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID_Admin( Stores.d.currncy_id ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvASSIGN NAME = "g.Store_CurrencyModule" VALUE = "{ Modules.d.code }">
					<MvASSIGN NAME = "g.Store_Original_CurrencyModule" VALUE = "{ Modules.d.code }">
				</MvIF>

				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID_Admin( Stores.d.ui_id ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvASSIGN NAME = "g.Store_UserInterface" VALUE = "{ Modules.d.code }">
					<MvASSIGN NAME = "g.Store_Original_UIModule" VALUE = "{ Modules.d.code }">
				</MvIF>
			<MvELSE>
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code_Admin( g.Store_UserInterface ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvASSIGN NAME = "l.ui_module" VALUE = "{ Modules.d.module }">
				</MvIF>
			</MvIF>
		</MvIF>
	<MvELSE>
		<MvIF EXPR = "{ g.Admin_User_Administrator }">
			<MvASSIGN NAME = "l.can_view" VALUE = 1>
		<MvELSE>
			<MvASSIGN NAME = "l.can_view" VALUE = 0>
		</MvIF>

		<MvIF EXPR = "{ g.Load_Fields }">
			<MvASSIGN NAME = "g.Store_License" VALUE = "">

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ User_Find_ID( g.Admin_User_ID ) }">
			<MvIF EXPR = "{ l.found }">
				<MvASSIGN NAME = "g.Store_Manager" VALUE = "{ Users.d.name }">
			<MvELSE>
				<MvASSIGN NAME = "g.Store_Manager" VALUE = "">
			</MvIF>

			<MvASSIGN NAME = "g.Store_StoreCode" VALUE = "">
			<MvASSIGN NAME = "g.Store_Name" VALUE = "">

	    	<MvASSIGN NAME = "g.Store_Owner" VALUE = "{ Domain.d.owner }">
	    	<MvASSIGN NAME = "g.Store_Email" VALUE = "{ Domain.d.email }">
	    	<MvASSIGN NAME = "g.Store_Company" VALUE = "{ Domain.d.company }">
	    	<MvASSIGN NAME = "g.Store_Address" VALUE = "{ Domain.d.address }">
	    	<MvASSIGN NAME = "g.Store_City" VALUE = "{ Domain.d.city }">
	    	<MvASSIGN NAME = "g.Store_State" VALUE = "{ Domain.d.state }">
	    	<MvASSIGN NAME = "g.Store_Zip" VALUE = "{ Domain.d.zip }">
	    	<MvASSIGN NAME = "g.Store_Country" VALUE = "{ Domain.d.country }">
			<MvASSIGN NAME = "g.Store_Phone" VALUE = "{ Domain.d.phone }">
	    	<MvASSIGN NAME = "g.Store_Fax" VALUE = "{ Domain.d.fax }">
	    	<MvIF EXPR = "{ g.Store_Country EQ 'DE' }">
				<MvLOCALIZED NAME = "g.Store_WeightUnits" ID = "MER-ADM-00750">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">kilograms</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			<MvELSE>
				<MvLOCALIZED NAME = "g.Store_WeightUnits" ID = "MER-ADM-00751">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">pounds</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
		    </MvIF>
	    	<MvASSIGN NAME = "g.Store_BasketExpiration" VALUE = 60>
			<MvLOCALIZED NAME = "g.Store_PriceGroupOverlap" ID = "MER-ADM-00752">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">HIGHEST</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
	    	<MvASSIGN NAME = "g.Store_Order_Start" VALUE = 1000>
	    	<MvASSIGN NAME = "g.Store_TaxModule" VALUE = "">
	    	<MvASSIGN NAME = "g.Store_CurrencyModule" VALUE = "">

			<MvASSIGN NAME = "g.Store_UserInterface" VALUE = "">

			<MvASSIGN NAME = "g.Store_MaintenanceTime" VALUE = "0">
			<MvLOCALIZED NAME = "g.Store_MaintenanceWarning" ID = "MER-ADM-00879">
				<MvLOCALIZED-TOKEN NAME = "p" VALUE = "%">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">%p%store_name%p% will be closing in %p%maint_countdown%p% minutes for maintenance.  Please complete your selection and proceed to the checkout.  All abandoned baskets will be emptied.</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvLOCALIZED NAME = "g.Store_MaintenanceMessage" ID = "MER-ADM-00880">
				<MvLOCALIZED-TOKEN NAME = "p" VALUE = "%">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Sorry, %p%store_name%p% is closed for maintenance.  We will re-open soon. Thanks</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
   		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ NOT l.can_view }">
		<MvFUNCTIONRETURN VALUE = "{ Screen_Blank() }">
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvEVAL EXPR = "{ BeginScreen( l.title, l.action, l.buttons ) }">

		<SCRIPT LANGUAGE = "JavaScript">
<!--
function PopupUIStorePreview( module_code )
{
	window.open( Sessionurl + 'Screen=STMP&Module_Code=' + module_code, 'UIStorePreview', 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=640,height=480' ).focus();
}
//-->
		</SCRIPT>

		<MvIF EXPR = "{ len( g.Edit_Store ) }">
			<SCRIPT LANGUAGE = "JavaScript">
<!--
function SetTaxModified()
{
	document.STOR.Store_TaxModified.value = 1;
}

function SetCurrencyModified()
{
	document.STOR.Store_CurrencyModified.value = 1;
}

function SetUIModified()
{
	document.STOR.Store_UIModified.value = 1;
}

function Store_Update()
{
	var submit = 1;
	var must_confirm = 0;
	var UI_consequences = '';
	var tax_consequences = '';
	var currency_consequences = '';
	var temp_value;
	var i;

	if ( document.STOR.Store_UserInterface.length && !document.STOR.Store_UserInterface.hidden)
	{
		for ( i = 0; i < document.STOR.Store_UserInterface.length; i++ )
		{
			if ( document.STOR.Store_UserInterface[ i ].checked )
			{
				temp_value = document.STOR.Store_UserInterface[ i ].value;
				break;
			}
		}
	}
	else
	{
		temp_value = document.STOR.Store_UserInterface.value;
	}


	if ( ( document.STOR.Store_Original_UIModule.value != temp_value ) )
	{
		UI_consequences = UI_consequences_const;
		must_confirm = 1;

	}

	if ( document.STOR.Store_TaxModule.length )
	{
		for ( i = 0; i < document.STOR.Store_TaxModule.length; i++ )
		{
			if ( document.STOR.Store_TaxModule[ i ].selected )
			{
				temp_value = document.STOR.Store_TaxModule[ i ].value;
				break;
			}
		}
	}
	else
	{
		temp_value = document.STOR.Store_TaxModule.value;
	}


	if ( ( document.STOR.Store_Original_TaxModule.value != temp_value ) )
	{
		tax_consequences = tax_consequences_const;
		must_confirm = 1;
	}

	if ( document.STOR.Store_CurrencyModule.length )
	{
		for ( i = 0; i < document.STOR.Store_CurrencyModule.length; i++ )
		{
			if ( document.STOR.Store_CurrencyModule[ i ].selected )
			{
				temp_value = document.STOR.Store_CurrencyModule[ i ].value;
				break;
			}
		}
	}
	else
	{
		temp_value = document.STOR.Store_CurrencyModule.value;
	}

	if ( ( document.STOR.Store_Original_CurrencyModule.value != temp_value ) )
	{
		currency_consequences = currency_consequences_const;
		must_confirm = 1;
	}

	if ( must_confirm )
	{
		consequences = consequences_begin + UI_consequences + tax_consequences + currency_consequences + consequences_end;

		if ( !confirm( consequences ) )
		{
			submit = 0;
		}
	}
	if ( submit )
	{
		SubmitForm( 'STOR', 'USTR' );
	}
}

//-->
			</SCRIPT>

		<MvLOCALIZED  ID = "MER-ADM-00883">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				<SCRIPT LANGUAGE = "JavaScript">
<!--
	var consequences_begin = 'You have selected new modules for some settings.\nIf you continue you will lose the settings for the existing modules.These modules will be effected:\n';
	var UI_consequences_const = '\tLayout\n';
	var tax_consequences_const = '\tSales Tax Calculation\n';
	var currency_consequences_const = '\tCurrency Formatting\n';
	var consequences_end = 'Do you wish to continue?';
//-->
				</SCRIPT>
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>


			<MvHIDE FIELDS = "g.Store_Original_TaxModule, g.Store_Original_CurrencyModule, g.Store_Original_UIModule, g.Store_TaxModified, g.Store_CurrencyModified, g.Store_UIModified">

			<INPUT TYPE = "hidden" NAME = "Have_Tax_Fields" VALUE = 1>
			<INPUT TYPE = "hidden" NAME = "Have_Currency_Fields" VALUE = 1>
			<INPUT TYPE = "hidden" NAME = "Have_UI_Fields" VALUE = 1>

			<MvHIDE FIELDS = "g.Edit_Store">

			<MvIF EXPR = "{ Stores.d.license NE Domain.d.license }">
				<MvASSIGN NAME = "l.default_tab" VALUE = "LICE">
				<MvLOCALIZED NAME = "l.tabs" ID = "MER-ADM-00227">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">LICE:License,IDEN:Identification,OWNE:Owner,SETT:Settings,LAYO:Layout,MNMD:Maintenance Mode,OMIN:Order Minimums</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			<MvELSE>
				<MvASSIGN NAME = "l.default_tab" VALUE = "IDEN">
				<MvLOCALIZED NAME = "l.tabs" ID = "MER-ADM-00228">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">IDEN:Identification,OWNE:Owner,SETT:Settings,LAYO:Layout,MNMD:Maintenance Mode,OMIN:Order Minimums</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			</MvIF>

			<MvIF EXPR = "{ g.Features:Customers:Enabled }">
				<MvDO FILE = "{ g.Module_Feature_CUS }" NAME = "l.more_tab" VALUE = "{ CUS_Screen_Store_Tab() }">
				<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.more_tab }">
			</MvIF>
			
			<MvIF EXPR = "{ CanI( 'STAX', 1, 0, 0, 0 ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID( Stores.d.tax_id ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_tabs" VALUE = "{ Module_Store_Tabs() }">
					<MvIF EXPR = "{ len( l.module_tabs ) }">
						<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.module_tabs }">
					</MvIF>
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ CanI( 'CURR', 1, 0, 0, 0 ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID( Stores.d.currncy_id ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvASSIGN NAME = "l.module_tabs" VALUE = "">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_tabs" VALUE = "{ Module_Store_Tabs() }">
					<MvIF EXPR = "{ len( l.module_tabs ) }">
						<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.module_tabs }">
					</MvIF>
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ CanI( 'STOR', 1, 0, 0, 0 ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID( Stores.d.ui_id ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_tabs" VALUE = "{ Module_Store_Tabs() }">
					<MvIF EXPR = "{ len( l.module_tabs ) }">
						<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.module_tabs }">
					</MvIF>
				</MvIF>
			</MvIF>
		<MvELSE>
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.inuse" VALUE = "{ Store_License_In_Use( Domain.d.license ) }">
			<MvIF EXPR = "{ l.inuse }">
				<MvASSIGN NAME = "l.default_tab" VALUE = "LICE">
				<MvLOCALIZED NAME = "l.tabs" ID = "MER-ADM-00229">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">LICE:License*,IDEN:Identification,OWNE:Owner*,SETT:Settings,LAYO:Layout</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			<MvELSE>
				<MvASSIGN NAME = "l.default_tab" VALUE = "IDEN">
				<MvLOCALIZED NAME = "l.tabs" ID = "MER-ADM-00230">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">IDEN:Identification,OWNE:Owner,SETT:Settings,LAYO:Layout</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			</MvIF>
		</MvIF>
		<MvEVAL EXPR = "{ DrawTabs( l.default_tab, l.tabs ) }">
		<MvEVAL EXPR = "{ BeginContent() }">

		<MvIF EXPR = "{ g.Tab EQ 'LICE' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00231">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">License #:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ len( g.Edit_Store ) }">
					<MvEVAL EXPR = "{ encodeentities( Stores.d.license ) }">
				<MvELSE>
					<INPUT TYPE = "text" SIZE = "40" NAME = "Store_License" VALUE = "{ encodeentities( g.Store_License ) }">
				</MvIF>
				</FONT>
			</TD></TR>
			</TABLE>
		<MvELSE>
			<MvIF EXPR = "{ len( g.Edit_Store ) EQ 0 }">
				<MvHIDE FIELDS = "g.Store_License">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ g.Tab EQ 'IDEN' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00232">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Manager:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ g.Admin_User_Administrator }">
					<INPUT TYPE = "text" SIZE = 20 NAME = "Store_Manager" VALUE = "{ encodeentities( g.Store_Manager ) }"> <A HREF = "JavaScript:PopupUserLookup( 'Store_Manager' );"><MvEVAL EXPR = "{ DrawImgButton_Search(0) }"></A>
				<MvELSE>
					<MvEVAL EXPR = "{ encodeentities( g.Store_Manager ) }">
					<MvHIDE FIELDS = "g.Store_Manager">
				</MvIF>
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00233">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store Code:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "20" NAME = "Store_StoreCode" VALUE = "{ encodeentities( g.Store_StoreCode ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00234">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store Name:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "40" NAME = "Store_Name" VALUE = "{ encodeentities( g.Store_Name ) }">
				</FONT>
			</TD></TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Store_StoreCode, g.Store_Manager, g.Store_Name">
		</MvIF>

		<MvIF EXPR = "{ g.Tab EQ 'OWNE' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00235">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Owner:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "40" NAME = "Store_Owner" VALUE = "{ encodeentities( g.Store_Owner ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00236">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Email Address:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "40" NAME = "Store_Email" VALUE = "{ encodeentities( g.Store_Email ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED  ID = "MER-ADM-00884">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Company:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "40" NAME = "Store_Company" VALUE = "{ encodeentities( g.Store_Company ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED  ID = "MER-ADM-00885">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Address:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "40" NAME = "Store_Address" VALUE = "{ encodeentities( g.Store_Address ) }">
				</FONT>
			</TD></TR>

			<MvIF EXPR = "{ s.miva_language EQ 'de-DE' }">
				<TR><TD NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-ADM-00241">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Zip/Postal Code:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = "10" NAME = "Store_Zip" VALUE = "{ encodeentities( g.Store_Zip ) }">
					</FONT>
				</TD></TR>

				<TR><TD NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-ADM-00239">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">City:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = "40" NAME = "Store_City" VALUE = "{ encodeentities( g.Store_City ) }">
					</FONT>
				</TD></TR>

				<TR><TD NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvIF EXPR = "{ Stores.d.country NE 'US' }">
						<MvLOCALIZED ID = "MER-ADM-00240">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">State/Province:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
					<MvELSE>
						<B>
						<MvLOCALIZED ID = "MER-ADM-00240">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">State/Province:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</B>
					</MvIF>
					</FONT>
				</TD><TD WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = "40" NAME = "Store_State" VALUE = "{ encodeentities( g.Store_State ) }">
					</FONT>
				</TD></TR>
			<MvELSE>
				<TR><TD NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-ADM-00239">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">City:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = "40" NAME = "Store_City" VALUE = "{ encodeentities( g.Store_City ) }">
					</FONT>
				</TD></TR>

				<TR><TD NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvIF EXPR = "{ Stores.d.country NE 'US' }">
						<MvLOCALIZED ID = "MER-ADM-00240">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">State/Province:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
					<MvELSE>
						<B>
						<MvLOCALIZED ID = "MER-ADM-00240">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">State/Province:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</B>
					</MvIF>
					</FONT>
				</TD><TD WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = "40" NAME = "Store_State" VALUE = "{ encodeentities( g.Store_State ) }">
					</FONT>
				</TD></TR>

				<TR><TD NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-ADM-00241">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Zip/Postal Code:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = "10" NAME = "Store_Zip" VALUE = "{ encodeentities( g.Store_Zip ) }">
					</FONT>
				</TD></TR>
			</MvIF>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00242">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Country:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.ok" VALUE = "{ Country_Select( 'Store_Country', g.Store_Country ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00243">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Phone:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "20" NAME = "Store_Phone" VALUE = "{ encodeentities( g.Store_Phone ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00244">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Fax:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "20" NAME = "Store_Fax" VALUE = "{ encodeentities( g.Store_Fax ) }">
				</FONT>
			</TD></TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Store_Owner, g.Store_Email, g.Store_Company, g.Store_Address, g.Store_City, g.Store_State, g.Store_Zip, g.Store_Country, g.Store_Phone, g.Store_Fax">
		</MvIF>

		<MvIF EXPR = "{ g.Tab EQ 'SETT' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00245">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Units of Measurement (Weight):</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "10" NAME = "Store_WeightUnits" VALUE = "{ encodeentities( g.Store_WeightUnits ) }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00246">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Basket Timeout (Minutes):</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "10" NAME = "Store_BasketExpiration" VALUE = "{ encodeentities( g.Store_BasketExpiration ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00247">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Price Group Overlap Resolution:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<SELECT NAME = "Store_PriceGroupOverlap">
				<MvLOCALIZED NAME = "l.option" ID = "MER-ADM-00248">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Highest Price</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawOption( 'HIGHEST', g.Store_PriceGroupOverlap, l.option ) }">

				<MvLOCALIZED NAME = "l.option" ID = "MER-ADM-00249">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Lowest Price</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawOption( 'LOWEST', g.Store_PriceGroupOverlap, l.option ) }">

				</SELECT>
				</FONT>
			</TD></TR>

			<MvIF EXPR = "{ NOT g.Edit_Store }">
				<TR><TD NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-ADM-00250">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">First Order #:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = "10" NAME = "Store_Order_Start" VALUE = "{ encodeentities( g.Store_Order_Start ) }">
					</FONT>
				</TD></TR>
			</MvIF>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00251">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Sales Tax Calculation:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ g.Admin_User_Administrator OR ( Stores.d.manager_id EQ g.Admin_User_ID ) }">
					<SELECT NAME = "Store_TaxModule">
					<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawOption_SelectOne() }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindFirst_Type_Admin( 'TAX' ) }">
					<MvWHILE EXPR = "{ l.found }">
						<MvIF EXPR = "{ ( g.Store_TaxModule EQ Modules.d.code ) OR (Modules.d.active) }">
							<MvIF EXPR = "{ NOT Modules.d.active }">
								<MvLOCALIZED NAME = "l.deactivated_text" ID = "MER-ADM-01551">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US"> (deactivated)</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
							<MvELSE>
								<MvASSIGN NAME = "l.deactivated_text" VALUE = "">
							</MvIF>
							<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawOption( Modules.d.code, g.Store_TaxModule, Modules.d.name $ l.deactivated_text ) }">
						</MvIF>
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindNext_Type_Admin( 'TAX' ) }">
					</MvWHILE>
					</SELECT>
				<MvELSE>
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_Code( g.Store_TaxModule ) }">
					<MvIF EXPR = "{ l.found }">
						<MvEVAL EXPR = "{ Modules.d.name }">
						<INPUT TYPE = "hidden" NAME = "Store_TaxModule" VALUE = "{ encodeentities( Modules.d.code ) }">
					</MvIF>
				</MvIF>
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00252">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Currency Formatting:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ g.Admin_User_Administrator OR ( Stores.d.manager_id EQ g.Admin_User_ID ) }">
					<SELECT NAME = "Store_CurrencyModule">
					<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawOption_SelectOne() }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindFirst_Type_Admin( 'CURRENCY' ) }">
					<MvWHILE EXPR = "{ l.found }">
						<MvIF EXPR = "{ ( Modules.d.code EQ g.Store_CurrencyModule ) OR Modules.d.active }">
							<MvIF EXPR = "{ NOT Modules.d.active }">
								<MvLOCALIZED NAME = "l.deactivated_text" ID = "MER-ADM-01552">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US"> (deactivated)</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
							<MvELSE>
								<MvASSIGN NAME = "l.deactivated_text" VALUE = "">
							</MvIF>

							<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawOption( Modules.d.code, g.Store_CurrencyModule, Modules.d.name $ l.deactivated_text ) }">
						</MvIF>
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindNext_Type_Admin( 'CURRENCY' ) }">
					</MvWHILE>
					</SELECT>
				<MvELSE>
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_Code( g.Store_CurrencyModule ) }">
					<MvIF EXPR = "{ l.found }">
						<MvEVAL EXPR = "{ Modules.d.name }">
						<INPUT TYPE = "hidden" NAME = "Store_CurrencyModule" VALUE = "{ encodeentities( Modules.d.code ) }">
					</MvIF>
				</MvIF>
				</FONT>
			</TD></TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Store_WeightUnits, g.Store_BasketExpiration, g.Store_PriceGroupOverlap, g.Store_TaxModule, g.Store_CurrencyModule">

			<MvIF EXPR = "{ NOT g.Edit_Store }">
				<MvHIDE FIELDS = "g.Store_Order_Start">
			</MvIF>

		</MvIF>

		<MvIF EXPR = "{ g.Tab EQ 'LAYO' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR>
			<MvASSIGN NAME = "l.column" VALUE = 0>
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindFirst_Type_Admin( 'UI' ) }">
			<MvWHILE EXPR = "{ l.found }">
				<MvIF EXPR = "{ ( Modules.d.code EQ g.Store_UserInterface ) OR Modules.d.Active }">
					<MvASSIGN NAME = "l.column" VALUE = "{ l.column + 1 }">
					<MvIF EXPR = "{ l.column GT 2 }">
						</TR><TR>
						<MvASSIGN NAME = "l.column" VALUE = 1>
					</MvIF>

					<TD BGCOLOR = "#f0f0f0" ALIGN = "center" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ Modules.d.Active }">
							<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.image" VALUE = "{ UIModule_Store_Thumbnail() }">
							<MvLOCALIZED NAME = "l.alt_text" ID = "MER-ADM-00805">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Preview</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							<A HREF = "{ 'JavaScript:PopupUIStorePreview( \'' $ encodeentities( Modules.d.code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ encodeentities( l.image ) }"></A>
							<BR>
						</MvIF>
						<MvIF EXPR = "{ Modules.d.code EQ g.Store_UserInterface }">
							<INPUT TYPE = "radio" NAME = "Store_UserInterface" VALUE = "{ encodeentities( Modules.d.code ) }" CHECKED>
						<MvELSE>
							<INPUT TYPE = "radio" NAME = "Store_UserInterface" VALUE = "{ encodeentities( Modules.d.code ) }">
						</MvIF>
						<MvEVAL EXPR = "{ Modules.d.name }">
						<MvIF EXPR = "{ NOT Modules.d.Active }">
							<BR>
							<MvLOCALIZED ID = "MER-ADM-01553">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US"><FONT COLOR = "#ff0000">( Deactivated )</FONT></MvLOCALIZED-TEXT>
								
							</MvLOCALIZED>
						</MvIF>
						</FONT>
					</TD>
				</MvIF>

				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindNext_Type_Admin( 'UI' ) }">
			</MvWHILE>
			</TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Store_UserInterface">
		</MvIF>

		<MvIF EXPR = "{ g.Tab EQ 'CFLD' }">
			<MvIF EXPR = "{ g.Features:Customers:Enabled }">
				<MvDO FILE = "{ g.Module_Feature_CUS }" NAME = "l.foo" VALUE = "{ Screen_Stores_CFLD() }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ g.Tab EQ 'MNMD' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
				<TR><TD NOWRAP VALIGN = "top">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-ADM-00888">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store Activity:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD WIDTH = "100%">
					<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
						<TR><TD ALIGN = "left" VALIGN = "middle" COLSPAN = 2>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvIF EXPR = "{ g.Store_MaintenanceType EQ 'E' }">
								<INPUT TYPE = "radio" NAME = "Store_MaintenanceType" VALUE = "E" CHECKED>
							<MvELSE>
								<INPUT TYPE = "radio" NAME = "Store_MaintenanceType" VALUE = "E">
							</MvIF>
							<MvLOCALIZED ID = "MER-ADM-00889">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store Online</MvLOCALIZED-TEXT>
							</MvLOCALIZED>

							</FONT>
						</TD></TR>

						<TR><TD ALIGN = "left" VALIGN = "middle" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">

							<MvIF EXPR = "{ g.Store_MaintenanceType EQ 'A' }">
								<INPUT TYPE = "radio" NAME = "Store_MaintenanceType" VALUE = "A" CHECKED>
							<MvELSE>
								<INPUT TYPE = "radio" NAME = "Store_MaintenanceType" VALUE = "A">
							</MvIF>
							<MvLOCALIZED ID = "MER-ADM-00890">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Offline At</MvLOCALIZED-TEXT>
							</MvLOCALIZED>

							<INPUT TYPE = "text" NAME = "Store_MaintenanceTime" VALUE = "{ encodeentities( g.Store_MaintenanceTime ) }" SIZE = "10">
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							
								<MvCOMMENT> Change the display date, For German, Day come first </MvCOMMENT>
								<MvIF EXPR = "{ s.miva_language EQ 'de-DE' }">
									<MvLOCALIZED ID = "MER-ADM-00892">
										<MvLOCALIZED-TEXT LANGUAGE = "en-US">Day:</MvLOCALIZED-TEXT>
									</MvLOCALIZED>
									<INPUT TYPE = "text" NAME = "Store_MaintenanceDay" VALUE = "{ encodeentities( g.Store_MaintenanceDay ) }" SIZE = "2">
									<MvLOCALIZED ID = "MER-ADM-00891">
										<MvLOCALIZED-TEXT LANGUAGE = "en-US">On Month:</MvLOCALIZED-TEXT>
									</MvLOCALIZED>
									<INPUT TYPE = "text" NAME = "Store_MaintenanceMonth" VALUE = "{ encodeentities( g.Store_MaintenanceMonth ) }" SIZE = "2">
								<MvELSE>
									<MvLOCALIZED ID = "MER-ADM-00891">
										<MvLOCALIZED-TEXT LANGUAGE = "en-US">On Month:</MvLOCALIZED-TEXT>
									</MvLOCALIZED>
									<INPUT TYPE = "text" NAME = "Store_MaintenanceMonth" VALUE = "{ encodeentities( g.Store_MaintenanceMonth ) }" SIZE = "2">
									<MvLOCALIZED ID = "MER-ADM-00892">
										<MvLOCALIZED-TEXT LANGUAGE = "en-US">Day:</MvLOCALIZED-TEXT>
									</MvLOCALIZED>
									<INPUT TYPE = "text" NAME = "Store_MaintenanceDay" VALUE = "{ encodeentities( g.Store_MaintenanceDay ) }" SIZE = "2">
								</MvIF>
							
								<MvLOCALIZED ID = "MER-ADM-00893">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Year:</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<INPUT TYPE = "text" NAME = "Store_MaintenanceYear" VALUE = "{ encodeentities( g.Store_MaintenanceYear ) }" SIZE = "4">
							</FONT>
						</TD></TR>
					</TABLE>

					<TR><TD ALIGN = "left" NOWRAP>
							&nbsp;
					</TD><TD WIDTH = "100%">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.formatted_time" VALUE = "{ Format_Time( s.time_t, s.miva_language ) }">
							<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.formatted_date" VALUE = "{ Format_Date( s.time_t, s.miva_language ) }">

							<MvLOCALIZED ID = "MER-ADM-00894">
								<MvLOCALIZED-TOKEN NAME = "time" VALUE = "{ l.formatted_time }">
								<MvLOCALIZED-TOKEN NAME = "date" VALUE = "{ l.formatted_date }">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US"><I>It is currently: %time% on %date%</I></MvLOCALIZED-TEXT>
							</MvLOCALIZED>

						</FONT>
					</TD></TR>
				</TD></TR>
			</TABLE>

			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
				<TR><TD>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-ADM-00888">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">No New Customer:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</FONT>
				</TD><TD>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" NAME = "Store_NoNewCustomerTime" VALUE = "{ encodeentities( g.Store_NoNewCustomerTime ) }" SIZE = "10">
					<MvLOCALIZED ID = "MER-ADM-01488">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Minutes before store goes offline.</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</FONT>
				</TD></TR>

				<TR><TD NOWRAP VALIGN = "left">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00895">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US"><B>Warning Message:</B></MvLOCALIZED-TEXT>
						</MvLOCALIZED>
					</FONT>
				</TD><TD ALIGN = "left" VALIGN = "middle" COLSPAN = 2>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<TEXTAREA NAME = "Store_MaintenanceWarning" ROWS = 10 COLS = 58 WRAP = "off"><MIVA STANDARDOUTPUTLEVEL = "text, html"><MvEVAL EXPR = "{ encodeentities( g.Store_MaintenanceWarning ) }"><MIVA STANDARDOUTPUTLEVEL = "text, html, compresswhitespace"></TEXTAREA>
					</FONT>
				</TD></TR>

				<TR><TD NOWRAP VALIGN = "left">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-ADM-00896">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US"><B>Maintenance Message:</B></MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</FONT>
				</TD><TD ALIGN = "left" VALIGN = "middle" COLSPAN = 2>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<TEXTAREA NAME = "Store_MaintenanceMessage" ROWS = 10 COLS = 58 WRAP = "off"><MIVA STANDARDOUTPUTLEVEL = "text, html"><MvEVAL EXPR = "{ encodeentities( g.Store_MaintenanceMessage ) }"><MIVA STANDARDOUTPUTLEVEL = "text, html, compresswhitespace"></TEXTAREA>
					</FONT>
				</TD></TR>

				<TR><TD NOWRAP VALIGN = "top">
					&nbsp;
				</TD><TD>
					<TABLE CELLPADDING = 4 CELLSPACING = 0>
						<TR><TD NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-01500">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Available Tokens:</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD><TD ALIGN = "left" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							%store_name%
							</FONT>
						</TD><TD ALIGN = "left" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-01501">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name of your store</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD></TR>

						<TR><TD NOWRAP>
							&nbsp;
						</TD><TD ALIGN = "left" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							%maint_countdown%
							</FONT>
						</TD><TD ALIGN = "left" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-01502">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Minutes until store closes</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD></TR>

						<TR><TD NOWRAP>
							&nbsp;
						</TD><TD ALIGN = "left" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							%maint_countdown_formatted%
							</FONT>
						</TD><TD ALIGN = "left" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-01554">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Formatted time until store closes</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD></TR>

						<TR><TD NOWRAP>
							&nbsp;
						</TD><TD ALIGN = "left" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							%maint_time%
							</FONT>
						</TD><TD ALIGN = "left" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-01503">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">The time your store goes offline</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD></TR>

						<TR><TD NOWRAP>
							&nbsp;
						</TD><TD ALIGN = "left" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							%maint_date%
							</FONT>
						</TD><TD ALIGN = "left" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-01504">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">The date your store goes offline</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD></TR>
					</TABLE>
				</TD></TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Store_MaintenanceType, g.Store_MaintenanceTime, g.Store_NoNewCustomerTime, g.Store_MaintenanceMonth, g.Store_MaintenanceDay, g.Store_MaintenanceYear, g.Store_MaintenanceWarning, g.Store_MaintenanceMessage">
		</MvIF>

		<MvIF EXPR = "{ g.Tab EQ 'OMIN' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-ADM-00899">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Minimum Quantity:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</FONT><BR>
				</TD><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" SIZE = "10" NAME = "Store_OrderMinQuantity" VALUE = "{ encodeentities( g.Store_OrderMinQuantity ) }">
					</FONT>
				</TD></TR>
				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-ADM-00900">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Minimum Price:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</FONT><BR>
				</TD><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" SIZE = "10" NAME = "Store_OrderMinPrice" VALUE = "{ encodeentities( g.Store_OrderMinPrice ) }">
					</FONT>
				</TD></TR>
				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					&nbsp;
					</FONT><BR>
				</TD><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Store_OrderMinMeetAll, 'Store_OrderMinMeetAll', 'Yes', '' ) }">
						<MvLOCALIZED ID = "MER-ADM-00901">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Must Meet Both Minimums</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
					</FONT>
				</TD></TR>
				<TR><TD NOWRAP VALIGN = "top">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<I>
					<MvLOCALIZED ID = "MER-ADM-00902">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Minimum Not Met Message:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</I>
					</FONT>
				</TD><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<TEXTAREA NAME = "Store_OrderMinMessage" ROWS = 10 COLS = 58 WRAP = "off"><MIVA STANDARDOUTPUTLEVEL = "text, html"><MvEVAL EXPR = "{ encodeentities( g.Store_OrderMinMessage ) }"><MIVA STANDARDOUTPUTLEVEL = "text, html, compresswhitespace"></TEXTAREA>
					</FONT>
				</TD></TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Store_OrderMinQuantity, g.Store_OrderMinPrice, g.Store_OrderMinMeetAll, g.Store_OrderMinMessage">
		</MvIF>

		<MvIF EXPR = "{ len( g.Edit_Store ) }">
			<MvIF EXPR = "{ CanI( 'STAX', 1, 0, 0, 0 ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID_Admin( Stores.d.tax_id ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Store_Content( g.Tab, g.Load_Fields ) }">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ CanI( 'CURR', 1, 0, 0, 0 ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID_Admin( Stores.d.currncy_id ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Store_Content( g.Tab, g.Load_Fields ) }">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ CanI( 'STOR', 1, 0, 0, 0 ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID_Admin( Stores.d.ui_id ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Store_Content( g.Tab, g.Load_Fields ) }">
				</MvIF>
			</MvIF>
		</MvIF>

		<MvEVAL EXPR = "{ EndContent() }">

		<MvIF EXPR = "{ len( g.Edit_Store ) }">
			<MvASSIGN NAME = "l.buttons" VALUE = "">
			<MvIF EXPR = "{ CanI( 'CURR', 0, 1, 0, 0 ) OR CanI( 'CURR', 0, 0, 1, 0 ) OR CanI( 'CURR', 0, 0, 0, 1 ) OR
							CanI( 'STAX', 0, 1, 0, 0 ) OR CanI( 'STAX', 0, 0, 1, 0 ) OR CanI( 'STAX', 0, 0, 0, 1 ) OR
							CanI( 'STOR', 0, 1, 0, 0 ) OR CanI( 'STOR', 0, 0, 1, 0 ) OR CanI( 'STOR', 0, 0, 0, 1 ) }">
				<MvASSIGN NAME = "l.buttons" VALUE = "USTR:[UPDATE];Store_Update()">
			</MvIF>
			<MvIF EXPR = "{ g.Admin_User_Administrator OR ( Stores.d.manager_id EQ g.Admin_User_ID ) }">
				<MvASSIGN NAME = "l.buttons" VALUE = "{ l.buttons $ ',DSTR.:[DELETE]' }">
			</MvIF>
			<MvEVAL EXPR = "{ DrawButtons( l.buttons ) }">
		<MvELSE>
			<MvIF EXPR = "{ g.Admin_User_Administrator OR ( Stores.d.manager_id EQ g.Admin_User_ID ) }">
				<MvEVAL EXPR = "{ DrawButtons( 'ISTR:[ADD]:STOR:1:0:0' ) }">
			<MvELSE>
				<MvEVAL EXPR = "{ DrawButtons( '' ) }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.inuse GT 0 AND ( NOT g.Edit_Store ) }">
			<FONT FACE = "Arial, Helvetica" SIZE = "-2">
			<BR>
			<MvLOCALIZED ID = "MER-ADM-00253">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">* Information on tabs marked with asterisks will be sent over the Internet to Miva Corporation</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</FONT>
		</MvIF>

		<MvEVAL EXPR = "{ EndScreen() }">
	</MvIF>
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>


<MvFUNCTION NAME = "Countries_Validate" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvASSIGN NAME = "l.index" VALUE = 1>
	<MvASSIGN NAME = "l.counter" VALUE = 0>
	<MvASSIGN NAME = "l.country_count" VALUE = 0>

	<MvWHILE EXPR = "{ l.ok AND ( l.index LE g.StoreCountry_Count ) }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.assigned" VALUE = "{ StoreCountry_Find_ID( g.Country[ l.index ]:ID ) }">

		<MvIF EXPR = "{ l.assigned }">
			<MvIF EXPR = "{ NOT g.StoreCountry_Assigned[ l.index ] }">
				<MvASSIGN NAME = "l.counter" VALUE = "{ l.counter + 1 }">
			</MvIF>
		</MvIF>

		<MvASSIGN NAME = "l.index" VALUE = "{ l.index + 1 }">
	</MvWHILE>

	<MvDO FILE = "{ g.Library_DB }" NAME = "{ l.ok }" VALUE = "{ _DB_Open_StoreCountries() }">

	<MvIF EXPR = "{ l.ok }">
		<MvGO NAME = "StoreCountries" ROW = "top">

		<MvWHILE EXPR = "{ NOT StoreCountries.d.EOF }">
			<MvASSIGN NAME = "l.country_count" VALUE = "{ l.country_count + 1 }">
			<MvIF EXPR = "{ l.country_count GT l.counter }">
				<MvASSIGN NAME = "l.fine" VALUE = 1>
			</MvIF>

			<MvSKIP NAME = "StoreCountries" ROWS = 1>
		</MvWHILE>

		<MvIF EXPR = "{ l.fine }">
			<MvFUNCTIONRETURN VALUE = "{ l.ok }">
		<MvELSE>
			<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-02323">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">You must have at least one country on your list</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'STCT', '', l.error_message ) }">
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Countries_Update">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvASSIGN NAME = "l.valid" VALUE = 1>
	<MvASSIGN NAME = "l.modified" VALUE = 0>

	<MvASSIGN NAME = "l.can_add" VALUE = "{ CanI( 'STCT', 0, 1, 0, 0 ) }">
	<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'STCT', 0, 0, 0, 1 ) }">
	<MvASSIGN NAME = "l.country" VALUE = 1>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ _DB_Open_Countries() }">
	<MvIF EXPR =  "{ l.ok }">
		<MvIF EXPR = "{ Countries_Validate() }">
			<MvWHILE EXPR = "{ l.ok AND ( l.country LE g.StoreCountry_Count ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.assigned" VALUE = "{ StoreCountry_Find_ID( g.Country[ l.country ]:ID ) }">

				<MvIF EXPR = "{ g.StoreCountry_Assigned[ l.country ] }">
					<MvIF EXPR = "{ l.ok AND l.can_add }">
						<MvIF EXPR = "{ NOT l.assigned }">
							<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ StoreCountry_Insert( g.Country[ l.country ]:ID, g.Country[ l.country ]:Name, g.Country[ l.country ]:Alpha, g.Country[ l.country ]:Numeric ) }">
						</MvIF>
					</MvIF>
				<MvELSE>
					<MvIF EXPR = "{ l.assigned }">
						<MvIF EXPR = "{ l.ok AND l.can_delete }">
							<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ StoreCountry_Delete( StoreCountries.d.id ) }">
						</MvIF>
					</MvIF>
				</MvIF>

				<MvASSIGN NAME = "l.country" VALUE = "{ l.country + 1 }">
			</MvWHILE>

			<MvIF EXPR = "{ l.ok AND l.can_add }">
				<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00903">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Countries updated</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			</MvIF>
		</MvIF>
	</MvIF>
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Countries" PARAMETERS = "" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'STCT', 0, 1, 0, 0 ) }">
	<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'STCT', 0, 0, 0, 1 ) }">

	<MvIF EXPR = "{ NOT g.Have_List_Fields }">
		<MvASSIGN NAME = "g.Country_Stack" VALUE = "">
		<MvASSIGN NAME = "g.Country_Search" VALUE = "">
		<MvASSIGN NAME = "g.Country_Show" VALUE = "All">

		<MvASSIGN NAME = "g.Country_Offset" VALUE = 0>
		<MvASSIGN NAME = "g.Country_Display" VALUE = "{ g.Admin_User_PageLen }">
	<MvELSE>
		<MvASSIGN NAME = "g.Country_Display" VALUE = "{ int( g.Country_Display ) }">
		<MvIF EXPR = "{ g.Country_Display LT 1 }">
			<MvASSIGN NAME = "g.Country_Display" VALUE = 1>
		</MvIF>
	</MvIF>

	<MvLOCALIZED NAME = "l.screen_label" ID = "MER-ADM-00904">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Countries</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvEVAL EXPR = "{ BeginScreen( l.screen_label, 'STCT', 'Help:stct.html' ) }">
	<INPUT TYPE = "hidden" NAME = "Have_List_Fields" VALUE = "1">

	<MvLOCALIZED NAME = "l.tab_list" ID = "MER-ADM-00905">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">STCT:Countries</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvEVAL EXPR = "{ DrawTabs( 'STCT', l.tab_list ) }">

	<MvEVAL EXPR = "{ BeginContent() }">

	<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">

	<TR><TD ALIGN = "left" VALIGN = "middle" WIDTH = "100%">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvHIDE FIELDS = "g.Country_Show">

		<A HREF = "JavaScript:ListReloadField( 'Country_Offset', 'Country_Stack', 'Country_Show', 'All' );"><MvEVAL EXPR = "{ DrawImgButton_All( g.Country_Show EQ 'All' ) }"></A>

		<A HREF = "JavaScript:ListReloadField( 'Country_Offset', 'Country_Stack', 'Country_Show', 'Unassigned' );"><MvEVAL EXPR = "{ DrawImgButton_Unassigned( g.Country_Show EQ 'Unassigned' ) }"></A>

		<A HREF = "JavaScript:ListReloadField( 'Country_Offset', 'Country_Stack', 'Country_Show', 'Assigned' );"><MvEVAL EXPR = "{ DrawImgButton_Assigned( g.Country_Show EQ 'Assigned' ) }"></A>
		</FONT>
	</TD><TD ALIGN = "right" VALIGN = "middle">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
		<MvLOCALIZED ID = "MER-ADM-00906">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Search:</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B></FONT>
	</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvASSIGN NAME = "g.Country_Search" VALUE = "{ ltrim( rtrim( g.Country_Search ) ) }">
		<INPUT TYPE = "text" NAME = "Country_Search" VALUE = "{ encodeentities( g.Country_Search ) }" SIZE = 20>
		<A HREF = "JavaScript:ListReload( 'Country_Offset', 'Country_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Search(0) }"></A>
		</FONT>
	</TD></TR>
	</TABLE>

	<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
		<TR><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080" NOWRAP>
			<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1"><B>
			<MvLOCALIZED ID = "MER-ADM-00907">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Assigned</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>

			<MvIF EXPR = "{ l.can_add OR l.can_delete }">
				<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_CheckAll( 'StoreCountry_Assigned' ) }">
			</MvIF>

		</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080" NOWRAP>
			<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1"><B>
			<MvLOCALIZED ID = "MER-ADM-00908">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080" WIDTH = "100%">
			<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1"><B>
			<MvLOCALIZED ID = "MER-ADM-00909">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Country</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD></TR>

		<MvASSIGN NAME = "l.shown" VALUE = 0>
		<MvASSIGN NAME = "l.lastoffset" VALUE = 0>

		<MvIF EXPR = "{ ( g.Country_Show EQ 'All' ) OR ( g.Country_Show EQ 'Unassigned' ) }">
			<MvASSIGN NAME = "l.assigned" VALUE = 0>
		</MvIF>

		<MvIF EXPR = "{ g.Country_Show EQ 'Assigned' }">
			<MvASSIGN NAME = "l.assigned" VALUE = 1>
		</MvIF>

		<MvIF EXPR = "{ g.Country_Show EQ 'All' }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Country_FindOffset_All( g.Country_Offset, g.Country_Search ) }">
		</MvIF>

		<MvIF EXPR = "{ g.Country_Show EQ 'Unassigned' }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ StoreCountry_Country_FindOffset_Unassigned( g.Country_Offset, g.Country_Search ) }">
		</MvIF>

		<MvIF EXPR = "{ g.Country_Show EQ 'Assigned' }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ StoreCountry_Country_FindOffset_Assigned( g.Country_Offset, g.Country_Search ) }">
		</MvIF>

		<MvWHILE EXPR = "{ ( l.shown LT g.Country_Display ) AND l.nextoffset }">
			<MvIF EXPR = "{ g.Country_Show EQ 'All' }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.assigned" VALUE = "{ StoreCountry_Find( StoreCountries.d.id, Countries.d.id ) }">
			</MvIF>

			<MvASSIGN NAME = "l.shown" VALUE = "{ l.shown + 1 }">

			<MvIF EXPR = "{ ( l.shown MOD 2 ) EQ 0 }">
				<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffdd">
			<MvELSE>
				<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffff">
			</MvIF>

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.country_found" VALUE = "{ StoreCountry_Find_ID( Countries.d.id ) }">

			<MvIF EXPR = "{ l.country_found }">
				<MvASSIGN NAME = "l.country_name" VALUE = "{ Countries.d.name }">
			<MvELSE>
				<MvASSIGN NAME = "l.country_name" VALUE = "">
			</MvIF>

			<TR><TD ALIGN = "center" VALIGN = "middle" NOWRAP BGCOLOR = "{ l.bgcolor }">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ l.can_delete OR l.can_add }">
					<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( l.country_found, 'StoreCountry_Assigned[' $ l.shown $ ']', 'Yes', '' ) }">
				<MvELSE>
					<MvEVAL EXPR = "{ DrawCheck_Assigned( l.country_found ) }">
				</MvIF>

				<MvASSIGN NAME = "g.Country" INDEX = "{ l.shown }" MEMBER = "ID" VALUE = "{ Countries.d.id }">
				<MvASSIGN NAME = "g.Country" INDEX = "{ l.shown }" MEMBER = "Alpha" VALUE = "{ Countries.d.alpha }">
				<MvASSIGN NAME = "g.Country" INDEX = "{ l.shown }" MEMBER = "Name" VALUE = "{ Countries.d.name }">
				<MvASSIGN NAME = "g.Country" INDEX = "{ l.shown }" MEMBER = "Numeric" VALUE = "{ Countries.d.numeric }">
				</FONT>
			</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ encodeentities( Countries.d.alpha ) }">
				</FONT>
			</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ encodeentities( Countries.d.name ) }">
				</FONT>
			</TD></TR>

			<MvASSIGN NAME = "l.lastoffset" VALUE = "{ l.nextoffset }">

			<MvIF EXPR = "{ g.Country_Show EQ 'All' }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Country_FindNext_All( l.nextoffset, g.Country_Search ) }">
			</MvIF>

			<MvIF EXPR = "{ g.Country_Show EQ 'Unassigned' }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ StoreCountry_Country_FindNext_Unassigned( l.nextoffset, g.Country_Search ) }">
			</MvIF>

			<MvIF EXPR = "{ g.Country_Show EQ 'Assigned' }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ StoreCountry_Country_FindNext_Assigned( l.nextoffset, g.Country_Search ) }">
			</MvIF>
		</MvWHILE>
		
		<MvHIDE FIELDS = "g.Country">
		<INPUT TYPE = "hidden" NAME = "StoreCountry_Count" VALUE = "{ encodeentities( l.shown ) }">

		<TR><TD BGCOLOR = "#000080" ALIGN = "left" VALIGN = "middle" NOWRAP>
			<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
			<MvHIDE FIELDS = "g.Country_Stack, g.Country_Offset">
			<MvIF EXPR = "{ g.Country_Show EQ 'All' }">
				<MvIF EXPR = "{ l.shown }">
					<B><MvEVAL EXPR = "{ g.Country_Offset + 1 }">-<MvEVAL EXPR = "{ l.lastoffset }"></B>
				<MvELSE>
					<B>0-0</B>
				</MvIF>
			<MvELSE>
				<MvEVAL EXPR = "{ Show_BoldNA() }">
			</MvIF>
			</FONT>
		</TD><TD BGCOLOR = "#000080" ALIGN = "right" VALIGN = "middle" COLSPAN = 3>
			<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
			<MvIF EXPR = "{ len( g.Country_Stack ) }">
				<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListPrevious( \'Country_Offset\', \'Country_Stack\' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Previous('0') }"><MvEVAL EXPR = "</A>">
			</MvIF>

			 <INPUT TYPE = "text" NAME = "Country_Display" VALUE = "{ encodeentities( g.Country_Display ) }" SIZE = 5> <A HREF = "JavaScript:ListReload( 'Country_Offset', 'Country_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Refresh('0') }"></A>
			 <INPUT TYPE = "hidden" NAME = "Country_Count" VALUE = "{ encodeentities( l.shown ) }">

			 <MvIF EXPR = "{ l.nextoffset }">
				<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListNext( \'Country_Offset\', \'Country_Stack\', ' $ l.lastoffset $ ' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Next('0') }"><MvEVAL EXPR = "</A>">
			 </MvIF>
			</FONT>
		</TD></TR>
	</TABLE>

	<MvEVAL EXPR = "{ EndContent() }">

	<MvIF EXPR = "{ l.can_delete OR l.can_add }">
		<MvEVAL EXPR = "{ DrawButtons( 'STCT:[UPDATE]' ) }">
	<MvELSE>
		<MvEVAL EXPR = "{ DrawButtons( '' ) }">
	</MvIF>

	<MvEVAL EXPR = "{ EndScreen() }">

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Lookup
|
</MvCOMMENT>

<MvFUNCTION NAME = "Screen_User_Lookup">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ NOT g.Have_List_Fields }">
		<MvASSIGN NAME = "g.User_Stack" VALUE = "">
		<MvASSIGN NAME = "g.User_Search" VALUE = "">
		<MvASSIGN NAME = "g.User_Offset" VALUE = 0>
		<MvASSIGN NAME = "g.User_Display" VALUE = "{ g.Admin_User_PageLen }">
	<MvELSE>
		<MvASSIGN NAME = "g.User_Display" VALUE = "{ int( g.User_Display ) }">
		<MvIF EXPR = "{ g.User_Display LT 1 }">
			<MvASSIGN NAME = "g.User_Display" VALUE = 1>
		</MvIF>
	</MvIF>

	<MvLOCALIZED NAME = "l.screen_label" ID = "MER-ADM-00273">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">User Lookup</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvEVAL EXPR = "{ BeginScreen( l.screen_label, 'ULKP', 'Help:ulkp.html' ) }">

	<INPUT TYPE = "hidden" NAME = "Have_List_Fields" VALUE = "1">
	<MvHIDE FIELDS = "g.Lookup_Form, g.Lookup_Field">

	<MvLOCALIZED NAME = "l.tab_list" ID = "MER-ADM-00274">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">USER:Users</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvEVAL EXPR = "{ DrawTabs( 'USER', l.tab_list ) }">

	<MvEVAL EXPR = "{ BeginContent() }">
	
	<MvEVAL EXPR = "{ JavaScript_SetVariables( 'g', 'Lookup_Form, Lookup_Field' ) }">

	<SCRIPT LANGUAGE = "JavaScript">
<!--
function SendUser( login )
{
	opener.document.forms[ Lookup_Form ].elements[ Lookup_Field ].value = unescape( login );
	window.close();
}
//-->
	</SCRIPT>

	<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
	<TR><TD WIDTH = "100%">
		&nbsp;
	</TD><TD ALIGN = "right" VALIGN = "middle">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
		<MvLOCALIZED ID = "MER-ADM-00275">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Search:</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B></FONT>
	</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvASSIGN NAME = "g.User_Search" VALUE = "{ ltrim( rtrim( g.User_Search ) ) }">
		<INPUT TYPE = "text" NAME = "User_Search" VALUE = "{ encodeentities( g.User_Search ) }" SIZE = 20>
		<A HREF = "JavaScript:ListReload( 'User_Offset', 'User_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Search(0) }"></A>
		</FONT>
	</TD></TR>
	</TABLE>

	<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
	<TR><TD BGCOLOR = "#000080" WIDTH = "100%">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
		<MvLOCALIZED ID = "MER-ADM-00753">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B></FONT>
	</TD><TD BGCOLOR = "#000080">
		&nbsp;
	</TD></TR>

	<MvASSIGN NAME = "l.shown" VALUE = 0>
	<MvASSIGN NAME = "l.lastoffset" VALUE = 0>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ User_FindOffset_All( g.User_Offset, g.User_Search ) }">
	<MvWHILE EXPR = "{ ( l.shown LT g.User_Display ) AND l.nextoffset }">
		<MvASSIGN NAME = "l.shown" VALUE = "{ l.shown + 1 }">

		<MvIF EXPR = "{ ( l.shown MOD 2 ) EQ 0 }">
			<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffdd">
		<MvELSE>
			<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffff">
		</MvIF>

		<TR><TD BGCOLOR = "{ l.bgcolor }" VALIGN = "middle" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvEVAL EXPR = "{ encodeentities( Users.d.name ) }">
			</FONT>
		</TD><TD BGCOLOR = "{ l.bgcolor }" VALIGN = "middle" ALIGN = "right" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvEVAL EXPR = "{ '<A HREF = "JavaScript:SendUser( \'' $ JavaScriptEncode( Users.d.name ) $ '\' );">' }"> <MvEVAL EXPR = "{ DrawImgButton_Select('0') }"><MvEVAL EXPR = "</A>">
			</FONT>
		</TD></TR>

		<MvASSIGN NAME = "l.lastoffset" VALUE = "{ l.nextoffset }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ User_FindNext_All( l.nextoffset, g.User_Search ) }">
	</MvWHILE>

	<TR><TD BGCOLOR = "#000080" ALIGN = "left" VALIGN = "middle" NOWRAP>
		<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
		<MvHIDE FIELDS = "g.User_Stack, g.User_Offset">
		<MvIF EXPR = "{ l.shown }">
			<B><MvEVAL EXPR = "{ g.User_Offset + 1 }">-<MvEVAL EXPR = "{ l.lastoffset }"></B>
		<MvELSE>
			<B>0-0</B>
		</MvIF>
		</FONT>
	</TD><TD BGCOLOR = "#000080" ALIGN = "right" VALIGN = "middle" NOWRAP>
		<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
		<MvIF EXPR = "{ len( g.User_Stack ) }">
			<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListPrevious( \'User_Offset\', \'User_Stack\' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Previous('0') }"><MvEVAL EXPR = "</A>">
		</MvIF>

		 <INPUT TYPE = "text" NAME = "User_Display" VALUE = "{ encodeentities( g.User_Display ) }" SIZE = 5> <A HREF = "JavaScript:ListReload( 'User_Offset', 'User_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Refresh('0') }"></A>
		 <INPUT TYPE = "hidden" NAME = "User_Count" VALUE = "{ encodeentities( l.shown ) }">

		 <MvIF EXPR = "{ l.nextoffset }">
			<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListNext( \'User_Offset\', \'User_Stack\', ' $ l.lastoffset $ ' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Next('0') }"><MvEVAL EXPR = "</A>">
		 </MvIF>
		</FONT>
	</TD></TR>
	</TABLE>
	<MvEVAL EXPR = "{ EndContent() }">

	<TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
	<TR><TD BGCOLOR = "#000000">

	<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
	<TR><TD BGCOLOR = "#f0f0f0" WIDTH = "100%" ALIGN = "left" VALIGN = "middle">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvIF EXPR = "{ len( g.Message ) }">
			<MvEVAL EXPR = "{ g.Message }">
		<MvELSE>
			&nbsp;
		</MvIF>
		</FONT>
	</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvLOCALIZED ID = "MER-ADM-00754">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				<INPUT TYPE = "button" VALUE = "Close" ONCLICK = "window.close();">
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</FONT>
	</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvEVAL EXPR = "{ DrawButton_Reset() }">
		</FONT>
	</TD></TR>
	</TABLE>

	</TD></TR>
	</TABLE>

	<MvEVAL EXPR = "{ EndScreen() }">

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Category_Lookup">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ NOT g.Have_List_Fields }">
		<MvASSIGN NAME = "g.Category_Stack" VALUE = "">
		<MvASSIGN NAME = "g.Category_Search" VALUE = "">
		<MvASSIGN NAME = "g.Category_Offset" VALUE = 0>
		<MvASSIGN NAME = "g.Category_Display" VALUE = "{ g.Admin_User_PageLen }">
	<MvELSE>
		<MvASSIGN NAME = "g.Category_Display" VALUE = "{ int( g.Category_Display ) }">
		<MvIF EXPR = "{ g.Category_Display LT 1 }">
			<MvASSIGN NAME = "g.Category_Display" VALUE = 1>
		</MvIF>
	</MvIF>

	<MvLOCALIZED NAME = "l.screen_label" ID = "MER-ADM-00276">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Category Lookup</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvEVAL EXPR = "{ BeginScreen( l.screen_label, 'CLKP', 'Help:clkp.html' ) }">

	<INPUT TYPE = "hidden" NAME = "Have_List_Fields" VALUE = "1">
	<MvHIDE FIELDS = "g.Lookup_Form, g.Lookup_Field">

	<MvLOCALIZED NAME = "l.tab_list" ID = "MER-ADM-00277">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">CTGY:Categories</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvEVAL EXPR = "{ DrawTabs( 'CTGY', l.tab_list ) }">

	<MvEVAL EXPR = "{ BeginContent() }">
	
	<MvEVAL EXPR = "{ JavaScript_SetVariables( 'g', 'Lookup_Form, Lookup_Field' ) }">

	<SCRIPT LANGUAGE = "JavaScript">
<!--
function SendCategoryCode( cat_code )
{
	opener.document.forms[ Lookup_Form ].elements[ Lookup_Field ].value = unescape( cat_code );
	window.close();
}
//-->
	</SCRIPT>

	<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
	<TR><TD WIDTH = "100%">
		&nbsp;
	</TD><TD ALIGN = "right" VALIGN = "middle">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
		<MvLOCALIZED ID = "MER-ADM-00278">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Search:</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B></FONT>
	</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvASSIGN NAME = "g.Category_Search" VALUE = "{ ltrim( rtrim( g.Category_Search ) ) }">
		<INPUT TYPE = "text" NAME = "Category_Search" VALUE = "{ encodeentities( g.Category_Search ) }" SIZE = 20>
		<A HREF = "JavaScript:ListReload( 'Category_Offset', 'Category_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Search(0) }"></A>
		</FONT>
	</TD></TR>
	</TABLE>

	<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
	<TR><TD BGCOLOR = "#000080">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
		<MvLOCALIZED ID = "MER-ADM-00279">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B></FONT>
	</TD><TD BGCOLOR = "#000080" WIDTH = "100%">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
		<MvLOCALIZED ID = "MER-ADM-00280">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B></FONT>
	</TD><TD BGCOLOR = "#000080">
		&nbsp;
	</TD></TR>

	<MvASSIGN NAME = "l.shown" VALUE = 0>
	<MvASSIGN NAME = "l.lastoffset" VALUE = 0>
	<MvASSIGN NAME = "l.last_category_code" VALUE = "">

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Category_FindOffset_All( g.Category_Offset, g.Category_Search ) }">
	<MvWHILE EXPR = "{ ( l.shown LT g.Category_Display ) AND l.nextoffset }">
		<MvASSIGN NAME = "l.shown" VALUE = "{ l.shown + 1 }">

		<MvIF EXPR = "{ ( l.shown MOD 2 ) EQ 0 }">
			<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffdd">
		<MvELSE>
			<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffff">
		</MvIF>

		<TR><TD BGCOLOR = "{ l.bgcolor }" VALIGN = "middle" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvEVAL EXPR = "{ encodeentities( Categories.d.code ) }">
			</FONT>
		</TD><TD BGCOLOR = "{ l.bgcolor }" VALIGN = "middle" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvEVAL EXPR = "{ encodeentities( Categories.d.name ) }">
			</FONT>
		</TD><TD BGCOLOR = "{ l.bgcolor }" VALIGN = "middle" ALIGN = "right" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvEVAL EXPR = "{ '<A HREF = "JavaScript:SendCategoryCode( \'' $ JavaScriptEncode( Categories.d.code ) $ '\' );">' }"> <MvEVAL EXPR = "{ DrawImgButton_Select('0') }"><MvEVAL EXPR = "</A>">
			</FONT>
		</TD></TR>

		<MvASSIGN NAME = "l.lastoffset" VALUE = "{ l.nextoffset }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Category_FindNext_All( l.nextoffset, g.Category_Search ) }">
	</MvWHILE>

	<TR><TD BGCOLOR = "#000080" ALIGN = "left" VALIGN = "middle" NOWRAP>
		<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
		<MvHIDE FIELDS = "g.Category_Stack, g.Category_Offset">
		<MvIF EXPR = "{ l.shown }">
			<B><MvEVAL EXPR = "{ g.Category_Offset + 1 }">-<MvEVAL EXPR = "{ l.lastoffset }"></B>
		<MvELSE>
			<B>0-0</B>
		</MvIF>
		</FONT>
	</TD><TD BGCOLOR = "#000080" ALIGN = "right" VALIGN = "middle" COLSPAN = 2>
		<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
		<MvIF EXPR = "{ len( g.Category_Stack ) }">
			<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListPrevious( \'Category_Offset\', \'Category_Stack\' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Previous('0') }"><MvEVAL EXPR = "</A>">
		</MvIF>

		 <INPUT TYPE = "text" NAME = "Category_Display" VALUE = "{ encodeentities( g.Category_Display ) }" SIZE = 5> <A HREF = "JavaScript:ListReload( 'Category_Offset', 'Category_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Refresh('0') }"></A>
		 <INPUT TYPE = "hidden" NAME = "Category_Count" VALUE = "{ encodeentities( l.shown ) }">

		 <MvIF EXPR = "{ l.nextoffset }">
			<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListNext( \'Category_Offset\', \'Category_Stack\', ' $ l.lastoffset $ ' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Next('0') }"><MvEVAL EXPR = "</A>">
		 </MvIF>
		</FONT>
	</TD></TR>
	</TABLE>
	<MvEVAL EXPR = "{ EndContent() }">

	<TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
	<TR><TD BGCOLOR = "#000000">
	<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
	<TR><TD BGCOLOR = "#f0f0f0" WIDTH = "100%" ALIGN = "left" VALIGN = "middle">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvIF EXPR = "{ len( g.Message ) }">
			<MvEVAL EXPR = "{ g.Message }">
		<MvELSE>
			&nbsp;
		</MvIF>
		</FONT>
	</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvLOCALIZED ID = "MER-ADM-00755">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				<INPUT TYPE = "button" VALUE = "Close" ONCLICK = "window.close();">
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</FONT>
	</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvEVAL EXPR = "{ DrawButton_Reset() }">
		</FONT>
	</TD></TR>
	</TABLE>
	</TD></TR>
	</TABLE>

	<MvEVAL EXPR = "{ EndScreen() }">

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Product_Lookup">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ NOT g.Have_List_Fields }">
		<MvASSIGN NAME = "g.Product_Stack" VALUE = "">
		<MvASSIGN NAME = "g.Product_Search" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show" VALUE = "All">
		<MvASSIGN NAME = "g.Product_Offset" VALUE = 0>
		<MvASSIGN NAME = "g.Product_Display" VALUE = "{ g.Admin_User_PageLen }">

		<MvASSIGN NAME = "g.Product_Show_Code" VALUE = "Yes">
		<MvASSIGN NAME = "g.Product_Show_Name" VALUE = "Yes">
		<MvASSIGN NAME = "g.Product_Show_Price" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show_Cost" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show_Weight" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show_Description" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show_Taxable" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show_Thumbnail" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show_Image" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show_Active" VALUE = "">
	<MvELSE>
		<MvASSIGN NAME = "g.Product_Display" VALUE = "{ int( g.Product_Display ) }">
		<MvIF EXPR = "{ g.Product_Display LT 1 }">
			<MvASSIGN NAME = "g.Product_Display" VALUE = 1>
		</MvIF>
	</MvIF>

	<MvASSIGN NAME = "l.valid" VALUE = "{ Product_Batch_Validate() }">

	<MvIF EXPR = "{ g.Product_Display_Flag }">
		<MvASSIGN NAME = "g.Product_Show_Code" VALUE = "Yes">
	</MvIF>

	<MvLOCALIZED NAME = "l.screen_label" ID = "MER-ADM-00281">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Product Lookup</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvEVAL EXPR = "{ BeginScreen( l.screen_label, 'PLKP', 'Help:plkp.html' ) }">

	<INPUT TYPE = "hidden" NAME = "Have_List_Fields" VALUE = "1">
	<MvHIDE FIELDS = "g.Lookup_Form, g.Lookup_Field">

	<MvLOCALIZED NAME = "l.tab_list" ID = "MER-ADM-00282">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">PRDS:Products</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvEVAL EXPR = "{ DrawTabs( 'PRDS', l.tab_list ) }">

	<MvEVAL EXPR = "{ BeginContent() }">
	<MvEVAL EXPR = "{ JavaScript_SetVariables( 'g', 'Lookup_Form, Lookup_Field' ) }">
	
	<SCRIPT LANGUAGE = "JavaScript">
<!--
function SendProductCode( prod_code )
{
	opener.document.forms[ Lookup_Form ].elements[ Lookup_Field ].value = unescape( prod_code );
	window.close();
}
//-->
	</SCRIPT>

	<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
	<TR><TD ALIGN = "left" VALIGN = "middle" NOWRAP>
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvHIDE FIELDS = "g.Product_Show">
		<A HREF = "JavaScript:ListReloadField( 'Product_Offset', 'Product_Stack', 'Product_Show', 'All' );"><MvEVAL EXPR = "{ DrawImgButton_All( g.Product_Show EQ 'All' ) }"></A>

		<A HREF = "JavaScript:ListReloadField( 'Product_Offset', 'Product_Stack', 'Product_Show', 'Uncategorized' );"><MvEVAL EXPR = "{ DrawImgButton_Uncategorized( g.Product_Show EQ 'Uncategorized' ) }"></A>
		</FONT>
	</TD><TD ALIGN = "right" VALIGN = "middle" WIDTH = "100%">
		&nbsp;
	</TD><TD ALIGN = "right" VALIGN = "middle">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
		<MvLOCALIZED ID = "MER-ADM-00283">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Search:</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B></FONT>
	</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvASSIGN NAME = "g.Product_Search" VALUE = "{ ltrim( rtrim( g.Product_Search ) ) }">
		<INPUT TYPE = "text" NAME = "Product_Search" VALUE = "{ encodeentities( g.Product_Search ) }" SIZE = 20>
		<A HREF = "JavaScript:ListReload( 'Product_Offset', 'Product_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Search(0) }"></A>
		</FONT>
	</TD></TR>

	<TR><TD ALIGN = "left" VALIGN = "top">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
		<MvLOCALIZED ID = "MER-ADM-00284">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Display:</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B></FONT>
	</TD><TD ALIGN = "left" VALIGN = "middle" COLSPAN = 3>
		<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
		<TR><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00285">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Code, 'Product_Show_Code', 'Yes', l.text ) }">
			</FONT>
		</TD><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00286">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Name, 'Product_Show_Name', 'Yes', l.text ) }">
			</FONT>
		</TD><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00287">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Price</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Price, 'Product_Show_Price', 'Yes', l.text ) }">
			</FONT>
		</TD></TR>

		<TR><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00288">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Cost</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Cost, 'Product_Show_Cost', 'Yes', l.text ) }">
			</FONT>
		</TD><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00289">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Weight</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Weight, 'Product_Show_Weight', 'Yes', l.text ) }">
			</FONT>
		</TD><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00290">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Description</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Description, 'Product_Show_Description', 'Yes', l.text ) }">
			</FONT>
		</TD></TR>

		<TR><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00291">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Taxable</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Taxable, 'Product_Show_Taxable', 'Yes', l.text ) }">
			</FONT>
		</TD><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00292">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Thumbnail Image</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Thumbnail, 'Product_Show_Thumbnail', 'Yes', l.text ) }">
			</FONT>
		</TD><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00293">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Full-sized Image</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Image, 'Product_Show_Image', 'Yes', l.text ) }">
			</FONT>
		</TD></TR>
		<TR><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00919">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Active</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Active, 'Product_Show_Active', 'Yes', l.text ) }">
			</FONT>
		</TD></TR>

		</TABLE>
	</TD></TR>
	</TABLE>

	<MvASSIGN NAME = "l.columns" VALUE = 0>

	<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
	<TR>

	<MvIF EXPR = "{ g.Product_Show_Code }">
		<TD BGCOLOR = "#000080">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
			<MvLOCALIZED ID = "MER-ADM-00294">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD>

		<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
	</MvIF>

	<MvIF EXPR = "{ g.Product_Show_Name }">
		<TD BGCOLOR = "#000080" WIDTH = "100%">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
			<MvLOCALIZED ID = "MER-ADM-00295">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD>

		<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
	</MvIF>

	<MvIF EXPR = "{ g.Product_Show_Price }">
		<TD BGCOLOR = "#000080" ALIGN = "right">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
			<MvLOCALIZED ID = "MER-ADM-00296">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Price</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD>

		<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
	</MvIF>

	<MvIF EXPR = "{ g.Product_Show_Cost }">
		<TD BGCOLOR = "#000080" ALIGN = "right">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
			<MvLOCALIZED ID = "MER-ADM-00297">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Cost</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD>

		<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
	</MvIF>

	<MvIF EXPR = "{ g.Product_Show_Weight }">
		<TD BGCOLOR = "#000080" ALIGN = "right">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
			<MvLOCALIZED ID = "MER-ADM-00298">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Weight</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD>

		<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
	</MvIF>

	<MvIF EXPR = "{ g.Product_Show_Description }">
		<TD BGCOLOR = "#000080">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
			<MvLOCALIZED ID = "MER-ADM-00299">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Description</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD>

		<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
	</MvIF>

	<MvIF EXPR = "{ g.Product_Show_Taxable }">
		<TD BGCOLOR = "#000080">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
			<MvLOCALIZED ID = "MER-ADM-00300">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Taxable</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD>

		<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
	</MvIF>

	<MvIF EXPR = "{ g.Product_Show_Thumbnail }">
		<TD BGCOLOR = "#000080">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
			<MvLOCALIZED ID = "MER-ADM-00301">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Thumbnail Image</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD>

		<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
	</MvIF>

	<MvIF EXPR = "{ g.Product_Show_Image }">
		<TD BGCOLOR = "#000080">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
			<MvLOCALIZED ID = "MER-ADM-00302">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Full-sized Image</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD>

		<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
	</MvIF>

	<MvIF EXPR = "{ g.Product_Show_Active }">
		<TD BGCOLOR = "#000080">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
			<MvLOCALIZED ID = "MER-ADM-00920">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Active</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD>

		<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
	</MvIF>

	<TD BGCOLOR = "#000080">
		&nbsp;
	</TD></TR>

	<MvASSIGN NAME = "l.shown" VALUE = 0>
	<MvASSIGN NAME = "l.lastoffset" VALUE = 0>
	<MvASSIGN NAME = "l.last_product_code" VALUE = "">

	<MvIF EXPR = "{ g.Product_Show EQ 'All' }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Product_FindOffset_All( g.Product_Offset, g.Product_Search ) }">
	</MvIF>

	<MvIF EXPR = "{ g.Product_Show EQ 'Uncategorized' }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Product_FindOffset_Uncategorized( g.Product_Offset, g.Product_Search ) }">
	</MvIF>

	<MvWHILE EXPR = "{ ( l.shown LT g.Product_Display ) AND l.nextoffset }">
		<MvASSIGN NAME = "l.product_code" VALUE = "{ Products.d.code }">
		<MvASSIGN NAME = "l.product_name" VALUE = "{ Products.d.name }">
		<MvASSIGN NAME = "l.product_price" VALUE = "{ Products.d.price }">
		<MvASSIGN NAME = "l.product_cost" VALUE = "{ Products.d.cost }">
		<MvASSIGN NAME = "l.product_weight" VALUE = "{ Products.d.weight }">
		<MvASSIGN NAME = "l.product_desc" VALUE = "{ Products.d.desc }">
		<MvASSIGN NAME = "l.product_taxable" VALUE = "{ Products.d.taxable }">
		<MvASSIGN NAME = "l.product_thumbnail" VALUE = "{ Products.d.thumbnail }">
		<MvASSIGN NAME = "l.product_image" VALUE = "{ Products.d.image }">
		<MvASSIGN NAME = "l.product_active" VALUE = "{ Products.d.active }">

		<MvASSIGN NAME = "l.lastoffset" VALUE = "{ l.nextoffset }">

		<MvIF EXPR = "{ g.Product_Show EQ 'All' }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Product_FindNext_All( l.nextoffset, g.Product_Search ) }">
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show EQ 'Uncategorized' }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Product_FindNext_Uncategorized( l.nextoffset, g.Product_Search ) }">
		</MvIF>

		<MvASSIGN NAME = "l.shown" VALUE = "{ l.shown + 1 }">

		<MvIF EXPR = "{ ( l.shown MOD 2 ) EQ 0 }">
			<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffdd">
		<MvELSE>
			<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffff">
		</MvIF>

		<TR>

		<MvIF EXPR = "{ g.Product_Show_Code }">
			<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ encodeentities( l.product_code ) }">
				</FONT>
			</TD>
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Name }">
			<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ len( l.product_name ) }">
					<MvEVAL EXPR = "{ encodeentities( l.product_name ) }">
				<MvELSE>
					&nbsp;
				</MvIF>
				</FONT>
			</TD>
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Price }">
			<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ encodeentities( l.product_price ) }">
				</FONT>
			</TD>
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Cost }">
			<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ encodeentities( l.product_cost ) }">
				</FONT>
			</TD>
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Weight }">
			<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ encodeentities( l.product_weight ) }">
				</FONT>
			</TD>
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Description }">
			<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ len( l.product_desc ) }">
					<MvEVAL EXPR = "{ encodeentities( l.product_desc ) }">
				<MvELSE>
					&nbsp;
				</MvIF>
				</FONT>
			</TD>
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Taxable }">
			<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" ALIGN = "center">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ DrawCheck_Taxable( l.product_taxable ) }">
				</FONT>
			</TD>
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Thumbnail }">
			<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ len( l.product_thumbnail ) }">
					<MvEVAL EXPR = "{ encodeentities( l.product_thumbnail ) }">
				<MvELSE>
					&nbsp;
				</MvIF>
				</FONT>
			</TD>
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Image }">
			<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ len( l.product_image ) }">
					<MvEVAL EXPR = "{ encodeentities( l.product_image ) }">
				<MvELSE>
					&nbsp;
				</MvIF>
				</FONT>
			</TD>
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Active }">
			<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" ALIGN = "center">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ DrawCheck_Active( l.product_active ) }">
				</FONT>
			</TD>
		</MvIF>

		<TD WIDTH = "100%" BGCOLOR = "{ l.bgcolor }" VALIGN = "top" ALIGN = "right" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvEVAL EXPR = "{ '<A HREF = "JavaScript:SendProductCode( \'' $ JavaScriptEncode( l.product_code ) $ '\' );">' }"> <MvEVAL EXPR = "{ DrawImgButton_Select('0') }"><MvEVAL EXPR = "</A>">
			</FONT>
		</TD></TR>

		<MvASSIGN NAME = "l.last_product_code" VALUE = "{ l.product_code }">
	</MvWHILE>

	<TR><TD BGCOLOR = "#000080" ALIGN = "left" VALIGN = "middle" NOWRAP>
		<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
		<MvHIDE FIELDS = "g.Product_Stack, g.Product_Offset">
		<MvIF EXPR = "{ g.Product_Show EQ 'All' }">
			<MvIF EXPR = "{ l.shown }">
				<B><MvEVAL EXPR = "{ g.Product_Offset + 1 }">-<MvEVAL EXPR = "{ l.lastoffset }"></B>
			<MvELSE>
				<B>0-0</B>
			</MvIF>
		<MvELSE>
			<MvEVAL EXPR = "{ Show_BoldNA() }">
		</MvIF>
		</FONT>
	</TD><TD BGCOLOR = "#000080" ALIGN = "right" VALIGN = "middle" COLSPAN = "{ l.columns }">
		<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
		<MvIF EXPR = "{ len( g.Product_Stack ) }">
			<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListPrevious( \'Product_Offset\', \'Product_Stack\' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Previous('0') }"><MvEVAL EXPR = "</A>">
		</MvIF>

		 <INPUT TYPE = "text" NAME = "Product_Display" VALUE = "{ encodeentities( g.Product_Display ) }" SIZE = 5> <A HREF = "JavaScript:ListReload( 'Product_Offset', 'Product_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Refresh('0') }"></A>
		 <INPUT TYPE = "hidden" NAME = "Product_Count" VALUE = "{ encodeentities( l.shown ) }">

		 <MvIF EXPR = "{ l.nextoffset }">
			<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListNext( \'Product_Offset\', \'Product_Stack\', ' $ l.lastoffset $ ' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Next('0') }"><MvEVAL EXPR = "</A>">
		 </MvIF>
		</FONT>
	</TD></TR>
	</TABLE>
	<MvEVAL EXPR = "{ EndContent() }">

	<TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
	<TR><TD BGCOLOR = "#000000">

	<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
	<TR><TD BGCOLOR = "#f0f0f0" WIDTH = "100%" ALIGN = "left" VALIGN = "middle">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvIF EXPR = "{ len( g.Message ) }">
			<MvEVAL EXPR = "{ g.Message }">
		<MvELSE>
			&nbsp;
		</MvIF>
		</FONT>
	</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvLOCALIZED ID = "MER-ADM-00756">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				<INPUT TYPE = "button" VALUE = "Close" ONCLICK = "window.close();">
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</FONT>
	</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvEVAL EXPR = "{ DrawButton_Reset() }">
		</FONT>
	</TD></TR>
	</TABLE>

	</TD></TR>
	</TABLE>

	<MvEVAL EXPR = "{ EndScreen() }">

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Groups
|
</MvCOMMENT>

<MvFUNCTION NAME = "Group_Validate">
	<MvASSIGN NAME = "g.Group_Name" VALUE = "{ ltrim( rtrim( g.Group_Name ) ) }">

	<MvIF EXPR = "{ len( g.Group_Name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00303">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a group name</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'GROP', 'Group_Name', l.error_message ) }">	
	<MvELSE>
		<MvIF EXPR = "{ len( g.Group_Name ) GT 40 }">
			<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-01555">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Group name must be 40 characters or less</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'GROP', 'Group_Name', l.error_message ) }">		
		<MvELSE>
			<MvIF EXPR = "{ ( len( g.Edit_Group ) EQ 0 ) OR ( toupper( g.Group_Name ) NE toupper( g.Edit_Group ) ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Group_Find_Name( g.Group_Name ) }">
				<MvIF EXPR = "{ l.found }">
					<MvLOCALIZED NAME = "l.err" ID = "MER-ADM-00304">
						<MvLOCALIZED-TOKEN NAME = "group" VALUE = "{ g.Group_Name }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">A group with the name '%group%' already exists</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvFUNCTIONRETURN VALUE = "{ FieldError( 'GROP', 'Group_Name', l.err ) }">
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Group_Insert" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ Group_Validate() }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.group_id" VALUE = "{ Group_Insert( g.Group_Name ) }">
		<MvIF EXPR = "{ NOT l.group_id }">
			<MvASSIGN NAME = "l.ok" VALUE = 0>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "l.priv" VALUE = 1>
			<MvWHILE EXPR = "{ l.ok AND ( l.priv LE g.Group_Privilege_Count ) }">

				<MvIF EXPR = "{ g.Group_Privilege[ l.priv ]:View OR
								g.Group_Privilege[ l.priv ]:Add OR
								g.Group_Privilege[ l.priv ]:Modify OR
								g.Group_Privilege[ l.priv ]:Delete }">

					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ GroupPrivilege_Insert( l.group_id, g.Group_Privilege[ l.priv ]:Privilege, g.Group_Privilege[ l.priv ]:View, g.Group_Privilege[ l.priv ]:Add, g.Group_Privilege[ l.priv ]:Modify, g.Group_Privilege[ l.priv ]:Delete ) }">
				</MvIF>

				<MvASSIGN NAME = "l.priv" VALUE = "{ l.priv + 1 }">
			</MvWHILE>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "g.Edit_Group" VALUE = "{ g.Group_Name }">
			<MvASSIGN NAME = "g.Tab" VALUE = "USER">

			<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00305">
				<MvLOCALIZED-TOKEN NAME = "group" VALUE = "{ encodeentities( g.Group_Name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Group '%group%' added</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvEVAL EXPR = "{ Update_LeftNavigation() }">
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Group_Update">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ Group_Validate() }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Group_Find_Name( g.Edit_Group ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "l.original_name" VALUE = "{ Groups.d.name }">

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Group_Update( Groups.d.id, g.Group_Name ) }">
			<MvIF EXPR = "{ l.ok }">
				<MvASSIGN NAME = "l.priv" VALUE = 1>
				<MvWHILE EXPR = "{ l.ok AND ( l.priv LE g.Group_Privilege_Count ) }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ GroupPrivilege_Find( Groups.d.id, g.Group_Privilege[ l.priv ]:Privilege ) }">
					<MvIF EXPR = "{ l.found }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ GroupPrivilege_Update( Groups.d.id, g.Group_Privilege[ l.priv ]:Privilege, g.Group_Privilege[ l.priv ]:View, g.Group_Privilege[ l.priv ]:Add, g.Group_Privilege[ l.priv ]:Modify, g.Group_Privilege[ l.priv ]:Delete ) }">
					<MvELSE>
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ GroupPrivilege_Insert( Groups.d.id, g.Group_Privilege[ l.priv ]:Privilege, g.Group_Privilege[ l.priv ]:View, g.Group_Privilege[ l.priv ]:Add, g.Group_Privilege[ l.priv ]:Modify, g.Group_Privilege[ l.priv ]:Delete ) }">
					</MvIF>

					<MvASSIGN NAME = "l.priv" VALUE = "{ l.priv + 1 }">
				</MvWHILE>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvASSIGN NAME = "l.user" VALUE = 1>
				<MvWHILE EXPR = "{ l.ok AND ( l.user LE g.Group_User_Count ) }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.assigned" VALUE = "{ UserXGroup_Find( g.Group_User[ l.user ]:ID, Groups.d.id ) }">

					<MvIF EXPR = "{ g.Group_User_Assigned[ l.user ] }">
						<MvIF EXPR = "{ NOT l.assigned }">
							<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ UserXGroup_Insert( g.Group_User[ l.user ]:ID, Groups.d.id ) }">
						</MvIF>
					<MvELSE>
						<MvIF EXPR = "{ l.assigned }">
							<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ UserXGroup_Delete( g.Group_User[ l.user ]:ID, Groups.d.id ) }">
						</MvIF>
					</MvIF>

					<MvASSIGN NAME = "l.user" VALUE = "{ l.user + 1 }">
				</MvWHILE>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00306">
					<MvLOCALIZED-TOKEN NAME = "group" VALUE = "{ encodeentities( g.Group_Name ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Group '%group%' updated</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvASSIGN NAME = "g.Edit_Group" VALUE = "{ g.Group_Name }">

				<MvEVAL EXPR = "{ Update_LeftNavigation() }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Group_Delete">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Group_Find_Name( g.Edit_Group ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Group_Delete( Groups.d.id ) }">
		<MvIF EXPR = "{ l.ok }">
				<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00307">
					<MvLOCALIZED-TOKEN NAME = "group" VALUE = "{ encodeentities( g.Edit_Group ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Group '%group%' deleted</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			<MvASSIGN NAME = "g.Edit_Group" VALUE = "">
			<MvASSIGN NAME = "g.Tab" VALUE = "">

			<MvEVAL EXPR = "{ Update_LeftNavigation() }">
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Groups">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00308">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Group</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvASSIGN NAME = "l.action" VALUE = "IGRP">

	<MvASSIGN NAME = "l.can_user_add" VALUE = "{ g.Admin_User_Administrator OR g.Admin_User_Create }">

	<MvIF EXPR = "{ len( g.Edit_Group ) }">
		<MvASSIGN NAME = "l.action" VALUE = "UGRP">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Group_Find_Name( g.Edit_Group ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00309">
				<MvLOCALIZED-TOKEN NAME = "group" VALUE = "{ encodeentities( Groups.d.name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Edit Group: %group%</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvIF EXPR = "{ g.Load_Fields }">
				<MvASSIGN NAME = "g.Group_Name" VALUE = "{ Groups.d.name }">
			</MvIF>
		</MvIF>
	<MvELSE>
		<MvIF EXPR = "{ g.Load_Fields }">
			<MvASSIGN NAME = "g.Group_Name" VALUE = "">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ NOT g.Have_List_Fields }">
		<MvASSIGN NAME = "g.Group_User_Stack" VALUE = "">
		<MvASSIGN NAME = "g.Group_User_Search" VALUE = "">
		<MvASSIGN NAME = "g.Group_User_Show" VALUE = "All">

		<MvASSIGN NAME = "g.Group_User_Offset" VALUE = 0>
		<MvASSIGN NAME = "g.Group_User_Display" VALUE = "{ g.Admin_User_PageLen }">
	<MvELSE>
		<MvASSIGN NAME = "g.Group_User_Display" VALUE = "{ int( g.Group_User_Display ) }">
		<MvIF EXPR = "{ g.Group_User_Display LT 1 }">
			<MvASSIGN NAME = "g.Group_User_Display" VALUE = 1>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ l.ok AND g.Load_Fields }">
		<MvASSIGN NAME = "g.Group_Privilege_Count" VALUE = 0>

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Privilege_FindFirst() }">
		<MvWHILE EXPR = "{ l.ok AND l.found }">
			<MvASSIGN NAME = "g.Group_Privilege_Count" VALUE = "{ g.Group_Privilege_Count + 1 }">
			<MvASSIGN NAME = "g.Group_Privilege" INDEX = "{ g.Group_Privilege_Count }" MEMBER = "Privilege" VALUE = "{ Privileges.d.privilege }">
			<MvASSIGN NAME = "g.Group_Privilege" INDEX = "{ g.Group_Privilege_Count }" MEMBER = "Name" VALUE = "{ Privileges.d.name }">
			<MvASSIGN NAME = "g.Group_Privilege" INDEX = "{ g.Group_Privilege_Count }" MEMBER = "View" VALUE = 0>
			<MvASSIGN NAME = "g.Group_Privilege" INDEX = "{ g.Group_Privilege_Count }" MEMBER = "Add" VALUE = 0>
			<MvASSIGN NAME = "g.Group_Privilege" INDEX = "{ g.Group_Privilege_Count }" MEMBER = "Modify" VALUE = 0>
			<MvASSIGN NAME = "g.Group_Privilege" INDEX = "{ g.Group_Privilege_Count }" MEMBER = "Delete" VALUE = 0>

			<MvIF EXPR = "{ len( g.Edit_Group ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ GroupPrivilege_Find( Groups.d.id, Privileges.d.privilege ) }">
				<MvIF EXPR = "{ l.found }">
					<MvASSIGN NAME = "g.Group_Privilege" INDEX = "{ g.Group_Privilege_Count }" MEMBER = "View" VALUE = "{ GroupPrivileges.d.view }">
					<MvASSIGN NAME = "g.Group_Privilege" INDEX = "{ g.Group_Privilege_Count }" MEMBER = "Add" VALUE = "{ GroupPrivileges.d.add }">
					<MvASSIGN NAME = "g.Group_Privilege" INDEX = "{ g.Group_Privilege_Count }" MEMBER = "Modify" VALUE = "{ GroupPrivileges.d.modify }">
					<MvASSIGN NAME = "g.Group_Privilege" INDEX = "{ g.Group_Privilege_Count }" MEMBER = "Delete" VALUE = "{ GroupPrivileges.d.delete }">
				</MvIF>
			</MvIF>

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Privilege_FindNext() }">
		</MvWHILE>
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvEVAL EXPR = "{ BeginScreen( l.title, '', 'Help:grps.html' ) }">
		<MvHIDE FIELDS = "g.Group_Privilege_Count">
		<INPUT TYPE = "hidden" NAME = "Have_List_Fields" VALUE = "1">

		<MvIF EXPR = "{ len( g.Edit_Group ) }">
			<MvHIDE FIELDS = "g.Edit_Group">
		</MvIF>

		<MvIF EXPR = "{ len( g.Edit_Group ) }">
			<MvLOCALIZED NAME = "l.tab_list" ID = "MER-ADM-00310">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">GROP:Group,USER:Users</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvEVAL EXPR = "{ DrawTabs( 'GROP', l.tab_list ) }">
		<MvELSE>
			<MvLOCALIZED NAME = "l.tab_list" ID = "MER-ADM-00311">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">GROP:Group</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvEVAL EXPR = "{ DrawTabs( 'GROP', l.tab_list ) }">
		</MvIF>

		<MvEVAL EXPR = "{ BeginContent() }">

		<MvIF EXPR = "{ g.Tab EQ 'GROP' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00312">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Group Name:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Group_Name" VALUE = "{ encodeentities( g.Group_Name ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00313">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Privileges:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD>
				<TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0>
				<TR><TD BGCOLOR = "#000000">
				<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
				<TR><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
					<MvLOCALIZED ID = "MER-ADM-00314">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
					<MvLOCALIZED ID = "MER-ADM-00315">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">View</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
					<MvLOCALIZED ID = "MER-ADM-00316">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
					<MvLOCALIZED ID = "MER-ADM-00317">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Modify</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
					<MvLOCALIZED ID = "MER-ADM-00318">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Delete</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD></TR>

				<MvASSIGN NAME = "l.priv" VALUE = 1>
				<MvASSIGN NAME = "l.green" VALUE = 0>
				<MvWHILE EXPR = "{ l.priv LE g.Group_Privilege_Count }">
					<MvIF EXPR = "{ l.green }">
						<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffdd">
					<MvELSE>
						<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffff">
					</MvIF>

					<TR><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "hidden" NAME = "{ 'g.Group_Privilege[' $ l.priv $ ']:Privilege' }" VALUE = "{ g.Group_Privilege[ l.priv ]:Privilege }">
						<INPUT TYPE = "hidden" NAME = "{ 'g.Group_Privilege[' $ l.priv $ ']:Name' }" VALUE = "{ g.Group_Privilege[ l.priv ]:Name }">
						<MvEVAL EXPR = "{ g.Group_Privilege[ l.priv ]:Name }">
						</FONT>
					</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Group_Privilege[ l.priv ]:View, 'Group_Privilege[' $ l.priv  $ ']:View', 'Yes', '' ) }">
						</FONT>
					</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Group_Privilege[ l.priv ]:Add, 'Group_Privilege[' $ l.priv  $ ']:Add', 'Yes', '' ) }">
						</FONT>
					</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Group_Privilege[ l.priv ]:Modify, 'Group_Privilege[' $ l.priv  $ ']:Modify', 'Yes', '' ) }">
						</FONT>
					</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Group_Privilege[ l.priv ]:Delete, 'Group_Privilege[' $ l.priv  $ ']:Delete', 'Yes', '' ) }">
						</FONT>
					</TD></TR>

					<MvASSIGN NAME = "l.green" VALUE = "{ NOT l.green }">
					<MvASSIGN NAME = "l.priv" VALUE = "{ l.priv + 1 }">
				</MvWHILE>
				</TABLE>
				</TD></TR>
				</TABLE>
			</TD></TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Group_Name, g.Group_Privilege">
		</MvIF>

		<MvIF EXPR = "{ g.Tab EQ 'USER' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD ALIGN = "left" VALIGN = "middle" WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvHIDE FIELDS = "g.Group_User_Show">
				<A HREF = "JavaScript:ListReloadField( 'Group_User_Offset', 'Group_User_Stack', 'Group_User_Show', 'All' );"><MvEVAL EXPR = "{ DrawImgButton_All( g.Group_User_Show EQ 'All' ) }"></A>
				<A HREF = "JavaScript:ListReloadField( 'Group_User_Offset', 'Group_User_Stack', 'Group_User_Show', 'Unassigned' );"><MvEVAL EXPR = "{ DrawImgButton_Unassigned( g.Group_User_Show EQ 'Unassigned' ) }"></A>
				<A HREF = "JavaScript:ListReloadField( 'Group_User_Offset', 'Group_User_Stack', 'Group_User_Show', 'Assigned' );"><MvEVAL EXPR = "{ DrawImgButton_Assigned( g.Group_User_Show EQ 'Assigned' ) }"></A>
				</FONT>
			</TD><TD ALIGN = "right" VALIGN = "middle">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00319">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Search:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvASSIGN NAME = "g.Group_User_Search" VALUE = "{ ltrim( rtrim( g.Group_User_Search ) ) }">
				<INPUT TYPE = "text" NAME = "Group_User_Search" VALUE = "{ encodeentities( g.Group_User_Search ) }" SIZE = 20>
				<A HREF = "JavaScript:ListReload( 'Group_User_Offset', 'Group_User_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Search(0) }"></A>
				</FONT>
			</TD></TR>
			</TABLE>

			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR>
				<TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00320">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Assigned</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
				<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_CheckAll( 'Group_User_Assigned' ) }">			
			</TD><TD BGCOLOR = "#000080" WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00321">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">User</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD ALIGN = "right" BGCOLOR = "#000080">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff">
				<MvIF EXPR = "{ l.can_user_add }">
					<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00322">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">New User</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<A HREF = "{ g.sessionurl $ 'Screen=USER' }"><MvEVAL EXPR = "{ DrawImgButton_NewX( 0, l.alt) }"></A>
				<MvELSE>
					&nbsp;
				</MvIF>
				</FONT>
			</TD></TR>

			<MvASSIGN NAME = "l.shown" VALUE = 0>
			<MvASSIGN NAME = "l.lastoffset" VALUE = 0>

			<MvIF EXPR = "{ ( g.Group_User_Show EQ 'All' ) OR ( g.Group_User_Show EQ 'Unassigned' ) }">
				<MvASSIGN NAME = "l.assigned" VALUE = 0>
			</MvIF>

			<MvIF EXPR = "{ g.Group_User_Show EQ 'Assigned' }">
				<MvASSIGN NAME = "l.assigned" VALUE = 1>
			</MvIF>

			<MvIF EXPR = "{ g.Group_User_Show EQ 'All' }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ User_FindOffset_All( g.Group_User_Offset, g.Group_User_Search ) }">
			</MvIF>

			<MvIF EXPR = "{ g.Group_User_Show EQ 'Unassigned' }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Group_User_FindOffset_Unassigned( Groups.d.id, g.Group_User_Offset, g.Group_User_Search ) }">
			</MvIF>

			<MvIF EXPR = "{ g.Group_User_Show EQ 'Assigned' }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Group_User_FindOffset_Assigned( Groups.d.id, g.Group_User_Offset, g.Group_User_Search ) }">
			</MvIF>

			<MvWHILE EXPR = "{ ( l.shown LT g.Group_User_Display ) AND l.nextoffset }">
				<MvIF EXPR = "{ g.Group_User_Show EQ 'All' }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.assigned" VALUE = "{ UserXGroup_Find( Users.d.id, Groups.d.id ) }">
				</MvIF>

				<MvASSIGN NAME = "l.shown" VALUE = "{ l.shown + 1 }">

				<MvIF EXPR = "{ ( l.shown MOD 2 ) EQ 0 }">
					<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffdd">
				<MvELSE>
					<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffff">
				</MvIF>

				<TR><TD ALIGN = "center" BGCOLOR = "{ l.bgcolor }">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckboxModAlert( l.assigned, 'Group_User_Assigned[' $ l.shown $ ']', 'Yes', '' ) }">
					</FONT>
				</TD><TD BGCOLOR = "{ l.bgcolor }">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "hidden" NAME = "{ 'Group_User[' $ l.shown $ ']:ID' }" VALUE = "{ encodeentities( Users.d.id ) }">
					<MvEVAL EXPR = "{ encodeentities( Users.d.name ) }">
					</FONT>
				</TD><TD ALIGN = "right" BGCOLOR = "{ l.bgcolor }">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<A HREF = "{ g.sessionurl $ 'Screen=USER&Edit_User=' $ encodeattribute( Users.d.name ) }"><MvEVAL EXPR = "{ DrawImgButton_Edit('0') }"></A>
					</FONT>
				</TD></TR>

				<MvASSIGN NAME = "l.lastoffset" VALUE = "{ l.nextoffset }">

				<MvIF EXPR = "{ g.Group_User_Show EQ 'All' }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ User_FindNext_All( l.nextoffset, g.Group_User_Search ) }">
				</MvIF>

				<MvIF EXPR = "{ g.Group_User_Show EQ 'Unassigned' }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Group_User_FindNext_Unassigned( Groups.d.id, l.nextoffset, g.Group_User_Search ) }">
				</MvIF>

				<MvIF EXPR = "{ g.Group_User_Show EQ 'Assigned' }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Group_User_FindNext_Assigned( Groups.d.id, l.nextoffset, g.Group_User_Search ) }">
				</MvIF>
			</MvWHILE>

			<TR><TD BGCOLOR = "#000080" ALIGN = "left" VALIGN = "middle" NOWRAP>
				<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
				<MvHIDE FIELDS = "g.Group_User_Stack, g.Group_User_Offset">
				<MvIF EXPR = "{ g.Group_User_Show EQ 'All' }">
					<MvIF EXPR = "{ l.shown }">
						<B><MvEVAL EXPR = "{ g.Group_User_Offset + 1 }">-<MvEVAL EXPR = "{ l.lastoffset }"></B>
					<MvELSE>
						<B>0-0</B>
					</MvIF>
				<MvELSE>
					<MvEVAL EXPR = "{ Show_BoldNA() }">
				</MvIF>
				</FONT>
			</TD><TD BGCOLOR = "#000080" ALIGN = "right" VALIGN = "middle" COLSPAN = 2>
				<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
				<MvIF EXPR = "{ len( g.Group_User_Stack ) }">
					<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListPrevious( \'Group_User_Offset\', \'Group_User_Stack\' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Previous('0') }"><MvEVAL EXPR = "</A>">
				</MvIF>

				 <INPUT TYPE = "text" NAME = "Group_User_Display" VALUE = "{ encodeentities( g.Group_User_Display ) }" SIZE = 5> <A HREF = "JavaScript:ListReload( 'Group_User_Offset', 'Group_User_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Refresh('0') }"></A>
				 <INPUT TYPE = "hidden" NAME = "Group_User_Count" VALUE = "{ encodeentities( l.shown ) }">

				 <MvIF EXPR = "{ l.nextoffset }">
					<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListNext( \'Group_User_Offset\', \'Group_User_Stack\', ' $ l.lastoffset $ ' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Next('0') }"><MvEVAL EXPR = "</A>">
				 </MvIF>
				</FONT>
			</TD></TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Group_User_Stack, g.Group_User_Search, g.Group_User_Show, g.Group_User_Offset, g.Group_User_Display">
		</MvIF>

		<MvEVAL EXPR = "{ EndContent() }">

		<MvIF EXPR = "{ len( g.Edit_Group ) }">
			<MvEVAL EXPR = "{ DrawButtons( 'UGRP:[UPDATE],DGRP:[DELETE]' ) }">
		<MvELSE>
			<MvEVAL EXPR = "{ DrawButtons( 'IGRP:[ADD]' ) }">
		</MvIF>

		<MvEVAL EXPR = "{ EndScreen() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| States
|
</MvCOMMENT>

<MvFUNCTION NAME = "State_Validate">
	<MvASSIGN NAME = "g.State_Code" VALUE = "{ ltrim( rtrim( g.State_Code ) ) }">
	<MvASSIGN NAME = "g.State_Name" VALUE = "{ ltrim( rtrim( g.State_Name ) ) }">

	<MvIF EXPR = "{ ( NOT g.Edit_State ) OR ( toupper( g.Edit_State_Code ) NE toupper( g.State_Code ) ) }">
		<MvIF EXPR = "{ len( g.State_Code ) GT 50 }">
			<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-01556">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code must be 50 characters long or shorter</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'STAT', 'State_Code', l.error_message ) }">
		</MvIF>

		<MvIF EXPR = "{ '%' IN g.State_Code }">
			<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-01557">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code may not contain a percent sign</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'STAT', 'State_Code', l.error_message ) }">
		</MvIF>

		<MvIF EXPR = "{ '\\' IN g.State_Code }">
			<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-01558">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code may not contain a backslash (\\)</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'STAT', 'State_Code', l.error_message ) }">
		</MvIF>

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ State_Find_Code( g.State_Code ) }">
		<MvIF EXPR = "{ l.found }">
			<MvIF EXPR = "{ len( g.State_Code ) }">
				<MvLOCALIZED NAME = "l.error_message"  ID = "MER-ADM-00921">
					<MvLOCALIZED-TOKEN NAME = "state" VALUE = "{ g.State_Code }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">A state with the code '%state%' already exists</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'STAT', 'State_Code', l.error_message ) }">
			<MvELSE>
				<MvLOCALIZED NAME = "l.error_message"  ID = "MER-ADM-00922">
					<MvLOCALIZED-TOKEN NAME = "state" VALUE = "{ g.State_Code }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">A state with a blank code already exists</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'STAT', 'State_Code', l.error_message ) }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ len( g.State_Code ) AND ( g.State_Code EQ 0 ) }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-01559">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">A state code cannot be '0'</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'STAT', 'State_Code', l.error_message ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.State_Name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00324">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a state name</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'STAT', 'State_Name', l.error_message ) }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_State_Update" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvASSIGN NAME = "l.valid" VALUE = 1>
	<MvASSIGN NAME = "l.modified" VALUE = 0>

	<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'STAT', 0, 1, 0, 0 ) }">
	<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'STAT', 0, 0, 1, 0 ) }">
	<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'STAT', 0, 0, 0, 1 ) }">

	<MvIF EXPR = "{ ( g.Add_State AND l.can_add ) OR ( g.Edit_State AND l.can_modify ) }">
		<MvASSIGN NAME = "l.valid" VALUE = "{ State_Validate() }">
	</MvIF>

	<MvIF EXPR = "{ l.valid }">
		<MvIF EXPR = "{ l.ok AND l.can_add }">
			<MvIF EXPR = "{ g.Add_State }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ State_Insert( g.State_Code, g.State_Name ) }">
				<MvASSIGN NAME = "l.modified" VALUE = "1">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.ok AND l.can_modify }">
			<MvIF EXPR = "{ g.Edit_State }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ State_Update( g.Edit_State_Code, g.State_Code, g.State_Name ) }">
				<MvASSIGN NAME = "l.modified" VALUE = "1">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.ok AND l.can_delete }">
			<MvASSIGN NAME = "l.state" VALUE = 1>
			<MvWHILE EXPR = "{ l.ok AND ( l.state LE g.State_Count ) }">
				<MvIF EXPR = "{ g.State_Remove[ l.state ] }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ State_Delete( g.State_Code[ l.state ] ) }">
					<MvASSIGN NAME = "l.modified" VALUE = "1">
				</MvIF>

				<MvASSIGN NAME = "l.state" VALUE = "{ l.state + 1 }">
			</MvWHILE>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "g.Edit_State" VALUE = 0>
			<MvASSIGN NAME = "g.Edit_State_Code" VALUE = "">
			<MvIF EXPR = "{ l.modified }">
				<MvLOCALIZED NAME = "g.Message"  ID = "MER-ADM-00923">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">State table updated</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			<MvELSE>
				<MvASSIGN NAME = "g.Message" VALUE = "">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_States">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'STAT', 0, 1, 0, 0 ) }">
	<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'STAT', 0, 0, 1, 0 ) }">
	<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'STAT', 0, 0, 0, 1 ) }">

	<MvIF EXPR = "{ NOT g.Have_List_Fields }">
		<MvASSIGN NAME = "g.State_Stack" VALUE = "">
		<MvASSIGN NAME = "g.State_Search" VALUE = "">
		<MvASSIGN NAME = "g.State_Offset" VALUE = 0>
		<MvASSIGN NAME = "g.State_Display" VALUE = "{ g.Admin_User_PageLen }">
	<MvELSE>
		<MvASSIGN NAME = "g.State_Display" VALUE = "{ int( g.State_Display ) }">
		<MvIF EXPR = "{ g.State_Display LT 1 }">
			<MvASSIGN NAME = "g.State_Display" VALUE = 1>
		</MvIF>
	</MvIF>

	<MvLOCALIZED NAME = "l.screen_label"  ID = "MER-ADM-00924">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">States</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvEVAL EXPR = "{ BeginScreen( l.screen_label, 'STAT', 'Help:stat.html' ) }">
	<INPUT TYPE = "hidden" NAME = "Have_List_Fields" VALUE = "1">

	<MvLOCALIZED NAME = "l.tab_list"  ID = "MER-ADM-00925">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">STAT:States</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvEVAL EXPR = "{ DrawTabs( 'STAT', l.tab_list ) }">

	<MvEVAL EXPR = "{ BeginContent() }">
	<SCRIPT LANGUAGE = "JavaScript">
<!--
HaveCustomReset = 1;

function CustomReset()
{
	document.STAT.Add_State.value = '';
	document.STAT.Edit_State.value = '';
}

function AddState( add )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Screen' ].value = Screen;
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Add_State' ].value = add;
		document.forms[ Screen ].elements[ 'Edit_State' ].value = '';
		document.forms[ Screen ].elements[ 'Edit_State_Code' ].value = '';
		document.forms[ Screen ].elements[ 'Action' ].value = '';
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
		document.forms[ Screen ].submit();
	}
}

function EditState( state_code, edit )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Screen' ].value = Screen;
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Add_State' ].value = 0;
		document.forms[ Screen ].elements[ 'Edit_State' ].value = edit;
		document.forms[ Screen ].elements[ 'Edit_State_Code' ].value = unescape( state_code );
		document.forms[ Screen ].elements[ 'Action' ].value = '';
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
		document.forms[ Screen ].submit();
	}
}

//-->
	</SCRIPT>

	<MvHIDE FIELDS = "g.Add_State, g.Edit_State, g.Edit_State_Code">

	<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
	<TR><TD ALIGN = "left" VALIGN = "middle" WIDTH = "100%">
		&nbsp;
	</TD><TD ALIGN = "right" VALIGN = "middle">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
		<MvLOCALIZED  ID = "MER-ADM-00926">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Search:</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B></FONT>
	</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvASSIGN NAME = "g.State_Search" VALUE = "{ ltrim( rtrim( g.State_Search ) ) }">
		<INPUT TYPE = "text" NAME = "State_Search" VALUE = "{ encodeentities( g.State_Search ) }" SIZE = 20>
		<A HREF = "JavaScript:ListReload( 'State_Offset', 'State_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Search(0) }"></A>
		</FONT>
	</TD></TR>
	</TABLE>

	<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
	<TR>

	<MvIF EXPR = "{ ( NOT g.Add_State ) AND
					( NOT g.Edit_State ) AND
					l.can_delete }">
		<TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080" NOWRAP>
			<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1"><B>
			<MvLOCALIZED  ID = "MER-ADM-00927">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Remove</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			</B></FONT>

			<MvIF EXPR = "{ l.can_delete }">
				<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_CheckAll( 'State_Remove' ) }">
			</MvIF>
		</TD>
		
	</MvIF>

	<TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080" NOWRAP>
		<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1"><B>
		<MvLOCALIZED  ID = "MER-ADM-00928">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B></FONT>
	</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080" WIDTH = "100%">
		<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1"><B>
		<MvLOCALIZED  ID = "MER-ADM-00929">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">State</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B></FONT>
	</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "#000080" NOWRAP>
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvLOCALIZED NAME = "l.alt"  ID = "MER-ADM-00930">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">New State</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvIF EXPR = "{ g.Add_State }">
			<A HREF = "JavaScript:AddState( 0 );"><MvEVAL EXPR = "{ DrawImgButton_NewX( 1, l.alt ) }"></A>
		<MvELSE>
			<MvIF EXPR = "{ l.can_add }">
				<A HREF = "JavaScript:AddState( 1 );"><MvEVAL EXPR = "{ DrawImgButton_NewX( 0, l.alt ) }"></A>
			<MvELSE>
				&nbsp;
			</MvIF>
		</MvIF>
		</FONT>
	</TD></TR>

	<MvASSIGN NAME = "l.shown" VALUE = 0>
	<MvASSIGN NAME = "l.lastoffset" VALUE = 0>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ State_FindOffset_All( g.State_Offset, g.State_Search ) }">
	<MvWHILE EXPR = "{ ( l.shown LT g.State_Display ) AND l.nextoffset }">
		<MvASSIGN NAME = "l.shown" VALUE = "{ l.shown + 1 }">

		<MvIF EXPR = "{ ( l.shown MOD 2 ) EQ 0 }">
			<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffdd">
		<MvELSE>
			<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffff">
		</MvIF>

<MvCOMMENT>
| added a length comparrison for Edit_State_Code and States.d.code so we can distinguish 
| between a 'null' value and a '0' value entered for state code. 
</MvCOMMENT>

		<MvIF EXPR = "{ ( NOT g.Add_State ) AND
						( g.Edit_State ) AND
						( g.Edit_State_Code EQ States.d.code ) AND ( len( g.Edit_State_Code ) EQ len( States.d.code ) ) }">
			<MvIF EXPR = "{ NOT g.Data_Entry_Error }">
				<MvASSIGN NAME = "g.State_Code" VALUE = "{ States.d.code }">
				<MvASSIGN NAME = "g.State_Name" VALUE = "{ States.d.name }">
			</MvIF>

			<TR><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 15 NAME = "State_Code" VALUE = "{ encodeentities( g.State_Code ) }" ONCHANGE = "SetModified();">
				</FONT>
			</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 30 NAME = "State_Name" VALUE = "{ encodeentities( g.State_Name ) }" ONCHANGE = "SetModified();">
				</FONT>
			</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ l.can_modify }">
					<MvEVAL EXPR = "{ '<A HREF = "JavaScript:EditState( \'\', 0 );">' }"><MvEVAL EXPR = "{ DrawImgButton_EditHere(1) }"><MvEVAL EXPR = "</A>">
				<MvELSE>
					&nbsp;
				</MvIF>
				</FONT>
			</TD></TR>
		<MvELSE>
			<TR>

			<MvIF EXPR = "{ ( NOT g.Add_State ) AND
							( NOT g.Edit_State ) AND
							l.can_delete }">
				<TD ALIGN = "center" VALIGN = "middle" NOWRAP BGCOLOR = "{ l.bgcolor }">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "hidden" NAME = "{ 'State_Code[' $  l.shown $ ']'}" VALUE = "{ encodeentities( States.d.code ) }">
					<INPUT TYPE = "checkbox" NAME = "{ 'State_Remove[' $ l.shown $ ']' }" VALUE = "Yes" ONCLICK = "SetModified();">
					</FONT>
				</TD>
			</MvIF>

			<TD ALIGN = "left" VALIGN = "middle" NOWRAP BGCOLOR = "{ l.bgcolor }">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ len( States.d.code ) }">
					<MvEVAL EXPR = "{ encodeentities( States.d.code ) }">
				<MvELSE>
					&nbsp;
				</MvIF>
				</FONT>
			</TD><TD ALIGN = "left" VALIGN = "middle" NOWRAP BGCOLOR = "{ l.bgcolor }">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ encodeentities( States.d.name ) }">
				</FONT>
			</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ l.can_modify }">
					<MvEVAL EXPR = "{ '<A HREF = "JavaScript:EditState( \'' $ JavaScriptEncode( States.d.code ) $ '\', 1 );">' }"><MvEVAL EXPR = "{ DrawImgButton_EditHere(0) }"><MvEVAL EXPR = "</A>">
				<MvELSE>
					&nbsp;
				</MvIF>
				</FONT>
			</TD></TR>
		</MvIF>

		<MvASSIGN NAME = "l.lastoffset" VALUE = "{ l.nextoffset }">

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ State_FindNext_All( l.nextoffset, g.State_Search ) }">
	</MvWHILE>

	<MvIF EXPR = "{ g.Add_State }">
		<MvIF EXPR = "{ ( l.shown MOD 2 ) NE 0 }">
			<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffdd">
		<MvELSE>
			<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffff">
		</MvIF>

		<MvIF EXPR = "{ NOT g.Data_Entry_Error }">
			<MvASSIGN NAME = "g.State_Code" VALUE = "">
			<MvASSIGN NAME = "g.State_Name" VALUE = "">
		</MvIF>

		<TR><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<INPUT TYPE = "text" SIZE = 15 NAME = "State_Code" VALUE = "{ encodeentities( g.State_Code ) }" ONCHANGE = "SetModified();">
			</FONT>
		</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<INPUT TYPE = "text" SIZE = 30 NAME = "State_Name" VALUE = "{ encodeentities( g.State_Name ) }" ONCHANGE = "SetModified();">
			</FONT>
		</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
			&nbsp;
		</TD></TR>
	</MvIF>

	<TR><TD BGCOLOR = "#000080" ALIGN = "left" VALIGN = "middle" NOWRAP>
		<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
		<MvHIDE FIELDS = "g.State_Stack, g.State_Offset">
		<MvIF EXPR = "{ l.shown }">
			<B><MvEVAL EXPR = "{ g.State_Offset + 1 }">-<MvEVAL EXPR = "{ l.lastoffset }"></B>
		<MvELSE>
			<B>0-0</B>
		</MvIF>
		</FONT>
	</TD><TD BGCOLOR = "#000080" ALIGN = "right" VALIGN = "middle" COLSPAN = 3>
		<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
		<MvIF EXPR = "{ len( g.State_Stack ) }">
			<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListPrevious( \'State_Offset\', \'State_Stack\' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Previous('0') }"><MvEVAL EXPR = "</A>">
		</MvIF>

		 <INPUT TYPE = "text" NAME = "State_Display" VALUE = "{ encodeentities( g.State_Display ) }" SIZE = 5> <A HREF = "JavaScript:ListReload( 'State_Offset', 'State_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Refresh('0') }"></A>
		 <INPUT TYPE = "hidden" NAME = "State_Count" VALUE = "{ encodeentities( l.shown ) }">

		 <MvIF EXPR = "{ l.nextoffset }">
			<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListNext( \'State_Offset\', \'State_Stack\', ' $ l.lastoffset $ ' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Next('0') }"><MvEVAL EXPR = "</A>">
		 </MvIF>
		</FONT>
	</TD></TR>
	</TABLE>
	<MvEVAL EXPR = "{ EndContent() }">

	<MvIF EXPR = "{ l.can_modify OR l.can_delete OR l.can_add }">
		<MvEVAL EXPR = "{ DrawButtons( 'STAT:[UPDATE]' ) }">
	<MvELSE>
		<MvEVAL EXPR = "{ DrawButtons( '' ) }">
	</MvIF>

	<MvEVAL EXPR = "{ EndScreen() }">

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Categories
|
</MvCOMMENT>

<MvFUNCTION NAME = "Category_BatchEdit_Validate">
	<MvASSIGN NAME = "g.Category_Code" VALUE = "{ ltrim( rtrim( g.Category_Code ) ) }">
	<MvASSIGN NAME = "g.Category_Name" VALUE = "{ ltrim( rtrim( g.Category_Name ) ) }">

	<MvIF EXPR = "{ NOT Validate_Code( g.Category_Code ) }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00333">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a category code</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'CTGY', 'Category_Code', g.Validation_Message ) }">
	<MvELSE>
		<MvIF EXPR = "{ ( NOT g.Edit_Category ) OR ( toupper( g.Category_Code ) NE toupper( g.Edit_Category ) ) }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_Find_Code( g.Category_Code ) }">
			<MvIF EXPR = "{ l.found }">
				<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00334">
					<MvLOCALIZED-TOKEN NAME = "category" VALUE = "{ g.Category_Code }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">A category with the code '%category%' already exists</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'CTGY', 'Category_Code', l.error_message ) }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ len( g.Category_Name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00335">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a category name</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'CTGY', 'Category_Name', l.error_message ) }">
	</MvIF>
	
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
	<MvWHILE EXPR = "{ l.found }">
		<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_version" VALUE = "{ Module_API_Version() }">
		<MvIF EXPR = "{ l.module_version }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_valid" VALUE = "{ Module_Category_BatchEdit_Validate() }">
			<MvIF EXPR = "{ NOT l.module_valid }">
				<MvFUNCTIONRETURN VALUE = 0>
			</MvIF>
		</MvIF>

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
	</MvWHILE>


	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Category_BatchEdit">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvASSIGN NAME = "l.valid" VALUE = 1>

	<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'CTGY', 0, 1, 0, 0 ) }">
	<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'CTGY', 0, 0, 1, 0 ) }">
	<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'CTGY', 0, 0, 0, 1 ) }">

	<MvIF EXPR = "{ l.ok AND len( g.Edit_Category ) }">
		<MvIF EXPR = "{ l.can_modify }">
			<MvASSIGN NAME = "l.valid" VALUE = "{ Category_BatchEdit_Validate() }">
			<MvIF EXPR = "{ l.valid }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Find_Code( g.Edit_Category ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Update( Categories.d.id, Categories.d.parent_id,
																							  g.Category_Code, g.Category_Name, g.Category_Active ) }">
					<MvIF EXPR = "{ l.ok }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
						<MvWHILE EXPR = "{ l.found }">
							<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_version" VALUE = "{ Module_API_Version() }">
							<MvIF EXPR = "{ l.module_version }">
								<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_valid" VALUE = "{ Module_Category_BatchEdit_Update( Categories.d.id ) }">
								<MvIF EXPR = "{ NOT l.module_valid }">
									<MvFUNCTIONRETURN VALUE = 0>
								</MvIF>
							</MvIF>

							<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
						</MvWHILE>
					</MvIF>
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ l.ok AND l.valid AND l.can_delete }">
		<MvASSIGN NAME = "l.category" VALUE = 1>
		<MvWHILE EXPR = "{ l.ok AND ( l.category LE g.Category_Count ) }">
			<MvIF EXPR = "{ g.Category_Remove[ l.category ] }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Find_Code( g.Category_Code[ l.category ] ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
					<MvWHILE EXPR = "{ l.ok AND l.found }">
						<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Category_Delete( Categories.d.id ) }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
					</MvWHILE>

					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Delete( Categories.d.id ) }">
				</MvIF>
			</MvIF>

			<MvASSIGN NAME = "l.category" VALUE = "{ l.category + 1 }">
		</MvWHILE>
	</MvIF>

	<MvIF EXPR = "{ l.ok AND l.valid }">
		<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00336">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Categories updated</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvASSIGN NAME = "g.Edit_Category" VALUE = "">

		<MvEVAL EXPR = "{ Update_LeftNavigation() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Category_BatchSort">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'CTGY', 0, 0, 1, 0 ) }">

	<MvIF EXPR = "{ len( g.Swap_Category_1 ) AND len( g.Swap_Category_2 ) AND l.can_modify }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Find_Code( g.Swap_Category_1 ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "l.id_1" VALUE = "{ Categories.d.id }">
			<MvASSIGN NAME = "l.order_1" VALUE = "{ Categories.d.order }">

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Find_Code( g.Swap_Category_2 ) }">
			<MvIF EXPR = "{ l.ok }">
				<MvASSIGN NAME = "l.id_2" VALUE = "{ Categories.d.id }">
				<MvASSIGN NAME = "l.order_2" VALUE = "{ Categories.d.order }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Update_Order( l.id_1, l.order_2 ) }">
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Update_Order( l.id_2, l.order_1 ) }">
		</MvIF>
		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00337">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Categories swapped</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Category_Sort AND l.can_modify }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Sort( g.Category_Sort_By, g.Category_Sort_Ascending ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00338">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Categories sorted</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "g.Edit_Category" VALUE = "">
		<MvEVAL EXPR = "{ Update_LeftNavigation() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Category_BatchEdit">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI('CTGY', 0, 1, 0, 0) }">
	<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI('CTGY', 0, 0, 1, 0) }">
	<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI('CTGY', 0, 0, 0, 1) }">

	<MvIF EXPR = "{ NOT g.Have_List_Fields }">
		<MvASSIGN NAME = "g.Category_Stack" VALUE = "">
		<MvASSIGN NAME = "g.Category_Search" VALUE = "">
		<MvASSIGN NAME = "g.Category_Offset" VALUE = 0>
		<MvASSIGN NAME = "g.Category_Display" VALUE = "{ g.Admin_User_PageLen }">
	<MvELSE>
		<MvASSIGN NAME = "g.Category_Display" VALUE = "{ int( g.Category_Display ) }">
		<MvIF EXPR = "{ g.Category_Display LT 1 }">
			<MvASSIGN NAME = "g.Category_Display" VALUE = 1>
		</MvIF>
	</MvIF>

	<MvLOCALIZED NAME = "l.screen_label" ID = "MER-ADM-00339">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Categories</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvEVAL EXPR = "{ BeginScreen( l.screen_label, 'CBED', 'Help:cbed.html' ) }">
	<INPUT TYPE = "hidden" NAME = "Have_List_Fields" VALUE = "1">

	<MvLOCALIZED NAME = "l.tab_list" ID = "MER-ADM-00340">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">CTGY:Categories</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvEVAL EXPR = "{ DrawTabs( 'CTGY', l.tab_list ) }">

	<MvEVAL EXPR = "{ BeginContent() }">

	<MvLOCALIZED NAME = "g.Text" ID = "MER-ADM-00786">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Sorting items cannot be undone by pressing the reset button.\n\nContinue?</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	
	<MvEVAL EXPR = "{ JavaScript_SetVariables( 'g', 'Text' ) }">

	<SCRIPT LANGUAGE = "JavaScript">
<!--
function EditCategory( cat_code )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Screen' ].value = Screen;
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Edit_Category' ].value = unescape( cat_code );
		document.forms[ Screen ].elements[ 'Action' ].value = '';
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
		document.forms[ Screen ].submit();
	}
}

function SwapCategories( cat_code1, cat_code2 )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Action' ].value = 'CSRT';
		document.forms[ Screen ].elements[ 'Screen' ].value = Screen;
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Edit_Category' ].value = '';
		document.forms[ Screen ].elements[ 'Swap_Category_1' ].value = unescape( cat_code1 );
		document.forms[ Screen ].elements[ 'Swap_Category_2' ].value = unescape( cat_code2 );
		document.forms[ Screen ].submit();
	}
}
function SortCategories( key )
{
	if ( CheckModified() )
	{
		if ( confirm( Text ) )
		{

			document.forms[ Screen ].elements[ 'Category_Sort' ].value = '1';
			document.forms[ Screen ].elements[ 'Action' ].value = 'CSRT';
			if ( key == 'aname')
			{
				document.forms[ Screen ].elements[ 'Category_Sort_By' ].value = 'name';
				document.forms[ Screen ].elements[ 'Category_Sort_Ascending' ].value = '1';
			}
			else
				if ( key == 'dname')
				{
					document.forms[ Screen ].elements[ 'Category_Sort_By' ].value = 'name';
					document.forms[ Screen ].elements[ 'Category_Sort_Ascending' ].value = '0';
				}
				else
					if ( key == 'acode')
					{
						document.forms[ Screen ].elements[ 'Category_Sort_By' ].value = 'code';
						document.forms[ Screen ].elements[ 'Category_Sort_Ascending' ].value = '1';
					}
					else
						if ( key == 'dcode')
						{
							document.forms[ Screen ].elements[ 'Category_Sort_By' ].value = 'code';
							document.forms[ Screen ].elements[ 'Category_Sort_Ascending' ].value = '0';
						}
						else
							document.forms[ Screen ].elements[ 'Category_Sort' ].value = '0';

			document.forms[ Screen ].submit();
		}
	}
}

//-->
	</SCRIPT>

	<MvIF EXPR = "{ g.Tab EQ 'CTGY' }">
		<INPUT TYPE = "hidden" NAME = "Swap_Category_1" VALUE = "">
		<INPUT TYPE = "hidden" NAME = "Swap_Category_2" VALUE = "">

		<MvHIDE FIELDS = "g.Edit_Category">

		<INPUT TYPE = "hidden" NAME = "Category_Sort" VALUE = "">
		<INPUT TYPE = "hidden" NAME = "Category_Sort_By" VALUE = "">
		<INPUT TYPE = "hidden" NAME = "Category_Sort_Ascending" VALUE = "">

		<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
		<TR><TD>
			&nbsp;
		</TD><TD ALIGN = "right" VALIGN = "middle">
			&nbsp;
		</TD><TD>
			&nbsp;
		</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
			<MvLOCALIZED ID = "MER-ADM-00341">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Search:&nbsp;</MvLOCALIZED-TEXT>
			</MvLOCALIZED></B>
			<MvASSIGN NAME = "g.Category_Search" VALUE = "{ ltrim( rtrim( g.Category_Search ) ) }">
			<INPUT TYPE = "text" NAME = "Category_Search" VALUE = "{ g.Category_Search }" SIZE = 20>
			<A HREF = "JavaScript:ListReload( 'Category_Offset', 'Category_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Search(0) }"></A>
			</FONT>
		</TD></TR>

		<MvIF EXPR = "{ ( len( g.Category_Search ) EQ 0) AND l.can_modify }">
			<TR><TD ALIGN = "left" VALIGN = "top">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00757">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US"><B>Sort:</B></MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD ALIGN = "left" COLSPAN = 3>
				<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
				<TR><TD ALIGN = "left">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00342">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name Ascending</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<A HREF = "JavaScript:SortCategories( 'aname' )"><MvEVAL EXPR = "{ l.label }"></A>
					</FONT>
				</TD><TD ALIGN = "left">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00343">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name Descending</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<A HREF = "JavaScript:SortCategories( 'dname' )"><MvEVAL EXPR = "{ l.label }"></A>
					</FONT>
				</TD></TR>
				<TR><TD ALIGN = "left">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00344">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code Ascending</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<A HREF = "JavaScript:SortCategories( 'acode' )"><MvEVAL EXPR = "{ l.label }"></A>
					</FONT>
				</TD><TD ALIGN = "left">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00345">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code Descending</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<A HREF = "JavaScript:SortCategories( 'dcode' )"><MvEVAL EXPR = "{ l.label }"></A>
					</FONT>
				</TD></TR>
				</TABLE>
			</TD></TR>
		</MvIF>
		</TABLE>

		<MvASSIGN NAME = "l.columns" VALUE = 0>

		<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
		<TR>

		<MvIF EXPR = "{ ( len( g.Edit_Category ) EQ 0 ) AND l.can_delete }">
			<TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00346">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Remove</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>

				<MvIF EXPR = "{ l.can_delete }">
					<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_CheckAll( 'Category_Remove' ) }">
				</MvIF>
			</TD>

			<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
		</MvIF>

		<MvIF EXPR = "{ ( len( g.Category_Search ) EQ 0 ) AND l.can_modify }">
			<TD BGCOLOR = "#000080">
				&nbsp;
			</TD>
		</MvIF>

		<TD BGCOLOR = "#000080">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
			<MvLOCALIZED ID = "MER-ADM-00347">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD><TD BGCOLOR = "#000080">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
			<MvLOCALIZED ID = "MER-ADM-00348">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD><TD ALIGN = "right" BGCOLOR = "#000080">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
			<MvLOCALIZED ID = "MER-ADM-00931">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Active</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD><TD ALIGN = "right" BGCOLOR = "#000080" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff">
			<MvIF EXPR = "{ l.can_add }">
				<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00349">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">New Category</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<A HREF = "{ g.sessionurl $ 'Screen=CTGY&Store_Code=' $ encodeattribute( g.Store_Code ) }"><MvEVAL EXPR = "{ DrawImgButton_NewX( 0, l.alt) }"></A>
			<MvELSE>
				&nbsp;
			</MvIF>
			</FONT>
		</TD></TR>

		<MvASSIGN NAME = "l.shown" VALUE = 0>
		<MvASSIGN NAME = "l.lastoffset" VALUE = 0>
		<MvASSIGN NAME = "l.last_category_code" VALUE = "">

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Category_FindOffset_All( g.Category_Offset, g.Category_Search ) }">
		<MvWHILE EXPR = "{ ( l.shown LT g.Category_Display ) AND l.nextoffset }">

			<MvASSIGN NAME = "l.category_code" VALUE = "{ Categories.d.code }">
			<MvASSIGN NAME = "l.category_name" VALUE = "{ Categories.d.name }">
			<MvASSIGN NAME = "l.category_active" VALUE = "{ Categories.d.active }">

			<MvASSIGN NAME = "l.lastoffset" VALUE = "{ l.nextoffset }">

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Category_FindNext_All( l.nextoffset, g.Category_Search ) }">

			<MvASSIGN NAME = "l.shown" VALUE = "{ l.shown + 1 }">

			<MvIF EXPR = "{ ( l.shown MOD 2 ) EQ 0 }">
				<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffdd">
			<MvELSE>
				<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffff">
			</MvIF>

			<TR>

			<MvIF EXPR = "{ ( len( g.Edit_Category ) NE 0 ) AND
							( g.Edit_Category EQ l.category_code ) AND l.can_modify }">
				<MvIF EXPR = "{ NOT g.Data_Entry_Error }">
					<MvASSIGN NAME = "g.Category_Code" VALUE = "{ l.category_code }">
					<MvASSIGN NAME = "g.Category_Name" VALUE = "{ l.category_name }">
					<MvASSIGN NAME = "g.Category_Active" VALUE = "{ l.category_active }">
				</MvIF>

				<MvIF EXPR = "{ ( len( g.Category_Search ) EQ 0 ) }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
						<MvIF EXPR = "{ len( l.last_category_code ) OR ( ( l.shown LT g.Category_Display ) AND l.nextoffset ) }">
							<MvIF EXPR = "{ len( l.last_category_code ) }">
								<MvLOCALIZED NAME = "l.alt_text" ID = "MER-ADM-00806">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Up</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<A HREF = "{ 'JavaScript:SwapCategories( \'' $ JavaScriptEncode( l.last_category_code ) $ '\', \'' $ JavaScriptEncode( l.category_code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_u.gif' }"></A>
							<MvELSE>
								<MvLOCALIZED NAME = "l.alt_text" ID = "MER-ADM-00807">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Down</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<IMG BORDER = 0 WIDTH = 11 HEIGHT = 23 SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }">
							</MvIF>

							<MvIF EXPR = "{ ( l.shown LT g.Category_Display ) AND l.nextoffset }">
								<A HREF = "{ 'JavaScript:SwapCategories( \'' $ JavaScriptEncode( l.category_code ) $ '\', \'' $ JavaScriptEncode( Categories.d.code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_d.gif' }"></A>
							</MvIF>
						<MvELSE>
							&nbsp;
						</MvIF>
					</TD>
				</MvIF>

				<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = 15 NAME = "Category_Code" VALUE = "{ encodeentities( g.Category_Code ) }" ONCHANGE = "SetModified();">
					</FONT>
				</TD><TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = 30 NAME = "Category_Name" VALUE = "{ encodeentities( g.Category_Name ) }" ONCHANGE = "SetModified();">
					</FONT>
				</TD><TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvIF EXPR = "{ g.Category_Active }">
						<INPUT TYPE = "checkbox" NAME = "Category_Active" VALUE = "Yes" CHECKED ONCLICK = "SetModified();">
					<MvELSE>
						<INPUT TYPE = "checkbox" NAME = "Category_Active" VALUE = "Yes" ONCLICK = "SetModified();">
					</MvIF>
					</FONT>
				</TD><TD ALIGN = "right" VALIGN = "top" BGCOLOR = "{ l.bgcolor }" WIDTH = "100%" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<A HREF = "JavaScript:EditCategory( '' );"><MvEVAL EXPR = "{ DrawImgButton_EditHere('1') }"></A>
					<A HREF = "{ g.sessionurl $ 'Screen=CTGY&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Edit_Category=' $ encodeattribute( l.category_code ) }"><MvEVAL EXPR = "{ DrawImgButton_Edit('0') }"><MvEVAL EXPR = "</A>">
					</FONT>
				</TD></TR>
			<MvELSE>
				<MvIF EXPR = "{ ( len( g.Edit_Category ) EQ 0 ) AND l.can_delete }">
					<TD VALIGN = "top" ALIGN = "center" BGCOLOR = "{ l.bgcolor }">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "hidden" NAME = "{ 'Category_Code[' $ l.shown $ ']' }" VALUE = "{ encodeentities( l.category_code ) }">
						<INPUT TYPE = "checkbox" NAME = "{ 'Category_Remove[' $ l.shown $ ']' }" VALUE = "Yes" ONCLICK = "SetModified();">
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ ( len( g.Category_Search ) EQ 0 ) AND l.can_modify }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
						<MvIF EXPR = "{ len( l.last_category_code ) OR ( ( l.shown LT g.Category_Display ) AND l.nextoffset ) }">
							<MvIF EXPR = "{ len( l.last_category_code ) }">
								<MvLOCALIZED NAME = "l.alt_text" ID = "MER-ADM-00808">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Up</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<A HREF = "{ 'JavaScript:SwapCategories( \'' $ JavaScriptEncode( l.last_category_code ) $ '\', \'' $ JavaScriptEncode( l.category_code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_u.gif' }"></A>
							<MvELSE>
								<IMG BORDER = 0 WIDTH = 11 HEIGHT = 23 SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }">
							</MvIF>

							<MvIF EXPR = "{ ( l.shown LT g.Category_Display ) AND l.nextoffset }">
								<MvLOCALIZED NAME = "l.alt_text" ID = "MER-ADM-00809">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Down</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<A HREF = "{ 'JavaScript:SwapCategories( \'' $ JavaScriptEncode( l.category_code ) $ '\', \'' $ JavaScriptEncode( Categories.d.code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_d.gif' }"></A>
							</MvIF>
						<MvELSE>
							&nbsp;
						</MvIF>
					</TD>
				</MvIF>

				<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ encodeentities( l.category_code ) }">
					</FONT>
				</TD><TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" WIDTH = "100%" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ encodeentities( l.category_name ) }">
					</FONT>
				</TD><TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" WIDTH = "100%" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ DrawCheck_Active( l.category_active ) }">
					</FONT>
				</TD><TD ALIGN = "right" VALIGN = "top" BGCOLOR = "{ l.bgcolor }" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvIF EXPR = "{ l.can_modify }">
						<MvEVAL EXPR = "{ '<A HREF = "JavaScript:EditCategory( \'' $ JavaScriptEncode( l.category_code ) $ '\' );">' }"><MvEVAL EXPR = "{ DrawImgButton_EditHere('0') }"><MvEVAL EXPR = "</A>">
					</MvIF>
					<A HREF = "{ g.sessionurl $ 'Screen=CTGY&Store_Code=' $ encodeattribute( g.Store_Code )  $ '&Edit_Category=' $ encodeattribute( l.category_code ) }"><MvEVAL EXPR = "{ DrawImgButton_Edit('0') }"></A>
					</FONT>
				</TD></TR>
			</MvIF>

			<MvASSIGN NAME = "l.last_category_code" VALUE = "{ l.category_code }">
		</MvWHILE>

		<MvIF EXPR = "{ len( g.Edit_Category ) }">
			<MvASSIGN NAME = "l.colspan" VALUE = 2>
		<MvELSE>
			<MvASSIGN NAME = "l.colspan" VALUE = 3>
		</MvIF>

		<MvIF EXPR = "{ len( g.Category_Search ) EQ 0 }">
			<MvASSIGN NAME = "l.colspan" VALUE = "{ l.colspan + 1 }">
		</MvIF>

		<TR><TD BGCOLOR = "#000080" ALIGN = "left" VALIGN = "middle" NOWRAP>
			<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
			<MvHIDE FIELDS = "g.Category_Stack, g.Category_Offset">
			<MvIF EXPR = "{ l.shown }">
				<B><MvEVAL EXPR = "{ g.Category_Offset + 1 }">-<MvEVAL EXPR = "{ l.lastoffset }"></B>
			<MvELSE>
				<B>0-0</B>
			</MvIF>
			</FONT>
		</TD><TD BGCOLOR = "#000080" ALIGN = "right" VALIGN = "middle" COLSPAN = "5">
			<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
			<MvIF EXPR = "{ len( g.Category_Stack ) }">
				<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListPrevious( \'Category_Offset\', \'Category_Stack\' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Previous('0') }"><MvEVAL EXPR = "</A>">
			</MvIF>

			 <INPUT TYPE = "text" NAME = "Category_Display" VALUE = "{ encodeentities( g.Category_Display ) }" SIZE = 5> <A HREF = "JavaScript:ListReload( 'Category_Offset', 'Category_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Refresh('0') }"></A>
			 <INPUT TYPE = "hidden" NAME = "Category_Count" VALUE = "{ encodeentities( l.shown ) }">

			 <MvIF EXPR = "{ l.nextoffset }">
				<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListNext( \'Category_Offset\', \'Category_Stack\', ' $ l.lastoffset $ ' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Next('0') }"><MvEVAL EXPR = "</A>">
			 </MvIF>
			</FONT>
		</TD></TR>
		</TABLE>
	<MvELSE>
		<MvHIDE FIELDS = "g.Category_Search, g.Category_Stack, g.Category_Offset, g.Category_Display">
		<INPUT TYPE = "hidden" NAME = "Category_Count" VALUE = "{ encodeentities( l.shown ) }">
		<MvIF EXPR = "{ g.Edit_Category }">
			<MvHIDE FIELDS = "g.Edit_Category, g.Category_Code, g.Category_Name, g.Category_Active">
		</MvIF>
	</MvIF>

	<MvEVAL EXPR = "{ EndContent() }">

	<MvASSIGN NAME = "l.buttons" VALUE = "">
	<MvIF EXPR = "{ l.can_modify OR l.can_delete }">
		<MvASSIGN NAME = "l.buttons" VALUE = "CBED:[UPDATE]">
	</MvIF>

	<MvEVAL EXPR = "{ DrawButtons( l.buttons ) }">
	<MvEVAL EXPR = "{ EndScreen() }">
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Category_Validate">
	<MvASSIGN NAME = "g.Category_Code" VALUE = "{ ltrim( rtrim( g.Category_Code ) ) }">
	<MvASSIGN NAME = "g.Category_Name" VALUE = "{ ltrim( rtrim( g.Category_Name ) ) }">
	<MvASSIGN NAME = "g.Category_Parent" VALUE = "{ ltrim( rtrim( g.Category_Parent ) ) }">

	<MvIF EXPR = "{ NOT Validate_Code( g.Category_Code ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'CTGY', 'Category_Code', g.Validation_Message ) }">
	<MvELSE>
		<MvIF EXPR = "{ ( NOT g.Edit_Category ) OR ( toupper( g.Category_Code ) NE toupper( g.Edit_Category ) ) }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_Find_Code( g.Category_Code ) }">

			<MvIF EXPR = "{ l.found }">
				<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00351">
					<MvLOCALIZED-TOKEN NAME = "category" VALUE = "{ g.Category_Code }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">A category with the code '%category%' already exists</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'CTGY', 'Category_Code', l.error_message ) }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ len( g.Category_Name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00352">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a category name</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'CTGY', 'Category_Name', l.error_message ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Category_Parent ) }">
		<MvIF EXPR = "{ g.Category_Code EQ g.Category_Parent }">
			<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00353">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">A category can not be its own parent</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'CTGY', 'Category_Parent', l.error_message ) }">
		<MvELSE>
			<MvDO FILE = "{ g.Library_DB }" NAME = "g.Category_Parent_ID" VALUE = "{ Category_Find_Code( g.Category_Parent ) }">
			<MvIF EXPR = "{ g.Category_Parent_ID EQ 0 }">
				<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00354">
					<MvLOCALIZED-TOKEN NAME = "category" VALUE = "{ g.Category_Parent }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Category '%category%' not found</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'CTGY', 'Category_Parent', l.error_message ) }">
			<MvELSE>
				<MvIF EXPR = "{ len( g.Edit_Category ) }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.id" VALUE = "{ Category_Find_Code( g.Edit_Category ) }">
					<MvIF EXPR = "{ l.id }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_Find_Code( g.Category_Parent ) }">
						<MvWHILE EXPR = "{ l.found AND Categories.d.parent_id }">
							<MvIF EXPR = "{ Categories.d.parent_id EQ l.id }">
								<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00355">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">A category can not be the child of one of its children</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<MvFUNCTIONRETURN VALUE = "{ FieldError( 'CTGY', 'Category_Parent', l.error_message ) }">
							</MvIF>

							<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_Find_ID( Categories.d.parent_id ) }">
						</MvWHILE>
					</MvIF>
				</MvIF>
			</MvIF>
		</MvIF>
	<MvELSE>
		<MvASSIGN NAME = "g.Category_Parent_ID" VALUE = 0>
	</MvIF>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
	<MvWHILE EXPR = "{ l.found }">
		<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_valid" VALUE = "{ Module_Category_Validate() }">
		<MvIF EXPR = "{ NOT l.module_valid }">
			<MvFUNCTIONRETURN VALUE = 0>
		</MvIF>

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
	</MvWHILE>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Category_Insert">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ Category_Validate() }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.category_id" VALUE = "{ Category_Insert( g.Category_Parent_ID, g.Category_Code, g.Category_Name, g.Category_Active ) }">
		<MvIF EXPR = "{ NOT l.category_id }">
			<MvASSIGN NAME = "l.ok" VALUE = 0>
		<MvELSE>
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
			<MvWHILE EXPR = "{ l.ok AND l.found }">
				<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Category_Update( l.category_id ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
			</MvWHILE>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00356">
				<MvLOCALIZED-TOKEN NAME = "category" VALUE = "{ encodeentities( g.Category_Name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Category '%category%' added</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvEVAL EXPR = "{ Update_LeftNavigation() }">
		</MvIF>
	</MvIF>

	<MvASSIGN NAME = "g.Tab" VALUE = "CTGY">

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Category_Update">
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Find_Code( g.Edit_Category ) }">
	<MvASSIGN NAME = "l.category_id" VALUE = "{ Categories.d.id }">
	<MvASSIGN NAME = "l.category_name" VALUE = "{ Categories.d.name }">

	<MvIF EXPR = "{ l.ok }">
		<MvIF EXPR = "{ Category_Validate() }">
			<MvIF EXPR = "{ CanI( 'PROD', 1, 0, 0, 0 ) }">
				<MvASSIGN NAME = "l.product" VALUE = 1>
				<MvWHILE EXPR = "{ l.ok AND ( l.product LE g.Category_Product_Count ) }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Product_Find_Code( g.Category_Product[ l.product ] ) }">
					<MvIF EXPR = "{ l.found }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.assigned" VALUE = "{ CategoryXProduct_Find( l.category_id, Products.d.id ) }">

						<MvIF EXPR = "{ g.Category_Product_Assigned[ l.product ] }">
							<MvIF EXPR = "{ NOT l.assigned }">
								<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ CategoryXProduct_Insert( l.category_id, Products.d.id ) }">
							</MvIF>
						<MvELSE>
							<MvIF EXPR = "{ l.assigned }">
								<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ CategoryXProduct_Delete( l.category_id, Products.d.id ) }">
							</MvIF>
						</MvIF>
					</MvIF>

					<MvASSIGN NAME = "l.product" VALUE = "{ l.product + 1 }">
				</MvWHILE>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Update( l.category_id, g.Category_Parent_ID, g.Category_Code, g.Category_Name, g.Category_Active ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
					<MvWHILE EXPR = "{ l.ok AND l.found }">
						<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Category_Update( l.category_id ) }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
					</MvWHILE>
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00357">
					<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ encodeentities( g.Module_Message ) }">
					<MvLOCALIZED-TOKEN NAME = "category" VALUE = "{ encodeentities( l.category_name ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">%module%Category '%category%' updated</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvASSIGN NAME = "g.Edit_Category" VALUE = "{ g.Category_Code }">

				<MvEVAL EXPR = "{ Update_LeftNavigation() }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Category_Sort">
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Find_Code( g.Edit_Category ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.category_id" VALUE = "{ Categories.d.id }">
		<MvASSIGN NAME = "l.category_name" VALUE = "{ Categories.d.name }">

		<MvIF EXPR = "{ len( g.Swap_Category_Product_1 ) AND len( g.Swap_Category_Product_2 ) }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Find_Code( g.Swap_Category_Product_1 ) }">
			<MvIF EXPR = "{ l.ok }">
				<MvASSIGN NAME = "l.id_1" VALUE = "{ Products.d.id }">
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Find_Code( g.Swap_Category_Product_2 ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvASSIGN NAME = "l.id_2" VALUE = "{ Products.d.id }">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ CategoryXProduct_Find( l.category_id, l.id_1 ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvASSIGN NAME = "l.order_1" VALUE = "{ CategoryXProduct.d.order }">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ CategoryXProduct_Find( l.category_id, l.id_2 ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvASSIGN NAME = "l.order_2" VALUE = "{ CategoryXProduct.d.order }">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ CategoryXProduct_Update_Order( l.category_id, l.id_1, l.order_2 ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ CategoryXProduct_Update_Order( l.category_id, l.id_2, l.order_1 ) }">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00358">
					<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ encodeentities( g.Module_Message ) }">
					<MvLOCALIZED-TOKEN NAME = "category" VALUE = "{ encodeentities( l.category_name ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">%module%'Category '%category%' products swapped</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvIF EXPR = "{ g.CatXProd_Sort }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ CategoryXProduct_Sort( l.category_id, g.CatXProd_Sort_By, g.CatXProd_Sort_Ascending ) }">
			<MvIF EXPR = "{ l.ok }">
				<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00359">
					<MvLOCALIZED-TOKEN NAME = "category" VALUE = "{ encodeentities( l.category_name ) }">
					<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ encodeentities( g.Module_Message ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">%module%'Category '%category%' products sorted</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "g.Edit_Category" VALUE = "{ g.Category_Code }">
		<MvEVAL EXPR = "{ Update_LeftNavigation() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Category_Delete">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Find_Code( g.Edit_Category ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.category_name" VALUE = "{ Categories.d.name }">
		<MvASSIGN NAME = "l.category_code" VALUE = "{ Categories.d.code }">
		<MvASSIGN NAME = "l.category_id" VALUE = "{ Categories.d.id }">

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_FindNext_CategoryOrder( l.category_code ) }">
		<MvIF EXPR = "{ l.found }">
			<MvASSIGN NAME = "g.Edit_Category" VALUE = "{ Categories.d.code }">
		<MvELSE>
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_FindPrev_CategoryOrder( l.category_code ) }">
			<MvIF EXPR = "{ l.found }">
				<MvASSIGN NAME = "g.Edit_Category" VALUE = "{ Categories.d.code }">
			<MvELSE>
				<MvASSIGN NAME = "g.Edit_Category" VALUE = "">
				<MvASSIGN NAME = "g.Edit_Item" VALUE = "">
				<MvASSIGN NAME = "g.Tab" VALUE = "">
			</MvIF>
		</MvIF>
		
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
		<MvWHILE EXPR = "{ l.ok AND l.found }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Category_Delete( l.category_id ) }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
		</MvWHILE>

		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Delete( l.category_id ) }">
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00360">
				<MvLOCALIZED-TOKEN NAME = "category" VALUE = "{ encodeentities( l.category_name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Category '%category%' deleted</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvEVAL EXPR = "{ Update_LeftNavigation() }">
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Categories" STANDARDOUTPUTLEVEL = "text,html, compresswhitespace">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00361">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Category</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvASSIGN NAME = "l.action" VALUE = "ICGY">
	<MvASSIGN NAME = "l.category_id" VALUE = 0>
	<MvASSIGN NAME = "l.buttons" VALUE = "Help:ctgy.html">

	<MvASSIGN NAME = "l.can_product_view"	VALUE = "{ CanI( 'PROD', 1, 0, 0, 0 ) }">
	<MvASSIGN NAME = "l.can_product_add"	VALUE = "{ CanI( 'PROD', 0, 1, 0, 0 ) }">
	<MvASSIGN NAME = "l.can_modify"		VALUE = "{ CanI( 'CTGY', 0, 0, 1, 0 ) }">

	<MvIF EXPR = "{ len( g.Edit_Item ) }">
		<MvASSIGN NAME = "g.Edit_Category" VALUE = "{ g.Edit_Item }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Edit_Category ) EQ 0 AND CanI( 'CTGY', 0, 1, 0, 0 ) EQ 0 }">
		<MvFUNCTIONRETURN VALUE = "{ Screen_Blank() }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Edit_Category ) }">
		<MvIF EXPR = "{ g.Prev_Item }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_FindPrev_CategoryOrder( g.Edit_Category ) }">
			<MvIF EXPR = "{ l.found }">
				<MvASSIGN NAME = "g.Edit_Category" VALUE = "{ Categories.d.code }">
			<MvELSE>
				<MvLOCALIZED NAME = "l.message" ID = "MER-ADM-01509">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">There is no previous Category</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvASSIGN NAME = "g.Message" VALUE = "{ l.message }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ g.Next_Item }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_FindNext_CategoryOrder( g.Edit_Category ) }">
			<MvIF EXPR = "{ l.found }">
				<MvASSIGN NAME = "g.Edit_Category" VALUE = "{ Categories.d.code }">
			<MvELSE>
				<MvLOCALIZED NAME = "l.message" ID = "MER-ADM-01510">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">There is no next Category</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvASSIGN NAME = "g.Message" VALUE = "{ l.message }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ g.First_Item }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_FindFirst() }">
			<MvIF EXPR = "{ l.found }">
				<MvASSIGN NAME = "g.Edit_Category" VALUE = "{ Categories.d.code }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ g.Last_Item }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_FindLast() }">
			<MvIF EXPR = "{ l.found }">
				<MvASSIGN NAME = "g.Edit_Category" VALUE = "{ Categories.d.code }">
			</MvIF>
		</MvIF>


		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Find_Code( g.Edit_Category ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00362">
				<MvLOCALIZED-TOKEN NAME = "category" VALUE = "{ encodeentities( Categories.d.name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Edit Category: %category%</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvASSIGN NAME = "l.action" VALUE = "UCGY">
			<MvASSIGN NAME = "l.category_id" VALUE = "{ Categories.d.id }">
			<MvASSIGN NAME = "l.buttons" VALUE = "{ 'Links:Screen=LINK&Type=CTGY&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Category_Code=' $ encodeattribute( Categories.d.code ) $ ',Help:ctgy.html' }">

			<MvIF EXPR = "{ g.Load_Fields }">
				<MvASSIGN NAME = "g.Category_Code" VALUE = "{ Categories.d.code }">
				<MvASSIGN NAME = "g.Category_Name" VALUE = "{ Categories.d.name }">
				<MvASSIGN NAME = "g.Category_Active" VALUE = "{ Categories.d.active }">

				<MvIF EXPR = "{ Categories.d.parent_id }">
					<MvASSIGN NAME = "l.parent" VALUE = "{ Categories.d.parent_id }">

					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Find_ID( l.parent ) }">
					<MvIF EXPR = "{ l.ok }">
						<MvASSIGN NAME = "g.Category_Parent" VALUE = "{ Categories.d.code }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Category_Find_Code( g.Edit_Category ) }">
					</MvIF>
				</MvIF>
			</MvIF>
		</MvIF>
	<MvELSE>
		<MvIF EXPR = "{ g.Load_Fields }">
			<MvASSIGN NAME = "g.Category_Code" VALUE = "">
			<MvASSIGN NAME = "g.Category_Name" VALUE = "">
			<MvASSIGN NAME = "g.Category_Active" VALUE = 1>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ NOT g.Have_List_Fields }">
		<MvASSIGN NAME = "g.Category_Product_Stack" VALUE = "">
		<MvASSIGN NAME = "g.Category_Product_Search" VALUE = "">
		<MvASSIGN NAME = "g.Category_Product_Show" VALUE = "All">
		<MvASSIGN NAME = "g.Category_Product_Offset" VALUE = 0>
		<MvASSIGN NAME = "g.Category_Product_Display" VALUE = "{ g.Admin_User_PageLen }">
	<MvELSE>
		<MvASSIGN NAME = "g.Category_Product_Display" VALUE = "{ int( g.Category_Product_Display ) }">
		<MvIF EXPR = "{ g.Category_Product_Display LT 1 }">
			<MvASSIGN NAME = "g.Category_Product_Display" VALUE = 1>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvEVAL EXPR = "{ BeginScreen( l.title, l.action, l.buttons ) }">
		<INPUT TYPE = "hidden" NAME = "Have_List_Fields" VALUE = "1">

		<MvIF EXPR = "{ len( g.Edit_Category ) }">
			<MvHIDE FIELDS = "Edit_Category">
		</MvIF>

		<MvLOCALIZED NAME = "l.tabs" ID = "MER-ADM-00363">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">CTGY:Category</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
		<MvWHILE EXPR = "{ l.found }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_tabs" VALUE = "{ Module_Category_Tabs( l.category_id ) }">
			<MvIF EXPR = "{ len( l.module_tabs ) }">
				<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.module_tabs }">
			</MvIF>

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
		</MvWHILE>

		<MvIF EXPR = "{ len( g.Edit_Category ) AND l.can_product_view }">
			<MvLOCALIZED NAME = "l.moretabs" ID = "MER-ADM-00364">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">PROD:Products</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.moretabs }">
		</MvIF>
		<MvEVAL EXPR = "{ DrawTabs( 'CTGY', l.tabs ) }">

		<MvEVAL EXPR = "{ BeginContent() }">
		<MvIF EXPR = "{ g.Tab EQ 'CTGY' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00365">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Category Code:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 20 NAME = "Category_Code" VALUE = "{ encodeentities( g.Category_Code ) }" ONCHANGE = "{ 'SetItemModified( \'' $ g.Edit_Category $ '\' );' }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00366">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Category Name:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Category_Name" VALUE = "{ encodeentities( g.Category_Name ) }" ONCHANGE = "{ 'SetItemModified( \'' $ g.Edit_Category $ '\' );' }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00367">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Parent Category:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD WIDTH = "100%" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 20 NAME = "Category_Parent" VALUE = "{ encodeentities( g.Category_Parent ) }" ONCHANGE = "{ 'SetItemModified( \'' $ g.Edit_Category $ '\' );' }">
					<A HREF = "JavaScript:PopupCategoryLookup( 'Category_Parent' );">
					<MvEVAL EXPR = "{ DrawImgButton_Lookup(0) }"></A>
				</FONT>
			</TD></TR>
			<TR><TD NOWRAP>
				&nbsp;
			</TD><TD ALIGN = "left">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00932">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Active</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvIF EXPR = "{ g.Category_Active }">
					<INPUT TYPE = "checkbox" NAME = "Category_Active" VALUE = "Yes" CHECKED ONCHANGE = "{ 'SetItemModified( \'' $ g.Edit_Category $ '\' );' }"> <MvEVAL EXPR = "{ l.text }">
				<MvELSE>
					<INPUT TYPE = "checkbox" NAME = "Category_Active" VALUE = "Yes" ONCHANGE = "{ 'SetItemModified( \'' $ g.Edit_Category $ '\' );' }"> <MvEVAL EXPR = "{ l.text }">
				</MvIF>

				</FONT>
			</TD></TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Category_Code, g.Category_Name, g.Category_Parent, g.Category_Active">
		</MvIF>

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
		<MvWHILE EXPR = "{ l.ok AND l.found }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Category_Content( g.Tab, g.Load_Fields, l.category_id ) }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
		</MvWHILE>


		<MvIF EXPR = "{ ( g.Tab EQ 'PROD' ) AND l.can_product_view }">
			<MvLOCALIZED  NAME = "g.Text" ID = "MER-ADM-00933">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Sorting items cannot be undone by pressing the reset button.\n\nContinue?</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvEVAL EXPR = "{ JavaScript_SetVariables( 'g', 'Text' ) }">

			<SCRIPT LANGUAGE = "JavaScript">
<!--
function SwapProducts( prod_code1, prod_code2 )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Action' ].value = 'SCGY';
		document.forms[ Screen ].elements[ 'Screen' ].value = Screen;
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
		document.forms[ Screen ].elements[ 'Swap_Category_Product_1' ].value = unescape( prod_code1 );
		document.forms[ Screen ].elements[ 'Swap_Category_Product_2' ].value = unescape( prod_code2 );
		document.forms[ Screen ].submit();
	}
}

function SortCatProducts( key )
{
	if ( CheckModified() )
	{
		if ( confirm( Text ) )
		{
			document.forms[ Screen ].elements[ 'CatXProd_Sort' ].value = '1';
			document.forms[ Screen ].elements[ 'Action' ].value = 'SCGY';
			if ( key == 'aname')
			{
				document.forms[ Screen ].elements[ 'CatXProd_Sort_By' ].value = 'name';
				document.forms[ Screen ].elements[ 'CatXProd_Sort_Ascending' ].value = '1';
			}
			else
			{
				if ( key == 'dname')
				{
					document.forms[ Screen ].elements[ 'CatXProd_Sort_By' ].value = 'name';
					document.forms[ Screen ].elements[ 'CatXProd_Sort_Ascending' ].value = '0';
				}
				else
				{
					if ( key == 'acode')
					{
						document.forms[ Screen ].elements[ 'CatXProd_Sort_By' ].value = 'code';
						document.forms[ Screen ].elements[ 'CatXProd_Sort_Ascending' ].value = '1';
					}
					else
					{
						if ( key == 'dcode')
						{
							document.forms[ Screen ].elements[ 'CatXProd_Sort_By' ].value = 'code';
							document.forms[ Screen ].elements[ 'CatXProd_Sort_Ascending' ].value = '0';
						}
						else
						{
							document.forms[ Screen ].elements[ 'CatXProd_Sort' ].value = '0';
						}
					}
				}
			}

			document.forms[ Screen ].submit();
		}
	}
}
//-->
			</SCRIPT>

			<INPUT TYPE = "hidden" NAME = "Swap_Category_Product_1" VALUE = "">
			<INPUT TYPE = "hidden" NAME = "Swap_Category_Product_2" VALUE = "">

			<INPUT TYPE = "hidden" NAME = "CatXProd_Sort" VALUE = "">
			<INPUT TYPE = "hidden" NAME = "CatXProd_Sort_By" VALUE = "">
			<INPUT TYPE = "hidden" NAME = "CatXProd_Sort_Ascending" VALUE = "">

			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD ALIGN = "left" VALIGN = "middle" WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvHIDE FIELDS = "g.Category_Product_Show">
				<A HREF = "JavaScript:ListReloadField( 'Category_Product_Offset', 'Category_Product_Stack', 'Category_Product_Show', 'All' );"><MvEVAL EXPR = "{ DrawImgButton_All( g.Category_Product_Show EQ 'All' ) }"></A>

				<A HREF = "JavaScript:ListReloadField( 'Category_Product_Offset', 'Category_Product_Stack', 'Category_Product_Show', 'Unassigned' );"><MvEVAL EXPR = "{ DrawImgButton_Unassigned( g.Category_Product_Show EQ 'Unassigned' ) }"></A>

				<A HREF = "JavaScript:ListReloadField( 'Category_Product_Offset', 'Category_Product_Stack', 'Category_Product_Show', 'Assigned' );"><MvEVAL EXPR = "{ DrawImgButton_Assigned( g.Category_Product_Show EQ 'Assigned' ) }"></A>

				</FONT>
			</TD><TD ALIGN = "right" VALIGN = "middle">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED  ID = "MER-ADM-00934">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Search:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvASSIGN NAME = "g.Category_Product_Search" VALUE = "{ ltrim( rtrim( g.Category_Product_Search ) ) }">
				<INPUT TYPE = "text" NAME = "Category_Product_Search" VALUE = "{ encodeentities( g.Category_Product_Search ) }" SIZE = 20>
				<A HREF = "JavaScript:ListReload( 'Category_Product_Offset', 'Category_Product_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Search(0) }"></A>
				</FONT>
			</TD></TR>

			<MvIF EXPR = "{ ( g.Category_Product_Show EQ 'Assigned' ) AND
							l.can_modify AND
							l.can_product_view AND ( len( g.Category_Product_Search ) EQ 0 ) }">
				<TR><TD ALIGN = "left" VALIGN = "top" COLSPAN = 3>
					<TABLE>
					<TR><TD WIDTH = 25%>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00758">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US"><B>Sort:</B></MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" WIDTH = 25%>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00841">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name Ascending</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						<A HREF = "JavaScript:SortCatProducts( 'aname' )"><MvEVAL EXPR = "{ l.label }"></A>
						</FONT>
					</TD><TD ALIGN = "left" WIDTH = 25%>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00842">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name Descending</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						<A HREF = "JavaScript:SortCatProducts( 'dname' )"><MvEVAL EXPR = "{ l.label }"></A>
						</FONT>
					</TD><TD WIDTH = 25%>
						&nbsp;
					</TD></TR>
					<TR><TD>
						&nbsp;
					</TD><TD ALIGN = "left">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00810">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code Ascending</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						<A HREF = "JavaScript:SortCatProducts( 'acode' )"><MvEVAL EXPR = "{ l.label }"></A>
						</FONT>
					</TD><TD ALIGN = "left">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED NAME = "l.label" ID = "MER-ADM-00762">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code Descending</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						<A HREF = "JavaScript:SortCatProducts( 'dcode' )"><MvEVAL EXPR = "{ l.label }"></A>
						</FONT>
					</TD><TD>
						&nbsp;
					</TD></TR>
					</TABLE>
				</TD></TR>
			</MvIF>
			</TABLE>

			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR>
				<TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED  ID = "MER-ADM-00935">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Assigned</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT> 

				<MvIF EXPR = "{ l.can_modify }">
					<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_CheckAll( 'Category_Product_Assigned' ) }">			
				</MvIF>
			</TD>

			<MvIF EXPR = "{ ( g.Category_Product_Show EQ 'Assigned' ) AND ( len( g.Category_Product_Search ) EQ 0 ) AND l.can_modify }">
				<TD BGCOLOR = "#000080">
					&nbsp;
				</TD>
			</MvIF>

			<TD BGCOLOR = "#000080">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED  ID = "MER-ADM-00936">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD BGCOLOR = "#000080" WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED  ID = "MER-ADM-00937">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>

			</TD><TD ALIGN = "right" BGCOLOR = "#000080" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff">
				<MvIF EXPR = "{ l.can_product_add }">
					<MvLOCALIZED NAME = "l.alt"  ID = "MER-ADM-00938">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Product</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<A HREF = "{ g.sessionurl $ 'Screen=PROD&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Category_Code=' $ encodeattribute( g.Category_Code ) }">
					<MvEVAL EXPR = "{ DrawImgButton_NewX( 0, l.alt ) }"></A>
				<MvELSE>
					&nbsp;
				</MvIF>
				</FONT>
			</TD></TR>

			<MvASSIGN NAME = "l.shown" VALUE = 0>
			<MvASSIGN NAME = "l.lastoffset" VALUE = 0>
			<MvASSIGN NAME = "l.last_product_code" VALUE = "">

			<MvIF EXPR = "{ ( g.Category_Product_Show EQ 'All' ) OR ( g.Category_Product_Show EQ 'Unassigned' ) }">
				<MvASSIGN NAME = "l.assigned" VALUE = 0>
			</MvIF>

			<MvIF EXPR = "{ g.Category_Product_Show EQ 'Assigned' }">
				<MvASSIGN NAME = "l.assigned" VALUE = 1>
			</MvIF>

			<MvIF EXPR = "{ g.Category_Product_Show EQ 'All' }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Product_FindOffset_All( g.Category_Product_Offset, g.Category_Product_Search ) }">
			</MvIF>

			<MvIF EXPR = "{ g.Category_Product_Show EQ 'Unassigned' }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Category_Product_FindOffset_Unassigned( Categories.d.id, g.Category_Product_Offset, g.Category_Product_Search ) }">
			</MvIF>

			<MvIF EXPR = "{ g.Category_Product_Show EQ 'Assigned' }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Category_Product_FindOffset_Assigned( Categories.d.id, g.Category_Product_Offset, g.Category_Product_Search ) }">
			</MvIF>

			<MvWHILE EXPR = "{ ( l.shown LT g.Category_Product_Display ) AND l.nextoffset }">
				<MvIF EXPR = "{ g.Category_Product_Show EQ 'All' }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.assigned" VALUE = "{ CategoryXProduct_Find( Categories.d.id, Products.d.id ) }">
				</MvIF>

				<MvASSIGN NAME = "l.product_code" VALUE = "{ Products.d.code }">
				<MvASSIGN NAME = "l.product_name" VALUE = "{ Products.d.name }">

				<MvASSIGN NAME = "l.lastoffset" VALUE = "{ l.nextoffset }">

				<MvIF EXPR = "{ g.Category_Product_Show EQ 'All' }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Product_FindNext_All( l.nextoffset, g.Category_Product_Search ) }">
				</MvIF>

				<MvIF EXPR = "{ g.Category_Product_Show EQ 'Unassigned' }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Category_Product_FindNext_Unassigned( Categories.d.id, l.nextoffset, g.Category_Product_Search ) }">
				</MvIF>

				<MvIF EXPR = "{ g.Category_Product_Show EQ 'Assigned' }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Category_Product_FindNext_Assigned( Categories.d.id, l.nextoffset, g.Category_Product_Search ) }">
				</MvIF>

				<MvASSIGN NAME = "l.shown" VALUE = "{ l.shown + 1 }">

				<MvIF EXPR = "{ ( l.shown MOD 2 ) EQ 0 }">
					<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffdd">
				<MvELSE>
					<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffff">
				</MvIF>

				<TR><TD ALIGN = "center" BGCOLOR = "{ l.bgcolor }" VALIGN = "top">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvIF EXPR = "{ l.can_modify }">
						<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckboxModAlert( l.assigned, 'Category_Product_Assigned[' $ l.shown $ ']', 'Yes', '' ) }">
					<MvELSE>
						<MvEVAL EXPR = "{ DrawCheck_Assigned( l.assigned ) }">
					</MvIF>
					</FONT>
				</TD>

				<MvIF EXPR = "{ ( g.Category_Product_Show EQ 'Assigned' ) AND ( len( g.Category_Product_Search ) EQ 0 ) AND l.can_modify }">
					<TD BGCOLOR = "{ l.bgcolor }" NOWRAP  VALIGN = "top">
						<MvIF EXPR = "{ len( l.last_product_code ) OR ( ( l.shown LT g.Category_Product_Display ) AND l.nextoffset ) }">
							<MvIF EXPR = "{ len( l.last_product_code ) }">
								<MvLOCALIZED NAME = "l.alt_text" ID = "MER-ADM-00811">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Up</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<A HREF = "{ 'JavaScript:SwapProducts( \'' $ JavaScriptEncode( l.last_product_code ) $ '\', \'' $ JavaScriptEncode( l.product_code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_u.gif' }"></A>
							<MvELSE>
								<IMG BORDER = 0 WIDTH = 11 HEIGHT = 23 SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }">
							</MvIF>

							<MvIF EXPR = "{ ( l.shown LT g.Category_Product_Display ) AND l.nextoffset }">
								<MvLOCALIZED NAME = "l.alt_text" ID = "MER-ADM-00812">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Down</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<A HREF = "{ 'JavaScript:SwapProducts( \'' $ JavaScriptEncode( l.product_code ) $ '\', \'' $ JavaScriptEncode( Products.d.code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_d.gif' }"></A>
							</MvIF>
						<MvELSE>
							&nbsp;
						</MvIF>
					</TD>
				</MvIF>

				<TD BGCOLOR = "{ l.bgcolor }"  VALIGN = "top">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "hidden" NAME = "{ 'Category_Product[' $ l.shown $ ']' }" VALUE = "{ encodeentities( l.product_code ) }">
					<MvEVAL EXPR = "{ encodeentities( l.product_code ) }">
					</FONT>
				</TD><TD BGCOLOR = "{ l.bgcolor }" WIDTH = "100%" VALIGN = "top">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ encodeentities( l.product_name ) }">
					</FONT>
				</TD><TD ALIGN = "right" BGCOLOR = "{ l.bgcolor }" NOWRAP VALIGN = "top">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<A HREF = "{ g.sessionurl $ 'Screen=PROD&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Edit_Product=' $ encodeattribute( l.product_code ) }"><MvEVAL EXPR = "{ DrawImgButton_Edit('0') }"></A>
					</FONT>
				</TD></TR>

				<MvASSIGN NAME = "l.last_product_code" VALUE = "{ l.product_code }">
			</MvWHILE>

			<MvIF EXPR = "{ ( g.Category_Product_Show EQ 'Assigned' ) AND ( len( g.Category_Product_Search ) EQ 0 ) }">
				<MvASSIGN NAME = "l.colspan" VALUE = 4>
			<MvELSE>
				<MvASSIGN NAME = "l.colspan" VALUE = 3>
			</MvIF>

			<TR><TD BGCOLOR = "#000080" ALIGN = "left" VALIGN = "middle" NOWRAP>
				<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
				<MvHIDE FIELDS = "g.Category_Product_Stack, g.Category_Product_Offset">

				<MvIF EXPR = "{ g.Category_Product_Show EQ 'All' }">
					<MvIF EXPR = "{ l.shown }">
						<B><MvEVAL EXPR = "{ g.Category_Product_Offset + 1 }">-<MvEVAL EXPR = "{ l.lastoffset }"></B>
					<MvELSE>
						<B>0-0</B>
					</MvIF>
				<MvELSE>
					<MvEVAL EXPR = "{ Show_BoldNA() }">
				</MvIF>
				</FONT>
			</TD><TD BGCOLOR = "#000080" ALIGN = "right" VALIGN = "middle" COLSPAN = "{ l.colspan }">
				<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
				<MvIF EXPR = "{ len( g.Category_Product_Stack ) }">
					<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListPrevious( \'Category_Product_Offset\', \'Category_Product_Stack\' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Previous('0') }"><MvEVAL EXPR = "</A>">
				</MvIF>

				 <INPUT TYPE = "text" NAME = "Category_Product_Display" VALUE = "{ encodeentities( g.Category_Product_Display ) }" SIZE = 5> <A HREF = "JavaScript:ListReload( 'Category_Product_Offset', 'Category_Product_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Refresh('0') }"></A>
				 <INPUT TYPE = "hidden" NAME = "Category_Product_Count" VALUE = "{ encodeentities( l.shown ) }">

				 <MvIF EXPR = "{ l.nextoffset }">
					<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListNext( \'Category_Product_Offset\', \'Category_Product_Stack\', ' $ l.lastoffset $ ' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Next('0') }"><MvEVAL EXPR = "</A>">
				 </MvIF>
				</FONT>
			</TD></TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Category_Product_Stack, g.Category_Product_Search, g.Category_Product_Show, g.Category_Product_Offset, g.Category_Product_Display">
		</MvIF>

		<MvEVAL EXPR = "{ EndContent() }">

		<MvIF EXPR = "{ len( g.Edit_Category ) }">
			<MvEVAL EXPR = "{ DrawButtons_NextPrevious( 'UCGY:[UPDATE]:CTGY:0:1:0,DCGY:[DELETE]:CTGY:0:0:1', g.Edit_Category ) }">
		<MvELSE>
			<MvEVAL EXPR = "{ DrawButtons( 'ICGY:[ADD]:CTGY:1:0:0' ) }">
		</MvIF>

		<MvEVAL EXPR = "{ EndScreen() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Products
|
</MvCOMMENT>

<MvFUNCTION NAME = "Product_Batch_Validate">
	<MvASSIGN NAME = "g.Product_Display_Flag" VALUE = "0">

	<MvIF EXPR = "{ NOT len( g.Product_Show_Code $ g.Product_Show_Name $ g.Product_Show_Price $
					g.Product_Show_Cost $ g.Product_Show_Weight $ g.Product_Show_Description $
					g.Product_Show_Taxable $ g.Product_Show_Thumbnail $ g.Product_Show_Image ) }">

		<MvASSIGN NAME = "g.Product_Display_Flag" VALUE = "1">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Product_BatchEdit_Validate">
	<MvASSIGN NAME = "g.Product_Code" VALUE = "{ ltrim( rtrim( g.Product_Code ) ) }">
	<MvASSIGN NAME = "g.Product_Name" VALUE = "{ ltrim( rtrim( g.Product_Name ) ) }">
	<MvASSIGN NAME = "g.Product_Thumbnail" VALUE = "{ ltrim( rtrim( g.Product_Thumbnail ) ) }">
	<MvASSIGN NAME = "g.Product_Image" VALUE = "{ ltrim( rtrim( g.Product_Image ) ) }">
	<MvASSIGN NAME = "g.Product_Price" VALUE = "{ ltrim( rtrim( g.Product_Price ) ) }">
	<MvASSIGN NAME = "g.Product_Cost" VALUE = "{ ltrim( rtrim( g.Product_Cost ) ) }">
	<MvASSIGN NAME = "g.Product_Weight" VALUE = "{ ltrim( rtrim( g.Product_Weight ) ) }">

	<MvIF EXPR = "{ NOT Validate_Code( g.Product_Code ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PRDS', 'Product_Code', g.Validation_Message ) }">
	<MvELSE>
		<MvIF EXPR = "{ ( len( g.Edit_Product ) EQ 0 ) OR ( toupper( g.Edit_Product ) NE toupper( g.Product_Code ) ) }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Product_Find_Code( g.Product_Code ) }">
			<MvIF EXPR = "{ l.found }">
				<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00374">
					<MvLOCALIZED-TOKEN NAME = "product" VALUE = "{ g.Product_Code }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">A product with the code '%product%' already exists</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PRDS', 'Product_Code', l.error_message ) }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ len( g.Product_Name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00375">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a product name</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PRDS', 'Product_Name', l.error_message ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_Currency_NonNegative_Optional( g.Product_Price ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PRDS', 'Product_Price', g.Validation_Message ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_Currency_NonNegative_Optional( g.Product_Cost ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PRDS', 'Product_Cost', g.Validation_Message ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_FloatingPoint_NonNegative_Optional( g.Product_Weight ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PRDS', 'Product_Weight', g.Validation_Message ) }">
	</MvIF>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
	<MvWHILE EXPR = "{ l.found }">
		<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_version" VALUE = "{ Module_API_Version() }">
		<MvIF EXPR = "{ l.module_version }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_valid" VALUE = "{ Module_Product_BatchEdit_Validate() }">
			<MvIF EXPR = "{ NOT l.module_valid }">
				<MvFUNCTIONRETURN VALUE = 0>
			</MvIF>
		</MvIF>

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
	</MvWHILE>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Product_BatchEdit">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvASSIGN NAME = "l.valid" VALUE = 1>

	<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'PROD', 0, 0, 1, 0 ) }">
	<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'PROD', 0, 0, 0, 1 ) }">
	<MvASSIGN NAME = "l.modified"	VALUE = 0>

	<MvIF EXPR = "{ len( g.Edit_Product ) AND ( l.can_modify OR l.can_delete ) }">
		<MvASSIGN NAME = "l.valid" VALUE = "{ Product_BatchEdit_Validate() }">
	</MvIF>

	<MvIF EXPR = "{ l.valid }">
		<MvIF EXPR = "{ l.ok }">
			<MvIF EXPR = "{ len( g.Edit_Product ) AND l.can_modify }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Find_Code( g.Edit_Product ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Update( Products.d.id, g.Product_Code,
																							 g.Product_Name, g.Product_Thumbnail,
																							 g.Product_Image, g.Product_Price,
																							 g.Product_Cost, g.Product_Description,
																							 g.Product_Weight, g.Product_Taxable,
																							 g.Product_Active ) }">
					<MvIF EXPR = "{ l.ok }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
						<MvWHILE EXPR = "{ l.found }">
							<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_version" VALUE = "{ Module_API_Version() }">
							<MvIF EXPR = "{ l.module_version }">
								<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_valid" VALUE = "{ Module_Product_BatchEdit_Update( Products.d.id ) }">
								<MvIF EXPR = "{ NOT l.module_valid }">
									<MvFUNCTIONRETURN VALUE = 0>
								</MvIF>
							</MvIF>

							<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
						</MvWHILE>
					</MvIF>
					<MvASSIGN NAME = "l.modified" VALUE = 1>
				</MvIF>
				
			<MvELSE>
				<MvASSIGN NAME = "l.product" VALUE = 1>
				<MvWHILE EXPR = "{ l.ok AND ( l.product LE g.Product_Count ) AND l.can_delete }">
					<MvIF EXPR = "{ g.Product_Remove[ l.product ] }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Find_Code( g.Product_Code[ l.product ] ) }">
						<MvIF EXPR = "{ l.ok }">
							<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
							<MvWHILE EXPR = "{ l.ok AND l.found }">
								<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Product_Delete( Products.d.id ) }">
								<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
							</MvWHILE>

							<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Delete( Products.d.id ) }">
							<MvASSIGN NAME = "l.modified" VALUE = 1>
						</MvIF>
					</MvIF>

					<MvASSIGN NAME = "l.product" VALUE = "{ l.product + 1 }">
				</MvWHILE>
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvIF EXPR = "{ l.modified }">
				<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00382">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Products updated</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			<MvELSE>
				<MvASSIGN NAME = "g.Message" VALUE = "">
			</MvIF>
			<MvASSIGN NAME = "g.Edit_Product" VALUE = "">

			<MvEVAL EXPR = "{ Update_LeftNavigation() }">
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Product_BatchSort">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'PROD', 0, 0, 1, 0 ) }">

	<MvIF EXPR = "{ len( g.Swap_Product_1 ) AND len( g.Swap_Product_2 ) AND l.can_modify }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Find_Code( g.Swap_Product_1 ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "l.id_1" VALUE = "{ Products.d.id }">
			<MvASSIGN NAME = "l.order_1" VALUE = "{ Products.d.order }">

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Find_Code( g.Swap_Product_2 ) }">
			<MvIF EXPR = "{ l.ok }">
				<MvASSIGN NAME = "l.id_2" VALUE = "{ Products.d.id }">
				<MvASSIGN NAME = "l.order_2" VALUE = "{ Products.d.order }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Update_Order( l.id_1, l.order_2 ) }">
			<MvASSIGN NAME = "l.modified" VALUE = 1>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Update_Order( l.id_2, l.order_1 ) }">
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00383">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Products swapped</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Product_Sort AND l.can_modify }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Sort( g.Product_Sort_By, g.Product_Sort_Ascending ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00384">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Products sorted</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "g.Edit_Product" VALUE = "">
		<MvEVAL EXPR = "{ Update_LeftNavigation() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Product_BatchEdit" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'PROD', 0, 1, 0, 0 ) }">
	<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'PROD', 0, 0, 1, 0 ) }">
	<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'PROD', 0, 0, 0, 1 ) }">

	<MvIF EXPR = "{ NOT g.Have_List_Fields }">
		<MvASSIGN NAME = "g.Product_Stack" VALUE = "">
		<MvASSIGN NAME = "g.Product_Search" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show" VALUE = "All">
		<MvASSIGN NAME = "g.Product_Offset" VALUE = 0>
		<MvASSIGN NAME = "g.Product_Display" VALUE = "{ g.Admin_User_PageLen }">

		<MvASSIGN NAME = "g.Product_Show_Code" VALUE = "Yes">
		<MvASSIGN NAME = "g.Product_Show_Name" VALUE = "Yes">
		<MvASSIGN NAME = "g.Product_Show_Price" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show_Cost" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show_Weight" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show_Description" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show_Taxable" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show_Thumbnail" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show_Image" VALUE = "">
		<MvASSIGN NAME = "g.Product_Show_Active" VALUE = "">

		<MvASSIGN NAME = "g.Product_Sort" VALUE = "0">
		<MvASSIGN NAME = "g.Product_Sort_By" VALUE = "name">
		<MvASSIGN NAME = "g.Product_Sort_Ascending" VALUE = "1">

		<MvASSIGN NAME = "g.RelatedProduct_Show" VALUE = "All">
	<MvELSE>
		<MvASSIGN NAME = "g.Product_Display" VALUE = "{ int( g.Product_Display ) }">
		<MvIF EXPR = "{ g.Product_Display LT 1 }">
			<MvASSIGN NAME = "g.Product_Display" VALUE = 1>
		</MvIF>
	</MvIF>

	<MvASSIGN NAME = "l.valid" VALUE = "{ Product_Batch_Validate() }">

	<MvIF EXPR = "{ g.Product_Display_Flag }">
		<MvASSIGN NAME = "g.Product_Show_Code" VALUE = "Yes">
	</MvIF>

	<MvLOCALIZED NAME = "l.screen_label" ID = "MER-ADM-00385">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Products</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvEVAL EXPR = "{ BeginScreen( l.screen_label, 'PBED', 'Help:pbed.html' ) }">
	<INPUT TYPE = "hidden" NAME = "Have_List_Fields" VALUE = "1">

	<MvLOCALIZED NAME = "l.tab_list" ID = "MER-ADM-00386">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">PRDS:Products</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvEVAL EXPR = "{ DrawTabs( 'PRDS', l.tab_list ) }">

	<MvEVAL EXPR = "{ BeginContent() }">

	<MvLOCALIZED ID = "MER-ADM-00788">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				<SCRIPT LANGUAGE = "JavaScript">
			<!--
			var text = 'Sorting items cannot be undone by pressing the reset button.\n\nContinue?';
			//-->
				</SCRIPT>
		</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<SCRIPT LANGUAGE = "JavaScript">
<!--
function EditProduct( prod_code )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Screen' ].value = Screen;
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Edit_Product' ].value = unescape( prod_code );
		document.forms[ Screen ].elements[ 'Action' ].value = '';
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
		document.forms[ Screen ].submit();
	}
}

function SwapProducts( prod_code1, prod_code2 )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Action' ].value = 'PSRT';
		document.forms[ Screen ].elements[ 'Screen' ].value = Screen;
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Swap_Product_1' ].value = unescape( prod_code1 );
		document.forms[ Screen ].elements[ 'Swap_Product_2' ].value = unescape( prod_code2 );
		document.forms[ Screen ].submit();
	}
}

function SortProducts( key )
{
	if ( CheckModified() )
	{
		if ( confirm( text ) )
		{
			document.forms[ Screen ].elements[ 'Product_Sort' ].value = '1';
			document.forms[ Screen ].elements[ 'Action' ].value = 'PSRT';
			if ( key == 'aname')
			{
					document.forms[ Screen ].elements[ 'Product_Sort_By' ].value = 'name';
					document.forms[ Screen ].elements[ 'Product_Sort_Ascending' ].value = '1';
			}
			else
				if ( key == 'dname' )
				{
					document.forms[ Screen ].elements[ 'Product_Sort_By' ].value = 'name';
					document.forms[ Screen ].elements[ 'Product_Sort_Ascending' ].value = '0';
				}
				else
					if ( key == 'acode')
					{
						document.forms[ Screen ].elements[ 'Product_Sort_By' ].value = 'code';
						document.forms[ Screen ].elements[ 'Product_Sort_Ascending' ].value = '1';
					}
					else
						if ( key == 'dcode')
						{
							document.forms[ Screen ].elements[ 'Product_Sort_By' ].value = 'code';
							document.forms[ Screen ].elements[ 'Product_Sort_Ascending' ].value = '0';
						}
						else
						{
							document.forms[ Screen ].elements[ 'Product_Sort' ].value = '0';
						}
			document.forms[ Screen ].submit();
		}
	}
}

//-->
	</SCRIPT>
	<MvIF EXPR = "{ g.Tab EQ 'PRDS' }">
		<INPUT TYPE = "hidden" NAME = "Swap_Product_1" VALUE = "">
		<INPUT TYPE = "hidden" NAME = "Swap_Product_2" VALUE = "">

		<MvHIDE FIELDS = "g.Edit_Product">

		<INPUT TYPE = "hidden" NAME = "Product_Sort" VALUE = "">
		<INPUT TYPE = "hidden" NAME = "Product_Sort_By" VALUE = "">
		<INPUT TYPE = "hidden" NAME = "Product_Sort_Ascending" VALUE = "">

		<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
		<TR><TD ALIGN = "left" VALIGN = "middle" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvHIDE FIELDS = "g.Product_Show">
			<A HREF = "JavaScript:ListReloadField( 'Product_Offset', 'Product_Stack', 'Product_Show', 'All' );"><MvEVAL EXPR = "{ DrawImgButton_All( g.Product_Show EQ 'All' ) }"></A>

			<A HREF = "JavaScript:ListReloadField( 'Product_Offset', 'Product_Stack', 'Product_Show', 'Uncategorized' );"><MvEVAL EXPR = "{ DrawImgButton_Uncategorized( g.Product_Show EQ 'Uncategorized' ) }"></A>
			</FONT>
		</TD><TD ALIGN = "right" VALIGN = "middle" WIDTH = "100%">
			&nbsp;
		</TD><TD ALIGN = "right" VALIGN = "middle">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
			<MvLOCALIZED ID = "MER-ADM-00387">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Search:</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvASSIGN NAME = "g.Product_Search" VALUE = "{ ltrim( rtrim( g.Product_Search ) ) }">
			<INPUT TYPE = "text" NAME = "Product_Search" VALUE = "{ g.Product_Search }" SIZE = 20>
			<A HREF = "JavaScript:ListReload( 'Product_Offset', 'Product_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Search(0) }"></A>
			</FONT>
		</TD></TR>

		<TR><TD ALIGN = "left" VALIGN = "top">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
			<MvLOCALIZED  ID = "MER-ADM-00940">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Display:</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD><TD ALIGN = "left" VALIGN = "middle" COLSPAN = 3>
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
			<TR><TD ALIGN = "left">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00389">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Code, 'Product_Show_Code', 'Yes', l.text ) }">
				</FONT>
			</TD><TD ALIGN = "left">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00390">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Name, 'Product_Show_Name', 'Yes', l.text ) }">
				</FONT>
			</TD><TD ALIGN = "left">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00391">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Price</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Price, 'Product_Show_Price', 'Yes', l.text ) }">
				</FONT>
			</TD></TR>

			<TR><TD ALIGN = "left">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00392">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Cost</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Cost, 'Product_Show_Cost', 'Yes', l.text ) }">
				</FONT>
			</TD><TD ALIGN = "left">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00393">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Weight</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Weight, 'Product_Show_Weight', 'Yes', l.text ) }">
				</FONT>
			</TD><TD ALIGN = "left">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00394">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Description</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Description, 'Product_Show_Description', 'Yes', l.text ) }">
				</FONT>
			</TD></TR>

			<TR><TD ALIGN = "left">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00395">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Taxable</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Taxable, 'Product_Show_Taxable', 'Yes', l.text ) }">
				</FONT>
			</TD><TD ALIGN = "left">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00396">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Thumbnail Image</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Thumbnail, 'Product_Show_Thumbnail', 'Yes', l.text ) }">
				</FONT>
			</TD><TD ALIGN = "left">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00397">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Full-sized Image</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Image, 'Product_Show_Image', 'Yes', l.text ) }">
				</FONT>
			</TD></TR>
			<TR><TD ALIGN = "left">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00941">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Active</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Show_Active, 'Product_Show_Active', 'Yes', l.text ) }">
				</FONT>
			</TD></TR>
			</TABLE>
		</TD></TR>

		<MvIF EXPR = "{ ( g.Product_Show EQ 'All' ) AND ( len( g.Product_Search ) EQ 0 ) AND l.can_modify }">
			<TR><TD ALIGN = "left" VALIGN = "top">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00398">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Sort:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD ALIGN = "left" VALIGN = "middle" COLSPAN = 3>
				<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
				<TR><TD ALIGN = "left">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<A HREF = "JavaScript:SortProducts( 'aname' )">
					<MvLOCALIZED ID = "MER-ADM-00399">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name Ascending</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</A>
					</FONT>
				</TD><TD ALIGN = "left">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<A HREF = "JavaScript:SortProducts( 'dname' )">
					<MvLOCALIZED ID = "MER-ADM-00400">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name Descending</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</A>
					</FONT>
				</TD></TR>
				<TR><TD ALIGN = "left">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<A HREF = "JavaScript:SortProducts( 'acode' )">
					<MvLOCALIZED ID = "MER-ADM-00401">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code Ascending</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</A>
					</FONT>
				</TD><TD ALIGN = "left">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<A HREF = "JavaScript:SortProducts( 'dcode' )">
					<MvLOCALIZED ID = "MER-ADM-00402">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code Descending</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</A>
					</FONT>
				</TD></TR>
				</TABLE>
			</TD></TR>
		</MvIF>
		</TABLE>

		<MvASSIGN NAME = "l.columns" VALUE = 0>

		<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
		<TR>

		<MvIF EXPR = "{ len( g.Edit_Product ) EQ 0 AND l.can_delete }">
			<TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080" NOWRAP>			
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00403">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Remove</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>

				<MvIF EXPR = "{ l.can_delete }">
					<MvASSIGN NAME = "l.ok" VALUE = "{ Screen_CheckAll( 'Product_Remove' ) }">
				</MvIF>
			</TD>                                 

			<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
		</MvIF>

		<MvIF EXPR = "{ ( g.Product_Show EQ 'All' ) AND ( len( g.Product_Search ) EQ 0 ) AND l.can_modify }">
			<TD BGCOLOR = "#000080">
				&nbsp;
			</TD>

			<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Code }">
			<TD BGCOLOR = "#000080">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00404">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD>

			<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Name }">
			<TD BGCOLOR = "#000080" WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00405">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Name</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD>

			<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Price }">
			<TD BGCOLOR = "#000080" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00406">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Price</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD>

			<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Cost }">
			<TD BGCOLOR = "#000080" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00407">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Cost</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD>

			<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Weight }">
			<TD BGCOLOR = "#000080" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00408">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Weight</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD>

			<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Description }">
			<TD BGCOLOR = "#000080">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00409">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Description</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD>

			<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Taxable }">
			<TD BGCOLOR = "#000080">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00410">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Taxable</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD>

			<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Thumbnail }">
			<TD BGCOLOR = "#000080">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00411">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Thumbnail Image</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD>

			<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Image }">
			<TD BGCOLOR = "#000080">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00412">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Full-sized Image</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD>

			<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show_Active }">
			<TD BGCOLOR = "#000080">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00950">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Active</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD>

			<MvASSIGN NAME = "l.columns" VALUE = "{ l.columns + 1 }">
		</MvIF>

		<TD ALIGN = "right" BGCOLOR = "#000080" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff">
			<MvIF EXPR = "{ l.can_add }">
				<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00413">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">New Product</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<A HREF = "{ g.sessionurl $ 'Screen=PROD&Store_Code=' $ encodeattribute( g.Store_Code ) }">
				<MvEVAL EXPR = "{ DrawImgButton_NewX( 0, l.alt ) }"></A>
			<MvELSE>
				&nbsp;
			</MvIF>
			</FONT>
		</TD></TR>

		<MvASSIGN NAME = "l.shown" VALUE = 0>
		<MvASSIGN NAME = "l.lastoffset" VALUE = 0>
		<MvASSIGN NAME = "l.last_product_code" VALUE = "">

		<MvIF EXPR = "{ g.Product_Show EQ 'All' }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Product_FindOffset_All( g.Product_Offset, g.Product_Search ) }">
		</MvIF>

		<MvIF EXPR = "{ g.Product_Show EQ 'Uncategorized' }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Product_FindOffset_Uncategorized( g.Product_Offset, g.Product_Search ) }">
		</MvIF>

		<MvWHILE EXPR = "{ ( l.shown LT g.Product_Display ) AND l.nextoffset }">
			<MvASSIGN NAME = "l.product_code" VALUE = "{ Products.d.code }">
			<MvASSIGN NAME = "l.product_id" VALUE = "{ Products.d.id }">
			<MvASSIGN NAME = "l.product_name" VALUE = "{ Products.d.name }">
			<MvASSIGN NAME = "l.product_price" VALUE = "{ Products.d.price }">
			<MvASSIGN NAME = "l.product_cost" VALUE = "{ Products.d.cost }">
			<MvASSIGN NAME = "l.product_weight" VALUE = "{ Products.d.weight }">
			<MvASSIGN NAME = "l.product_desc" VALUE = "{ Products.d.desc }">
			<MvASSIGN NAME = "l.product_taxable" VALUE = "{ Products.d.taxable }">
			<MvASSIGN NAME = "l.product_thumbnail" VALUE = "{ Products.d.thumbnail }">
			<MvASSIGN NAME = "l.product_image" VALUE = "{ Products.d.image }">
			<MvASSIGN NAME = "l.product_active" VALUE = "{ Products.d.active }">

			<MvASSIGN NAME = "l.lastoffset" VALUE = "{ l.nextoffset }">

			<MvIF EXPR = "{ g.Product_Show EQ 'All' }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Product_FindNext_All( l.nextoffset, g.Product_Search ) }">
			</MvIF>

			<MvIF EXPR = "{ g.Product_Show EQ 'Uncategorized' }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.nextoffset" VALUE = "{ Product_FindNext_Uncategorized( l.nextoffset, g.Product_Search ) }">
			</MvIF>

			<MvASSIGN NAME = "l.shown" VALUE = "{ l.shown + 1 }">

			<MvIF EXPR = "{ ( l.shown MOD 2 ) EQ 0 }">
				<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffdd">
			<MvELSE>
				<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffff">
			</MvIF>

			<TR>
			<MvIF EXPR = "{ ( len( g.Edit_Product ) NE 0 ) AND ( g.Edit_Product EQ l.product_code ) }">
				<MvIF EXPR = "{ NOT g.Data_Entry_Error }">
					<MvASSIGN NAME = "g.Product_Code" VALUE = "{ l.product_code }">
					<MvASSIGN NAME = "g.Product_Name" VALUE = "{ l.product_name }">
					<MvASSIGN NAME = "g.Product_Price" VALUE = "{ l.product_price }">
					<MvASSIGN NAME = "g.Product_Cost" VALUE = "{ l.product_cost }">
					<MvASSIGN NAME = "g.Product_Weight" VALUE = "{ l.product_weight }">
					<MvASSIGN NAME = "g.Product_Description" VALUE = "{ l.product_desc }">
					<MvASSIGN NAME = "g.Product_Taxable" VALUE = "{ l.product_taxable }">
					<MvASSIGN NAME = "g.Product_Thumbnail" VALUE = "{ l.product_thumbnail }">
					<MvASSIGN NAME = "g.Product_Image" VALUE = "{ l.product_image }">
					<MvASSIGN NAME = "g.Product_Active" VALUE = "{ l.product_active }">

				</MvIF>

				<MvIF EXPR = "{ ( g.Product_Show EQ 'All' ) AND ( len( g.Product_Search ) EQ 0 ) }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
						<MvIF EXPR = "{ l.can_modify }">
							<MvIF EXPR = "{ len( l.last_product_code ) OR ( ( l.shown LT g.Product_Display ) AND l.nextoffset ) }">
								<MvIF EXPR = "{ len( l.last_product_code ) }">
								<MvLOCALIZED NAME = "l.alt_text" ID = "MER-ADM-00813">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Up</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
									<A HREF = "{ 'JavaScript:SwapProducts( \'' $ JavaScriptEncode( l.last_product_code ) $ '\', \'' $ JavaScriptEncode( l.product_code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_u.gif' }"></A>
								<MvELSE>
									<IMG BORDER = 0 WIDTH = 11 HEIGHT = 23 SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }">
								</MvIF>

								<MvIF EXPR = "{ ( l.shown LT g.Product_Display ) AND l.nextoffset }">
								<MvLOCALIZED NAME = "l.alt_text" ID = "MER-ADM-00814">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Down</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
									<A HREF = "{ 'JavaScript:SwapProducts( \'' $ JavaScriptEncode( l.product_code ) $ '\', \'' $ JavaScriptEncode( Products.d.code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_d.gif' }"></A>
								</MvIF>
							<MvELSE>
								&nbsp;
							</MvIF>
						<MvELSE>
							&nbsp;
						</MvIF>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Code }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" SIZE = 15 NAME = "Product_Code" VALUE = "{ encodeentities( g.Product_Code ) }" ONCHANGE = "SetModified();">
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Name }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" SIZE = 30 NAME = "Product_Name" VALUE = "{ encodeentities( g.Product_Name ) }" ONCHANGE = "SetModified();">
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Price }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" ALIGN = "right">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" SIZE = 10 NAME = "Product_Price" VALUE = "{ encodeentities( g.Product_Price ) }" ONCHANGE = "SetModified();">
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Cost }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" ALIGN = "right">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" SIZE = 10 NAME = "Product_Cost" VALUE = "{ encodeentities( g.Product_Cost ) }" ONCHANGE = "SetModified();">
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Weight }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" ALIGN = "right">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" SIZE = 10 NAME = "Product_Weight" VALUE = "{ encodeentities( g.Product_Weight ) }" ONCHANGE = "SetModified();">
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Description }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<TEXTAREA NAME = "Product_Description" ROWS = 5 COLS = 58 WRAP = "off" ONCHANGE = "SetModified();"><MIVA STANDARDOUTPUTLEVEL = "text, html"><MvEVAL EXPR = "{ encodeentities( g.Product_Description ) }"><MIVA STANDARDOUTPUTLEVEL = "text, html, compresswhitespace"></TEXTAREA>
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Taxable }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" ALIGN = "center">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ g.Product_Taxable }">
							<INPUT TYPE = "checkbox" NAME = "Product_Taxable" VALUE = "Yes" CHECKED ONCLICK = "SetModified();">
						<MvELSE>
							<INPUT TYPE = "checkbox" NAME = "Product_Taxable" VALUE = "Yes" ONCLICK = "SetModified();">
						</MvIF>
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Thumbnail }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" SIZE = 40 NAME = "Product_Thumbnail" VALUE = "{ encodeentities( g.Product_Thumbnail ) }" ONCHANGE = "SetModified();">
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Image }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" SIZE = 40 NAME = "Product_Image" VALUE = "{ encodeentities( g.Product_Image ) }" ONCHANGE = "SetModified();">
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Active }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ g.Product_Active }">
							<INPUT TYPE = "checkbox" NAME = "Product_Active" VALUE = "Yes" CHECKED ONCLICK = "SetModified();">
						<MvELSE>
							<INPUT TYPE = "checkbox" NAME = "Product_Active" VALUE = "Yes" ONCLICK = "SetModified();">
						</MvIF>
						</FONT>
					</TD>
				</MvIF>

				<TD ALIGN = "right" VALIGN = "top" BGCOLOR = "{ l.bgcolor }" WIDTH = "100%" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">

					<MvIF EXPR = "{ NOT g.Product_Show_Code }">
						<MvHIDE FIELDS = "g.Product_Code">
					</MvIF>

					<MvIF EXPR = "{ NOT g.Product_Show_Name }">
						<MvHIDE FIELDS = "g.Product_Name">
					</MvIF>

					<MvIF EXPR = "{ NOT g.Product_Show_Price }">
						<MvHIDE FIELDS = "g.Product_Price">
					</MvIF>

					<MvIF EXPR = "{ NOT g.Product_Show_Cost }">
						<MvHIDE FIELDS = "g.Product_Cost">
					</MvIF>

					<MvIF EXPR = "{ NOT g.Product_Show_Weight }">
						<MvHIDE FIELDS = "g.Product_Weight">
					</MvIF>

					<MvIF EXPR = "{ NOT g.Product_Show_Description }">
						<MvHIDE FIELDS = "g.Product_Description">
					</MvIF>

					<MvIF EXPR = "{ NOT g.Product_Show_Taxable }">
						<MvHIDE FIELDS = "g.Product_Taxable">
					</MvIF>

					<MvIF EXPR = "{ NOT g.Product_Show_Thumbnail }">
						<MvHIDE FIELDS = "g.Product_Thumbnail">
					</MvIF>

					<MvIF EXPR = "{ NOT g.Product_Show_Image }">
						<MvHIDE FIELDS = "g.Product_Image">
					</MvIF>

					<MvIF EXPR = "{ NOT g.Product_Show_Active }">
						<MvHIDE FIELDS = "g.Product_Active">
					</MvIF>

					<A HREF = "JavaScript:EditProduct( '' );"><MvEVAL EXPR = "{ DrawImgButton_EditHere('1') }"></A>
					<A HREF = "{ g.sessionurl $ 'Screen=PROD&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Edit_Product=' $ encodeattribute( l.product_code ) }"><MvEVAL EXPR = "{ DrawImgButton_Edit('0') }"></A>
					</FONT>
				</TD></TR>
			<MvELSE>
				<MvIF EXPR = "{ len( g.Edit_Product ) EQ 0 AND l.can_delete }">
					<TD VALIGN = "top" ALIGN = "center" BGCOLOR = "{ l.bgcolor }">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "hidden" NAME = "{ 'Product_Code[' $ l.shown $ ']' }" VALUE = "{ encodeentities( l.product_code ) }">
						<INPUT TYPE = "checkbox" NAME = "{ 'Product_Remove[' $ l.shown $ ']' }" VALUE = "Yes" ONCLICK = "SetModified();">
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ ( g.Product_Show EQ 'All' ) AND ( len( g.Product_Search ) EQ 0 ) AND l.can_modify }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
						<MvIF EXPR = "{ len( l.last_product_code ) OR ( ( l.shown LT g.Product_Display ) AND l.nextoffset ) AND l.can_modify }">
							<MvIF EXPR = "{ len( l.last_product_code ) }">
								<MvLOCALIZED NAME = "l.alt_text" ID = "MER-ADM-00815">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Up</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<A HREF = "{ 'JavaScript:SwapProducts( \'' $ JavaScriptEncode( l.last_product_code ) $ '\', \'' $ JavaScriptEncode( l.product_code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_u.gif' }"></A>
							<MvELSE>
								<IMG BORDER = 0 WIDTH = 11 HEIGHT = 23 SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }">
							</MvIF>

							<MvIF EXPR = "{ ( l.shown LT g.Product_Display ) AND l.nextoffset }">
								<MvLOCALIZED NAME = "l.alt_text" ID = "MER-ADM-00816">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Down</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<A HREF = "{ 'JavaScript:SwapProducts( \'' $ JavaScriptEncode( l.product_code ) $ '\', \'' $ JavaScriptEncode( Products.d.code ) $ '\' );'}"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_d.gif' }"></A>
							</MvIF>
						<MvELSE>
							&nbsp;
						</MvIF>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ len( g.Product_Show_Code ) }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ encodeentities( l.product_code ) }">
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Name }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ len( l.product_name ) }">
							<MvEVAL EXPR = "{ encodeentities( l.product_name ) }">
						<MvELSE>
							&nbsp;
						</MvIF>
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ len( g.Product_Show_Price ) }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" ALIGN = "right">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ encodeentities( l.product_price ) }">
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ len( g.Product_Show_Cost ) }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" ALIGN = "right">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ encodeentities( l.product_cost ) }">
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ len( g.Product_Show_Weight ) }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" ALIGN = "right">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ encodeentities( l.product_weight ) }">
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Description }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" WIDTH = "100%">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ len( l.product_desc ) }">
							<MvEVAL EXPR = "{ encodeentities( l.product_desc ) }">
						<MvELSE>
							&nbsp;
						</MvIF>
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Taxable }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" ALIGN = "center">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ DrawCheck_Taxable( l.product_taxable ) }">
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Thumbnail }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ len( l.product_thumbnail ) }">
							<MvEVAL EXPR = "{ encodeentities( l.product_thumbnail ) }">
						<MvELSE>
							&nbsp;
						</MvIF>
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Image }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ len( l.product_image ) }">
							<MvEVAL EXPR = "{ encodeentities( l.product_image ) }">
						<MvELSE>
							&nbsp;
						</MvIF>
						</FONT>
					</TD>
				</MvIF>

				<MvIF EXPR = "{ g.Product_Show_Active }">
					<TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ DrawCheck_Active( l.product_active ) }">
						</FONT>
					</TD>
				</MvIF>

				<TD ALIGN = "right" VALIGN = "top" BGCOLOR = "{ l.bgcolor }" WIDTH = "100%" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvIF EXPR = "{ l.can_modify }">
						<MvEVAL EXPR = "{ '<A HREF = "JavaScript:EditProduct( \'' $ encodeattribute(encodeattribute(encodeattribute(JavaScriptEncode( l.product_code )))) $ '\' );">' }"><MvEVAL EXPR = "{ DrawImgButton_EditHere('0') }"><MvEVAL EXPR = "</A>">
					</MvIF>
					<A HREF = "{ g.sessionurl $ 'Screen=PROD&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Edit_Product=' $ encodeattribute( l.product_code ) }"><MvEVAL EXPR = "{ DrawImgButton_Edit('0') }"><MvEVAL EXPR = "</A>">
					</FONT>
				</TD></TR>
			</MvIF>

			<MvASSIGN NAME = "l.last_product_code" VALUE = "{ l.product_code }">
		</MvWHILE>

		<TR><TD BGCOLOR = "#000080" ALIGN = "left" VALIGN = "middle" NOWRAP>
			<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
			<MvHIDE FIELDS = "g.Product_Stack, g.Product_Offset">
			<MvIF EXPR = "{ g.Product_Show EQ 'All' }">
				<MvIF EXPR = "{ l.shown }">
					<B><MvEVAL EXPR = "{ g.Product_Offset + 1 }">-<MvEVAL EXPR = "{ l.lastoffset }"></B>
				<MvELSE>
					<B>0-0</B>
				</MvIF>
			<MvELSE>
				<MvEVAL EXPR = "{ Show_BoldNA() }">
			</MvIF>
			</FONT>
		</TD><TD BGCOLOR = "#000080" ALIGN = "right" VALIGN = "middle" COLSPAN = "{ l.columns }">
			<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
			<MvIF EXPR = "{ len( g.Product_Stack ) }">
				<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListPrevious( \'Product_Offset\', \'Product_Stack\' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Previous('0') }"><MvEVAL EXPR = "</A>">
			</MvIF>

			 <INPUT TYPE = "text" NAME = "Product_Display" VALUE = "{ encodeentities( g.Product_Display ) }" SIZE = 5> <A HREF = "JavaScript:ListReload( 'Product_Offset', 'Product_Stack' );"><MvEVAL EXPR = "{ DrawImgButton_Refresh('0') }"></A>
			 <INPUT TYPE = "hidden" NAME = "Product_Count" VALUE = "{ encodeentities( l.shown ) }">

			 <MvIF EXPR = "{ l.nextoffset }">
				<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListNext( \'Product_Offset\', \'Product_Stack\', ' $ l.lastoffset $ ' );">' }"><MvEVAL EXPR = "{ DrawImgButton_Next('0') }"><MvEVAL EXPR = "</A>">
			 </MvIF>
			</FONT>
		</TD></TR>
		</TABLE>
	<MvELSE>
		<MvHIDE FIELDS = "g.Edit_Product, g.Product_Show, g.Product_Show_Code, g.Product_Show_Name, g.Product_Show_Price, g.Product_Show_Cost, g.Product_Show_Weight, g.Product_Show_Description, g.Product_Show_Taxable, g.Product_Show_Thumbnail, g.Product_Show_Image, g.Product_Show_Active, g.Product_Stack, g.Product_Offset, g.Product_Display, g.Product_Count, g.Product_Search, g.Product_Offset">

		<MvIF EXPR = "{ g.Edit_Product }">
			<MvHIDE FIELDS = "g.Product_Code, g.Product_Name, g.Product_Price, g.Product_Cost, g.Product_Weight, g.Product_Description, g.Product_Taxable, g.Product_Thumbnail, g.Product_Image, g.Product_Active">
		</MvIF>
	</MvIF>

	<MvEVAL EXPR = "{ EndContent() }">

	<MvIF EXPR = "{ l.can_modify OR l.can_delete }">
		<MvEVAL EXPR = "{ DrawButtons( 'PBED:[UPDATE]' ) }">
	<MvELSE>
		<MvEVAL EXPR = "{ DrawButtons( '' ) }">
	</MvIF>

	<MvEVAL EXPR = "{ EndScreen() }">

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Product_Validate" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">

	<MvASSIGN NAME = "g.Product_Code" VALUE = "{ ltrim( rtrim( g.Product_Code ) ) }">
	<MvASSIGN NAME = "g.Product_Name" VALUE = "{ ltrim( rtrim( g.Product_Name ) ) }">
	<MvASSIGN NAME = "g.Product_Thumbnail" VALUE = "{ ltrim( rtrim( g.Product_Thumbnail ) ) }">
	<MvASSIGN NAME = "g.Product_Image" VALUE = "{ ltrim( rtrim( g.Product_Image ) ) }">
	<MvASSIGN NAME = "g.Product_Price" VALUE = "{ ltrim( rtrim( g.Product_Price ) ) }">
	<MvASSIGN NAME = "g.Product_Cost" VALUE = "{ ltrim( rtrim( g.Product_Cost ) ) }">
	<MvASSIGN NAME = "g.Product_Weight" VALUE = "{ ltrim( rtrim( g.Product_Weight ) ) }">
	<MvASSIGN NAME = "g.Category_Code" VALUE = "{ ltrim( rtrim( g.Category_Code ) ) }">

	<MvIF EXPR = "{ len( g.Category_Code ) }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_Find_Code( g.Category_Code ) }">

		<MvIF EXPR = "{ NOT l.found }">
			<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-01560">
					<MvLOCALIZED-TOKEN NAME = "category" VALUE = "{ g.Category_Code }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Category '%category%' not found</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PROD', 'Category_Code', l.error_message ) }">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_Code( g.Product_Code ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PROD', 'Product_Code', g.Validation_Message ) }">
	<MvELSE>
		<MvIF EXPR = "{ ( len( g.Edit_Product ) EQ 0 ) OR ( toupper( g.Edit_Product ) NE toupper( g.Product_Code ) ) }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Product_Find_Code( g.Product_Code ) }">
			<MvIF EXPR = "{ l.found }">
				<MvLOCALIZED NAME = "l.error_message"  ID = "MER-ADM-01127">
					<MvLOCALIZED-TOKEN NAME = "product" VALUE = "{ g.Product_Code }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">A product with the code '%product%' already exists</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PROD', 'Product_Code', l.error_message ) }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ len( g.Product_Name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_message"  ID = "MER-ADM-01128">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a product name</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PROD', 'Product_Name', l.error_message ) }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Product_Category_Code ) }">
		<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.found" VALUE = "{ Category_Find_Code( g.Product_Category_Code ) }">
		<MvIF EXPR = "{ NOT l.found }">
			<MvLOCALIZED NAME = "l.error_message"  ID = "MER-ADM-01129">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Category Code does not exist</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PROD', 'Product_Category_Code', l.error_message ) }">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_Currency_NonNegative_Optional( g.Product_Price ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PROD', 'Product_Price', g.Validation_Message ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_Currency_NonNegative_Optional( g.Product_Cost ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PROD', 'Product_Cost', g.Validation_Message ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT Validate_FloatingPoint_NonNegative_Optional( g.Product_Weight ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PROD', 'Product_Weight', g.Validation_Message ) }">
	</MvIF>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
	<MvWHILE EXPR = "{ l.found }">
		<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_valid" VALUE = "{ Module_Product_Validate() }">
		<MvIF EXPR = "{ NOT l.module_valid }">
			<MvFUNCTIONRETURN VALUE = 0>
		</MvIF>

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
	</MvWHILE>
	
	<MvIF EXPR = "{ g.RelatedProduct_Count }">
		<MvASSIGN NAME = "l.count" VALUE = "1">
		<MvWHILE EXPR = "{ l.count LE g.RelatedProduct_Count }">
			<MvIF EXPR = "{ ( g.RelatedProduct_Assigned[ l.count ] ) AND ( g.Edit_Product EQ g.RelatedProduct[ l.count ] ) }">
				<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-01459">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">A product may not be related to itself</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvASSIGN NAME = "g.RelatedProduct_Assigned" INDEX = "{ l.count }" VALUE = 0>
				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'RELP', '', l.error_message ) }">
			</MvIF>

			<MvASSIGN NAME = "l.count" VALUE = "{ l.count + 1 }">
		</MvWHILE>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Product_Attribute_Validate">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvASSIGN NAME = "g.Product_Attribute_Code" VALUE = "{ ltrim( rtrim( g.Product_Attribute_Code ) ) }">
	<MvASSIGN NAME = "g.Product_Attribute_Prompt" VALUE = "{ ltrim( rtrim( g.Product_Attribute_Prompt ) ) }">
	<MvASSIGN NAME = "g.Product_Attribute_Price" VALUE = "{ ltrim( rtrim( g.Product_Attribute_Price ) ) }">
	<MvASSIGN NAME = "g.Product_Attribute_Cost" VALUE = "{ ltrim( rtrim( g.Product_Attribute_Cost ) ) }">

	<MvASSIGN NAME = "g.Product_Attribute_Template_Code" VALUE = "{ gettoken( g.Product_Attribute_Type, ':', 2 ) }">
	<MvASSIGN NAME = "l.product_attribute_type" VALUE = "{ gettoken( g.Product_Attribute_Type, ':', 1 ) }">

	<MvIF EXPR = "{ l.product_attribute_type NE 'template' }">
		<MvIF EXPR = "{ NOT Validate_Code( g.Product_Attribute_Code ) }">
			<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-01138">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify an attribute code</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'ATTR', 'Product_Attribute_Code', g.Validation_Message ) }">
		<MvELSE>
			<MvIF EXPR = "{ ( len( g.Edit_Product_Attribute ) EQ 0 ) OR ( toupper( g.Edit_Product_Attribute ) NE toupper( g.Product_Attribute_Code ) ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Attribute_Find_Code( Products.d.id, g.Product_Attribute_Code ) }">
				<MvIF EXPR = "{ l.found }">
					<MvLOCALIZED NAME = "l.error_message"  ID = "MER-ADM-01139">
						<MvLOCALIZED-TOKEN NAME = "attribute" VALUE = "{ g.Product_Attribute_Code }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">An attribute with the code '%attribute%' already exists</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvFUNCTIONRETURN VALUE = "{ FieldError( 'ATTR', 'Product_Attribute_Code', l.error_message ) }">
				</MvIF>
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ len( g.Product_Attribute_Prompt ) EQ 0 }">
			<MvLOCALIZED NAME = "l.error_message"  ID = "MER-ADM-01140">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify an attribute prompt</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'ATTR', 'Product_Attribute_Prompt', l.error_message ) }">
		</MvIF>
	<MvELSE>
		<MvIF EXPR = "{ g.Features:AttributeTemplates:Enabled }">
			<MvDO FILE = "{ g.Feature_ATT }" NAME = "l.ok" VALUE = "{ Product_Attribute_Validate_Template_Duplicate() }">
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Product_Option_Validate">
	<MvASSIGN NAME = "g.Product_Option_Code" VALUE = "{ ltrim( rtrim( g.Product_Option_Code ) ) }">
	<MvASSIGN NAME = "g.Product_Option_Prompt" VALUE = "{ ltrim( rtrim( g.Product_Option_Prompt ) ) }">
	<MvASSIGN NAME = "g.Product_Option_Price" VALUE = "{ ltrim( rtrim( g.Product_Option_Price ) ) }">
	<MvASSIGN NAME = "g.Product_Option_Cost" VALUE = "{ ltrim( rtrim( g.Product_Option_Cost ) ) }">

	<MvIF EXPR = "{ NOT Validate_Code( g.Product_Option_Code ) }">
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'ATTR', 'Product_Option_Code', g.Validation_Message ) }">
	<MvELSE>
		<MvIF EXPR = "{ ( len( g.Edit_Product_Option ) EQ 0 ) OR ( toupper( g.Edit_Product_Option ) NE toupper( g.Product_Option_Code ) ) }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Attribute_Find_Code( Products.d.id, g.Edit_Product_Attribute ) }">
			<MvIF EXPR = "{ l.found }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Option_Find_Code( Attributes.d.id, g.Product_Option_Code ) }">
				<MvIF EXPR = "{ l.found }">
					<MvLOCALIZED NAME = "l.error_message"  ID = "MER-ADM-01142">
						<MvLOCALIZED-TOKEN NAME = "option" VALUE = "{ g.Product_Option_Code }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">An option with the code '%option%' already exists</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvFUNCTIONRETURN VALUE = "{ FieldError( 'ATTR', 'Product_Option_Code', l.error_message ) }">
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ len( g.Product_Option_Prompt ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_message"  ID = "MER-ADM-01143">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify an option prompt</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'ATTR', 'Product_Option_Prompt', l.error_message ) }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Product_Category_Validate" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "g.Category_Code" VALUE = "{ ltrim( rtrim( g.Category_Code ) ) }">

	<MvIF EXPR = "{ len( g.Category_Code ) }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Category_Find_Code( g.Category_Code ) }">

		<MvIF EXPR = "{ NOT l.found }">
			<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-01561">
					<MvLOCALIZED-TOKEN NAME = "category" VALUE = "{ g.Category_Code }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Category '%category%' not found</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvFUNCTIONRETURN VALUE = "{ FieldError( 'PROD', 'Category_Code', l.error_message ) }">
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Product_Insert" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvASSIGN NAME = "g.Message" VALUE = "">

	<MvIF EXPR = "{ Product_Validate() }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.product_id" VALUE = "{ Product_Insert( g.Product_Code, g.Product_Name,
																						 g.Product_Thumbnail, g.Product_Image,
																						 g.Product_Price, g.Product_Cost,
																						 g.Product_Description, g.Product_Weight,
																						 g.Product_Taxable, g.Product_Active ) }">


		<MvIF EXPR = "{ NOT l.product_id }">
			<MvASSIGN NAME = "l.ok" VALUE = 0>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.category_id" VALUE = "{ Category_Find_Code( g.Category_Code ) }">
			<MvIF EXPR = "{ l.category_id }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ CategoryXProduct_Insert( l.category_id, l.product_id ) }">
			</MvIF>

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">

			<MvWHILE EXPR = "{ l.ok AND l.found }">
				<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Product_Update( l.product_id ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
			</MvWHILE>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "g.Message"  ID = "MER-ADM-01144">
				<MvLOCALIZED-TOKEN NAME = "product" VALUE = "{ encodeentities( g.Product_Name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Product '%product%' added</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvASSIGN NAME = "g.Tab" VALUE = "PROD">
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Product_Update" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvASSIGN NAME = "l.product_attribute_type" VALUE = "{ gettoken( g.Product_Attribute_Type, ':', 1 ) }">
	<MvASSIGN NAME = "l.product_attribute_template" VALUE = "{ gettoken( g.Product_Attribute_Type, ':', 2 ) }">

	<MvIF EXPR = "{ NOT g.AttributeTemplate_Code }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Find_Code( g.Edit_Product ) }">
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.original_name" VALUE = "{ Products.d.name }">

		<MvIF EXPR = "{ NOT g.AttributeTemplate_Code }">
			<MvASSIGN NAME = "l.valid" VALUE = "{ Product_Validate() }">
		<MvELSE>
			<MvASSIGN NAME = "l.valid" VALUE = "1">
		</MvIF>

		<MvIF EXPR = "{ l.valid AND
						( g.Add_Product_Attribute OR len( g.Edit_Product_Attribute ) ) AND
						( NOT g.Add_Product_Option ) AND
						( len( g.Edit_Product_Option ) EQ 0 ) }">
			<MvASSIGN NAME = "l.valid" VALUE = "{ Product_Attribute_Validate() }">
		</MvIF>

		<MvIF EXPR = "{ l.valid AND ( g.Add_Product_Option OR ( len( g.Edit_Product_Attribute ) AND len( g.Edit_Product_Option ) ) ) }">
			<MvASSIGN NAME = "l.valid" VALUE = "{ Product_Option_Validate() }">
		</MvIF>

		<MvIF EXPR = "{ l.ok AND l.valid }">

			<MvIF EXPR = "{ NOT g.AttributeTemplate_Code }">
				<MvIF EXPR = "{ g.Features:Inventory:Enabled }">
					<MvDO FILE = "{ g.Module_Feature_INV_AD }" NAME = "l.valid" VALUE = "{ INV_Validate_InventoryProductSettings() }">
				</MvIF>

				<MvIF EXPR = "{ l.valid }">			
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Update( Products.d.id, g.Product_Code,
																							 g.Product_Name, g.Product_Thumbnail,
																							 g.Product_Image, g.Product_Price,
																							 g.Product_Cost, g.Product_Description,
																							 g.Product_Weight, g.Product_Taxable,
																							 g.Product_Active ) }">
					<MvIF EXPR = "{ g.Features:Inventory:Enabled }">
						<MvDO FILE = "{ g.Module_Feature_INV_AD }" NAME = "l.ok" VALUE = "{ INV_Action_UpdateInventoryProductSettings( Products.d.id ) }">
					</MvIF>
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ len( g.Swap_Product_Attribute_1 ) AND
							len( g.Swap_Product_Attribute_2 ) }">
    			<MvASSIGN NAME = "l.swap_attribute_1" VALUE = "{ g.Swap_Product_Attribute_1 }">
    			<MvASSIGN NAME = "l.swap_attribute_2" VALUE = "{ g.Swap_Product_Attribute_2 }">
			</MvIF>

			<MvIF EXPR = "{ len( g.Swap_AttributeTemplate_Attribute_1 ) AND
							len( g.Swap_AttributeTemplate_Attribute_2 ) }">
    			<MvASSIGN NAME = "l.swap_attribute_1" VALUE = "{ g.Swap_AttributeTemplate_Attribute_1 }">
    			<MvASSIGN NAME = "l.swap_attribute_2" VALUE = "{ g.Swap_AttributeTemplate_Attribute_2 }">
			</MvIF>

			<MvIF EXPR = "{ len( l.swap_attribute_1 ) AND
							len( l.swap_attribute_2 ) }">
				<MvIF EXPR = "{ NOT g.AttributeTemplate_Code }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Find_Code( Products.d.id, l.swap_attribute_1 ) }">
				<MvELSE>
					<MvIF EXPR = "{ g.Features:AttributeTemplates:Enabled }">
						<MvDO FILE = "{ g.Feature_ATT_DB }" NAME = "l.ok" VALUE = "{ AttributeTemplateAttribute_Find_Code( Products.d.id, l.swap_attribute_1 ) }">
					</MvIF>
				</MvIF>

				<MvIF EXPR = "{ l.ok }">
					<MvASSIGN NAME = "l.id_1" VALUE = "{ Attributes.d.id }">
					<MvASSIGN NAME = "l.order_1" VALUE = "{ Attributes.d.order }">

					<MvIF EXPR = "{ NOT g.AttributeTemplate_Code }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Find_Code( Products.d.id, l.swap_attribute_2 ) }">
					<MvELSE>
						<MvIF EXPR = "{ g.Features:AttributeTemplates:Enabled }">
							<MvDO FILE = "{ g.Feature_ATT_DB }" NAME = "l.ok" VALUE = "{ AttributeTemplateAttribute_Find_Code( Products.d.id, l.swap_attribute_2 ) }">
						</MvIF>
					</MvIF>
					
					<MvIF EXPR = "{ l.ok }">
						<MvASSIGN NAME = "l.id_2" VALUE = "{ Attributes.d.id }">
						<MvASSIGN NAME = "l.order_2" VALUE = "{ Attributes.d.order }">
					</MvIF>
				</MvIF>

				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Update_Order( l.id_1, l.order_2 ) }">
				</MvIF>

				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Update_Order( l.id_2, l.order_1 ) }">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ ( NOT g.Add_Product_Attribute ) AND
							( NOT g.Add_Product_Option ) AND
							( len( g.Edit_Product_Attribute ) EQ 0 ) AND
							( len( g.Edit_Product_Option ) EQ 0 ) }">
				<MvASSIGN NAME = "l.attribute" VALUE = 1>
				<MvWHILE EXPR = "{ l.ok AND ( l.attribute LE g.Product_Attribute_Count ) }">
					<MvIF EXPR = "{ g.Product_Attribute_Remove[ l.attribute ] }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Find_Code( Products.d.id, g.Product_Attribute_Code[ l.attribute ] ) }">
						<MvIF EXPR = "{ l.ok }">
							<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Delete( Attributes.d.id ) }">
						</MvIF>
					<MvELSE>
						<MvASSIGN NAME = "l.attribute_found" VALUE = 0>
						<MvASSIGN NAME = "l.option" VALUE = 1>

						<MvWHILE EXPR = "{ l.ok AND ( l.option LE g.Product_Option_Count[ l.attribute ] ) }">
							<MvIF EXPR = "{ g.Product_Option_Remove[ l.attribute ][ l.option ] }">
								<MvIF EXPR = "{ NOT l.attribute_found }">
									<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Find_Code( Products.d.id, g.Product_Attribute_Code[ l.attribute ] ) }">
									<MvIF EXPR = "{ l.ok }">
										<MvASSIGN NAME = "l.attribute_found" VALUE = 1>
									</MvIF>
								</MvIF>

								<MvIF EXPR = "{ l.ok }">
									<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Option_Find_Code( Attributes.d.id, g.Product_Option_Code[l.attribute][l.option] ) }">
									<MvIF EXPR = "{ l.ok AND ( Options.d.id EQ Attributes.d.default_id ) }">
										<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Update( Attributes.d.id, 0, Attributes.d.code, Attributes.d.type, '', Attributes.d.prompt, Attributes.d.price, Attributes.d.cost, Attributes.d.required, Attributes.d.image ) }">
									</MvIF>

									<MvIF EXPR = "{ l.ok }">
										<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Option_Delete( Options.d.id ) }">
									</MvIF>
								</MvIF>
							</MvIF>

							<MvASSIGN NAME = "l.option" VALUE = "{ l.option + 1 }">
						</MvWHILE>
					</MvIF>

					<MvASSIGN NAME = "l.attribute" VALUE = "{ l.attribute + 1 }">
				</MvWHILE>
			</MvIF>

			<MvIF EXPR = "{ len( g.Swap_Product_Option_Attribute ) AND
							len( g.Swap_Product_Option_1 ) AND
							len( g.Swap_Product_Option_2 ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Find_Code( Products.d.id, g.Swap_Product_Option_Attribute ) }">
				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Option_Find_Code( Attributes.d.id, g.Swap_Product_Option_1 ) }">
					<MvIF EXPR = "{ l.ok }">
						<MvASSIGN NAME = "l.id_1" VALUE = "{ Options.d.id }">
						<MvASSIGN NAME = "l.order_1" VALUE = "{ Options.d.order }">

						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Option_Find_Code( Attributes.d.id, g.Swap_Product_Option_2 ) }">
						<MvIF EXPR = "{ l.ok }">
							<MvASSIGN NAME = "l.id_2" VALUE = "{ Options.d.id }">
							<MvASSIGN NAME = "l.order_2" VALUE = "{ Options.d.order }">
						</MvIF>
					</MvIF>

					<MvIF EXPR = "{ l.ok }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Option_Update_Order( l.id_1, l.order_2 ) }">
					</MvIF>

					<MvIF EXPR = "{ l.ok }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Option_Update_Order( l.id_2, l.order_1 ) }">
					</MvIF>
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok AND len( g.Edit_Product_Attribute ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Find_Code( Products.d.id, g.Edit_Product_Attribute ) }">
			</MvIF>

			<MvIF EXPR = "{ l.ok AND len( g.Edit_Product_Option ) }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Option_Find_Code( Attributes.d.id, g.Edit_Product_Option ) }">
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvIF EXPR = "{ g.Add_Product_Option }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.option_id" VALUE = "{ Option_Insert( Attributes.d.id, g.Product_Option_Code,
																								   g.Product_Option_Prompt, g.Product_Option_Price,
																								   g.Product_Option_Cost, g.Product_Option_Image ) }">
					<MvIF EXPR = "{ NOT l.option_id }">
						<MvASSIGN NAME = "l.ok" VALUE = 0>
					<MvELSE>
						<MvIF EXPR = "{ g.Product_Option_Default }">
							<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Update( Attributes.d.id, l.option_id, Attributes.d.code,
																									   Attributes.d.type, Attributes.d.attemp_id, Attributes.d.prompt,
																									   Attributes.d.price, Attributes.d.cost,
																									   Attributes.d.required, Attributes.d.image ) }">
						</MvIF>
					</MvIF>
				</MvIF>

				<MvIF EXPR = "{ len( g.Edit_Product_Attribute ) AND len( g.Edit_Product_Option ) }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Option_Update( Options.d.id, g.Product_Option_Code, g.Product_Option_Prompt,
																							g.Product_Option_Price, g.Product_Option_Cost, g.Product_Option_Image ) }">
					<MvIF EXPR = "{ l.ok }">
						<MvIF EXPR = "{ g.Product_Option_Default }">
							<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Update( Attributes.d.id, Options.d.id, Attributes.d.code,
																									   Attributes.d.type, Attributes.d.attemp_id, Attributes.d.prompt,
																									   Attributes.d.price, Attributes.d.cost,
																									   Attributes.d.required, Attributes.d.image ) }">
						<MvELSE>
							<MvIF EXPR = "{ Options.d.id EQ Attributes.d.default_id }">
								<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Update( Attributes.d.id, 0, Attributes.d.code,
																										   Attributes.d.type, Attributes.d.attemp_id, Attributes.d.prompt,
																										   Attributes.d.price, Attributes.d.cost,
																										   Attributes.d.required, Attributes.d.image ) }">
							</MvIF>
						</MvIF>
					</MvIF>

					<MvIF EXPR = "{ l.ok }">
						<MvASSIGN NAME = "g.Edit_Product_Attribute" VALUE = "">
						<MvASSIGN NAME = "g.Edit_Product_Option" VALUE = "">
					</MvIF>
				</MvIF>

				<MvIF EXPR = "{ g.Add_Product_Attribute }">
					<MvIF EXPR = "{ l.product_attribute_type EQ 'template' }">
						<MvIF EXPR = "{ g.Features:AttributeTemplates:Enabled }">
							<MvDO FILE = "{ g.Feature_ATT_DB }" NAME = "l.ok" VALUE = "{ AttributeTemplate_Find_Code( gettoken( g.Product_Attribute_Type, ':', 2 ) ) }">
							<MvIF EXPR = "{ g.Product_Attribute_Copy }">
								<MvDO FILE = "{ g.Feature_ATT_DB }" NAME = "l.ok" VALUE = "{ AttributeTemplate_Copy( AttributeTemplates.d.id, Products.d.id, '' ) }">
							<MvELSE>
								<MvIF EXPR = "{ NOT len( g.Product_Attribute_Code ) }">
									<MvASSIGN NAME = "g.Product_Attribute_Code" VALUE = "{ AttributeTemplates.d.code }">
								</MvIF>
								<MvIF EXPR = "{ NOT len( g.Product_Attribute_Prompt ) }">
									<MvASSIGN NAME = "g.Product_Attribute_Prompt" VALUE = "{ AttributeTemplates.d.prompt }">
								</MvIF>

								<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Insert( Products.d.id, g.Product_Attribute_Code, l.product_attribute_type, AttributeTemplates.d.id, g.Product_Attribute_Prompt, g.Product_Attribute_Price, g.Product_Attribute_Cost, g.Product_Attribute_Required, g.Product_Attribute_Image ) }">
								<MvIF EXPR = "{ l.ok }">
									<MvIF EXPR = "{ ( g.Product_Attribute_Type EQ 'radio' ) OR ( g.Product_Attribute_Type EQ 'select' ) }">
										<MvASSIGN NAME = "g.Add_Product_Attribute" VALUE = 0>
										<MvASSIGN NAME = "g.Add_Product_Option" VALUE = 1>
										<MvASSIGN NAME = "g.Edit_Product_Attribute" VALUE = "{ g.Product_Attribute_Code }">
									</MvIF>
								</MvIF>
							</MvIF>
						</MvIF>
					<MvELSE>
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Insert( Products.d.id, g.Product_Attribute_Code, l.product_attribute_type, AttributeTemplates.d.id, g.Product_Attribute_Prompt, g.Product_Attribute_Price, g.Product_Attribute_Cost, g.Product_Attribute_Required, g.Product_Attribute_Image ) }">
						<MvIF EXPR = "{ l.ok }">
							<MvIF EXPR = "{ ( g.Product_Attribute_Type EQ 'radio' ) OR ( g.Product_Attribute_Type EQ 'select' ) }">
								<MvASSIGN NAME = "g.Add_Product_Attribute" VALUE = 0>
								<MvASSIGN NAME = "g.Add_Product_Option" VALUE = 1>
								<MvASSIGN NAME = "g.Edit_Product_Attribute" VALUE = "{ g.Product_Attribute_Code }">
							</MvIF>
						</MvIF>
					</MvIF>
				</MvIF>

				<MvIF EXPR = "{ ( len( g.Edit_Product_Attribute ) NE 0 ) AND ( ( NOT g.Add_Product_Option ) AND ( len( g.Edit_Product_Option ) EQ 0 ) ) }">
					<MvIF EXPR = "{ ( gettoken( g.Product_Attribute_Type, ':', 1 ) EQ 'template' ) AND g.Product_Attribute_Copy }">
						<MvIF EXPR = "{ g.Features:AttributeTemplates:Enabled }">
							<MvDO FILE = "{ g.Feature_ATT_DB }" NAME = "l.ok" VALUE = "{ AttributeTemplate_Find_Code( gettoken( g.Product_Attribute_Type, ':', 2 ) ) }">
							<MvDO FILE = "{ g.Feature_ATT_DB }" NAME = "l.ok" VALUE = "{ AttributeTemplate_Copy( AttributeTemplates.d.id, Products.d.id, '' ) }">
							<MvIF EXPR = "{ l.ok }">
								<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Find_Code( Products.d.id, g.Edit_Product_Attribute ) }">	
								<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Delete( Attributes.d.id ) }">							
							</MvIF>
						</MvIF>
					<MvELSE>
						<MvIF EXPR = "{ g.Features:AttributeTemplates:Enabled }">
							<MvDO FILE = "{ g.Feature_ATT_DB }" NAME = "l.ok" VALUE = "{ AttributeTemplate_Find_Code( gettoken( g.Product_Attribute_Type, ':', 2 ) ) }">
							<MvIF EXPR = "{ ( l.product_attribute_type EQ 'template' ) }">
								<MvASSIGN NAME = "g.Product_Attribute_Code" VALUE = "{ l.product_attribute_template }">
							</MvIF>
						</MvIF>
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Attribute_Update( Attributes.d.id, Attributes.d.default_id, g.Product_Attribute_Code, l.product_attribute_type, AttributeTemplates.d.id, g.Product_Attribute_Prompt, g.Product_Attribute_Price, g.Product_Attribute_Cost, g.Product_Attribute_Required, g.Product_Attribute_Image ) }">
						<MvIF EXPR = "{ l.ok }">
							<MvASSIGN NAME = "g.Edit_Product_Attribute" VALUE = "">
						</MvIF>
					</MvIF>
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvLOCALIZED NAME = "g.Message"  ID = "MER-ADM-01145">
					<MvLOCALIZED-TOKEN NAME = "product" VALUE = "{ encodeentities( l.original_name ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Product '%product%' updated</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvASSIGN NAME = "g.Edit_Product" VALUE = "{ g.Product_Code }">
			</MvIF>


			<MvIF EXPR = "{ g.Features:RelatedProducts:Enabled }">
				<MvASSIGN NAME = "l.count" VALUE = 1>
				<MvASSIGN NAME = "l.current_id" VAlUE = "{ Products.d.id }">

				<MvWHILE EXPR = "{ l.ok AND ( l.count LE g.RelatedProduct_Count ) }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.relprod_id" VALUE = "{ Product_Find_Code( g.RelatedProduct[ l.count ] ) }">
					<MvIF EXPR = "{ l.relprod_id }">
						<MvIF EXPR = "{ g.RelatedProduct_Assigned[ l.count ] }">
							<MvDO FILE = "{ g.Module_Feature_RPD_DB }" NAME = "l.gotcha" VALUE = "{ RelatedProduct_Find_ID( l.current_id, l.relprod_id ) }">
							<MvIF EXPR = "{ NOT l.gotcha }">
								<MvDO FILE = "{ g.Module_Feature_RPD_DB }" NAME = "l.ok" VALUE = "{ RelatedProduct_Insert( l.current_id, l.relprod_id ) }">
							</MvIF>
						<MvELSE>
							<MvDO FILE = "{ g.Module_Feature_RPD_DB}" NAME = "l.gotcha" VALUE = "{ RelatedProduct_Find_ID( l.current_id, l.relprod_id ) }">
							<MvIF EXPR = "{ l.gotcha }">
								<MvDO FILE = "{ g.Module_Feature_RPD_DB }" NAME = "l.ok" VALUE = "{ RelatedProduct_Delete( l.current_id, l.relprod_id ) }">
							</MvIF>
						</MvIF>
					</MvIF>
					<MvASSIGN NAME = "l.count" VALUE = "{ l.count + 1 }">
				</MvWHILE>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
				<MvWHILE EXPR = "{ l.ok AND l.found }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Product_Update( Products.d.id ) }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
				</MvWHILE>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvASSIGN NAME = "g.ItemModified" VALUE = 0>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Product_Delete">
	<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.ok" VALUE = "{ Product_Find_Code( g.Edit_Product ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.product_name" VALUE = "{ Products.d.name }">
		<MvASSIGN NAME = "l.product_code" VALUE = "{ Products.d.code }">
		<MvASSIGN NAME = "l.product_id" VALUE = "{ Products.d.id }">

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Product_FindNext_ProductOrder( g.Edit_Product ) }">
		<MvIF EXPR = "{ l.found }">
			<MvASSIGN NAME = "g.Edit_Product" VALUE = "{ Products.d.code }">
		<MvELSE>
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Product_FindPrev_ProductOrder( g.Edit_Product ) }">
			<MvIF EXPR = "{ l.found }">
				<MvASSIGN NAME = "g.Edit_Product" VALUE = "{ Products.d.code }">
			<MvELSE>
				<MvASSIGN NAME = "g.Edit_Product" VALUE = "">
				<MvASSIGN NAME = "g.Edit_Item" VALUE = "">
				<MvASSIGN NAME = "g.Tab" VALUE = "">
			</MvIF>
		</MvIF>

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
		<MvWHILE EXPR = "{ l.ok AND l.found }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Product_Delete( l.product_id ) }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
		</MvWHILE>

		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Delete( l.product_id ) }">
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "g.Message" ID = "MER-USL-AD-00009">
				<MvLOCALIZED-TOKEN NAME = "product" VALUE = "{ encodeentities( l.product_name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Product '%product%' deleted</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvEVAL EXPR = "{ Update_LeftNavigation() }">
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Products" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvLOCALIZED NAME = "l.title"  ID = "MER-ADM-01147">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Product</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvASSIGN NAME = "l.action" VALUE = "IPRD">
	<MvASSIGN NAME = "l.product_id" VALUE = 0>
	<MvASSIGN NAME = "l.buttons" VALUE = "Help:prod.html">

	<MvASSIGN NAME = "l.can_view"	VALUE = "{ CanI( 'PROD', 1, 0, 0, 0 ) }">
	<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'PROD', 0, 1, 0, 0 ) }">
	<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'PROD', 0, 0, 1, 0 ) }">

	<MvIF EXPR = "{ len( g.Edit_Item ) }">
		<MvASSIGN NAME = "g.Edit_Product" VALUE = "{ g.Edit_Item }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Edit_Product ) EQ 0 AND l.can_add EQ 0 }">
		<MvFUNCTIONRETURN VALUE = "{ Screen_Blank() }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Category_Code ) }">
		<MvASSIGN NAME = "g.Product_Category_Code" VALUE = "{ g.Category_Code }">
	<MvELSE>
		<MvASSIGN NAME = "g.Product_Category_Code" VALUE = "">
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvIF EXPR = "{ g.Prev_Item }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Product_FindPrev_ProductOrder( g.Edit_Product ) }">
			<MvIF EXPR = "{ l.found }">
				<MvASSIGN NAME = "g.Edit_Product" VALUE = "{ Products.d.code }">
			<MvELSE>
				<MvLOCALIZED NAME = "l.message" ID = "MER-ADM-01511">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">There is no previous Product</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvASSIGN NAME = "g.Message" VALUE = "{ l.message }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ g.Next_Item }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Product_FindNext_ProductOrder( g.Edit_Product ) }">
			<MvIF EXPR = "{ l.found }">
				<MvASSIGN NAME = "g.Edit_Product" VALUE = "{ Products.d.code }">
			<MvELSE>
				<MvLOCALIZED NAME = "l.message" ID = "MER-ADM-01512">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">There is no next Product</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvASSIGN NAME = "g.Message" VALUE = "{ l.message }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ g.First_Item }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Product_FindFirst() }">
			<MvIF EXPR = "{ l.found }">
				<MvASSIGN NAME = "g.Edit_Product" VALUE = "{ Products.d.code }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ g.Last_Item }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Product_FindLast() }">
			<MvIF EXPR = "{ l.found }">
				<MvASSIGN NAME = "g.Edit_Product" VALUE = "{ Products.d.code }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ len( g.Edit_Product ) }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Product_Find_Code( g.Edit_Product ) }">
			<MvIF EXPR = "{ l.ok }">
				<MvLOCALIZED NAME = "l.title"  ID = "MER-ADM-01148">
					<MvLOCALIZED-TOKEN NAME = "product" VALUE = "{ encodeentities( Products.d.name ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Edit Product: %product%</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvASSIGN NAME = "l.action" VALUE = "UPRD">
				<MvASSIGN NAME = "l.product_id" VALUE = "{ Products.d.id }">
				<MvASSIGN NAME = "l.buttons" VALUE = "{ 'Links:Screen=LINK&Type=PROD&Store_Code=' $  encodeattribute( g.Store_Code ) $ '&Category_Code=&' $ encodeattribute( g.Category_Code ) $ '&Product_Code=' $ encodeattribute( Products.d.code ) $ ',Help:prod.html' }">
				<MvASSIGN NAME = "g.Product_Offset" VALUE = 0>

				<MvIF EXPR = "{ g.Load_Fields }">
					<MvASSIGN NAME = "g.Product_Show" VALUE = "All">
					<MvASSIGN NAME = "g.Product_Code" VALUE = "{ Products.d.code }">
					<MvASSIGN NAME = "g.Product_Name" VALUE = "{ Products.d.name }">
					<MvASSIGN NAME = "g.Product_Thumbnail" VALUE = "{ Products.d.thumbnail }">
					<MvASSIGN NAME = "g.Product_Image" VALUE = "{ Products.d.image }">
					<MvASSIGN NAME = "g.Product_Price" VALUE = "{ Products.d.price }">
					<MvASSIGN NAME = "g.Product_Cost" VALUE = "{ Products.d.cost }">
					<MvASSIGN NAME = "g.Product_Description" VALUE = "{ Products.d.desc }">
					<MvASSIGN NAME = "g.Product_Weight" VALUE = "{ Products.d.weight }">
					<MvASSIGN NAME = "g.Product_Taxable" VALUE = "{ Products.d.taxable }">
					<MvASSIGN NAME = "g.Product_Active" VALUE = "{ Products.d.active }">
					
					<MvIF EXPR = "{ g.Features:Inventory:Enabled }">
						<MvDO FILE = "{ g.Module_Feature_INV_AD }" NAME = "l.ok" VALUE = "{ INV_ProductEditScreen_LoadInventory( Products.d.id ) }">
					</MvIF>					
				</MvIF>
			</MvIF>
		<MvELSE>
			<MvIF EXPR = "{ g.Load_Fields }">
				<MvASSIGN NAME = "g.Product_Code" VALUE = "">
				<MvASSIGN NAME = "g.Product_Name" VALUE = "">
				<MvASSIGN NAME = "g.Category_Code" VALUE = "{ g.Category_Code }">
				<MvASSIGN NAME = "g.Product_Thumbnail" VALUE = "">
				<MvASSIGN NAME = "g.Product_Image" VALUE = "">
				<MvASSIGN NAME = "g.Product_Price" VALUE = "0.00">
				<MvASSIGN NAME = "g.Product_Cost" VALUE = "0.00">
				<MvASSIGN NAME = "g.Product_Description" VALUE = "">
				<MvASSIGN NAME = "g.Product_Weight" VALUE = "0.00">
				<MvASSIGN NAME = "g.Product_Taxable" VALUE = 1>
				<MvASSIGN NAME = "g.Product_Active" VALUE = 1>

				<MvIF EXPR = "{ g.Features:Inventory:Enabled }">
					<MvDO FILE = "{ g.Module_Feature_INV_AD }" NAME = "l.ok" VALUE = "{ INV_ProductEditScreen_LoadInventory( Products.d.id ) }">
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ NOT g.Have_List_Fields }">
		<MvASSIGN NAME = "g.RelatedProduct_Show" VALUE = "All">
		<MvASSIGN NAME = "g.RelatedProduct_Stack" VALUE = "">
		<MvASSIGN NAME = "g.RelatedProduct_Offset" VALUE = 0>
		<MvASSIGN NAME = "g.RelatedProduct_Display" VALUE = "{ g.Admin_User_PageLen }">
	<MvELSE>
		<MvASSIGN NAME = "g.RelatedProduct_Display" VALUE = "{ int( g.RelatedProduct_Display ) }">
		<MvIF EXPR = "{ g.RelatedProduct_Display LT 1 }">
			<MvASSIGN NAME = "g.RelatedProduct_Display" VALUE = 1>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ NOT g.Have_List_Fields }">
		<MvASSIGN NAME = "g.Upsell_Stack" VALUE = "">
		<MvASSIGN NAME = "g.Upsell_Offset" VALUE = 0>
		<MvASSIGN NAME = "g.Upsell_Display" VALUE = "{ g.Admin_User_PageLen }">
	<MvELSE>
		<MvASSIGN NAME = "g.Upsell_Display" VALUE = "{ int( g.Upsell_Display ) }">
		<MvIF EXPR = "{ g.Upsell_Display LT 1 }">
			<MvASSIGN NAME = "g.Upsell_Display" VALUE = 1>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvEVAL EXPR = "{ BeginScreen( l.title, l.action, l.buttons ) }">

		<INPUT TYPE = "hidden" NAME = "Have_List_Fields" VALUE = "1">

		<MvIF EXPR = "{ len( g.Edit_Product ) }">
			<MvHIDE FIELDS = "g.Edit_Product">
		</MvIF>

		<MvLOCALIZED NAME = "l.tabs" ID = "MER-ADM-00435">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">PROD:Product,IMAG:Images</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvIF EXPR = "{ len( g.Edit_Product ) }">
			<MvIF EXPR = "{ g.Features:RelatedProducts:Enabled }">
				<MvDO FILE = "{ g.Module_Feature_RPD_AD }" NAME = "l.rpd_tab" VALUE = "{ RPD_Generate_Tab() }">
				<MvIF EXPR = "{ len( l.rpd_tab ) }">
					<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.rpd_tab }">
				</MvIF>
			</MvIF>

			<MvLOCALIZED NAME = "l.moretabs"  ID = "MER-ADM-01149">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">ATTR:Attributes</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.moretabs }">

			<MvIF EXPR = "{ g.Features:Upsale:Enabled }">
				<MvDO FILE = "{ g.Module_Feature_USL_AD }" NAME = "l.moretabs" VALUE = "{ USL_ProductEditScreen_UpsaleTab() }">
				<MvIF EXPR = "{ len( l.moretabs ) }">
					<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.moretabs }">		
				</MvIF>
			</MvIF>
			
			<MvIF EXPR = "{ g.Features:Inventory:Enabled }">
				<MvDO FILE = "{ g.Module_Feature_INV_AD }" NAME = "l.moretabs" VALUE = "{ INV_ProductEditScreen_InventoryTabs() }">
				<MvIF EXPR = "{ len(l.moretabs) }">
					<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.moretabs }">		
				</MvIF>
			</MvIF>
		</MvIF>

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
		<MvWHILE EXPR = "{ l.found }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_tabs" VALUE = "{ Module_Product_Tabs( l.product_id ) }">
			<MvIF EXPR = "{ len( l.module_tabs ) }">
				<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.module_tabs }">
			</MvIF>

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
		</MvWHILE>

		<MvEVAL EXPR = "{ DrawTabs( 'PROD', l.tabs ) }">

		<MvEVAL EXPR = "{ BeginContent() }">
		<MvIF EXPR = "{ g.Tab EQ 'PROD' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED  ID = "MER-ADM-01152">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Product Code:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 20 NAME = "Product_Code" VALUE = "{ encodeentities( g.Product_Code ) }" ONCHANGE = "{ 'SetItemModified( \'' $ g.Edit_Product $ '\' );' }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED  ID = "MER-ADM-01153">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Product Name:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Product_Name" VALUE = "{ encodeentities( g.Product_Name ) }" ONCHANGE = "{ 'SetItemModified( \'' $ g.Edit_Product $ '\' );' }">
				</FONT>
			</TD></TR>

			<MvIF EXPR = "{ CanI( 'CTGY', 0, 0, 1, 0 ) }">
				<MvIF EXPR = "{ NOT len( g.Edit_Product ) }">
					<TR><TD NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED  ID = "MER-ADM-01154">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Category Code:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD WIDTH = "100%">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED NAME = "l.alt_text" ID = "MER-MMU-00504">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Lookup</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						<INPUT TYPE = "text" NAME = "Category_Code" SIZE = "20" VALUE = "{ encodeentities( g.Category_Code ) }" ONCHANGE = "{ 'SetItemModified( \'' $ g.Edit_Product $ '\' );' }">
						<A HREF = "JavaScript:PopupCategoryLookup( 'Category_Code' );"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'search.gif' }"></A>
						</FONT>
					</TD></TR>
				</MvIF>
			</MvIF>
			
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00439">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Price:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 10 NAME = "Product_Price" VALUE = "{ encodeentities( g.Product_Price ) }" ONCHANGE = "{ 'SetItemModified( \'' $ g.Edit_Product $ '\' );' }">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00440">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Cost:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 10 NAME = "Product_Cost" VALUE = "{ encodeentities( g.Product_Cost ) }" ONCHANGE = "{ 'SetItemModified( \'' $ g.Edit_Product $ '\' );'}">
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00441">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Weight:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 10 NAME = "Product_Weight" VALUE = "{ encodeentities( g.Product_Weight ) }" ONCHANGE = "{ 'SetItemModified( \'' $ g.Edit_Product $ '\' );'}">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00442">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Description:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<TEXTAREA NAME = "Product_Description" ROWS = 10 COLS = 58 WRAP = "off" ONCHANGE = "{ 'SetItemModified( \'' $ g.Edit_Product $ '\' );'}"><MIVA STANDARDOUTPUTLEVEL = "text, html"><MvEVAL EXPR = "{ encodeentities( g.Product_Description ) }"><MIVA STANDARDOUTPUTLEVEL = "text, html, compresswhitespace"></TEXTAREA>
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				&nbsp;
			</TD><TD ALIGN = "left">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-00443">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Taxable</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvIF EXPR = "{ g.Product_Taxable }">
					<INPUT TYPE = "checkbox" NAME = "Product_Taxable" VALUE = "Yes" CHECKED ONCLICK = "{ 'SetItemModified( \'' $ g.Edit_Product $ '\' );'}">
				<MvELSE>
					<INPUT TYPE = "checkbox" NAME = "Product_Taxable" VALUE = "Yes" ONCLICK = "{ 'SetItemModified( \'' $ g.Edit_Product $ '\' );'}">
				</MvIF>
				<MvEVAL EXPR = "{ l.text }">

				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				&nbsp;
			</TD><TD ALIGN = "left">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-01155">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Active</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvIF EXPR = "{ g.Product_Active }">
					<INPUT TYPE = "checkbox" NAME = "Product_Active" VALUE = "Yes" CHECKED ONCLICK = "{ 'SetItemModified( \'' $ g.Edit_Product $ '\' );'}">
				<MvELSE>
					<INPUT TYPE = "checkbox" NAME = "Product_Active" VALUE = "Yes" ONCLICK = "{ 'SetItemModified( \'' $ g.Edit_Product $ '\' );'}">
				</MvIF>
				<MvEVAL EXPR = "{ l.text }">

				</FONT>
			</TD></TR>
			</TABLE>

		<MvELSE>
			<MvHIDE FIELDS = "g.Product_Code, g.Product_Name, g.Category_Code, g.Product_Price, g.Product_Cost, g.Product_Weight, g.Product_Description, g.Product_Taxable, g.Product_Active">
		</MvIF>

		<MvIF EXPR = "{ g.tab EQ 'RELP' }">
			<MvIF EXPR = "{ g.Features:RelatedProducts:Enabled }">
				<MvDO FILE = "{ g.Module_Feature_RPD_AD }" NAME = "l.rep_tab" VALUE = "{ RPD_Tab() }">
			</MvIF>
		<MvELSE>
			<MvHIDE FIELDS = "g.RelatedProduct_Stack, g.Product_Search, g.RelatedProduct_Show, g.RelatedProduct_Offset, g.RelatedProduct_Display">
		</MvIF>

		<MvIF EXPR = "{ g.Tab EQ 'IMAG' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00444">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Thumbnail Image:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD WIDTH = "100%" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Product_Thumbnail" VALUE = "{ encodeentities( g.Product_Thumbnail ) }">
				<MvIF EXPR = "{ ( l.can_modify ) OR ( l.can_add AND NOT len( g.Product_Thumbnail ) ) }">
					<A HREF = "JavaScript:PopupFileUpload( 'Image', '', 'Product_Thumbnail' );"><MvEVAL EXPR = "{ DrawImgButton_Upload(0) }"></A>
				<MvELSE>
					&nbsp;
				</MvIF>
				</FONT>
			</TD></TR>

			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00445">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Full-sized Image:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD WIDTH = "100%" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Product_Image" VALUE = "{ encodeentities( g.Product_Image ) }">
				<MvIF EXPR = "{ ( l.can_modify ) OR ( l.can_add AND NOT len( g.Product_Image ) ) }">
					<A HREF = "JavaScript:PopupFileUpload( 'Image', '', 'Product_Image' );"><MvEVAL EXPR = "{ DrawImgButton_Upload(0) }"></A>
				<MvELSE>
					&nbsp;
				</MvIF>
				</FONT>
			</TD></TR>
			</TABLE>
		<MvELSE>
			<MvHIDE FIELDS = "g.Product_Thumbnail, g.Product_Image">
		</MvIF>

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst() }">
		<MvWHILE EXPR = "{ l.ok AND l.found }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Product_Content( g.Tab, g.Load_Fields, l.product_id ) }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext() }">
		</MvWHILE>

		<MvIF EXPR = "{ g.Tab EQ 'ATTR' }">
		
		 

		<SCRIPT LANGUAGE = "JavaScript">
<!--
function AddAttribute( add )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Screen' ].value = Screen;
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Add_Product_Attribute' ].value = add;
		document.forms[ Screen ].elements[ 'Add_Product_Option' ].value = 0;
		document.forms[ Screen ].elements[ 'Edit_Product_Attribute' ].value = '';
		document.forms[ Screen ].elements[ 'Edit_Product_Option' ].value = '';
		document.forms[ Screen ].elements[ 'Action' ].value = '';
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
		document.forms[ Screen ].submit();
	}
}

function EditAttribute( attr_code )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Screen' ].value = Screen;
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Add_Product_Attribute' ].value = 0;
		document.forms[ Screen ].elements[ 'Add_Product_Option' ].value = 0;
		document.forms[ Screen ].elements[ 'Edit_Product_Attribute' ].value = unescape( attr_code );
		document.forms[ Screen ].elements[ 'Edit_Product_Option' ].value = '';
		document.forms[ Screen ].elements[ 'Action' ].value = '';
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
		document.forms[ Screen ].submit();
	}
}

function SwapAttributes( attr_code1, attr_code2 )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Screen' ].value = Screen;
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Add_Product_Attribute' ].value = 0;
		document.forms[ Screen ].elements[ 'Add_Product_Option' ].value = 0;
		document.forms[ Screen ].elements[ 'Edit_Product_Attribute' ].value = '';
		document.forms[ Screen ].elements[ 'Edit_Product_Option' ].value = '';
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
		document.forms[ Screen ].elements[ 'Swap_Product_Attribute_1' ].value = unescape( attr_code1 );
		document.forms[ Screen ].elements[ 'Swap_Product_Attribute_2' ].value = unescape( attr_code2 );
		document.forms[ Screen ].submit();
	}
}

function NewOption( add, attr_code )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Screen' ].value = Screen;
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Add_Product_Attribute' ].value = 0;
		document.forms[ Screen ].elements[ 'Add_Product_Option' ].value = add;
		document.forms[ Screen ].elements[ 'Edit_Product_Attribute' ].value = unescape( attr_code );
		document.forms[ Screen ].elements[ 'Edit_Product_Option' ].value = '';
		document.forms[ Screen ].elements[ 'Action' ].value = '';
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;

		document.forms[ Screen ].submit();
	}
}

function EditOption( attr_code, opt_code )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Screen' ].value = Screen;
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Add_Product_Attribute' ].value = 0;
		document.forms[ Screen ].elements[ 'Add_Product_Option' ].value = 0;
		document.forms[ Screen ].elements[ 'Edit_Product_Attribute' ].value = unescape( attr_code );
		document.forms[ Screen ].elements[ 'Edit_Product_Option' ].value = unescape( opt_code );
		document.forms[ Screen ].elements[ 'Action' ].value = '';
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
		document.forms[ Screen ].submit();
	}
}

function SwapOptions( attr_code, opt_code1, opt_code2 )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Screen' ].value = Screen;
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Add_Product_Attribute' ].value = 0;
		document.forms[ Screen ].elements[ 'Add_Product_Option' ].value = 0;
		document.forms[ Screen ].elements[ 'Edit_Product_Attribute' ].value = '';
		document.forms[ Screen ].elements[ 'Edit_Product_Option' ].value = '';
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
		document.forms[ Screen ].elements[ 'Swap_Product_Option_Attribute' ].value = unescape( attr_code );
		document.forms[ Screen ].elements[ 'Swap_Product_Option_1' ].value = unescape( opt_code1 );
		document.forms[ Screen ].elements[ 'Swap_Product_Option_2' ].value = unescape( opt_code2 );
		document.forms[ Screen ].submit();
	}
}
//-->
		</SCRIPT>
			<MvHIDE FIELDS = "g.Add_Product_Attribute, g.Add_Product_Option, g.Edit_Product_Attribute, g.Edit_Product_Option">

			<INPUT TYPE = "hidden" NAME = "Swap_Product_Attribute_1" VALUE = "">
			<INPUT TYPE = "hidden" NAME = "Swap_Product_Attribute_2" VALUE = "">

			<INPUT TYPE = "hidden" NAME = "Swap_Product_Option_Attribute" VALUE = "">
			<INPUT TYPE = "hidden" NAME = "Swap_Product_Option_1" VALUE = "">
			<INPUT TYPE = "hidden" NAME = "Swap_Product_Option_2" VALUE = "">

			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR>

			<MvIF EXPR = "{ ( NOT g.Add_Product_Attribute ) AND
							( len( g.Edit_Product_Attribute ) EQ 0 ) AND
							( len( g.Edit_Product_Option ) EQ 0 ) AND
							l.can_modify }">
				<TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
					<MvLOCALIZED  ID = "MER-ADM-01162">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Remove</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
			
				</TD>
			</MvIF>
			<TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
				&nbsp;
			</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED  ID = "MER-ADM-01163">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED  ID = "MER-ADM-01164">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Prompt</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD ALIGN = "left" COLSPAN = "2" VALIGN = "middle" BGCOLOR = "#000080" WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED  ID = "MER-ADM-01165">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Image</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00449">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Type</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD>

			<TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
				<MvIF EXPR = "{ g.Features:AttributeTemplates:Enabled  }">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
					<MvLOCALIZED ID = "MER-ADM-01167">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Copy?</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				<MvELSE>
					&nbsp;
				</MvIF>
			</TD>

			<TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED  ID = "MER-ADM-01168">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Price</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD>

			<TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED  ID = "MER-ADM-01169">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Cost</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "#000080">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED  ID = "MER-ADM-01170">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">D</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "#000080">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED  ID = "MER-ADM-01171">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">R</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "#000080" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ l.can_modify }">
					<MvLOCALIZED NAME = "l.alt"  ID = "MER-ADM-01172">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">New Attribute</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvIF EXPR = "{ g.Add_Product_Attribute }">
						<A HREF = "JavaScript:AddAttribute( 0 );"><MvEVAL EXPR = "{ DrawImgButton_NewX( 1, l.alt ) }"></A>
					<MvELSE>
						<A HREF = "JavaScript:AddAttribute( 1 );"><MvEVAL EXPR = "{ DrawImgButton_NewX( 0, l.alt ) }"></A>
					</MvIF>
				<MvELSE>
					&nbsp;
				</MvIF>
				</FONT>
			</TD></TR>

			<MvASSIGN NAME = "l.green" VALUE = 0>
			<MvASSIGN NAME = "l.attribute" VALUE = 0>
			<MvASSIGN NAME = "l.previous_attribute_code" VALUE = "">

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.attribute_found" VALUE = "{ Attribute_FindFirst_Product( Products.d.id ) }">

			<MvWHILE EXPR = "{ l.attribute_found }">
				<MvASSIGN NAME = "l.attribute" VALUE = "{ l.attribute + 1 }">

				<MvASSIGN NAME = "l.attribute_id" VALUE = "{ Attributes.d.id }">
				<MvASSIGN NAME = "l.attribute_default_id" VALUE = "{ Attributes.d.default_id }">
				<MvASSIGN NAME = "l.attribute_code" VALUE = "{ Attributes.d.code }">
				<MvASSIGN NAME = "l.attribute_prompt" VALUE = "{ Attributes.d.prompt }">
				<MvASSIGN NAME = "l.attribute_type" VALUE = "{ Attributes.d.type }">
				<MvASSIGN NAME = "l.attribute_image" VALUE = "{ Attributes.d.image }">
				<MvASSIGN NAME = "l.attribute_price" VALUE = "{ Attributes.d.price }">
				<MvASSIGN NAME = "l.attribute_cost" VALUE = "{ Attributes.d.cost }">
				<MvASSIGN NAME = "l.attribute_required" VALUE = "{ Attributes.d.required }">
				<MvASSIGN NAME = "l.attribute_required" VALUE = "{ Attributes.d.required }">

				<MvIF EXPR = "{ l.green }">
					<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffdd">
				<MvELSE>
					<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffff">
				</MvIF>

				<MvIF EXPR = "{ g.Features:AttributeTemplates:Enabled }">
					<MvIF EXPR = "{ l.attribute_type EQ 'template' }">
						<MvDO FILE = "{ g.Feature_ATT_DB }" NAME = "l.ok" VALUE = "{ AttributeTemplate_Find_ID( Attributes.d.attemp_id ) }">
						<MvASSIGN NAME = "l.attribute_template_id" VALUE = "{ AttributeTemplates.d.id }">
						<MvIF EXPR = "{ l.ok }">
							<MvASSIGN NAME = "l.attribute_type" VALUE = "{ l.attribute_type $ ':' $ AttributeTemplates.d.code }">
						</MvIF>
					<MvELSE>
						<MvASSIGN NAME = "l.attribute_template_id" VALUE = "">
					</MvIF>
				</MvIF>

				<MvDO FILE = "{ g.Library_DB }" NAME = "l.attribute_found" VALUE = "{ Attribute_FindNext_Product( Products.d.id ) }">

				<MvIF EXPR = "{ ( NOT g.Add_Product_Attribute ) AND
								( NOT g.Add_Product_Option ) AND
								( len( g.Edit_Product_Attribute ) NE 0 ) AND
								( len( g.Edit_Product_Option ) EQ 0 ) AND
								( g.Edit_Product_Attribute EQ l.attribute_code ) }">
					<MvIF EXPR = "{ NOT g.Data_Entry_Error }">

						<MvASSIGN NAME = "g.Product_Attribute_Code" VALUE = "{ l.attribute_code }">
						<MvASSIGN NAME = "g.Product_Attribute_Prompt" VALUE = "{ l.attribute_prompt }">
						<MvASSIGN NAME = "g.Product_Attribute_Image" VALUE = "{ l.attribute_image }">
						<MvASSIGN NAME = "g.Product_Attribute_Price" VALUE = "{ l.attribute_price }">
						<MvASSIGN NAME = "g.Product_Attribute_Cost" VALUE = "{ l.attribute_cost }">
						<MvASSIGN NAME = "g.Product_Attribute_Required" VALUE = "{ l.attribute_required }">
						<MvASSIGN NAME = "g.Product_Attribute_Copy" VALUE = "">
						<MvASSIGN NAME = "g.Product_Attribute_Type" VALUE = "{ l.attribute_type }">
					</MvIF>

					<TR><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
						<MvIF EXPR = "{ ( len( l.previous_attribute_code ) OR l.attribute_found ) AND l.can_modify }">
							<MvIF EXPR = "{ len( l.previous_attribute_code ) }">
								<MvLOCALIZED NAME = "l.alt_text"  ID = "MER-ADM-01173">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Up</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<A HREF = "{ 'JavaScript:SwapAttributes( \'' $ JavaScriptEncode( l.previous_attribute_code ) $ '\', \'' $ JavaScriptEncode( l.attribute_code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_u.gif' }"></A>
							<MvELSE>
								<IMG BORDER = 0 WIDTH = 11 HEIGHT = 23 SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }">
							</MvIF>

							<MvIF EXPR = "{ l.attribute_found }">
								<MvLOCALIZED NAME = "l.alt_text"  ID = "MER-ADM-01174">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Down</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<A HREF = "{ 'JavaScript:SwapAttributes( \'' $ JavaScriptEncode( l.attribute_code ) $ '\', \'' $ JavaScriptEncode( Attributes.d.code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_d.gif' }"></A>
							</MvIF>
						<MvELSE>
							&nbsp;
						</MvIF>
					</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ ( 'template:' $ l.attribute_code ) EQ l.attribute_type }">
							<INPUT TYPE = "text" SIZE = 15 NAME = "Product_Attribute_Code" VALUE = "" ONCHANGE = "SetModified();">
							<INPUT TYPE = "hidden" NAME = "Original_Product_Attribute_Code" VALUE = "{ encodeentities( g.Product_Attribute_Code ) }">
						<MvELSE>
							<INPUT TYPE = "text" SIZE = 15 NAME = "Product_Attribute_Code" VALUE = "{ encodeentities( g.Product_Attribute_Code ) }" ONCHANGE = "SetModified();">
						</MvIF>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" WIDTH = "100%">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ ( 'template:' $ l.attribute_code ) EQ l.attribute_type }">
							<INPUT TYPE = "text" SIZE = 15 NAME = "Product_Attribute_Prompt" VALUE = "" ONCHANGE = "SetModified();">
							<INPUT TYPE = "hidden" NAME = "Original_Product_Attribute_Prompt" VALUE = "{ encodeentities( g.Product_Attribute_Prompt ) }">
						<MvELSE>
							<INPUT TYPE = "text" SIZE = 15 NAME = "Product_Attribute_Prompt" VALUE = "{ encodeentities( g.Product_Attribute_Prompt ) }" ONCHANGE = "SetModified();">
						</MvIF>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" SIZE = 15 NAME = "Product_Attribute_Image" VALUE = "{ encodeentities( g.Product_Attribute_Image ) }" ONCHANGE = "SetModified();">
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<A HREF = "JavaScript:PopupFileUpload( 'Image', '', 'Product_Attribute_Image' );"><MvEVAL EXPR = "{ DrawImgButton_Upload(0) }"></A>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ Screen_Products_Type_Select() }">
						</FONT>
					</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Attribute_Copy, 'Product_Attribute_Copy', 'Yes', '' ) }">
						</FONT>
					</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" SIZE = 5 NAME = "Product_Attribute_Price" VALUE = "{ encodeentities( g.Product_Attribute_Price ) }" ONCHANGE = "SetModified();">
						</FONT>
					</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" SIZE = 5 NAME = "Product_Attribute_Cost" VALUE = "{ encodeentities( g.Product_Attribute_Cost ) }" ONCHANGE = "SetModified();">
						</FONT>
					</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
						&nbsp;
					</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ g.Product_Attribute_Required }">
							<INPUT TYPE = "checkbox" NAME = "Product_Attribute_Required" VALUE = "Yes" CHECKED ONCLICK = "SetModified();">
						<MvELSE>
							<INPUT TYPE = "checkbox" NAME = "Product_Attribute_Required" VALUE = "Yes" ONCLICK = "SetModified();">
						</MvIF>
						</FONT>
					</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ '<A HREF = "JavaScript:EditAttribute( \'\' );">' }"><MvEVAL EXPR = "{ DrawImgButton_EditHere(1) }"></A>

						<MvIF EXPR = "{ ( ( l.attribute_type EQ 'radio' ) OR ( l.attribute_type EQ 'select' ) ) AND l.can_modify }">
							<MvLOCALIZED NAME = "l.alt_text"  ID = "MER-ADM-01180">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">New Option</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							<A HREF = "{ 'JavaScript:NewOption( 1, \'' $ JavaScriptEncode( l.attribute_code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'new.gif' }"></A>
						</MvIF>
						</FONT>
					</TD></TR>
				<MvELSE>
					<TR>
					<MvIF EXPR = "{ ( NOT g.Add_Product_Attribute ) AND
									( NOT g.Add_Product_Option ) AND
									( len( g.Edit_Product_Attribute ) EQ 0 ) AND
									( len( g.Edit_Product_Option ) EQ 0 ) AND
									l.can_modify }">
						<TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "hidden" NAME = "{ 'Product_Attribute_Code[' $ l.attribute  $ ']' }" VALUE = "{ encodeentities( l.attribute_code ) }">
							<INPUT TYPE = "checkbox" NAME = "{ 'Product_Attribute_Remove[' $ l.attribute $ ']' }" VALUE = "Yes" ONCLICK = "SetModified();">
							</FONT>
						</TD>
					</MvIF>

					<TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
						<MvIF EXPR = "{ ( len( l.previous_attribute_code ) OR l.attribute_found ) AND l.can_modify }">
							<MvIF EXPR = "{ len( l.previous_attribute_code ) }">
								<MvLOCALIZED NAME = "l.alt_text"  ID = "MER-ADM-01181">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Up</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<A HREF = "{ 'JavaScript:SwapAttributes( \'' $ JavaScriptEncode( l.previous_attribute_code ) $ '\', \'' $ JavaScriptEncode( l.attribute_code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_u.gif' }"></A>
							<MvELSE>
								<IMG BORDER = 0 WIDTH = 11 HEIGHT = 23 SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }">
							</MvIF>

							<MvIF EXPR = "{ l.attribute_found }">
								<MvLOCALIZED NAME = "l.alt_text"  ID = "MER-ADM-01182">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Down</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<A HREF = "{ 'JavaScript:SwapAttributes( \'' $ JavaScriptEncode( l.attribute_code ) $ '\', \'' $ JavaScriptEncode( Attributes.d.code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_d.gif' }"></A>
							</MvIF>
						<MvELSE>
							&nbsp;
						</MvIF>
					</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ l.attribute_type NE ( 'template:' $ AttributeTemplates.d.code ) }">
							<B><MvEVAL EXPR = "{ encodeentities( l.attribute_code ) }"></B>
						<MvELSE>
							<B><MvEVAL EXPR = "{ encodeentities( AttributeTemplates.d.code ) }"></B>
						</MvIF>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ l.attribute_type NE ( 'template:' $ AttributeTemplates.d.code ) }">
							<B><MvEVAL EXPR = "{ encodeentities( l.attribute_prompt ) }"></B>
						<MvELSE>
							<B><MvEVAL EXPR = "{ encodeentities( AttributeTemplates.d.prompt ) }"></B>
						</MvIF>
						</FONT>
					</TD><TD ALIGN = "left" COLSPAN = "2" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ len( l.attribute_image ) }">
							<MvIF EXPR = "{ l.attribute_type EQ ( 'template:' $ AttributeTemplates.d.code ) }">
								<MvLOCALIZED NAME = "l.temp" ID = "MER-ATW-00115">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">N/A</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<Mveval expr = "{ l.temp }">
							<MvELSE>
								<B><MvEVAL EXPR = "{ encodeentities( MMUI_Short_Path( l.attribute_image ) ) }"></B>
							</MvIF>
						<MvELSE>
							&nbsp;
						</MvIF>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<B>
						<MvIF EXPR = "{ l.attribute_type EQ 'radio' }">
							<MvLOCALIZED  ID = "MER-ADM-01188">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Radio Buttons</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
						</MvIF>

						<MvIF EXPR = "{ l.attribute_type EQ 'select' }">
							<MvLOCALIZED  ID = "MER-ADM-01189">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Drop-down List</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
						</MvIF>

						<MvIF EXPR = "{ l.attribute_type EQ 'checkbox' }">
							<MvLOCALIZED  ID = "MER-ADM-01190">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Checkbox</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
						</MvIF>

						<MvIF EXPR = "{ l.attribute_type EQ 'text' }">
							<MvLOCALIZED  ID = "MER-ADM-01191">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Text Field</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
						</MvIF>

						<MvIF EXPR = "{ l.attribute_type EQ 'memo' }">
							<MvLOCALIZED  ID = "MER-ADM-01192">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Text Area</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
						</MvIF>

						<MvIF EXPR = "{ g.Features:AttributeTemplates:Enabled }">
							<MvIF EXPR = "{ gettoken( l.attribute_type, ':', 1 ) EQ 'template' }">
								<MvDO FILE = "{ g.Feature_ATT_DB }" NAME = "l.ok" VALUE = "{ AttributeTemplate_Find_ID( l.attribute_template_id ) }">
								<MvEVAL EXPR = "{ AttributeTemplates.d.prompt }">
							</MvIF>
						</MvIF>
						</B>
						</FONT>
					</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
						&nbsp;
					</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
						<MvIF EXPR = "{ ( l.attribute_type EQ 'checkbox' ) OR ( l.attribute_type EQ 'text' ) OR ( l.attribute_type EQ 'memo' ) }">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvEVAL EXPR = "{ encodeentities( l.attribute_price ) }">
							</FONT>
						<MvELSE>
							<FONT FACE = "Arial, Helvetica" SIZE = "1">
							<MvEVAL EXPR = "{ Show_NA() }">
							</FONT>
						</MvIF>
					</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
						<MvIF EXPR = "{ ( l.attribute_type EQ 'checkbox' ) OR ( l.attribute_type EQ 'text' ) OR ( l.attribute_type EQ 'memo' ) }">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvEVAL EXPR = "{ encodeentities( l.attribute_cost ) }">
							</FONT>
						<MvELSE>
							<FONT FACE = "Arial, Helvetica" SIZE = "1">
							<MvEVAL EXPR = "{ Show_NA() }">
							</FONT>
						</MvIF>
					</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
						&nbsp;
					</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
						<MvIF EXPR = "{ (l.attribute_type EQ 'radio') OR (l.attribute_type EQ 'select') OR (l.attribute_type EQ 'memo') OR (l.attribute_type EQ 'text') OR (l.attribute_type EQ 'checkbox') }">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvEVAL EXPR = "{ DrawCheck_Required( l.attribute_required ) }">
							</FONT>
						<MvELSE>
							&nbsp;
						</MvIF>
					</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ l.can_modify }">
							<A HREF = "{ 'JavaScript:EditAttribute( \'' $ JavaScriptEncode( l.attribute_code ) $ '\' );' }"><MvEVAL EXPR = "{ DrawImgButton_EditHere(0) }"><MvEVAL EXPR = "</A>">

							<MvIF EXPR = "{ ( l.attribute_type EQ 'radio' ) OR ( l.attribute_type EQ 'select' ) }">
								<MvLOCALIZED NAME = "l.alt_text"  ID = "MER-ADM-01193">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">New Option</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								<MvIF EXPR = "{ g.Add_Product_Option AND ( g.Edit_Product_Attribute EQ l.attribute_code ) }">
									<A HREF = "JavaScript:NewOption( 0, '' );"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'new_p.gif' }"></A>
								<MvELSE>
									<A HREF = "{ 'JavaScript:NewOption( 1, \'' $ JavaScriptEncode( l.attribute_code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'new.gif' }"></A>
								</MvIF>
							</MvIF>
						<MvELSE>
							&nbsp;
						</MvIF>
						</FONT>
					</TD></TR>
				</MvIF>

				<MvIF EXPR = "{ ( l.attribute_type EQ 'radio' ) OR ( l.attribute_type EQ 'select' ) }">
					<MvASSIGN NAME = "l.option" VALUE = 0>
					<MvASSIGN NAME = "l.previous_option_code" VALUE = "">

					<MvDO FILE = "{ g.Library_DB }" NAME = "l.option_found" VALUE = "{ Option_FindFirst_Attribute( l.attribute_id ) }">
					<MvWHILE EXPR = "{ l.option_found }">
						<MvASSIGN NAME = "l.option" VALUE = "{ l.option + 1 }">

						<MvASSIGN NAME = "l.option_id" VALUE = "{ Options.d.id }">
						<MvASSIGN NAME = "l.option_code" VALUE = "{ Options.d.code }">
						<MvASSIGN NAME = "l.option_prompt" VALUE = "{ Options.d.prompt }">
						<MvASSIGN NAME = "l.option_image" VALUE = "{ Options.d.image }">
						<MvASSIGN NAME = "l.option_price" VALUE = "{ Options.d.price }">
						<MvASSIGN NAME = "l.option_cost" VALUE = "{ Options.d.cost }">

						<MvDO FILE = "{ g.Library_DB }" NAME = "l.option_found" VALUE = "{ Option_FindNext_Attribute( l.attribute_id ) }">

						<MvIF EXPR = "{ ( NOT g.Add_Product_Attribute ) AND
										( NOT g.Add_Product_Option ) AND
										( len( g.Edit_Product_Attribute ) NE 0 ) AND
										( len( g.Edit_Product_Option ) NE 0 ) AND
										( g.Edit_Product_Attribute EQ l.attribute_code ) AND
										( g.Edit_Product_Option EQ l.option_code ) AND
										( l.can_modify OR l.can_add ) }">
							<MvIF EXPR = "{ NOT g.Data_Entry_Error }">
								<MvASSIGN NAME = "g.Product_Option_Code" VALUE = "{ l.option_code }">
								<MvASSIGN NAME = "g.Product_Option_Prompt" VALUE = "{ l.option_prompt }">
								<MvASSIGN NAME = "g.Product_Option_Image" VALUE = "{ l.option_image }">
								<MvASSIGN NAME = "g.Product_Option_Price" VALUE = "{ l.option_price }">
								<MvASSIGN NAME = "g.Product_Option_Cost" VALUE = "{ l.option_cost }">

								<MvIF EXPR = "{ l.option_id EQ l.attribute_default_id }">
									<MvASSIGN NAME = "g.Product_Option_Default" VALUE = "Yes">
								<MvELSE>
									<MvASSIGN NAME = "g.Product_Option_Default" VALUE = "">
								</MvIF>
							</MvIF>

							<TR><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<MvIF EXPR = "{ ( len( l.previous_option_code ) OR l.option_found ) }">
									<MvIF EXPR = "{ len( l.previous_option_code ) }">
										<MvLOCALIZED NAME = "l.alt_text"  ID = "MER-ADM-01194">
											<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Up</MvLOCALIZED-TEXT>
										</MvLOCALIZED>
										<A HREF = "{ 'JavaScript:SwapOptions( \'' $ JavaScriptEncode( l.attribute_code ) $ '\', \'' $ JavaScriptEncode( l.previous_option_code ) $ '\', \'' $ JavaScriptEncode( l.option_code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_u.gif' }"></A>
									<MvELSE>
										<IMG BORDER = 0 WIDTH = 11 HEIGHT = 23 SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }">
									</MvIF>

									<MvIF EXPR = "{ l.option_found }">
										<MvLOCALIZED NAME = "l.alt_text"  ID = "MER-ADM-01195">
											<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Down</MvLOCALIZED-TEXT>
										</MvLOCALIZED>
										<A HREF = "{ 'JavaScript:SwapOptions( \'' $ JavaScriptEncode( l.attribute_code ) $ '\', \'' $ JavaScriptEncode( l.option_code ) $ '\', \'' $ JavaScriptEncode( Options.d.code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_d.gif' }"></A>
									</MvIF>
								<MvELSE>
									&nbsp;
								</MvIF>
								</FONT>
							</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<INPUT TYPE = "text" SIZE = 15 NAME = "Product_Option_Code" VALUE = "{ encodeentities( g.Product_Option_Code ) }" ONCHANGE = "SetModified();">
								</FONT>
							</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" WIDTH = "100%">
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<INPUT TYPE = "text" SIZE = 15 NAME = "Product_Option_Prompt" VALUE = "{ encodeentities( g.Product_Option_Prompt ) }" ONCHANGE = "SetModified();">
								</FONT>
							</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<INPUT TYPE = "text" SIZE = 15 NAME = "Product_Option_Image" VALUE = "{ encodeentities( g.Product_Option_Image ) }" ONCHANGE = "SetModified();">
								</FONT>
							</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<A HREF = "JavaScript:PopupFileUpload( 'Image', '', 'Product_Option_Image' );"><MvEVAL EXPR = "{ DrawImgButton_Upload(0) }"></A>
								</FONT>
							</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
								&nbsp;
							</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
								&nbsp;
							</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<INPUT TYPE = "text" SIZE = 5 NAME = "Product_Option_Price" VALUE = "{ encodeentities( g.Product_Option_Price ) }" ONCHANGE = "SetModified();">
								</FONT>
							</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<INPUT TYPE = "text" SIZE = 5 NAME = "Product_Option_Cost" VALUE = "{ encodeentities( g.Product_Option_Cost ) }" ONCHANGE = "SetModified();">
								</FONT>
							</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<MvIF EXPR = "{ g.Product_Option_Default }">
									<INPUT TYPE = "checkbox" NAME = "Product_Option_Default" VALUE = "Yes" CHECKED ONCLICK = "SetModified();">
								<MvELSE>
									<INPUT TYPE = "checkbox" NAME = "Product_Option_Default" VALUE = "Yes" ONCLICK = "SetModified();">
								</MvIF>
								</FONT>
							</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
								&nbsp;
							</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<MvEVAL EXPR = "{ '<A HREF = "JavaScript:EditOption( \'\', \'\' );">' }"><MvEVAL EXPR = "{ DrawImgButton_EditHere(1) }"><MvEVAL EXPR = "</A>">
								</FONT>
							</TD></TR>
						<MvELSE>
							<TR>
							<MvIF EXPR = "{ ( NOT g.Add_Product_Attribute ) AND
											( NOT g.Add_Product_Option ) AND
											( len( g.Edit_Product_Attribute ) EQ 0 ) AND
											( len( g.Edit_Product_Option ) EQ 0 ) AND
											l.can_modify }">
								<TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
									<FONT FACE = "Arial, Helvetica" SIZE = "-1">
									<INPUT TYPE = "hidden" NAME = "{ 'Product_Option_Code[' $ l.attribute $ '][' $ l.option $ ']' }" VALUE = "{ encodeentities( l.option_code ) }">
									<INPUT TYPE = "checkbox" NAME = "{ 'Product_Option_Remove[' $ l.attribute $ '][' $ l.option $ ']' }" VALUE = "Yes" ONCLICK = "SetModified();">
									</FONT>
								</TD>
							</MvIF>

							<TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<MvIF EXPR = "{ ( len( l.previous_option_code ) OR l.option_found ) AND l.can_modify }">
									<MvIF EXPR = "{ len( l.previous_option_code ) }">
										<MvLOCALIZED NAME = "l.alt_text"  ID = "MER-ADM-01201">
											<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Up</MvLOCALIZED-TEXT>
										</MvLOCALIZED>
										<A HREF = "{ 'JavaScript:SwapOptions( \'' $ JavaScriptEncode( l.attribute_code ) $ '\', \'' $ JavaScriptEncode( l.previous_option_code ) $ '\', \'' $ JavaScriptEncode( l.option_code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_u.gif' }"></A>
									<MvELSE>
										<IMG BORDER = 0 WIDTH = 11 HEIGHT = 23 SRC = "{ g.AdminGraphics_Path $ 'blank.gif' }">
									</MvIF>

									<MvIF EXPR = "{ l.option_found }">
										<MvLOCALIZED NAME = "l.alt_text"  ID = "MER-ADM-01202">
											<MvLOCALIZED-TEXT LANGUAGE = "en-US">Move Down</MvLOCALIZED-TEXT>
										</MvLOCALIZED>
										
										<A HREF = "{ 'JavaScript:SwapOptions( \'' $ JavaScriptEncode( l.attribute_code ) $ '\', \'' $JavaScriptEncode( l.option_code ) $ '\', \'' $JavaScriptEncode( Options.d.code ) $ '\' );' }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'move_d.gif' }"></A>
									</MvIF>
								<MvELSE>
									&nbsp;
								</MvIF>
								</FONT>
							</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<MvEVAL EXPR = "{ encodeentities( l.option_code ) }">
								</FONT>
							</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<MvEVAL EXPR = "{ encodeentities( l.option_prompt ) }">
								</FONT>
							</TD><TD ALIGN = "left" COLSPAN = "2" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<MvIF EXPR = "{ len( l.option_image ) }">
									<MvEVAL EXPR = "{ encodeentities( MMUI_Short_Path( l.option_image ) ) }">
								<MvELSE>
									&nbsp;
								</MvIF>
								</FONT>
							</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
								&nbsp;
							</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
								&nbsp;
							</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<MvEVAL EXPR = "{ encodeentities( l.option_price ) }">
								</FONT>
							</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<MvEVAL EXPR = "{ encodeentities( l.option_cost ) }">
								</FONT>
							</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<MvEVAL EXPR = "{ DrawCheck_Default( l.option_id EQ l.attribute_default_id ) }">
								</FONT>
							</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
								&nbsp;
							</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
								<FONT FACE = "Arial, Helvetica" SIZE = "-1">
								<MvIF EXPR = "{ l.can_modify }">
									<MvEVAL EXPR = "{ '<A HREF = "JavaScript:EditOption( \'' $ JavaScriptEncode( l.attribute_code ) $ '\', \'' $ JavaScriptEncode( l.option_code ) $ '\' );">' }"><MvEVAL EXPR = "{ DrawImgButton_EditHere(0) }"></A>
								<MvELSE>
									&nbsp;
								</MvIF>
								</FONT>
							</TD></TR>
						</MvIF>

						<MvASSIGN NAME = "l.previous_option_code" VALUE = "{ l.option_code }">
					</MvWHILE>

					<MvIF EXPR = "{ g.Add_Product_Option AND ( g.Edit_Product_Attribute EQ l.attribute_code ) }">
						<MvIF EXPR = "{ NOT g.Data_Entry_Error }">
							<MvASSIGN NAME = "g.Product_Option_Code" VALUE = "">
							<MvASSIGN NAME = "g.Product_Option_Prompt" VALUE = "">
							<MvASSIGN NAME = "g.Product_Option_Image" VALUE = "">
							<MvASSIGN NAME = "g.Product_Option_Price" VALUE = "0.00">
							<MvASSIGN NAME = "g.Product_Option_Cost" VALUE = "0.00">
							<MvASSIGN NAME = "g.Product_Option_Default" VALUE = "">
						</MvIF>

						<TR><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
							&nbsp;
						</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" SIZE = 15 NAME = "Product_Option_Code" VALUE = "{ encodeentities( g.Product_Option_Code ) }" ONCHANGE = "SetModified();">
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" WIDTH = "100%">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" SIZE = 15 NAME = "Product_Option_Prompt" VALUE = "{ encodeentities( g.Product_Option_Prompt ) }" ONCHANGE = "SetModified();">
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" SIZE = 15 NAME = "Product_Option_Image" VALUE = "{ encodeentities( g.Product_Option_Image ) }" ONCHANGE = "SetModified();">
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<A HREF = "JavaScript:PopupFileUpload( 'Image', '', 'Product_Option_Image' );"><MvEVAL EXPR = "{ DrawImgButton_Upload(0) }"></A>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
							&nbsp;

						</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
							&nbsp;
						</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" SIZE = 5 NAME = "Product_Option_Price" VALUE = "{ encodeentities( g.Product_Option_Price ) }" ONCHANGE = "SetModified();">
							</FONT>
						</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" SIZE = 5 NAME = "Product_Option_Cost" VALUE = "{ encodeentities( g.Product_Option_Cost ) }" ONCHANGE = "SetModified();">
							</FONT>
						</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvIF EXPR = "{ g.Product_Option_Default }">
								<INPUT TYPE = "checkbox" NAME = "Product_Option_Default" VALUE = "Yes" CHECKED ONCLICK = "SetModified();">
							<MvELSE>
								<INPUT TYPE = "checkbox" NAME = "Product_Option_Default" VALUE = "Yes" ONCLICK = "SetModified();">
							</MvIF>
							</FONT>
						</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
							&nbsp;
						</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
							&nbsp;
						</TD></TR>
					</MvIF>
				</MvIF>

				<INPUT TYPE = "hidden" NAME = "{ 'Product_Option_Count[' $ l.attribute $ ']' }" VALUE = "{ encodeentities( l.option ) }">

				<MvASSIGN NAME = "l.green" VALUE = "{ NOT l.green }">
				<MvASSIGN NAME = "l.previous_attribute_code" VALUE = "{ l.attribute_code }">
			</MvWHILE>

			<INPUT TYPE = "hidden" NAME = "Product_Attribute_Count" VALUE = "{ encodeentities( l.attribute ) }">

			<MvIF EXPR = "{ g.Add_Product_Attribute AND ( l.can_modify OR l.can_add ) }">
				<MvIF EXPR = "{ l.green }">
					<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffdd">
				<MvELSE>
					<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffff">
				</MvIF>

				<MvIF EXPR = "{ NOT g.Data_Entry_Error }">
					<MvASSIGN NAME = "g.Product_Attribute_Code" VALUE = "">
					<MvASSIGN NAME = "g.Product_Attribute_Prompt" VALUE = "">
					<MvASSIGN NAME = "g.Product_Attribute_Image" VALUE = "">

					<MvASSIGN NAME = "g.Product_Attribute_Type" VALUE = "radio">
					<MvASSIGN NAME = "g.Product_Attribute_Price" VALUE = "0.00">
					<MvASSIGN NAME = "g.Product_Attribute_Cost" VALUE = "0.00">
					<MvASSIGN NAME = "g.Product_Attribute_Required" VALUE = "">
				</MvIF>

				<TR><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
					&nbsp;
				</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = 15 NAME = "Product_Attribute_Code" VALUE = "{ encodeentities( g.Product_Attribute_Code ) }" ONCHANGE = "SetModified();">
					</FONT>
				</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = 15 NAME = "Product_Attribute_Prompt" VALUE = "{ encodeentities( g.Product_Attribute_Prompt ) }" ONCHANGE = "SetModified();">
					</FONT>
				</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = 15 NAME = "Product_Attribute_Image" VALUE = "{ encodeentities( g.Product_Attribute_Image ) }" ONCHANGE = "SetModified();">
					</FONT>
				</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<A HREF = "JavaScript:PopupFileUpload( 'Image', '', 'Product_Attribute_Image' );"><MvEVAL EXPR = "{ DrawImgButton_Upload(0) }"></A>
					</FONT>
				</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">

					<MvEVAL EXPR = "{ Screen_Products_Type_Select() }">
					</FONT>
				</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Product_Attribute_Copy, 'Product_Attribute_Copy', 'Yes', '' ) }">
					</FONT>
				</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = 5 NAME = "Product_Attribute_Price" VALUE = "{ encodeentities( g.Product_Attribute_Price ) }" ONCHANGE = "SetModified();">
					</FONT>
				</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "text" SIZE = 5 NAME = "Product_Attribute_Cost" VALUE = "{ encodeentities( g.Product_Attribute_Cost ) }" ONCHANGE = "SetModified();">
					</FONT>
				</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
					&nbsp;
				</TD><TD ALIGN = "center" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvIF EXPR = "{ g.Product_Attribute_Required }">
						<INPUT TYPE = "checkbox" NAME = "Product_Attribute_Required" VALUE = "Yes" CHECKED ONCLICK = "SetModified();">
					<MvELSE>
						<INPUT TYPE = "checkbox" NAME = "Product_Attribute_Required" VALUE = "Yes" ONCLICK = "SetModified();">
					</MvIF>
					</FONT>
				</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "{ l.bgcolor }">
					&nbsp;
				</TD></TR>
			</MvIF>
			</TABLE>
		</MvIF>

		<MvIF EXPR = "{ g.Features:Upsale:Enabled }">
			<MvIF EXPR = "{ g.Tab EQ 'UPSL' }">
				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Module_Feature_USL_AD }" NAME = "l.display_tab" VALUE = "{ USL_ProductScreen_Display_UpsaleTab() }">
				</MvIF>
			<MvELSE>
				<MvHIDE FIELDS = "g.Upsell_Stack, g.Upsell_Offset, g.Upsell_Display, g.Upsell_Count, g.Upsell_Required_Percent, g.Upsell_By_Percent, g.Upsell_Price, g.Upsell_Percent">
			</MvIF>
		</MvIF>
		
		<MvIF EXPR = "{ g.Features:Inventory:Enabled }">
			<MvDO FILE = "{ g.Module_Feature_INV_AD }" NAME = "l.moretabs" VALUE = "{ INV_Screen_Product_Tab_Inventory(l.can_add,l.can_modify,l.can_delete) }">
		</MvIF>
		
		<MvEVAL EXPR = "{ EndContent() }">

		<MvIF EXPR = "{ len( g.Edit_Product ) }">
			<MvEVAL EXPR = "{ DrawButtons_NextPrevious( 'UPRD:[UPDATE]:PROD:0:1:0,DPRD:[DELETE]:PROD:0:0:1', g.Edit_Product ) }">
		<MvELSE>
			<MvEVAL EXPR = "{ DrawButtons( 'IPRD:[ADD]:PROD:1:0:0' ) }">
		</MvIF>

		<MvEVAL EXPR = "{ EndScreen() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Products_Type_Select" PARAMETERS = "" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<SELECT NAME = "Product_Attribute_Type" ONCHANGE = "SetModified();">
	<MvLOCALIZED NAME = "l.option_text"  ID = "MER-ADM-01236">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Radio Buttons</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawOption( 'radio', g.Product_Attribute_Type, l.option_text ) }">

	<MvLOCALIZED NAME = "l.option_text"  ID = "MER-ADM-01237">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Drop-down List</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawOption( 'select', g.Product_Attribute_Type, l.option_text ) }">

	<MvLOCALIZED NAME = "l.option_text"  ID = "MER-ADM-01238">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Checkbox</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawOption( 'checkbox', g.Product_Attribute_Type, l.option_text ) }">

	<MvLOCALIZED NAME = "l.option_text"  ID = "MER-ADM-01239">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Text Field</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawOption( 'text', g.Product_Attribute_Type, l.option_text ) }">

	<MvLOCALIZED NAME = "l.option_text"  ID = "MER-ADM-01240">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Text Area</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawOption( 'memo', g.Product_Attribute_Type, l.option_text ) }">

	<MvIF EXPR = "{ g.Features:AttributeTemplates:Enabled }">
		<MvDO FILE = "{ g.Feature_ATT_DB }" NAME = "l.found" VALUE = "{ AttributeTemplate_FindFirst() }">

		<MvWHILE EXPR = "{ l.found }">
			<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawOption( 'template:' $ AttributeTemplates.d.code, g.Product_Attribute_Type, AttributeTemplates.d.prompt) }">
			<MvDO FILE = "{ g.Feature_ATT_DB }" NAME = "l.found" VALUE = "{ AttributeTemplate_FindNext() }">
		</MvWHILE>
	</MvIF>
	</SELECT>
</MvFUNCTION>

<MvFUNCTION NAME = "MMUI_Short_Path" PARAMETERS = "path" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.pos" VALUE = "1">
	<MvASSIGN NAME = "l.short_path" VALUE = "">
	<MvASSIGN NAME = "l.temp_path" VALUE = "{ ltrim( rtrim( gettoken( l.path, '/', l.pos ) ) ) }">
	<MvWHILE EXPR = "{ len( l.temp_path ) }">
		<MvASSIGN NAME = "l.short_path" VALUE = "{ l.temp_path }">
		<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
		<MvASSIGN NAME = "l.temp_path" VALUE = "{ ltrim( rtrim( gettoken( l.path, '/', l.pos ) ) ) }">
	</MvWHILE>
	<MvIF EXPR = "{ len( l.short_path ) AND ( l.short_path NE l.path ) }">
		<MvASSIGN NAME = "l.short_path" VALUE = "{ '...' $ l.short_path }">
	</MvIF>
	<MvFUNCTIONRETURN VALUE = "{ l.short_path }">
</MvFUNCTION>

<MvCOMMENT>
|
| Store Modules
|
</MvCOMMENT>

<MvFUNCTION NAME = "StoreModules_Validate">
	<MvASSIGN NAME = "l.module" VALUE = 1>
	<MvWHILE EXPR = "{ l.module LE g.Module_Count }">
		<MvIF EXPR = "{ NOT g.Module_Assigned[ l.module ] }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_Code( g.Module_Code[ l.module ] ) }">
			<MvIF EXPR = "{ l.found }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_Find_ID( Modules.d.id ) }">
				<MvIF EXPR = "{ l.found AND ( StoreModules.d.refcount GT 0 ) }">
					<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00483">
						<MvLOCALIZED-TOKEN NAME = "module" VALUE = "{ Modules.d.name }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module '%module%' is in use by one or more orders, and cannot be removed</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvFUNCTIONRETURN VALUE = "{ FieldError( 'MODS', '', l.error_message ) }">
				</MvIF>
			</MvIF>
		</MvIF>

		<MvASSIGN NAME = "l.module" VALUE = "{ l.module + 1 }">
	</MvWHILE>

	<MvIF EXPR = "{ g.Module_Count }">
		<MvASSIGN NAME = "l.module" VALUE = 1>
		<MvWHILE EXPR = "{ l.module LE g.Module_Count }">
			<MvIF EXPR = "{ g.Module_Assigned[ l.module ] }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_Code( g.Module_Code[ l.module ] ) }">
				<MvIF EXPR = "{ l.found }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_Find_ID( Modules.d.id ) }">
					<MvIF EXPR = "{ l.found }">
						<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.valid" VALUE = "{ Module_Store_Validate() }">
						<MvIF EXPR = "{ NOT l.valid }">
							<MvFUNCTIONRETURN VALUE = 0>
						</MvIF>
					</MvIF>
				</MvIF>
			</MvIF>

			<MvASSIGN NAME = "l.module" VALUE = "{ l.module + 1 }">
		</MvWHILE>
	<MvELSE>
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst_Type( g.Module_Type ) }">
		<MvWHILE EXPR = "{ l.found }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.valid" VALUE = "{ Module_Store_Validate() }">
			<MvIF EXPR = "{ NOT l.valid }">
				<MvFUNCTIONRETURN VALUE = 0>
			</MvIF>

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext_Type( g.Module_Type ) }">
		</MvWHILE>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_StoreModules_Update">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvASSIGN NAME = "l.modified" VALUE = 0>

	<MvIF EXPR = "{ g.Module_Type EQ 'SHIPPING' }">
		<MvIF EXPR = "{ NOT Domain.d.d_ship }">
			<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'SHIP', 0, 1, 0, 0 ) }">
			<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'SHIP', 0, 0, 1, 0 ) }">
			<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'SHIP', 0, 0, 0, 1 ) }">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Module_Type EQ 'PAYMENT' }">
		<MvIF EXPR = "{ NOT Domain.d.d_pay }">
			<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'PMNT', 0, 1, 0, 0 ) }">
			<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'PMNT', 0, 0, 1, 0 ) }">
			<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'PMNT', 0, 0, 0, 1 ) }">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Module_Type EQ 'FULFILLMENT' }">
		<MvIF EXPR = "{ NOT Domain.d.d_ful }">
			<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'FUFL', 0, 1, 0, 0 ) }">
			<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'FUFL', 0, 0, 1, 0 ) }">
			<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'FUFL', 0, 0, 0, 1 ) }">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Module_Type EQ 'LOG' }">
		<MvIF EXPR = "{ NOT Domain.d.d_log }">
			<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'LOGM', 0, 1, 0, 0 ) }">
			<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'LOGM', 0, 0, 1, 0 ) }">
			<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'LOGM', 0, 0, 0, 1 ) }">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Module_Type EQ 'SYSTEM' }">
		<MvIF EXPR = "{ NOT Domain.d.d_sys }">
			<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'SYSM', 0, 1, 0, 0 ) }">
			<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'SYSM', 0, 0, 1, 0 ) }">
			<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'SYSM', 0, 0, 0, 1 ) }">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Module_Type EQ 'STOREUTIL' }">
		<MvIF EXPR = "{ NOT Domain.d.d_utl }">
			<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'SUTL', 0, 1, 0, 0 ) }">
			<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'SUTL', 0, 0, 1, 0 ) }">
			<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'SUTL', 0, 0, 0, 1 ) }">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Module_Type EQ 'STOREWIZARD' }">
		<MvASSIGN NAME = "l.can_add"	VALUE = "1">
		<MvASSIGN NAME = "l.can_modify" VALUE = "1">
		<MvASSIGN NAME = "l.can_delete" VALUE = "1">
	</MvIF>

	<MvIF EXPR = "{ l.can_modify OR l.can_add OR l.can_delete }">
		<MvIF EXPR = "{ l.can_modify }">
			<MvASSIGN NAME = "l.valid" VALUE = "{ StoreModules_Validate() }">
		<MvELSE>
			<MvASSIGN NAME = "l.valid" VALUE = "1">
		</MvIF>
        <MvIF EXPR = "{ l.valid }">
			<MvASSIGN NAME = "l.module" VALUE = 1>
			<MvWHILE EXPR = "{ l.ok AND ( l.module LE g.Module_Count ) }">
				<MvIF EXPR = "{ NOT g.Module_Assigned[ l.module ] }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_Code_Admin( g.Module_Code[ l.module ] ) }">
					<MvIF EXPR = "{ l.found }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_Find_ID_Admin( Modules.d.id ) }">
						<MvIF EXPR = "{ l.found AND l.can_delete }">
							<MvIF EXPR = "{ Modules.d.active }">
								<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Uninstall_Store() }">
							</MvIF>
							<MvIF EXPR = "{ l.ok }">
								<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ StoreModule_Delete( Modules.d.id ) }">
								<MvIF EXPR = "{ l.ok }">
									<MvASSIGN NAME = "l.modified" VALUE = 1>
								</MvIF>
							</MvIF>
						</MvIF>
					</MvIF>
				</MvIF>
				<MvASSIGN NAME = "l.module" VALUE = "{ l.module + 1 }">
			</MvWHILE>

			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst_Type( g.Module_Type ) }">
				<MvWHILE EXPR = "{ l.ok AND l.found AND l.can_modify }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Store_Update() }">
					<MvIF EXPR = "{ l.ok }">
						<MvASSIGN NAME = "l.modified" VALUE = 1>
					</MvIF>
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext_Type( g.Module_Type ) }">
				</MvWHILE>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvASSIGN NAME = "l.module" VALUE = 1>
				<MvWHILE EXPR = "{ l.ok AND ( l.module LE g.Module_Count ) }">
					<MvIF EXPR = "{ g.Module_Assigned[ l.module ] }">
						<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_Code( g.Module_Code[ l.module ] ) }">
						<MvIF EXPR = "{ l.found }">
							<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_Find_ID( Modules.d.id ) }">
							<MvIF EXPR = "{ ( NOT l.found ) AND l.can_add }">
								<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Install_Store() }">
								<MvIF EXPR = "{ l.ok }">
									<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ StoreModule_Insert( Modules.d.id, Modules.d.type ) }">
									<MvIF EXPR = "{ l.ok }">
										<MvASSIGN NAME = "l.modified" VALUE = 1>
									</MvIF>
								</MvIF>
							</MvIF>
						</MvIF>
					</MvIF>
					<MvASSIGN NAME = "l.module" VALUE = "{ l.module + 1 }">
				</MvWHILE>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvIF EXPR = "{ g.Module_Type EQ 'SHIPPING' AND l.modified }">
					<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00484">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Shipping Configuration updated</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ g.Module_Type EQ 'PAYMENT' AND l.modified }">
					<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00485">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Payment Configuration updated</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ g.Module_Type EQ 'FULFILLMENT' AND l.modified }">
					<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00486">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Order Fulfillment Configuration updated</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ g.Module_Type EQ 'LOG' AND l.modified }">
					<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00487">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Logging Configuration updated</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ g.Module_Type EQ 'SYSTEM' AND l.modified }">
					<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00488">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">System Extension Configuration updated</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ g.Module_Type EQ 'STOREUTIL' AND l.modified }">
					<MvEVAL EXPR = "{ Update_LeftNavigation() }">
					<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00489">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store Utility Configuration updated</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ g.Module_Type EQ 'WIZARD' AND l.modified }">
					<MvEVAL EXPR = "{ Update_LeftNavigation() }">
					<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00490">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Wizard Configuration updated</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>

				<MvIF EXPR = "{ g.Module_Type EQ 'STOREWIZARD' AND l.modified }">
					<MvEVAL EXPR = "{ Update_LeftNavigation() }">
					<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00491">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store Wizard Configuration updated</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_StoreModules">

	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvASSIGN NAME = "l.can_modify" VALUE = "0">

	<MvIF EXPR = "{ g.Module_Type EQ 'SHIPPING' }">
		<MvIF EXPR = "{ NOT Domain.d.d_ship }">
			<MvASSIGN NAME = "l.can_view"	VALUE = "{ CanI( 'SHIP', 1, 0 ,0 ,0 ) }">
			<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'SHIP', 0, 1, 0, 0 ) }">
			<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'SHIP', 0, 0, 1, 0 ) }">
			<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'SHIP', 0, 0, 0, 1 ) }">
			<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00492">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Shipping Configuration</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvASSIGN NAME = "l.buttons"    VALUE = "Help:smod_ship.html">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Module_Type EQ 'PAYMENT' }">
		<MvIF EXPR = "{ NOT Domain.d.d_pay }">
			<MvASSIGN NAME = "l.can_view"	VALUE = "{ CanI( 'PMNT', 1, 0 ,0 ,0 ) }">
			<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'PMNT', 0, 1, 0, 0 ) }">
			<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'PMNT', 0, 0, 1, 0 ) }">
			<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'PMNT', 0, 0, 0, 1 ) }">
			<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00493">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Payment Configuration</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvASSIGN NAME = "l.buttons"    VALUE = "Help:smod_pay.html">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Module_Type EQ 'FULFILLMENT' }">
		<MvIF EXPR = "{ NOT Domain.d.d_ful }">
			<MvASSIGN NAME = "l.can_view"	VALUE = "{ CanI( 'FUFL', 1, 0 ,0 ,0 ) }">
			<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'FUFL', 0, 1, 0, 0 ) }">
			<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'FUFL', 0, 0, 1, 0 ) }">
			<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'FUFL', 0, 0, 0, 1 ) }">
			<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00494">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Order Fulfillment Configuration</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvASSIGN NAME = "l.buttons"	VALUE = "Help:smod_fufl.html">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Module_Type EQ 'LOG' }">
		<MvIF EXPR = "{ NOT Domain.d.d_log }">
			<MvASSIGN NAME = "l.can_view"	VALUE = "{ CanI( 'LOGM', 1, 0 ,0 ,0 ) }">
			<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'LOGM', 0, 1, 0, 0 ) }">
			<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'LOGM', 0, 0, 1, 0 ) }">
			<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'LOGM', 0, 0, 0, 1 ) }">
			<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00495">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Logging Configuration</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvASSIGN NAME = "l.buttons"	VALUE = "Help:smod_log.html">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Module_Type EQ 'SYSTEM' }">
		<MvIF EXPR = "{ NOT Domain.d.d_sys }">
			<MvASSIGN NAME = "l.can_view"	VALUE = "{ CanI( 'SYSM', 1, 0 ,0 ,0 ) }">
			<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'SYSM', 0, 1, 0, 0 ) }">
			<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'SYSM', 0, 0, 1, 0 ) }">
			<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'SYSM', 0, 0, 0, 1 ) }">
			<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00496">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">System Extension Configuration</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvASSIGN NAME = "l.buttons"	VALUE = "Help:smod_sys.html">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Module_Type EQ 'STOREUTIL' }">
		<MvIF EXPR = "{ NOT Domain.d.d_utl }">
			<MvASSIGN NAME = "l.can_view"	VALUE = "{ CanI( 'SUTL', 1, 0, 0, 0 ) }">
			<MvASSIGN NAME = "l.can_add"	VALUE = "{ CanI( 'SUTL', 0, 1, 0, 0 ) }">
			<MvASSIGN NAME = "l.can_modify" VALUE = "{ CanI( 'SUTL', 0, 0, 1, 0 ) }">
			<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'SUTL', 0, 0, 0, 1 ) }">
			<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00497">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store Utility Configuration</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvASSIGN NAME = "l.buttons"	VALUE = "Help:smod_utl.html">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Module_Type EQ 'STOREWIZARD' }">
		<MvASSIGN NAME = "l.can_view"	VALUE = "1">
		<MvASSIGN NAME = "l.can_add"	VALUE = "1">
		<MvASSIGN NAME = "l.can_modify" VALUE = "1">
		<MvASSIGN NAME = "l.can_delete" VALUE = "1">
		<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00498">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store Wizards Configuration</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvASSIGN NAME = "l.buttons"	VALUE = "Help:smod_wiz.html">
	</MvIF>

	<MvIF EXPR = "{ l.can_view }">
		<MvLOCALIZED NAME = "l.tabs" ID = "MER-ADM-00499">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">MODS:Modules</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst_Type( g.Module_Type ) }">
		<MvWHILE EXPR = "{ l.found }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_tabs" VALUE = "{ Module_Store_Tabs() }">
			<MvIF EXPR = "{ len( l.module_tabs ) }">
				<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.module_tabs }">
			</MvIF>

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext_Type( g.Module_Type ) }">
		</MvWHILE>

		<MvEVAL EXPR = "{ BeginScreen( l.title, 'SMOD', l.buttons ) }">
		<MvHIDE FIELDS = "g.Module_Type">

		<MvEVAL EXPR = "{ DrawTabs( 'MODS', l.tabs ) }">

		<MvEVAL EXPR = "{ BeginContent() }">
		<MvIF EXPR = "{ g.Tab EQ 'MODS' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD BGCOLOR = "#000080">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00500">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Assigned</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD BGCOLOR = "#000080" WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
				<MvLOCALIZED ID = "MER-ADM-00501">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Module</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD></TR>

			<MvASSIGN NAME = "l.shown" VALUE = 0>

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindFirst_Type_Admin( g.Module_Type ) }">
			<MvWHILE EXPR = "{ l.found }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.assigned" VALUE = "{ StoreModule_Installed( Modules.d.id ) }">
				
				<MvIF EXPR = "{ l.assigned OR modules.d.active }">

					<MvASSIGN NAME = "l.shown" VALUE = "{ l.shown + 1 }">

					<MvIF EXPR = "{ ( l.shown MOD 2 ) EQ 0 }">
						<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffdd">
					<MvELSE>
						<MvASSIGN NAME = "l.bgcolor" VALUE = "#ffffff">
					</MvIF>

					<TR><TD ALIGN = "center" BGCOLOR = "{ l.bgcolor }">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ l.can_add OR l.can_delete }">
							<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckboxModAlert( l.assigned, 'Module_Assigned[' $ l.shown $ ']', 'Yes', '' ) }">
						<MvELSE>
							<MvEVAL EXPR = "{ DrawCheck_Assigned( l.assigned ) }">
						</MvIF>
						</FONT>
					</TD><TD BGCOLOR = "{ l.bgcolor }">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "hidden" NAME = "{ 'Module_Code[' $ l.shown $ ']' }" VALUE = "{ encodeentities( Modules.d.code ) }">

						<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.module_name" VALUE = "{ HTML_Format_Marks( Modules.d.name ) }">

						<MvEVAL EXPR = "{ l.module_name }">
						<MvIf EXPR = "{ NOT modules.d.active }">
							<FONT COLOR = "red">
							<MvLOCALIZED ID = "MER-ADM-01562">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US"> (Deactivated)</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
						</MvIF>
						</FONT>
					</TD></TR>
					
				</MvIF>

				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindNext_Type_Admin( g.Module_Type ) }">
			</MvWHILE>
			</TABLE>

			<INPUT TYPE = "hidden" NAME = "Module_Count" VALUE = "{ encodeentities( l.shown ) }">
		<MvELSE>
			<INPUT TYPE = "hidden" NAME = "Module_Count" VALUE = 0>
		</MvIF>

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst_Type( g.Module_Type ) }">
		<MvWHILE EXPR = "{ l.ok AND l.found }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ Module_Store_Content( g.Tab, g.Load_Fields ) }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext_Type( g.Module_Type ) }">
		</MvWHILE>

		<MvEVAL EXPR = "{ EndContent() }">

		<MvIF EXPR = "{ l.can_modify OR l.can_add OR l.can_delete }">
			<MvEVAL EXPR = "{ DrawButtons( 'SMOD:[UPDATE]' ) }">
		<MvELSE>
			<MvEVAL EXPR = "{ DrawButtons( '' ) }">
		</MvIF>

		<MvEVAL EXPR = "{ EndScreen() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Order_Information" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Order_Find_ID( g.Order_ID ) }">

	<MvIF EXPR = "{ l.ok }">
		<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-01563">
			<MvLOCALIZED-TOKEN NAME = "order_number" VALUE = "{ encodeentities( Orders.d.id ) }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Order #%order_number%</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
	</MvIF>

	<HEAD>
	<TITLE><MvEVAL EXPR = "{ encodeentities( l.title ) }"></TITLE>
	</HEAD>
	<BODY>
	
	<MvIF EXPR = "{ l.ok }">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<B>
		<MvLOCALIZED ID = "MER-ADM-01350">
			<MvLOCALIZED-TOKEN NAME = "order_number" VALUE = "{ encodeentities( Orders.d.id ) }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Order #%order_number%</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B>
		</FONT>
	</MvIF>

	<BR>
	<MvASSIGN NAME = "l.order_date" VALUE = "{ padl( time_t_month( Orders.d.date, timezone() ), 2, '0' ) $ '/' $
													   padl( time_t_dayofmonth( Orders.d.date, timezone() ), 2, '0' ) $ '/' $
													   time_t_year( Orders.d.date, timezone() ) }">
	<MvIF EXPR = "{ l.ok }">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<B>
		<MvLOCALIZED ID = "MER-ADM-01351">
			<MvLOCALIZED-TOKEN NAME = "date" VALUE = "{ encodeentities( l.order_date ) }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Date Of Order:	%date%</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B>	
		</FONT>
	</MvIF>

	<BR>
	<MvASSIGN NAME = "l.order_time" VALUE = "{ padl( time_t_hour( Orders.d.date, timezone() ), 2, '0' ) $ ':' $ padl( time_t_min( Orders.d.date, timezone() ), 2, '0' ) $ ':' $ padl( time_t_sec( Orders.d.date, timezone() ), 2, '0' ) $ ' ' $ s.stm_zone }">
	<MvIF EXPR = "{ l.ok }">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<B>
		<MvLOCALIZED ID = "MER-ADM-01352">
			<MvLOCALIZED-TOKEN NAME = "time" VALUE = "{ encodeentities( l.order_time ) }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Time Of Order:	%time%</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		</B>
		</FONT>
	</MvIF>

	<HR>
	<MvIF EXPR = "{ l.ok }">
		<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD ALIGN = "left" VALIGN = "middle">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<B>
				<MvLOCALIZED ID = "MER-ADM-01353">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Ship To:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B>
				</FONT>
			</TD><TD ALIGN = "left" VALIGN = "middle">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<B>
				<MvLOCALIZED ID = "MER-ADM-01354">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Bill To:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B>
				</FONT>
			</TD></TR>
			<TR><TD ALIGN = "left" VALIGN = "top">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ Orders.d.ship_fname }">
					<MvEVAL EXPR = "{ Orders.d.ship_lname }">
					</FONT>
				</TD></TR>

				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ Orders.d.ship_email }">
					</FONT>
				</TD></TR>

				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ Orders.d.ship_phone }">
					</FONT>
				</TD></TR>

				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ Orders.d.ship_fax }">
					</FONT>
				</TD></TR>

				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ Orders.d.ship_comp }">
					</FONT>
				</TD></TR>
				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<BR>
					<MvEVAL EXPR = "{ Orders.d.ship_addr }">
					</FONT>
				</TD></TR>

				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ Orders.d.ship_city $ ', ' }">
						<MvEVAL EXPR = "{ Orders.d.ship_state }">
						<MvEVAL EXPR = "{ Orders.d.ship_zip }">
					</FONT>
				</TD></TR>

				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ Orders.d.ship_cntry }">
					</FONT>
				</TD></TR>
			</TABLE>

			</TD><TD ALIGN = "left" VALIGN = "top">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ Orders.d.bill_fname }">
					<MvEVAL EXPR = "{ Orders.d.bill_lname }">
					</FONT>
				</TD></TR>


				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ Orders.d.bill_email }">
					</FONT>
				</TD></TR>

				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ Orders.d.bill_phone }">
					</FONT>
				</TD></TR>

				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ Orders.d.bill_fax }">
					</FONT>
				</TD></TR>

				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ Orders.d.bill_comp }">
					</FONT>
				</TD></TR>
				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<BR>
					<MvEVAL EXPR = "{ Orders.d.bill_addr }">
					</FONT>
				</TD></TR>

				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ Orders.d.bill_city $ ', ' }">
					<MvEVAL EXPR = "{ Orders.d.bill_state }">
					<MvEVAL EXPR = "{ Orders.d.bill_zip }">
					</FONT>
				</TD></TR>


				<TR><TD ALIGN = "left" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ Orders.d.bill_cntry }">
					</FONT>
				</TD></TR>
			</TABLE>
			</TD></TR>
		</TABLE>
		<HR>
		<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD ALIGN = "left" VALIGN = "middle">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<B>
				<MvLOCALIZED ID = "MER-ADM-01355">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Shipping Information:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B>
				</FONT>
			</TD><TD ALIGN = "left" VALIGN = "middle">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<B>
				<MvLOCALIZED ID = "MER-ADM-01356">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Payment Information:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B>
				</FONT>
			</TD></TR>

			<TR><TD ALIGN = "left" VALIGN = "top">
				<MvIF EXPR = "{ Orders.d.ship_id }">
					<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
						<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Orders.d.ship_id ) }">
						<MvIF EXPR = "{ l.found }">
							<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.fields" VALUE = "{ ShippingModule_Report_Fields() }">

							<MvIF EXPR = "{ len( l.fields ) }">
								<MvASSIGN NAME = "l.pos" VALUE = 1>
								<MvASSIGN NAME = "l.field" VALUE = "{ ltrim( rtrim( gettoken( l.fields, ',', l.pos ) ) ) }">
								<MvWHILE EXPR = "{ len( l.field ) }">
									<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.label" VALUE = "{ ShippingModule_Report_Label( l.field ) }">
									<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.value" VALUE = "{ ShippingModule_Report_Value( l.field ) }">

									<TR><TD ALIGN = "left" VALIGN = "top" NOWRAP>
										<FONT FACE = "Arial, Helvetica" SIZE = "-1">
											<MvEVAL EXPR = "{ l.label }">
										</FONT>
									</TD><TD ALIGN = "left" VALIGN = "top">
										<FONT FACE = "Arial, Helvetica" SIZE = "-1">
											<MvEVAL EXPR = "{ l.value }">
										</FONT>
									</TD></TR>

									<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
									<MvASSIGN NAME = "l.field" VALUE = "{ ltrim( rtrim( gettoken( l.fields, ',', l.pos ) ) ) }">
								</MvWHILE>
							</MvIF>
						</MvIF>
					</TABLE>
				</MvIF>
			</TD><TD ALIGN = "left" VALIGN = "top">
				<MvIF EXPR = "{ Orders.d.pay_id }">
					<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Orders.d.pay_id ) }">
					<MvIF EXPR = "{ l.found }">
						<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.desc" VALUE = "{ PaymentModule_Report_Description() }">
						<MvIF EXPR = "{ l.desc }">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvEVAL EXPR = "{ l.desc }">
							</FONT><BR>
						</MvIF>
						<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.fields" VALUE = "{ PaymentModule_Report_Fields() }">
						<MvIF EXPR = "{ len( l.fields ) }">
							<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>

								<MvASSIGN NAME = "l.pos" VALUE = 1>
								<MvASSIGN NAME = "l.field" VALUE = "{ ltrim( rtrim( gettoken( l.fields, ',', l.pos ) ) ) }">
								<MvWHILE EXPR = "{ len( l.field ) }">
									<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.label" VALUE = "{ PaymentModule_Report_Label( l.field ) }">
									<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.value" VALUE = "{ PaymentModule_Report_Value( l.field ) }">

									<TR><TD ALIGN = "left" VALIGN = "top" NOWRAP>
										<FONT FACE = "Arial, Helvetica" SIZE = "-1">
											<MvEVAL EXPR = "{ l.label }">
										</FONT>
									</TD><TD ALIGN = "left" VALIGN = "top">
										<FONT FACE = "Arial, Helvetica" SIZE = "-1">
											<MvEVAL EXPR = "{ l.value }">
										</FONT>
									</TD></TR>

									<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
									<MvASSIGN NAME = "l.field" VALUE = "{ ltrim( rtrim( gettoken( l.fields, ',', l.pos ) ) ) }">
								</MvWHILE>
							</TABLE>
						</MvIF>
					</MvIF>
				</MvIF>
			</TD></TR>
		</TABLE>
		<HR>
		<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD ALIGN = "left" VALIGN = "middle">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<B>
				<MvLOCALIZED ID = "MER-ADM-01357">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B>
				</FONT>
			</TD><TD ALIGN = "left" VALIGN = "middle">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<B>
				<MvLOCALIZED ID = "MER-ADM-01358">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Product</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B>
				</FONT>
			</TD><TD ALIGN = "left" VALIGN = "middle">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<B>
				<MvLOCALIZED ID ID = "MER-ADM-01359" ID = "MER-ADM-01397">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Quantity</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B>
				</FONT>
			</TD><TD ALIGN = "right" VALIGN = "middle">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<B>
				<MvLOCALIZED ID = "MER-ADM-01360">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Price/Ea.</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B>
				</FONT>
			</TD><TD ALIGN = "right" VALIGN = "middle">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<B>
				<MvLOCALIZED ID = "MER-ADM-01361">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Total</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B>
				</FONT>
			</TD></TR>
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ OrderItem_FindFirst_Order( Orders.d.id ) }">
			<MvWHILE EXPR = "{ l.found }">
				<TR><TD ALIGN = "left" VALIGN = "middle" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ encodeentities( OrderItems.d.code ) }">
					</FONT>
				</TD><TD ALIGN = "left" VALIGN = "middle" WIDTH = "100%" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ encodeentities( OrderItems.d.name ) }">

					<MvIF EXPR = "{ encodeentities( OrderItems.d.upsold ) }">
						<MvLOCALIZED  ID = "MER-ADM-01362">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">(Special Offer)</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
					</MvIF>
					</FONT>
				</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ encodeentities( OrderItems.d.quantity ) }">
					</FONT>
				</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ encodeentities( OrderItems.d.price ) }">
					</FONT>
					</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ ( OrderItems.d.price * OrderItems.d.quantity ) ROUND 2 }">
					</FONT>
				</TD></TR>
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ OrderOption_FindFirst_Line( OrderItems.d.line_id ) }">
				<MvWHILE EXPR = "{ l.found }">
					<TR><TD ALIGN = "left">
						&nbsp;
					</TD><TD ALIGN = "left">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ OrderOptions.d.option_id }">
							<MvEVAL EXPR = "{ encodeentities( OrderOptions.d.attr_code ) }">:
							<MvEVAL EXPR = "{ encodeentities( OrderOptions.d.opt_code ) }">
						<MvELSE>
							<MvIF EXPR = "{ OrderOptions.d.data }">
								<MvEVAL EXPR = "{ encodeentities( OrderOptions.d.attr_code ) }">:
								<MvEVAL EXPR = "{ OrderOptions.d.data }">
							<MvELSE>
								<MvIF EXPR = "{ OrderOptions.d.data_long }">
									<MvEVAL EXPR = "{ encodeentities( OrderOptions.d.attr_code ) }">:
									<MvEVAL EXPR = "{ OrderOptions.d.data_long }">
								<MvELSE>
									<MvEVAL EXPR = "{ encodeentities( OrderOptions.d.attr_code ) }">
								</MvIF>
							</MvIF>
						</MvIF>
						</FONT>
					</TD><TD ALIGN = "left">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							&nbsp;
						</FONT>
						</TD><TD ALIGN = "right">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ OrderOptions.d.price }">
							<MvEVAL EXPR = "{ encodeentities( OrderOptions.d.price ) }">
						<MvELSE>
							&nbsp;
						</MvIF>
						</FONT>
					</TD><TD ALIGN = "right">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ OrderOptions.d.price }">
							<MvEVAL EXPR = "{ ( OrderOptions.d.price * OrderItems.d.quantity ) ROUND 2 }">
						<MvELSE>
							&nbsp;
						</MvIF>
						</FONT>
					</TD></TR>

					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ OrderOption_FindNext_Line( OrderItems.d.line_id ) }">
				</MvWHILE>

				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ OrderItem_FindNext_Order( Orders.d.id ) }">
			</MvWHILE>

			<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.found" VALUE = "{ OrderCharge_FindFirst_Charge( Orders.d.id ) }">
			<MvIF EXPR = l.found>
				<MvWHILE EXPR = "{ l.found }">
					<TR><TD ALIGN = "right" VALIGN = "middle" COLSPAN = 3>
						&nbsp;
					</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<I>
						<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.description" VALUE = "{ HTML_Format_Marks( encodeentities( OrderCharges.d.desc ) ) }">
						<MvEVAL EXPR = "{ l.description }">:
						</I>
						</FONT>
					</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvEVAL EXPR = "{ OrderCharges.d.disp_amt ROUND 2 }">
						</FONT>
					</TD></TR>
					<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.found" VALUE = "{ OrderCharge_FindNext_Charge( Orders.d.id ) }">
				</MvWHILE>
			</MvIF>
			<TR><TD ALIGN = "right" VALIGN = "middle" COLSPAN = 3>
				&nbsp;
			</TD><TD ALIGN = "right" VALIGN = "middle">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">

				<B>
				<MvLOCALIZED ID = "MER-ADM-01363">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Total:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B>
				</FONT>
			</TD><TD ALIGN = "right" VALIGN = "middle">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvEVAL EXPR = "{ encodeentities( Orders.d.total ) }">
				</FONT>
			</TD></TR>
		</TABLE>
		<HR>
		</BODY>
	</MvIF>
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Create Batch
|
</MvCOMMENT>

<MvFUNCTION NAME = "Batch_Validate">
	<MvASSIGN NAME = "g.Batch_Name" VALUE = "{ ltrim( rtrim( g.Batch_Name ) ) }">

	<MvIF EXPR = "{ len( g.Batch_Name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00662">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a batch name</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( '', 'Batch_Name', l.error_message ) }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Create_Batch">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvIF EXPR = "{ CanI( 'ORDR', 0, 1, 0, 0 ) }">
		<MvIF EXPR = "{ Batch_Validate() }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "g.Batch_ID" VALUE = "{ Batch_Create( g.Batch_Name ) }">
			<MvIF EXPR = "{ NOT g.Batch_ID }">
				<MvASSIGN NAME = "l.ok" VALUE = 0>
			<MvELSE>
				<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00663">
					<MvLOCALIZED-TOKEN NAME = "batch" VALUE = "{ encodeentities( g.Batch_Name ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Batch '%batch%' created</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvASSIGN NAME = "g.Screen" VALUE = "BRPT">

				<MvEVAL EXPR = "{ Update_LeftNavigation() }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_CreateBatch">
	<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00664">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Create Batch</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ CanI( 'ORDR', 0, 1, 0, 0 ) }">
		<MvIF EXPR = "{ g.Load_Fields }">
			<MvASSIGN NAME = "Batch_Name" VALUE = "">
		</MvIF>

		<MvDO FILE = "{ g.Library_DB }" NAME = "l.count" VALUE = "{ Order_Count_Batch( 0 ) }">
		<MvIF EXPR = "{ l.count EQ 0 }">
			<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00665">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Create Batch: No new orders</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		<MvELSE>
			<MvIF EXPR = "{ l.count EQ 1 }">
				<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00666">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Create Batch: 1 new order</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			<MvELSE>
				<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00667">
					<MvLOCALIZED-TOKEN NAME = "count" VALUE = "{ encodeentities( l.count ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Create Batch: %count% new orders</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			</MvIF>
		</MvIF>

		<MvEVAL EXPR = "{ BeginScreen( l.title, 'CBCH', 'Help:cbch.html' ) }">
		<MvIF EXPR = "{ l.count EQ 0 }">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED ID = "MER-ADM-00668">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">There are no new orders</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</FONT>
		<MvELSE>
			<MvEVAL EXPR = "{ BeginContent() }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00669">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Batch Name:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = 40 NAME = "Batch_Name" VALUE = "{ encodeentities( g.Batch_Name ) }">
				</FONT>
			</TD></TR>
			</TABLE>
			<MvEVAL EXPR = "{ EndContent() }">
		</MvIF>

		<MvLOCALIZED NAME = "l.assn" ID = "MER-ADM-00851">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Create</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvIF EXPR = "{ l.count GT 0 }">
			<MvEVAL EXPR = "{ DrawButtons( 'CBCH:' $ l.assn ) }">
		</MvIF>

		<MvEVAL EXPR = "{ EndScreen() }">
	<MvELSE>
		<MvASSIGN NAME = "l.null" VALUE = "{ Screen_Blank() }">
	</MvIF>
	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvCOMMENT>
|
| Batch Reports
|
</MvCOMMENT>

<MvFUNCTION NAME = "BatchReport_Validate">
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_Code( g.Module_Code ) }">
	<MvIF EXPR = "{ NOT l.found }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-ADM-00670">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please select a report</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "{ FieldError( '', '', l.error_message ) }">
	<MvELSE>
		<MvASSIGN NAME = "g.Module_Report" VALUE = "{ Modules.d.module }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Run_BatchReport">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ CanI( 'ORDR', 1, 0, 0, 0 ) }">
		<MvIF EXPR = "{ BatchReport_Validate() }">
			<MvDO FILE = "{ g.Module_Root $ g.Module_Report }" NAME = "l.ok" VALUE = "{ BatchReportModule_Report( g.Batch_ID ) }">
			<MvIF EXPR = "{ l.ok }">
				<MvASSIGN NAME = "g.Screen" VALUE = "">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_BatchReport">
	<MvIF EXPR = "{ g.Load_Fields }">
		<MvASSIGN NAME = "Module_Code" VALUE = "">
	</MvIF>

	<MvIF EXPR = "{ CanI( 'ORDR', 1, 0, 0, 0 ) }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Batch_Find_ID( g.Batch_ID ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "l.screen_label" ID = "MER-ADM-00671">
				<MvLOCALIZED-TOKEN NAME = "batch_name" VALUE = "{ encodeentities( Batches.d.name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Run Batch Report: %batch_name%</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvEVAL EXPR = "{ BeginScreen( l.screen_label, 'BRPT', 'Help:brpt.html' ) }">

			<MvHIDE FIELDS = "g.Batch_ID">

			<MvEVAL EXPR = "{ BeginContent() }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-ADM-00672">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Report:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<SELECT NAME = "Module_Code">
				<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawOption_SelectOne() }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindFirst_Type( 'BATCHREPORT' ) }">
				<MvWHILE EXPR = "{ l.found }">
					<MvIF EXPR = "{ Modules.d.code EQ g.Module_Code }">
						<OPTION VALUE = "{ encodeentities( Modules.d.code ) }" SELECTED><MvEVAL EXPR = "{ Modules.d.name }"></OPTION>
					<MvELSE>
						<OPTION VALUE = "{ encodeentities( Modules.d.code ) }"><MvEVAL EXPR = "{ Modules.d.name }"></OPTION>
					</MvIF>

					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_FindNext_Type( 'BATCHREPORT' ) }">
				</MvWHILE>
				</SELECT>
				</FONT>
			</TD></TR>
			</TABLE>
			<MvEVAL EXPR = "{ EndContent() }">
			<MvLOCALIZED NAME = "l.button_text" ID = "MER-ADM-00673">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Run Report</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvEVAL EXPR = "{ DrawButtons( 'BRPT:' $ l.button_text ) }">
			<MvEVAL EXPR = "{ EndScreen() }">
		</MvIF>
	<MvELSE>
		<MvASSIGN NAME = "l.null" VALUE = "{ Screen_Blank() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Order Processing
|
</MvCOMMENT>

<MvFUNCTION NAME = "Action_Process_Order">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ CanI( 'ORDR', 0, 0, 1, 0 ) }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Order_Find_ID( g.Order_ID ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID( Orders.d.pay_id ) }">
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.processed" VALUE = "{ PaymentModule_Process() }">
			<MvIF EXPR = "{ l.processed LT 0 }">
				<MvASSIGN NAME = "l.ok" VALUE = 0>
			<MvELSE>
				<MvIF EXPR = "{ l.processed }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Order_Update_Processed( Orders.d.id, 1 ) }">
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Mark_Order">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ CanI( 'ORDR', 0, 0, 1, 0 ) }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Order_Find_ID( g.Order_ID ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Order_Update_Processed( Orders.d.id, 1 ) }">
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_ProcessOrders">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ CanI( 'ORDR', 0, 0, 1, 0 ) }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Batch_Find_ID( g.Batch_ID ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.date" VALUE = "{ Format_Date( Batches.d.date, s.miva_language ) }">

			<MvLOCALIZED NAME = "l.title" ID = "MER-ADM-00674">
				<MvLOCALIZED-TOKEN NAME = "batch" VALUE = "{ l.date $ ': ' $ encodeentities( Batches.d.name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Process Orders: %batch%</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<HEAD>
			<TITLE><MvEVAL EXPR = "{ encodeentities( l.title ) }"></TITLE>
			<MvIF EXPR = "{ g.Secure }">
				<BASE HREF = "{ g.secure_baseurl }">
			<MvELSE>
				<BASE HREF = "{ g.baseurl }">
			</MvIF>
			</HEAD>
			<BODY>

			<MvCOMMENT> Title </MvCOMMENT>
			<TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD BGCOLOR = "#000000">
				<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
				<TR><TD BGCOLOR = "#f0f0f0" WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica">
					<B><MvEVAL EXPR = "{ encodeentities( l.title ) }"></B>
					</FONT>
				</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-ADM-00839">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US"><A TARGET = "new" HREF = "http://www.miva.com/docs/merc_4.x_help/pord.html"></MvLOCALIZED-TEXT>
					</MvLOCALIZED>

					<MvEVAL EXPR = "{ DrawImgButton_Help(0) }"></A>
					</FONT>
				</TD></TR>
				</TABLE>
			</TD></TR>
			</TABLE>
			<BR>

			<MvASSIGN NAME = "l.count" VALUE = 0>
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Order_FindFirst_Batch_Unprocessed( Batches.d.id ) }">
			<MvWHILE EXPR = "{ l.found }">
				<MvIF EXPR = "{ Orders.d.pay_id }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Orders.d.pay_id ) }">
					<MvIF EXPR = "{ l.found }">
						<MvASSIGN NAME = "l.count" VALUE = "{ l.count + 1 }">

						<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
							<TR><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080" COLSPAN = 2>
								<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff"><B>
								<MvLOCALIZED ID = "MER-ADM-00675">
									<MvLOCALIZED-TOKEN NAME = "order" VALUE = "{ encodeentities( Orders.d.id ) }">
									<MvLOCALIZED-TEXT LANGUAGE = "en-US">Order #%order%</MvLOCALIZED-TEXT>
								</MvLOCALIZED>
								</B></FONT>
							</TD></TR>

							<TR><TD ALIGN = "left" VALIGN = "top">
								<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.desc" VALUE = "{ PaymentModule_Report_Description() }">
								<MvIF EXPR = "{ encodeentities( l.desc ) }">
									<FONT FACE = "Arial, Helvetica"><B><MvEVAL EXPR = "{ l.desc }"></B></FONT><BR>
								</MvIF>

								<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
								<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.fields" VALUE = "{ PaymentModule_Report_Fields() }">

								<MvASSIGN NAME = "l.pos" VALUE = 1>
								<MvASSIGN NAME = "l.field" VALUE = "{ ltrim( rtrim( gettoken( l.fields, ',', l.pos ) ) ) }">
								<MvWHILE EXPR = "{ len( l.field ) }">
									<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.label" VALUE = "{ PaymentModule_Report_Label( l.field ) }">
									<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.value" VALUE = "{ PaymentModule_Report_Value( l.field ) }">

									<TR><TD ALIGN = "left" VALIGN = "top" NOWRAP>
										<FONT FACE = "Arial, Helvetica" SIZE = "-1">
										<B><MvEVAL EXPR = "{ l.label }"></B>
										</FONT>
									</TD><TD ALIGN = "left" VALIGN = "top">
										<FONT FACE = "Arial, Helvetica" SIZE = "-1">
										<MvEVAL EXPR = "{ l.value }">
										</FONT>
									</TD></TR>

									<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
									<MvASSIGN NAME = "l.field" VALUE = "{ ltrim( rtrim( gettoken( l.fields, ',', l.pos ) ) ) }">
								</MvWHILE>
								</TABLE>
							</TD><TD ALIGN = "left" VALIGN = "top">
								<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
								<FORM METHOD = "post" ACTION = "{ g.sessionurl }">
								<TR><TD ALIGN = "left" VALIGN = "middle">
									<FONT FACE = "Arial, Helvetica" SIZE = "-1">
									<INPUT TYPE = "hidden" NAME = "Action" VALUE = "PORD">
									<INPUT TYPE = "hidden" NAME = "Screen" VALUE = "PORD">
									<INPUT TYPE = "hidden" NAME = "Store_Code" VALUE = "{ encodeentities( Stores.d.code ) }">
									<INPUT TYPE = "hidden" NAME = "Batch_ID" VALUE = "{ encodeentities( Batches.d.id ) }">
									<INPUT TYPE = "hidden" NAME = "Order_ID" VALUE = "{ encodeentities( Orders.d.id ) }">
									<MvLOCALIZED ID = "MER-ADM-00837">
										<MvLOCALIZED-TEXT LANGUAGE = "en-US"><INPUT TYPE = "submit" VALUE = "Process"></MvLOCALIZED-TEXT>
									</MvLOCALIZED>
									</FONT>
								</TD></TR>
								</FORM>

								<FORM METHOD = "post" ACTION = "{ g.sessionurl }">
								<TR><TD ALIGN = "left" VALIGN = "middle">
									<FONT FACE = "Arial, Helvetica" SIZE = "-1">
									<INPUT TYPE = "hidden" NAME = "Action" VALUE = "MORD">
									<INPUT TYPE = "hidden" NAME = "Screen" VALUE = "PORD">
									<INPUT TYPE = "hidden" NAME = "Store_Code" VALUE = "{ encodeentities( Stores.d.code ) }">
									<INPUT TYPE = "hidden" NAME = "Batch_ID" VALUE = "{ encodeentities( Batches.d.id ) }">
									<INPUT TYPE = "hidden" NAME = "Order_ID" VALUE = "{ encodeentities( Orders.d.id ) }">
									<MvLOCALIZED ID = "MER-ADM-00780">
										<MvLOCALIZED-TEXT LANGUAGE = "en-US">
											<INPUT TYPE = "submit" VALUE = "Mark as Processed">
										</MvLOCALIZED-TEXT>
									</MvLOCALIZED>
									</FONT>
								</TD></TR>
								</FORM>
								</TABLE>
							</TD></TR>
						</TABLE>

						<BR>
					</MvIF>
				</MvIF>

				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Order_FindNext_Batch_Unprocessed( Batches.d.id ) }">
			</MvWHILE>

			<MvIF EXPR = "{ l.count EQ 0 }">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00676">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">There are no orders to process in this batch</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</MvIF>

			</BODY>
		</MvIF>
	<MvELSE>
		<MvASSIGN NAME = "l.null" VALUE = "{ Screen_Blank() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Delete Batch
|
</MvCOMMENT>

<MvFUNCTION NAME = "Action_Batch_Delete">
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Batch_Find_ID( g.Batch_ID ) }">
	<MvASSIGN NAME = "l.can_delete" VALUE = "{ CanI( 'ORDR', 0, 0, 0, 1 ) }">
	<MvIF EXPR = "{ l.ok AND l.can_delete }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Order_FindFirst_Batch( Batches.d.id ) }">
		<MvWHILE EXPR = "{ l.ok AND l.found }">
			<MvIF EXPR = "{ l.ok AND Orders.d.pay_id }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Orders.d.pay_id ) }">
				<MvIF EXPR = "{ l.found }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ PaymentModule_Order_Delete() }">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok AND Orders.d.ship_id }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Orders.d.ship_id ) }">
				<MvIF EXPR = "{ l.found }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ ShippingModule_Order_Delete() }">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Order_Delete( Orders.d.id ) }">
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Order_FindFirst_Batch( Batches.d.id ) }">
			</MvIF>
		</MvWHILE>

		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Batch_Delete( Batches.d.id ) }">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ l.ok AND l.can_delete }">
		<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00677">
			<MvLOCALIZED-TOKEN NAME = "batch" VALUE = "{ encodeentities( Batches.d.name ) }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Batch '%batch%' deleted</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvEVAL EXPR = "{ Update_LeftNavigation() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_DeleteBatch">
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Batch_Find_ID( g.Batch_ID ) }">

	<MvIF EXPR = "{ l.ok AND CanI( 'ORDR', 0, 0, 0, 1 ) }">
		<MvLOCALIZED NAME = "l.screen_label" ID = "MER-ADM-00678">
			<MvLOCALIZED-TOKEN NAME = "batch_name" VALUE = "{ encodeentities( Batches.d.name ) }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Delete Batch: %batch_name%</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvEVAL EXPR = "{ BeginScreen( l.screen_label, '', 'Help:dbch.html' ) }">
		<MvHIDE FIELDS = "g.Batch_ID">

		<MvEVAL EXPR = "{ BeginContent() }">
		<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0>
		<TR><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED ID = "MER-ADM-00781">
				<MvLOCALIZED-TOKEN NAME = "name" value = "{ encodeentities( Batches.d.name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">
					Delete batch %name% and all associated orders?
				</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</FONT>
		</TD></TR>
		</TABLE>
		<MvEVAL EXPR = "{ EndContent() }">

		<TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
		<TR><TD BGCOLOR = "#000000">
			<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD BGCOLOR = "#f0f0f0" WIDTH = "100%">
				&nbsp;
			</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00783">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">
						<INPUT TYPE = "button" VALUE = "Delete" ONCLICK = "SubmitForm( 'BLNK', 'DBCH' );">
					</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD><TD BGCOLOR = "#f0f0f0" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-ADM-00784">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">
						<INPUT TYPE = "button" VALUE = "Cancel" ONCLICK = "SubmitForm( 'BLNK', '' );">
					</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD></TR>
			</TABLE>
		</TD></TR>
		</FORM>
		</TABLE>

		<MvEVAL EXPR = "{ EndScreen() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Edit Order
|
</MvCOMMENT>

<MvFUNCTION NAME = "Order_Validate">
	<MvASSIGN NAME = "g.Order_ShipFirstName" VALUE = "{ rtrim( ltrim( g.Order_ShipFirstName ) ) }">
	<MvASSIGN NAME = "g.Order_ShipLastName" VALUE = "{ rtrim( ltrim( g.Order_ShipLastName ) ) }">
	<MvASSIGN NAME = "g.Order_ShipEamil" VALUE = "{ rtrim( ltrim( g.Order_ShipEamil ) ) }">
	<MvASSIGN NAME = "g.Order_ShipPhone" VALUE = "{ rtrim( ltrim( g.Order_ShipPhone ) ) }">
	<MvASSIGN NAME = "g.Order_ShipFax" VALUE = "{ rtrim( ltrim( g.Order_ShipFax ) ) }">
	<MvASSIGN NAME = "g.Order_ShipCompany" VALUE = "{ rtrim( ltrim( g.Order_ShipCompany ) ) }">
	<MvASSIGN NAME = "g.Order_ShipAddress" VALUE = "{ rtrim( ltrim( g.Order_ShipAddress ) ) }">
	<MvASSIGN NAME = "g.Order_ShipCity" VALUE = "{ rtrim( ltrim( g.Order_ShipCity ) ) }">
	<MvASSIGN NAME = "g.Order_ShipState" VALUE = "{ rtrim( ltrim( g.Order_ShipState ) ) }">
	<MvASSIGN NAME = "g.Order_ShipZip" VALUE = "{ rtrim( ltrim( g.Order_ShipZip ) ) }">
	<MvASSIGN NAME = "g.Order_ShipCountry" VALUE = "{ rtrim( ltrim( g.Order_ShipCountry ) ) }">
	<MvASSIGN NAME = "g.Order_BillFirstName" VALUE = "{ rtrim( ltrim( g.Order_BillFirstName ) ) }">
	<MvASSIGN NAME = "g.Order_BillLastName" VALUE = "{ rtrim( ltrim( g.Order_BillLastName ) ) }">
	<MvASSIGN NAME = "g.Order_BillEmail" VALUE = "{ rtrim( ltrim( g.Order_BillEmail ) ) }">
	<MvASSIGN NAME = "g.Order_BillPhone" VALUE = "{ rtrim( ltrim( g.Order_BillPhone ) ) }">
	<MvASSIGN NAME = "g.Order_BillFax" VALUE = "{ rtrim( ltrim( g.Order_BillFax ) ) }">
	<MvASSIGN NAME = "g.Order_BillCompany" VALUE = "{ rtrim( ltrim( g.Order_BillCompany ) ) }">
	<MvASSIGN NAME = "g.Order_BillAddress" VALUE = "{ rtrim( ltrim( g.Order_BillAddress ) ) }">
	<MvASSIGN NAME = "g.Order_BillCity" VALUE = "{ rtrim( ltrim( g.Order_BillCity ) ) }">
	<MvASSIGN NAME = "g.Order_BillState" VALUE = "{ rtrim( ltrim( g.Order_BillState ) ) }">
	<MvASSIGN NAME = "g.Order_BillZip" VALUE = "{ rtrim( ltrim( g.Order_BillZip ) ) }">
	<MvASSIGN NAME = "g.Order_BillCountry" VALUE = "{ rtrim( ltrim( g.Order_BillCountry ) ) }">

	<MvASSIGN NAME = "g.Order_Tax" VALUE = "{ rtrim( ltrim( g.Order_Tax ) ) }">
	<MvASSIGN NAME = "g.Order_Shipping" VALUE = "{ rtrim( ltrim( g.Order_Shipping ) ) }">
	<MvASSIGN NAME = "g.Order_Total" VALUE = "{ rtrim( ltrim( g.Order_Total ) ) }">

	<MvASSIGN NAME = "g.Order_Module_Payment" VALUE = "">
	<MvASSIGN NAME = "g.Order_Module_Shipping" VALUE = "">

	<MvIF EXPR = "{ Orders.d.pay_id }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID( Orders.d.pay_id ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "g.Order_Module_Payment" VALUE = "{ Modules.d.module }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.valid" VALUE = "{ PaymentModule_Order_Validate() }">
			<MvIF EXPR = "{ NOT l.valid }">
				<MvFUNCTIONRETURN VALUE = 0>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ Orders.d.ship_id }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID( Orders.d.ship_id ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "g.Order_Module_Shipping" VALUE = "{ Modules.d.module }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.valid" VALUE = "{ ShippingModule_Order_Validate() }">
			<MvIF EXPR = "{ NOT l.valid }">
				<MvFUNCTIONRETURN VALUE = 0>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Order_Update">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ CanI( 'ORDR', 0, 0, 1, 0 ) }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Order_Find_ID( g.Edit_Order ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvIF EXPR = "{ Order_Validate() }">
				<MvIF EXPR = "{ l.ok AND len( g.Order_Module_Payment ) }">
					<MvDO FILE = "{ g.Module_Root $ g.Order_Module_Payment }" NAME = "l.ok" VALUE = "{ PaymentModule_Order_Update() }">
				</MvIF>

				<MvIF EXPR = "{ l.ok AND len( g.Order_Module_Shipping ) }">
					<MvDO FILE = "{ g.Module_Root $ g.Order_Module_Shipping }" NAME = "l.ok" VALUE = "{ ShippingModule_Order_Update() }">
				</MvIF>
				<MvASSIGN NAME = "l.charge_idx" VALUE = 1>
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ OrderCharge_FindFirst_Charge( Orders.d.id ) }">

				<MvWHILE EXPR = "{ ( NOT OrderCharges.d.EOF ) AND l.found }">
					<MvIF EXPR = "{ Order_Charge[ l.charge_idx ]:Disp_Amt NE OrderCharges.d.disp_amt }">
						<MvASSIGN NAME = "OrderCharges.d.disp_amt" VALUE = "{ Order_Charge[ l.charge_idx ]:Disp_Amt }">
						<MvUPDATE NAME = "OrderCharges">
					</MvIF>
					<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.found" VALUE = "{ OrderCharge_FindNext_Charge( Orders.d.id ) }">
					<MvASSIGN NAME = "l.charge_idx" VALUE = "{ l.charge_idx + 1 }">
				</MvWHILE>
				<MvIF EXPR = "{ l.ok }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Order_Update( Orders.d.id, Orders.d.cust_id, g.Order_ShipFirstName, g.Order_ShipLastName, g.Order_ShipEmail,
																						   g.Order_ShipCompany, g.Order_ShipPhone, g.Order_ShipFax, g.Order_ShipAddress,
																						   g.Order_ShipCity, g.Order_ShipState, g.Order_ShipZip, g.Order_ShipCountry,
																						   g.Order_BillFirstName, g.Order_BillLastName, g.Order_BillEmail, g.Order_BillCompany,
																						   g.Order_BillPhone, g.Order_BillFax, g.Order_BillAddress, g.Order_BillCity,
																						   g.Order_BillState, g.Order_BillZip, g.Order_BillCountry, g.Order_Tax,
																						   g.Order_Shipping, g.Order_Total ) }">
				</MvIF>

				<MvIF EXPR = "{ l.ok }">
					<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00679">
						<MvLOCALIZED-TOKEN NAME = "order" VALUE = "{ encodeentities( Orders.d.id ) }">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Order #%order% updated</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvEVAL EXPR = "{ Update_LeftNavigation() }">
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Order_Delete">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ CanI( 'ORDR', 0, 0, 0, 1 ) }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Order_Find_ID( g.Edit_Order ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvIF EXPR = "{ Orders.d.pay_id }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Orders.d.pay_id ) }">
				<MvIF EXPR = "{ l.found }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ PaymentModule_Order_Delete() }">
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvIF EXPR = "{ Orders.d.ship_id }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Orders.d.ship_id ) }">
					<MvIF EXPR = "{ l.found }">
						<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ ShippingModule_Order_Delete() }">
					</MvIF>
				</MvIF>
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Order_Delete( Orders.d.id ) }">
			</MvIF>

			<MvIF EXPR = "{ l.ok }">
				<MvLOCALIZED NAME = "g.Message" ID = "MER-ADM-00680">
					<MvLOCALIZED-TOKEN NAME = "order" VALUE = "{ encodeentities( Orders.d.id ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Order #%order% deleted</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvASSIGN NAME = "g.Edit_Order" VALUE = "">
				<MvASSIGN NAME = "g.Screen" VALUE = "BLNK">

				<MvEVAL EXPR = "{ Update_LeftNavigation() }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Printable" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvASSIGN NAME = "l.action" VALUE = "UORD">

	<MvIF EXPR = "{ CanI( 'ORDR', 1, 0, 0, 0 ) }">
		<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Order_Find_ID( g.Edit_Order ) }">

		<MvIF EXPR = "{ l.ok }">
			<MvIF EXPR = "{ g.Load_Fields }">
				<MvASSIGN NAME = "g.Order_ShipFirstName" VALUE = "{ Orders.d.ship_fname }">
				<MvASSIGN NAME = "g.Order_ShipLastName" VALUE = "{ Orders.d.ship_lname }">
				<MvASSIGN NAME = "g.Order_ShipEmail" VALUE = "{ Orders.d.ship_email }">
				<MvASSIGN NAME = "g.Order_ShipCompany" VALUE = "{ Orders.d.ship_comp }">
				<MvASSIGN NAME = "g.Order_ShipPhone" VALUE = "{ Orders.d.ship_phone }">
				<MvASSIGN NAME = "g.Order_ShipFax" VALUE = "{ Orders.d.ship_fax }">
				<MvASSIGN NAME = "g.Order_ShipAddress" VALUE = "{ Orders.d.ship_addr }">
				<MvASSIGN NAME = "g.Order_ShipCity" VALUE = "{ Orders.d.ship_city }">
				<MvASSIGN NAME = "g.Order_ShipState" VALUE = "{ Orders.d.ship_state }">
				<MvASSIGN NAME = "g.Order_ShipZip" VALUE = "{ Orders.d.ship_zip }">
				<MvASSIGN NAME = "g.Order_ShipCountry" VALUE = "{ Orders.d.ship_cntry }">

				<MvASSIGN NAME = "g.Order_BillFirstName" VALUE = "{ Orders.d.bill_fname }">
				<MvASSIGN NAME = "g.Order_BillLastName" VALUE = "{ Orders.d.bill_lname }">
				<MvASSIGN NAME = "g.Order_BillEmail" VALUE = "{ Orders.d.bill_email }">
				<MvASSIGN NAME = "g.Order_BillCompany" VALUE = "{ Orders.d.bill_comp }">
				<MvASSIGN NAME = "g.Order_BillPhone" VALUE = "{ Orders.d.bill_phone }">
				<MvASSIGN NAME = "g.Order_BillFax" VALUE = "{ Orders.d.bill_fax }">
				<MvASSIGN NAME = "g.Order_BillAddress" VALUE = "{ Orders.d.bill_addr }">
				<MvASSIGN NAME = "g.Order_BillCity" VALUE = "{ Orders.d.bill_city }">
				<MvASSIGN NAME = "g.Order_BillState" VALUE = "{ Orders.d.bill_state }">
				<MvASSIGN NAME = "g.Order_BillZip" VALUE = "{ Orders.d.bill_zip }">
				<MvASSIGN NAME = "g.Order_BillCountry" VALUE = "{ Orders.d.bill_cntry }">

				<MvASSIGN NAME = "g.Order_Tax" VALUE = "{ Orders.d.tax }">
				<MvASSIGN NAME = "g.Order_Shipping" VALUE = "{ Orders.d.shipping }">
				<MvASSIGN NAME = "g.Order_Total" VALUE = "{ Orders.d.total }">

				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ OrderCharge_FindFirst_Charge( Orders.d.id ) }">
				<MvASSIGN NAME = "l.charge_idx" VALUE = "1">
				<MvWHILE EXPR = "{ l.found }">
					<MvASSIGN NAME = "g.Order_Charge" INDEX = "{ l.charge_idx }" MEMBER = "Disp_Amt" VALUE = "{ OrderCharges.d.disp_amt }">
					<MvASSIGN NAME = "g.Order_Charge" INDEX = "{ l.charge_idx }" MEMBER = "Desc" VALUE = "{ OrderCharges.d.desc }">
					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ OrderCharge_FindNext_Charge( Orders.d.id ) }">
					<MvASSIGN NAME = "l.charge_idx" value = "{ l.charge_idx + 1 }">
				</MvWHILE>
				<MvASSIGN NAME = "g.Charge_Idx_Max" VALUE = "{ l.charge_idx - 1 }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
		<MvLOCALIZED NAME = "l.screen_label" ID = "MER-ADM-00681">
			<MvLOCALIZED-TOKEN NAME = "order_number" VALUE = "{ encodeentities( Orders.d.id ) }">

			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Edit Order: #%order_number%</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
			<MvEVAL EXPR = "{ BeginScreen( l.screen_label, l.action, 'Help:ordr.html' ) }">
			<INPUT TYPE = "hidden" NAME = "Edit_Order" VALUE = "{ encodeentities( Orders.d.id ) }">

			<MvLOCALIZED NAME = "l.tabs" ID = "MER-ADM-00682">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">CUST:Customer Information,ORDR:Order Information</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvIF EXPR = "{ Orders.d.pay_id }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Orders.d.pay_id ) }">
				<MvIF EXPR = "{ l.found }">
					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_tabs" VALUE = "{ PaymentModule_Order_Tabs() }">
					<MvIF EXPR = "{ len( l.module_tabs ) }">
						<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.module_tabs }">
					</MvIF>
				</MvIF>
			</MvIF>

			<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.shipping_found" VALUE = "{ OrderCharge_FindFirst_Type( Orders.d.id, 'SHIPPING' ) }">
			<MvIF EXPR = "{ Orders.d.shipping OR l.shipping_found }">
				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Orders.d.ship_id ) }">
				<MvIF EXPR = "{ l.found }">

					<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.module_tabs" VALUE = "{ ShippingModule_Order_Tabs() }">
					<MvIF EXPR = "{ len( l.module_tabs ) }">
						<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.module_tabs }">
					</MvIF>
				</MvIF>
			</MvIF>

			<MvEVAL EXPR = "{ DrawTabs( 'CUST', l.tabs ) }">
			<MvEVAL EXPR = "{ BeginContent() }">

			<MvIF EXPR = "{ g.Tab EQ 'CUST' }">
				<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
				<TR><TD ALIGN = "left" VALIGN = "top">
					<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
					<TR><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080" COLSPAN = 2>
						<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1"><B>
						<MvLOCALIZED ID = "MER-ADM-00683">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Ship To:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</B></FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
						<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1"><B>
						<MvLOCALIZED ID = "MER-ADM-00684">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Bill To:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</B></FONT>
					</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "#000080">
						<MvLOCALIZED NAME = "l.alt_text"  ID = "MER-ADM-01375">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Printable</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						
						<A HREF = "{ g.sessionurl $ 'Screen=PRFY&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Order_ID=' $ encodeattribute( Orders.d.id ) }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'order_edit.gif' }"></A>
						<MvIF EXPR = "{ g.Features:Customers:Enabled }">
							<MvIF EXPR = "{ Orders.d.cust_id }">
								<MvDO FILE = "{ g.Module_Feature_CUS_DB }" NAME = "l.found" VALUE = "{ Customer_Find_ID( Orders.d.cust_id ) }">
								<MvIF EXPR = "{ l.found AND CanI( 'CUST', 1, 0, 0, 0 ) }">
									<MvLOCALIZED NAME = "l.alt_text"  ID = "MER-ADM-01376">
										<MvLOCALIZED-TEXT LANGUAGE = "en-US">Edit Customer</MvLOCALIZED-TEXT>
									</MvLOCALIZED>
									<A HREF = "{ g.sessionurl $ 'Screen=CUST&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Edit_Customer=' $ encodeattribute( Customers.d.login ) }"><IMG ALT = "{ l.alt_text }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'edit.gif' }"></A>
								<MvELSE>
									&nbsp;
								</MvIF>
							<MvELSE>
								&nbsp;
							</MvIF>
						</MvIF>
					</TD></TR>

					<TR><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00843">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">First Name:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_ShipFirstName" VALUE = "{ encodeentities( g.Order_ShipFirstName ) }" SIZE = 20 TABINDEX = 1>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00686">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">First Name:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_BillFirstName" VALUE = "{ encodeentities( g.Order_BillFirstName ) }" SIZE = 20 TABINDEX = 12>
						</FONT>
					</TD></TR>

					<TR><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00687">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Last Name:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_ShipLastName" VALUE = "{ encodeentities( g.Order_ShipLastName ) }" SIZE = 20 TABINDEX = 2>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00688">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Last Name:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_BillLastName" VALUE = "{ encodeentities( g.Order_BillLastName ) }" SIZE = 20 TABINDEX = 13>
						</FONT>
					</TD></TR>

					<TR><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00689">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Email Address:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_ShipEmail" VALUE = "{ encodeentities( g.Order_ShipEmail ) }" SIZE = 20 TABINDEX = 3>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00690">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Email Address:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_BillEmail" VALUE = "{ encodeentities( g.Order_BillEmail ) }" SIZE = 20 TABINDEX = 14>
						</FONT>
					</TD></TR>

					<TR><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00691">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Phone Number:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_ShipPhone" VALUE = "{ encodeentities( g.Order_ShipPhone ) }" SIZE = 20 TABINDEX = 4>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00692">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Phone Number:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_BillPhone" VALUE = "{ encodeentities( g.Order_BillPhone ) }" SIZE = 20 TABINDEX = 15>
						</FONT>
					</TD></TR>

					<TR><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00693">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Fax Number:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_ShipFax" VALUE = "{ encodeentities( g.Order_ShipFax ) }" SIZE = 20 TABINDEX = 5>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00694">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Fax Number:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_BillFax" VALUE = "{ encodeentities( g.Order_BillFax ) }" SIZE = 20 TABINDEX = 16>
						</FONT>
					</TD></TR>

					<TR><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00695">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Company:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_ShipCompany" VALUE = "{ encodeentities( g.Order_ShipCompany ) }" SIZE = 20 TABINDEX = 6>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00696">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Company:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_BillCompany" VALUE = "{ encodeentities( g.Order_BillCompany ) }" SIZE = 20 TABINDEX = 17>
						</FONT>
					</TD></TR>

					<TR><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00697">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Address:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_ShipAddress" VALUE = "{ encodeentities( g.Order_ShipAddress ) }" SIZE = 20 TABINDEX = 7>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00698">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Address:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_BillAddress" VALUE = "{ encodeentities( g.Order_BillAddress ) }" SIZE = 20 TABINDEX = 18>
						</FONT>
					</TD></TR>

					<MvIF EXPR = "{ s.miva_language EQ 'de-DE' }">
						<TR><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-00703">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Zip/Postal Code:</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" NAME = "Order_ShipZip" VALUE = "{ encodeentities( g.Order_ShipZip ) }" SIZE = 20 TABINDEX = 10>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-00704">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Zip/Postal Code:</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" NAME = "Order_BillZip" VALUE = "{ encodeentities( g.Order_BillZip ) }" SIZE = 20 TABINDEX = 21>
							</FONT>
						</TD></TR>

						<TR><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-00699">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">City:</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" NAME = "Order_ShipCity" VALUE = "{ encodeentities( g.Order_ShipCity ) }" SIZE = 20 TABINDEX = 8>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-00700">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">City:</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" NAME = "Order_BillCity" VALUE = "{ encodeentities( g.Order_BillCity ) }" SIZE = 20 TABINDEX = 19>
							</FONT>
						</TD></TR>

						<TR><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-00701">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">State:</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" NAME = "Order_ShipState" VALUE = "{ encodeentities( g.Order_ShipState ) }" SIZE = 20 TABINDEX = 9>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-00702">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">State:</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" NAME = "Order_BillState" VALUE = "{ encodeentities( g.Order_BillState ) }" SIZE = 20 TABINDEX = 20>
							</FONT>
						</TD></TR>
					<MvELSE>
						<TR><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-00699">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">City:</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" NAME = "Order_ShipCity" VALUE = "{ encodeentities( g.Order_ShipCity ) }" SIZE = 20 TABINDEX = 8>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-00700">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">City:</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" NAME = "Order_BillCity" VALUE = "{ encodeentities( g.Order_BillCity ) }" SIZE = 20 TABINDEX = 19>
							</FONT>
						</TD></TR>

						<TR><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-00701">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">State:</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" NAME = "Order_ShipState" VALUE = "{ encodeentities( g.Order_ShipState ) }" SIZE = 20 TABINDEX = 9>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-00702">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">State:</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" NAME = "Order_BillState" VALUE = "{ encodeentities( g.Order_BillState ) }" SIZE = 20 TABINDEX = 20>
							</FONT>
						</TD></TR>

						<TR><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-00703">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Zip/Postal Code:</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" NAME = "Order_ShipZip" VALUE = "{ encodeentities( g.Order_ShipZip ) }" SIZE = 20 TABINDEX = 10>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvLOCALIZED ID = "MER-ADM-00704">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">Zip/Postal Code:</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							</FONT>
						</TD><TD ALIGN = "left" VALIGN = "middle">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<INPUT TYPE = "text" NAME = "Order_BillZip" VALUE = "{ encodeentities( g.Order_BillZip ) }" SIZE = 20 TABINDEX = 21>
							</FONT>
						</TD></TR>
					</MvIF>

					<TR><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00705">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Country:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_ShipCountry" VALUE = "{ encodeentities( g.Order_ShipCountry ) }" SIZE = 20 TABINDEX = 11>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvLOCALIZED ID = "MER-ADM-00706">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Country:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_BillCountry" VALUE = "{ encodeentities( g.Order_BillCountry ) }" SIZE = 20 TABINDEX = 22>
						</FONT>
					</TD></TR>
					</TABLE>
				</TD></TR>
				</TABLE>
			<MvELSE>
				<MvHIDE FIELDS = "g.Order_ShipFirstName, g.Order_ShipLastName, g.Order_ShipEmail, g.Order_ShipPhone, g.Order_ShipFax, g.Order_ShipCompany, g.Order_ShipAddress, g.Order_ShipCity, g.Order_ShipState, g.Order_ShipZip, g.Order_ShipCountry, g.Order_BillFirstName, g.Order_BillLastName, g.Order_BillEmail, g.Order_BillPhone, g.Order_BillFax, g.Order_BillCompany, g.Order_BillAddress, g.Order_BillCity, g.Order_BillState, g.Order_BillZip, g.Order_BillCountry">
			</MvIF>

			<MvIF EXPR = "{ g.Tab EQ 'ORDR' }">
				<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
				<TR><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-ADM-00707">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-ADM-00708">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Product</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD ALIGN = "left" VALIGN = "middle" BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-ADM-00709">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Quantity</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-ADM-00710">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Price/Ea.</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-ADM-00711">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Total</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD></TR>

				<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ OrderItem_FindFirst_Order( Orders.d.id ) }">
				<MvWHILE EXPR = "{ l.found }">
					<TR><TD ALIGN = "left" VALIGN = "middle" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ encodeentities( OrderItems.d.code ) }">
						</FONT>
					</TD><TD ALIGN = "left" VALIGN = "middle" WIDTH = "100%" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ encodeentities( OrderItems.d.name ) }">

						<MvIF EXPR = "{ encodeentities( OrderItems.d.upsold ) }">
							<MvLOCALIZED  ID = "MER-ADM-01377">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">(Special Offer)</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
						</MvIF>

						</FONT>
					</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ encodeentities( OrderItems.d.quantity ) }">
						</FONT>
					</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ encodeentities( OrderItems.d.price ) }">
						</FONT>
					</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ ( OrderItems.d.price * OrderItems.d.quantity ) ROUND 2 }">
						</FONT>
					</TD></TR>

					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ OrderOption_FindFirst_Line( OrderItems.d.line_id ) }">
					<MvWHILE EXPR = "{ l.found }">
						<TR><TD ALIGN = "left">
							&nbsp;
						</TD><TD ALIGN = "left">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvIF EXPR = "{ OrderOptions.d.option_id }">
								<MvEVAL EXPR = "{ encodeentities( OrderOptions.d.attr_code ) }">: <MvEVAL EXPR = "{ encodeentities( OrderOptions.d.opt_code ) }">
							<MvELSE>
								<MvIF EXPR = "{ OrderOptions.d.data }">
									<MvASSIGN NAME = "l.data" VALUE = "{ OrderOptions.d.data }">
								<MvELSE>
									<MvIF EXPR = "{ OrderOptions.d.data_long }">
										<MvASSIGN NAME = "l.data" VALUE = "{ OrderOptions.d.data_long }">
									<MvELSE>
										<MvASSIGN NAME = "l.data" VALUE = "">
									</MvIF>
								</MvIF>
							
							
								<MvIF EXPR = "{ l.data }">
									<MvASSIGN NAME = "l.data" VALUE = "{ encodeentities( l.data ) }">
									<MvASSIGN NAME = "l.data" VALUE = "{ glosub( l.data, asciichar(10), '<BR>' ) }">
									<MvEVAL EXPR = "{ encodeentities( OrderOptions.d.attr_code) }">: <MvEVAL EXPR = "{ l.data }">
								<MvELSE>
									<MvEVAL EXPR = "{ encodeentities( OrderOptions.d.attr_code ) }">
								</MvIF>
							</MvIF>
							</FONT>
						</TD><TD ALIGN = "left">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							&nbsp;
							</FONT>
						</TD><TD ALIGN = "right">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvIF EXPR = "{ OrderOptions.d.price }">
								<MvEVAL EXPR = "{ encodeentities( OrderOptions.d.price ) }">
							<MvELSE>
								&nbsp;
							</MvIF>
							</FONT>
						</TD><TD ALIGN = "right">
							<FONT FACE = "Arial, Helvetica" SIZE = "-1">
							<MvIF EXPR = "{ OrderOptions.d.price }">
								<MvEVAL EXPR = "{ ( OrderOptions.d.price * OrderItems.d.quantity ) ROUND 2 }">
							<MvELSE>
								&nbsp;
							</MvIF>
							</FONT>
						</TD></TR>

						<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ OrderOption_FindNext_Line( OrderItems.d.line_id ) }">
					</MvWHILE>

					<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ OrderItem_FindNext_Order( Orders.d.id ) }">
				</MvWHILE>

				<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.found" VALUE = "{ OrderCharge_FindFirst_Type( Orders.d.id, 'SHIPPING' ) }">
				<MvIF EXPR = "{ NOT l.found }">

					<TR><TD ALIGN = "right" VALIGN = "middle" COLSPAN = 4 NOWRAP>
						<MvIF EXPR = "{ NOT Orders.d.ship_id }">
							<MvASSIGN NAME = "l.description" VALUE = "">
						<MvELSE>
							<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_ID( Orders.d.ship_id ) }">
							<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.description" VALUE = "{ ShippingModule_Description( Orders.d.ship_data ) }">
						</MvIF>

						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<I>
						<MvLOCALIZED ID = "MER-ADM-00714">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Shipping:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						<MvIF EXPR = "{ len( l.description ) }">
							<MvEVAL EXPR = "{ encodeentities( l.description ) }">:
						</MvIF>
						</I>
						</FONT>
					</TD><TD ALIGN = "right" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_Shipping" VALUE = "{ encodeentities( g.Order_Shipping ) }" SIZE = 10>
						</FONT>
					</TD></TR>
				</MvIF>

				<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.found" VALUE = "{ OrderCharge_FindFirst_Type( Orders.d.id, 'TAX' ) }">
				<MvIF EXPR = "{ NOT l.found }">

					<TR><TD ALIGN = "right" VALIGN = "middle" COLSPAN = 3>
						&nbsp;
					</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1"><I>
						<MvLOCALIZED ID = "MER-ADM-00713">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Sales Tax:</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						</I></FONT>
					</TD><TD ALIGN = "right" VALIGN = "middle">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "Order_Tax" VALUE = "{ encodeentities( g.Order_Tax ) }" SIZE = 10>
						</FONT>
					</TD></TR>
				</MvIF>

				<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.found" VALUE = "{ OrderCharge_FindFirst_Charge( Orders.d.id ) }">
				<MvASSIGN NAME = "l.charge_idx" VALUE = "1">
				<MvWHILE EXPR = "{ l.charge_idx LE g.Charge_Idx_Max }">
					<TR><TD ALIGN = "right" VALIGN = "middle" COLSPAN = 3>
						&nbsp;
					</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<I>
						<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.description" VALUE = "{ HTML_Format_Marks( encodeentities( g.Order_Charge[ l.charge_idx ]:Desc ) ) }">
						<MvEVAL EXPR = "{ l.description }">:
						</I>
						</FONT>
					</TD><TD ALIGN = "right" VALIGN = "middle" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "text" NAME = "{ 'Order_Charge[' $  l.charge_idx $ ']:Disp_Amt' }" VALUE = "{ encodeentities( g.Order_Charge[ l.charge_idx ]:Disp_Amt ) ROUND 2 }" SIZE = 10>
						<INPUT TYPE = "hidden" NAME = "{'Order_Charge[' $ l.charge_idx $ ']:Desc' }" VALUE = "{ encodeentities( g.Order_Charge[ l.charge_idx ]:Desc ) }">
						</FONT>
					</TD></TR>
					<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.found" VALUE = "{ OrderCharge_FindNext_Charge( Orders.d.id ) }">
					<MvASSIGN NAME = "l.charge_idx" VALUE = "{ l.charge_idx + 1 }">
				</MvWHILE>

				<MvHIDE FIELDS = "g.Charge_Idx_Max">

				<TR><TD ALIGN = "right" VALIGN = "middle" COLSPAN = 3>
					&nbsp;
				</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff"><B>
					<MvLOCALIZED ID = "MER-ADM-00715">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Total:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD ALIGN = "right" VALIGN = "middle" BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff">
					<INPUT TYPE = "text" NAME = "Order_Total" VALUE = "{ encodeentities( g.Order_Total ) }" SIZE = 10>
					</FONT>
				</TD></TR>
				</TABLE>
				
			<MvELSE>
				<MvHIDE FIELDS = "g.Order_Tax, g.Order_Shipping, g.Charge_Idx_Max, g.Order_Total, g.Order_Charge">
			</MvIF>

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Orders.d.pay_id ) }">
			<MvIF EXPR = "{ l.found }">
				<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ PaymentModule_Order_Content( g.Tab, g.Load_Fields ) }">
			</MvIF>

			<MvDO FILE = "{ g.Library_DB }" NAME = "l.found" VALUE = "{ Module_Find_ID( Orders.d.ship_id ) }">
			<MvIF EXPR = "{ l.found }">
				<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ ShippingModule_Order_Content( g.Tab, g.Load_Fields ) }">
			</MvIF>

			<MvEVAL EXPR = "{ EndContent() }">
			<MvEVAL EXPR = "{ DrawButtons( 'UORD:[UPDATE]:ORDR:0:1:0,DORD:[DELETE]:ORDR:0:0:1' ) }">
			<MvEVAL EXPR = "{ EndScreen() }">
		</MvIF>
	<MvELSE>
		<MvASSIGN NAME = "l.null" VALUE = "{ Screen_Blank() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Store Utility
|
</MvCOMMENT>

<MvFUNCTION NAME = "Action_StoreUtility">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code( g.Module_Code ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.valid" VALUE = "{ StoreUtilityModule_Validate() }">
		<MvIF EXPR = "{ l.valid }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ StoreUtilityModule_Action() }">
			<MvIF EXPR = "{ l.ok }">
				<MvEVAL EXPR = "{ Update_LeftNavigation() }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_StoreUtility">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code( g.Module_Code ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ StoreUtilityModule_Screen() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Import Data
|
</MvCOMMENT>

<MvFUNCTION NAME = "Action_Import">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code( g.Module_Code ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.valid" VALUE = "{ ImportModule_Validate() }">
		<MvIF EXPR = "{ l.valid }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ ImportModule_Import() }">
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Import">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code( g.Module_Code ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ ImportModule_Screen() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Export Data
|
</MvCOMMENT>

<MvFUNCTION NAME = "Action_Export">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code( g.Module_Code ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.valid" VALUE = "{ ExportModule_Validate() }">
		<MvIF EXPR = "{ l.valid }">
			<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ ExportModule_Export() }">
			<MvIF EXPR = "{ l.ok }">
				<MvEVAL EXPR = "{ Update_LeftNavigation() }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Export">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code( g.Module_Code ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.ok" VALUE = "{ ExportModule_Screen() }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| User Interface Helper Functions
|
</MvCOMMENT>

<MvFUNCTION NAME = "FieldError" PARAMETERS = "tab, field, message" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "g.Tab" VALUE = "{ l.tab }">
	<MvASSIGN NAME = "g.Error_Field" VALUE = "{ l.field }">
	<MvASSIGN NAME = "g.Error_Field_Message" VALUE = "{ l.message }">
	<MvASSIGN NAME = "g.Data_Entry_Error" VALUE = 1>

	<MvFUNCTIONRETURN VALUE = 0>
</MvFUNCTION>

<MvFUNCTION NAME = "BeginScreen" PARAMETERS = "title, default_action, buttons" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<HEAD>
	<TITLE><MvEVAL EXPR = "{ l.title }"></TITLE>
	<MvIF EXPR = "{ g.Secure }">
		<BASE HREF = "{ g.secure_baseurl }">
	<MvELSE>
		<BASE HREF = "{ g.baseurl }">
	</MvIF>
	<MvIF EXPR = "{ NOT len( g.ItemModified ) }">
		<MvASSIGN NAME = "g.ItemModified" VALUE = 0>
	</MvIF>

	<MvEVAL EXPR = "{ JavaScript_SetVariables( 'g', 'Store_Code, Sessionurl, Screen, Tab, ItemModified, Edit_Store' ) }">
<SCRIPT LANGUAGE = "JavaScript">
<!--
var Loaded = 0;
var Modified = 0;
var HaveCustomReset = 0;
var PreemptiveSwitch_Screen = '';
var PreemptiveSwitch_Tab = '';

function DisplayModifiedMessage()
{
	return confirm( field_changes );
}

function CheckModified()
{
	if ( Modified )
	{
		return DisplayModifiedMessage();
	}
	return 1;
}

function CheckItemModified()
{
	if ( ItemModified > 0 )
	{
		return DisplayModifiedMessage();
	}
	return 1;
}

function SwitchItem( url )
{
	if ( CheckItemModified() )
	{
		document.location.replace( url );
	}
}

function SwitchTab( screen_code, tab_code )
{
	if ( Loaded )
	{
		if ( CheckModified() )
		{
			document.forms[ Screen ].elements[ 'Screen' ].value = screen_code;
			document.forms[ Screen ].elements[ 'Tab' ].value = tab_code;
			document.forms[ Screen ].elements[ 'Action' ].value = '';
			document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
			document.forms[ Screen ].elements[ 'ItemModified' ].value = ItemModified;
			document.forms[ Screen ].submit();
		}
	}
	else
	{
		PreemptiveSwitch_Screen = screen_code;
		PreemptiveSwitch_Tab = tab_code;
	}
}

function Reload()
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Screen' ].value = Screen;
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Action' ].value = '';
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
		document.forms[ Screen ].submit();
	}
}

function SubmitForm( screen_code, action_code )
{
	document.forms[ Screen ].elements[ 'Screen' ].value = unescape( screen_code );
	document.forms[ Screen ].elements[ 'Action' ].value = unescape( action_code );
	document.forms[ Screen ].submit();
}

function ResetForm( screen_code, tab_code )
{
	document.forms[ Screen ].elements[ 'Screen' ].value = screen_code;
	document.forms[ Screen ].elements[ 'Action' ].value = '';
	document.forms[ Screen ].elements[ 'Tab' ].value = tab_code;

	if ( HaveCustomReset )
	{
		CustomReset();
	}

	if ( document.forms[ Screen ].elements[ 'Have_List_Fields' ] )
	{
		document.forms[ Screen ].elements[ 'Have_List_Fields' ].value = 0;
	}

	document.forms[ Screen ].submit();
}

function FieldError( field, message )
{
	if ( field.length )
	{
		document.forms[ Screen ].elements[ field ].select();
		document.forms[ Screen ].elements[ field ].focus();
	}

	alert( message );
}

function PopupColorSelector( field )
{
	var color = document.forms[ Screen ].elements[ field ].value;

	window.open( Sessionurl + 'Screen=COLR&Form=' + Screen + '&Field=' + field + '&Color=' + escape( color ), 'ColorSelector', 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=300,height=540' ).focus();
}

function PopupFileUpload( type, data, field )
{
	var URL = Sessionurl + 'Screen=FUPL&FileUpload_Form=' + Screen + '&FileUpload_Field=' + field + '&FileUpload_Type=' + type + '&FileUpload_Data=' + escape( data );

	if ( String( Store_Code ).length )
	{
		URL += '&Store_Code=' + Store_Code;
	}
	else if ( String( Edit_Store ).length )
	{
		URL += '&Store_Code=' + Edit_Store;
	}

	window.open( URL, 'FileUpload', 'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no,width=465,height=200' ).focus();
}

function PopupUserLookup( field )
{
	var URL = Sessionurl + 'Screen=ULKP&Lookup_Form=' + Screen + '&Lookup_Field=' + field;

	if ( String( Store_Code ).length )
	{
		URL += '&Store_Code=' + Store_Code;
	}
	else if ( String( Edit_Store ).length )
	{
		URL += '&Store_Code=' + Edit_Store;
	}

	window.open( URL, 'UserLookup', 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=640,height=480' ).focus();
}

function PopupCategoryLookup( field )
{
	var URL = Sessionurl + 'Screen=CLKP&Lookup_Form=' + Screen + '&Lookup_Field=' + field;

	if ( String( Store_Code ).length )
	{
		URL += '&Store_Code=' + Store_Code;
	}
	else if ( String( Edit_Store ).length )
	{
		URL += '&Store_Code=' + Edit_Store;
	}

	window.open( URL, 'CategoryLookup', 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=640,height=480' ).focus();
}

function PopupProductLookup( field )
{
	var URL = Sessionurl + 'Screen=PLKP&Lookup_Form=' + Screen + '&Lookup_Field=' + field;

	if ( String( Store_Code ).length )
	{
		URL += '&Store_Code=' + Store_Code;
	}
	else if ( String( Edit_Store ).length )
	{
		URL += '&Store_Code=' + Edit_Store;
	}

	window.open( URL, 'ProductLookup', 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=640,height=480' ).focus();
}

function ListReload( field, stack )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Action' ].value = '';
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
		document.forms[ Screen ].elements[ field ].value = 0;
		document.forms[ Screen ].elements[ stack ].value = '';
		document.forms[ Screen ].submit();
	}
}

function ListReloadField( field, stack, changefield, changevalue )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Action' ].value = '';
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
		document.forms[ Screen ].elements[ field ].value = 0;
		document.forms[ Screen ].elements[ stack ].value = '';
		document.forms[ Screen ].elements[ changefield ].value = changevalue;
		document.forms[ Screen ].submit();
	}
}

function ListPrevious( field, stack )
{
	var stackvalue = document.forms[ Screen ].elements[ stack ].value;
	var pos = stackvalue.indexOf( ':' );
	var offset = stackvalue.substring( 0, pos );

	stackvalue = stackvalue.substring( pos + 1 );

	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Action' ].value = '';
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
		document.forms[ Screen ].elements[ stack ].value = stackvalue;
		document.forms[ Screen ].elements[ field ].value = offset;
		document.forms[ Screen ].submit();
	}
}

function ListNext( field, stack, offset )
{
	if ( CheckModified() )
	{
		document.forms[ Screen ].elements[ 'Tab' ].value = Tab;
		document.forms[ Screen ].elements[ 'Action' ].value = '';
		document.forms[ Screen ].elements[ 'Have_Fields' ].value = 1;
		document.forms[ Screen ].elements[ stack ].value = document.forms[ Screen ].elements[ field ].value + ':' + document.forms[ Screen ].elements[ stack ].value;
		document.forms[ Screen ].elements[ field ].value = offset;
		document.forms[ Screen ].submit();
	}
}

function SetModified()
{
	Modified = 1;
}

function SetItemModified( item )
{
	if ( item )
	{
		ItemModified = 1;
	}
}

function LoadFinished()
{
	Loaded = 1;
	if ( PreemptiveSwitch_Screen.length || PreemptiveSwitch_Tab.length )
	{
		SwitchTab( PreemptiveSwitch_Screen, PreemptiveSwitch_Tab );
	}
	
	if ( (typeof HaveLoadFinishedHandler) == 'undefined' ) return;
	LoadFinishedHandler();
}

function CheckAll( field_base, checked)
{
	var i;
	var box;

	for ( i = 1; ( box = document.forms[ Screen ].elements[ field_base +
		"[" + i.toString() + "]" ] ) != null; i++ )
	{
			  box.checked = checked;
	}
}

function CheckButtonPress()
{
	return false;
}


//-->
</SCRIPT>
	<MvLOCALIZED ID = "MER-ADM-00838">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">
			<SCRIPT LANGUAGE = "JavaScript">
<!--
		var field_changes = 'You have made changes to one or more fields.\nIf you continue without updating, your changes will be lost.\n\nContinue?';
//-->
			</SCRIPT>
		</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	</HEAD>

	<MvIF EXPR = "{ len( g.Error_Field ) OR ( len( g.Error_Field_Message ) ) }">
		<MvEVAL EXPR = "{ '<BODY BGCOLOR = "#ffffff" ONLOAD = "LoadFinished(); FieldError( \'' $ JavaScriptEncode( g.Error_Field ) $ '\', \'' $ JavaScriptEncode( g.Error_Field_Message ) $ '\' );">' }">
	<MvELSE>
		<BODY BGCOLOR = "#ffffff" ONLOAD = "LoadFinished();">
	</MvIF>

	<FORM NAME = "{ encodeentities( g.Screen ) }" METHOD = "POST" ACTION = "{ g.sessionurl }" ONSUBMIT = "return false;">
	<MvHIDE FIELDS = "g.Screen, g.Tab, g.ItemModified">
	<INPUT TYPE = "hidden" NAME = "Have_Fields" VALUE = "">
	<INPUT TYPE = "hidden" NAME = "Action" VALUE = "{ encodeentities( l.default_action ) }">

	<MvIF EXPR = "{ len( g.Store_Code ) }">
		<MvHIDE FIELDS = "g.Store_Code">
	</MvIF>

	<MvCOMMENT> Title </MvCOMMENT>
	<TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
	<TR><TD BGCOLOR = "#000000">
		<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
		<TR><TD BGCOLOR = "#f0f0f0" WIDTH = "100%">
			<FONT FACE = "Arial, Helvetica">
			<B><MvEVAL EXPR = "{ l.title }"></B>
			</FONT>
		</TD>

		<MvIF EXPR = "{ len( l.buttons ) }">
			<TD BGCOLOR = "#f0f0f0" ALIGN = "right" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvASSIGN NAME = "l.pos" VALUE = 1>
				<MvASSIGN NAME = "l.current" VALUE = "{ gettoken( l.buttons, ',', l.pos ) }">
				<MvWHILE EXPR = "{ len( l.current ) }">
					<MvASSIGN NAME = "l.sep_pos" VALUE = "{ ':' IN l.current }">
					<MvASSIGN NAME = "l.button_code" VALUE = "{ substring( l.current, 1, l.sep_pos - 1 ) }">
					<MvASSIGN NAME = "l.button_link" VALUE = "{ substring( l.current, l.sep_pos + 1, len( l.current ) - l.sep_pos ) }">

					<MvIF EXPR = "{ l.button_code EQ 'Links' }">
						<A TARGET = "new" HREF = "{ g.sessionurl $ l.button_link }"><MvEVAL EXPR = "{ DrawImgButton_Links(0) }"></A>
					</MvIF>

					<MvIF EXPR = "{ l.button_code EQ 'Help' }">
						<MvIF EXPR = "{ ( 'http:' IN l.button_link ) EQ 1 }">
							<A TARGET = "new" HREF = "{ l.button_link }"><MvEVAL EXPR = "{ DrawImgButton_Help(0) }"></A>
						<MvELSE>
							<MvLOCALIZED NAME = "l.path" ID = "MER-ADM-00839">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">http://www.miva.com/docs/merc_4.x_help/</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							<A TARGET = "new" HREF = "{ l.path $ l.button_link }"><MvEVAL EXPR = "{ DrawImgButton_Help(0) }"></A>
						</MvIF>
					</MvIF>

					<MvIF EXPR = "{ l.button_code EQ 'Text' }">
						<MvASSIGN NAME = "l.sep_pos" VALUE = "{ ':' IN l.button_link }">
						<MvASSIGN NAME = "l.button_text" VALUE = "{ substring( l.button_link, 1, l.sep_pos - 1 ) }">
						<MvASSIGN NAME = "l.button_link" VALUE = "{ substring( l.button_link, l.sep_pos + 1, len( l.button_link ) - l.sep_pos ) }">

						<MvIF EXPR = "{ ( 'http:' IN l.button_link ) EQ 1 }">
							<A TARGET = "new" HREF = "{ l.button_link }"><MvEVAL EXPR = "{ l.button_text }"></A>
						<MvELSE>
							<MvLOCALIZED NAME = "l.path" ID = "MER-ADM-00840">
								<MvLOCALIZED-TEXT LANGUAGE = "en-US">http://www.miva.com/docs/merc_4.x_help/</MvLOCALIZED-TEXT>
							</MvLOCALIZED>
							<A TARGET = "new" HREF = "{ l.path $ l.button_link }"><MvEVAL EXPR = "{ l.button_text }"></A>
						</MvIF>
					</MvIF>

					<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
					<MvASSIGN NAME = "l.current" VALUE = "{ gettoken( l.buttons, ',', l.pos ) }">
				</MvWHILE>
				</FONT>
			</TD>
		</MvIF>

		</TR>
		</TABLE>
	</TD></TR>
	</TABLE>
	<BR>
</MvFUNCTION>

<MvFUNCTION NAME = "EndScreen" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	</FORM>
	</BODY>
	<MvIF EXPR = "{ g.EndScreen }">
		<MvFUNCTIONRETURN VALUE = "1">
	</MvIF>
</MvFUNCTION>

<MvFUNCTION NAME = "DrawTabs" PARAMETERS = "default, tabs" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvIF EXPR = "{ len( g.Tab ) EQ 0 }">
		<MvASSIGN NAME = "g.Tab" VALUE = "{ l.default }">
	</MvIF>

	<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0>
	<TR>

	<MvASSIGN NAME = "l.row" VALUE = 1>
	<MvASSIGN NAME = "l.column" VALUE = 0>
	<MvASSIGN NAME = "l.pos" VALUE = 1>
	<MvASSIGN NAME = "l.current" VALUE = "{ gettoken( l.tabs, ',', l.pos ) }">
	<MvWHILE EXPR = "{ l.current }">
		<MvASSIGN NAME = "l.column" VALUE = "{ l.column + 1 }">
		<MvIF EXPR = "{ l.column GT 5 }">
			<MvASSIGN NAME = "l.row" VALUE = "{ l.row + 1 }">
			<MvASSIGN NAME = "l.column" VALUE = 1>

			</TR><TR>
		</MvIF>

		<MvASSIGN NAME = "l.sep_pos" VALUE = "{ ':' IN l.current }">
		<MvASSIGN NAME = "l.tab_code" VALUE = "{ substring( l.current, 1, l.sep_pos - 1 ) }">
		<MvASSIGN NAME = "l.tab_name" VALUE = "{ substring( l.current, l.sep_pos + 1, len( l.current ) - l.sep_pos ) }">

		<MvIF EXPR = "{ g.Tab EQ l.tab_code }">
			<MvASSIGN NAME = "l.bgcolor" VALUE = "#f0f0f0">
		<MvELSE>
			<MvASSIGN NAME = "l.bgcolor" VALUE = "#dddddd">
		</MvIF>

		<TD BGCOLOR = "{ l.bgcolor }">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvIF EXPR = "{ g.Tab EQ l.tab_code }">
				<B><MvEVAL EXPR = "{ l.tab_name }"></B>
			<MvELSE>
				<A HREF = "{ '#' $ JavaScriptEncode( l.tab_code ) }" ONCLICK = "{ 'SwitchTab( \'' $ JavaScriptEncode( g.Screen ) $ '\', \'' $ JavaScriptEncode( l.tab_code ) $ '\' ); return false;' }"><MvEVAL EXPR = "{ l.tab_name }"></A>
			</MvIF>
			</FONT>
		</TD>

		<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
		<MvASSIGN NAME = "l.current" VALUE = "{ gettoken( l.tabs, ',', l.pos ) }">
	</MvWHILE>

	<MvIF EXPR = "{ l.row GT 1 }">
		<MvASSIGN NAME = "l.colspan" VALUE = "{ 5 - l.column }">
		<MvIF EXPR = "{ l.colspan }">
			<TD COLSPAN = "{ l.colspan }" BGCOLOR = "#dddddd">
				&nbsp;
			</TD>
		</MvIF>
	</MvIF>
	</TR>
	</TABLE>
</MvFUNCTION>

<MvFUNCTION NAME = "BeginContent" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
	<TR><TD BGCOLOR = "#000000">
		<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
		<TR><TD BGCOLOR = "#f0f0f0">
</MvFUNCTION>

<MvFUNCTION NAME = "EndContent" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
		</TD></TR>
		</TABLE>
	</TD></TR>
	</TABLE>
	<BR>
</MvFUNCTION>

<MvFUNCTION NAME = "DrawButtons" PARAMETERS = "buttons">
	<MvFUNCTIONRETURN VALUE = "{ DrawButtons_NextPrevious( buttons, '' ) }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawButtons_NextPrevious" PARAMETERS = "buttons, item_code" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
	<TR><TD BGCOLOR = "#000000">

	<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
	<TR><TD BGCOLOR = "#f0f0f0" WIDTH = "100%" ALIGN = "left" VALIGN = "middle">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvLOCALIZED NAME = "l.next" ID = "MER-ADM-01513">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Next</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvLOCALIZED NAME = "l.prev" ID = "MER-ADM-01514">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Prev</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvLOCALIZED NAME = "l.first" ID = "MER-ADM-01515">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">First</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvLOCALIZED NAME = "l.last" ID = "MER-ADM-01516">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Last</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvIF EXPR = "{ len( l.item_code ) }">
			<A HREF = "{ 'javascript:SwitchItem( \'' $ g.sessionurl $ 'Screen=' $ encodeattribute( g.Screen ) $ '&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Edit_Item=' $ encodeattribute( l.item_code ) $ '&Tab=' $ encodeattribute( g.Tab ) $ '&First_Item=1\' )' }"><IMG SRC = "{ g.AdminGraphics_Path $ 'f_btn.gif' }" BORDER = 0 ALT = "{ l.first }"></A>
			<A HREF = "{ 'javascript:SwitchItem( \'' $ g.sessionurl $ 'Screen=' $ encodeattribute( g.Screen ) $ '&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Edit_Item=' $ encodeattribute( l.item_code ) $ '&Tab=' $ encodeattribute( g.Tab ) $ '&Prev_Item=1\' )' }"><IMG SRC = "{ g.AdminGraphics_Path $ 'p_btn.gif' }" BORDER = 0 ALT = "{ l.prev }"></A>
			<A HREF = "{ 'javascript:SwitchItem( \'' $ g.sessionurl $ 'Screen=' $ encodeattribute( g.Screen ) $ '&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Edit_Item=' $ encodeattribute( l.item_code ) $ '&Tab=' $ encodeattribute( g.Tab ) $ '&Next_Item=1\' )' }"><IMG SRC = "{ g.AdminGraphics_Path $ 'n_btn.gif' }" BORDER = 0 ALT = "{ l.next }"></A>
			<A HREF = "{ 'javascript:SwitchItem( \'' $ g.sessionurl $ 'Screen=' $ encodeattribute( g.Screen ) $ '&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Edit_Item=' $ encodeattribute( l.item_code ) $ '&Tab=' $ encodeattribute( g.Tab ) $ '&Last_Item=1\' )' }"><IMG SRC = "{ g.AdminGraphics_Path $ 'l_btn.gif' }" BORDER = 0 ALT = "{ l.last }"></A>
		</MvIF>
		<MvIF EXPR = "{ len( g.Message ) }">
			&nbsp;&nbsp;<MvEVAL EXPR = "{ g.Message }">
		<MvELSE>
			&nbsp;
		</MvIF>
		</FONT>
	</TD>

	<MvASSIGN NAME = "l.pos" VALUE = 1>
	<MvASSIGN NAME = "l.current" VALUE = "{ gettoken( l.buttons, ',', l.pos ) }">
	<MvWHILE EXPR = "{ l.current }">
		<MvASSIGN NAME = "l.can" VALUE = 1>
		<MvASSIGN NAME = "l.sep_pos" VALUE = "{ ':' IN l.current }">

		<MvASSIGN NAME = "l.temp" VALUE = "{ substring( l.current, 1, l.sep_pos - 1 ) }">
		<MvIF EXPR = "{ '.' IN l.temp }">
			<MvASSIGN NAME = "l.button_screen" VALUE = "{ gettoken( l.temp, '.', 1 ) }">
			<MvASSIGN NAME = "l.button_action" VALUE = "{ gettoken( l.temp, '.', 2 ) }">
		<MvELSE>
			<MvASSIGN NAME = "l.button_screen" VALUE = "{ g.Screen }">
			<MvASSIGN NAME = "l.button_action" VALUE = "{ l.temp }">
		</MvIF>

		<MvASSIGN NAME = "l.temp" VALUE = "{ substring( l.current, l.sep_pos + 1, len( l.current ) - l.sep_pos ) }">
		<MvIF EXPR = "{ ':' IN l.temp }">
			<MvASSIGN NAME = "l.button_text" VALUE = "{ gettoken( l.temp, ':', 1 ) }">
			<MvASSIGN NAME = "l.can" VALUE = "{ CanI( gettoken( l.temp, ':', 2 ), 0, gettoken( l.temp, ':', 3 ), gettoken( l.temp, ':', 4 ), gettoken( l.temp, ':', 5 ) ) }">
		<MvELSE>
			<MvASSIGN NAME = "l.button_text" VALUE = "{ l.temp }">
		</MvIF>

		<MvASSIGN NAME = "l.script" VALUE = "{ ltrim( rtrim( gettoken( l.button_text, ';', 2 ) ) ) }">
		<MvASSIGN NAME = "l.button_text" VALUE = "{ ltrim( rtrim( gettoken( l.button_text, ';', 1 ) ) ) }">

		<MvIF EXPR = "{ l.button_text EQ '[ADD]' }">
			<MvLOCALIZED NAME = "l.button_text" ID = "MER-ADM-00716">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
		<MvIF EXPR = "{ l.button_text EQ '[DELETE]' }">
			<MvLOCALIZED NAME = "l.button_text" ID = "MER-ADM-00717">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Delete</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
		<MvIF EXPR = "{ l.button_text EQ '[UPDATE]' }">
			<MvLOCALIZED NAME = "l.button_text" ID = "MER-ADM-00718">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Update</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
		<MvIF EXPR = "{ NOT len( l.script ) }">
			<MvASSIGN NAME = "l.script" VALUE = "{ 'SubmitForm( \'' $ encodeattribute( l.button_screen ) $ '\', \'' $ encodeattribute( l.button_action ) $ '\' )' }">
		</MvIF>

		<MvIF EXPR = "{ l.can }">
			<TD BGCOLOR = "#f0f0f0" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "button" VALUE = "{ encodeentities( l.button_text ) }" ONCLICK = "{ l.script $ ';' }">
				</FONT>
			</TD>
		</MvIF>
		<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
		<MvASSIGN NAME = "l.current" VALUE = "{ gettoken( l.buttons, ',', l.pos ) }">
	</MvWHILE>

	<TD BGCOLOR = "#f0f0f0" ALIGN = "right">
		<FONT FACE = "Arial, Helvetica" SIZE = "-1">
		<MvEVAL EXPR = "{ DrawButton_Reset() }">
		</FONT>
	</TD></TR>
	</TABLE>

	</TD></TR>
	</TABLE>
</MvFUNCTION>

<MvFUNCTION NAME = "JavaScript_SetVariables" PARAMETERS = "scope, variables" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.line" VALUE = "{ asciichar(10) }">
	<MvASSIGN NAME = "l.java_script" VALUE = "{ l.line $ '<SCRIPT LANGUAGE = "JavaScript">' $ l.line $ '<!--' }">
	<MvASSIGN NAME = "l.pos" VALUE = 1>
	<MvASSIGN NAME = "l.variable" VALUE = "{ glosub( rtrim( ltrim( gettoken( l.variables, ',', l.pos ) ) ), '\'', '\\\'' ) }">
	<MvWHILE EXPR = "{ l.variable }">
		<MvASSIGN NAME = "l.var_value" VALUE = "{ miva_variable_value( l.scope $ '.' $ l.variable ) }">
		
		<MvASSIGN NAME = "l.java_script" VALUE = "{ l.java_script $ l.line $ 'var ' $ l.variable $ ' = ' $ '\'' $ l.var_value $ '\'' $ ';' }">
		
		<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
		<MvASSIGN NAME = "l.variable" VALUE = "{ rtrim( ltrim( gettoken( l.variables, ',', l.pos ) ) ) }">
	</MvWHILE>
	<MvASSIGN NAME = "l.java_script" VALUE = "{ l.java_script $ l.line $ '//-->' $ l.line $ '</SCRIPT>' $ l.line }">
   <MvFUNCTIONRETURN VALUE = "{ l.java_script }">
</MvFUNCTION>

<MvFUNCTION NAME = "JavaScript_Set_A_Variable" PARAMETERS = "name, value" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.line" VALUE = "{ asciichar(10) }">
	<MvASSIGN NAME = "l.java_script" VALUE = "{ l.line $ '<SCRIPT LANGUAGE = "JavaScript">' $ l.line $ '<!--' }">
	<MvASSIGN NAME = "l.java_script" VALUE = "{ l.java_script $ l.line $ 'var ' $ l.name $ ' = \'' $ l.value $ '\';' }">
		
	<MvASSIGN NAME = "l.java_script" VALUE = "{ l.java_script $ l.line $ '//-->' $ l.line $ '</SCRIPT>' $ l.line }">
   <MvFUNCTIONRETURN VALUE = "{ l.java_script }">
</MvFUNCTION>

<MvFUNCTION NAME = "JavaScriptEncode" PARAMETERS = "field" STANDARDOUTPUTLEVEL = "">
	<MvFUNCTIONRETURN VALUE = "{ glosub( encodeentities( l.field ), '\'', '\\\'' ) }">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_Code" PARAMETERS = "value">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01564">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a code</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvIF EXPR = "{ len( l.value ) GT 50 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01565">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code must be 50 characters long or shorter</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvIF EXPR = "{ '%' IN l.value }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01566">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code may not contain a percent sign</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvIF EXPR = "{ '\\' IN l.value }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01567">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Code may not contain a backslash (\\)</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_Method_Length" PARAMETERS = "value, length">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01568">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a method</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvIF EXPR = "{ len( l.value ) GT l.length }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01569">
			<MvLOCALIZED-TOKEN NAME = "length" VALUE = "{ l.length }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Method must be %length% characters long or shorter</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvIF EXPR = "{ '%' IN l.value }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01570">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Method may not contain a percent sign</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvIF EXPR = "{ ('\\' IN l.value) OR (',' IN l.value) OR (':' IN l.value) }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01571">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Method may not contain a backslash (\\), comma (,) or colon (:)</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_Email" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.valid" VALUE = "{ Email_Validate( l.value ) }">
	<MvFUNCTIONRETURN VALUE = "{ l.valid }">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_Phone" PARAMETERS = "value, country" STANDARDOUTPUTLEVEL = "">
	<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.valid" VALUE = "{ Phone_Validate( l.value, l.country ) }">
	<MvFUNCTIONRETURN VALUE = "{ l.valid }">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_Zip" PARAMETERS = "value, country" STANDARDOUTPUTLEVEL = "">
	<MvDO FILE = "{ g.Library_Utilities }" NAME = "l.valid" VALUE = "{ Zip_Validate( l.value, l.country ) }">
	<MvFUNCTIONRETURN VALUE = "{ l.valid }">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_WholeNumber" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.validate" VALUE = "{ l.value }">

	<MvIF EXPR = "{ substring( l.value, l.pos, 1 ) EQ '-' }">
		<MvASSIGN NAME = "l.validate" VALUE = "{ substring( l.value, 2, len( l.value ) - 1 ) }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ isdigit( l.validate ) }">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_WholeNumber_Optional" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvFUNCTIONRETURN VALUE = "1">
	</MvIF>
	
	<MvASSIGN NAME = "l.validate" VALUE = "{ l.value }">
	
	<MvIF EXPR = "{ substring( l.value, l.pos, 1 ) EQ '-' }">
		<MvASSIGN NAME = "l.validate" VALUE = "{ substring( l.value, 2, len( l.value ) - 1 ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT isdigit( l.validate ) }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01572">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a whole number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ len( l.value ) GT 10 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01573">
			<MvLOCALIZED-TOKEN NAME = "low" VALUE = "{ l.low }">
			<MvLOCALIZED-TOKEN NAME = "high" VALUE = "{ l.high }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a number of 10 digits or less</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_WholeNumber_Required" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01574">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a whole number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvASSIGN NAME = "l.validate" VALUE = "{ l.value }">
	
	<MvIF EXPR = "{ substring( l.value, l.pos, 1 ) EQ '-' }">
		<MvASSIGN NAME = "l.validate" VALUE = "{ substring( l.value, 2, len( l.value ) - 1 ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT isdigit( l.validate ) }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01575">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a whole number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ len( l.value ) GT 10 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01576">
			<MvLOCALIZED-TOKEN NAME = "low" VALUE = "{ l.low }">
			<MvLOCALIZED-TOKEN NAME = "high" VALUE = "{ l.high }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a number of 10 digits or less</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_WholeNumber_Range_Required" PARAMETERS = "value, low, high" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01577">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a whole number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvASSIGN NAME = "l.validate" VALUE = "{ l.value }">

	<MvIF EXPR = "{ substring( l.value, l.pos, 1 ) EQ '-' }">
		<MvASSIGN NAME = "l.validate" VALUE = "{ substring( l.value, 2, len( l.value ) - 1 ) }">
	</MvIF>

	<MvIF EXPR = "{ NOT isdigit( l.validate ) }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01578">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a whole number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ ( l.value LT l.low ) OR ( l.value GT l.high )}">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01579">
			<MvLOCALIZED-TOKEN NAME = "low" VALUE = "{ l.low }">
			<MvLOCALIZED-TOKEN NAME = "high" VALUE = "{ l.high }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a number between %low% and %high%</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_WholeNumber_NonNegative_Optional" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvFUNCTIONRETURN VALUE = "1">
	</MvIF>
	
	<MvIF EXPR = "{ substring( l.value, l.pos, 1 ) EQ '-' }">
		<MvLOCALIZED NAME = "g.Validation_Message"  ID = "MER-ADM-00867">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a non-negative number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvASSIGN NAME = "l.validate" VALUE = "{ l.value }">

	<MvIF EXPR = "{ NOT isdigit( l.validate ) }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01580">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a whole number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ len( l.value ) GT 10 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01581">
			<MvLOCALIZED-TOKEN NAME = "low" VALUE = "{ l.low }">
			<MvLOCALIZED-TOKEN NAME = "high" VALUE = "{ l.high }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a number of 10 digits or less</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_WholeNumber_NonNegative_Required" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01582">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ substring( l.value, l.pos, 1 ) EQ '-' }">
		<MvLOCALIZED NAME = "g.Validation_Message"  ID = "MER-ADM-00867">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a non-negative number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvASSIGN NAME = "l.validate" VALUE = "{ l.value }">

	<MvIF EXPR = "{ NOT isdigit( l.validate ) }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01583">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a whole number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ len( l.value ) GT 10 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01584">
			<MvLOCALIZED-TOKEN NAME = "low" VALUE = "{ l.low }">
			<MvLOCALIZED-TOKEN NAME = "high" VALUE = "{ l.high }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a number of 10 digits or less</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_WholeNumber_Positive_Required" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01585">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a whole number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ l.value LE 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01586">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a positive number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvASSIGN NAME = "l.validate" VALUE = "{ l.value }">

	<MvIF EXPR = "{ NOT isdigit( l.validate ) }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01587">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a whole number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ len( l.value ) GT 10 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01588">
			<MvLOCALIZED-TOKEN NAME = "low" VALUE = "{ l.low }">
			<MvLOCALIZED-TOKEN NAME = "high" VALUE = "{ l.high }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a number of 10 digits or less</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_WholeNumber_Positive_Optional" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvFUNCTIONRETURN VALUE = "1">
	</MvIF>
	
	<MvIF EXPR = "{ l.value LE 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01589">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a positive number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvASSIGN NAME = "l.validate" VALUE = "{ l.value }">

	<MvIF EXPR = "{ NOT isdigit( l.validate ) }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01590">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a whole number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ len( l.value ) GT 10 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01591">
			<MvLOCALIZED-TOKEN NAME = "low" VALUE = "{ l.low }">
			<MvLOCALIZED-TOKEN NAME = "high" VALUE = "{ l.high }">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a number of 10 digits or less</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_FloatingPoint" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.valid" VALUE = 1>
	<MvASSIGN NAME = "l.pos" VALUE = 1>
	<MvASSIGN NAME = "l.len" VALUE = "{ len( l.value ) }">
	<MvASSIGN NAME = "l.have_decimal" VALUE = 0>

	<MvIF EXPR = "{ substring( l.value, l.pos, 1 ) EQ '-' }">
		<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	</MvIF>

	<MvWHILE EXPR = "{ l.valid AND ( l.pos LE l.len ) }">
		<MvASSIGN NAME = "l.char" VALUE = "{ substring( l.value, l.pos, 1 ) }">
		<MvIF EXPR = "{ NOT isdigit( l.char ) }">
			<MvIF EXPR = "{ l.char EQ '.' }">
				<MvIF EXPR = "{ l.have_decimal }">
					<MvASSIGN NAME = "l.valid" VALUE = 0>
				<MvELSE>
					<MvASSIGN NAME = "l.have_decimal" VALUE = 1>
				</MvIF>
			<MvELSE>
				<MvASSIGN NAME = "l.valid" VALUE = 0>
			</MvIF>
		</MvIF>

		<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	</MvWHILE>

	<MvFUNCTIONRETURN VALUE = "{ l.valid }">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_Currency_Optional" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvFUNCTIONRETURN VALUE = "1">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ Validate_Decimal( l.value, 10, 2 ) }">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_Currency_Required" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01592">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ Validate_Decimal( l.value, 10, 2 ) }">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_Currency_NonNegative_Optional" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvFUNCTIONRETURN VALUE = "1">
	</MvIF>
	
	<MvIF EXPR = "{ substring( l.value, l.pos, 1 ) EQ '-' }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01593">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a non-negative number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ Validate_Decimal( l.value, 10, 2 ) }">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_Currency_NonNegative_Required" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01594">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ substring( l.value, l.pos, 1 ) EQ '-' }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01595">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a non-negative number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ Validate_Decimal( l.value, 10, 2 ) }">

</MvFUNCTION>

<MvFUNCTION NAME = "Validate_FloatingPoint_Optional" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvFUNCTIONRETURN VALUE = "1">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ Validate_Decimal( l.value, 10, 2 ) }">

</MvFUNCTION>

<MvFUNCTION NAME = "Validate_FloatingPoint_Required" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01596">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ Validate_Decimal( l.value, 10, 2 ) }">

</MvFUNCTION>

<MvFUNCTION NAME = "Validate_FloatingPoint_NonNegative_Optional" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvFUNCTIONRETURN VALUE = "1">
	</MvIF>
	
	<MvIF EXPR = "{ substring( l.value, l.pos, 1 ) EQ '-' }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01597">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a non-negative number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ Validate_Decimal( l.value, 10, 2 ) }">

</MvFUNCTION>

<MvFUNCTION NAME = "Validate_FloatingPoint_NonNegative_Required" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01598">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ l.value LT 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01599">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a non-negative number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ Validate_Decimal( l.value, 10, 2 ) }">

</MvFUNCTION>

<MvFUNCTION NAME = "Validate_FloatingPoint_Positive_Required" PARAMETERS = "value" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01600">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ l.value LE 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01601">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a positive number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ Validate_Decimal( l.value, 10, 2 ) }">

</MvFUNCTION>

<MvFUNCTION NAME = "Validate_FloatingPoint_Length_NonNegative_Optional" PARAMETERS = "value, left, right" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0}">
		<MvFUNCTIONRETURN VALUE = "1">
	</MvIF>
	
	<MvIF EXPR = "{ l.value LT 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01602">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a non-negative number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ Validate_Decimal( l.value, l.left, l.right ) }">

</MvFUNCTION>


<MvFUNCTION NAME = "Validate_FloatingPoint_Length_NonNegative_Required" PARAMETERS = "value, left, right" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0}">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01603">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ l.value LT 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01604">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a non-negative number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ Validate_Decimal( l.value, l.left, l.right ) }">

</MvFUNCTION>

<MvFUNCTION NAME = "Validate_FloatingPoint_Length_Positive_Optional" PARAMETERS = "value, left, right" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvFUNCTIONRETURN VALUE = "1">
	</MvIF>
	
	<MvIF EXPR = "{ l.value LE 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01605">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a positive number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ Validate_Decimal( l.value, l.left, l.right ) }">

</MvFUNCTION>

<MvFUNCTION NAME = "Validate_FloatingPoint_Length_Positive_Required" PARAMETERS = "value, left, right" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ l.value LE 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01606">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a positive number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ Validate_Decimal( l.value, l.left, l.right ) }">

</MvFUNCTION>

<MvFUNCTION NAME = "Validate_FloatingPoint_Length_Required" PARAMETERS = "value, left, right" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ len( l.value ) EQ 0 }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01607">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ Validate_Decimal( l.value, l.left, l.right ) }">

</MvFUNCTION>

<MvFUNCTION NAME = "Validate_Decimal" PARAMETERS = "value, left, right" STANDARDOUTPUTLEVEL = "">

	<MvASSIGN NAME = "l.len" VALUE = "{ len( l.value ) }">
	
	<MvIF EXPR = "{ substring( l.value, l.pos, 1 ) EQ '-' }">
		<MvASSIGN NAME = "l.value" VALUE = "{ substring( l.value, 2, len( l.value ) ) }">
		<MvASSIGN NAME = "l.len" VALUE = "{ l.len - 1 }">
	</MvIF>
	
	<MvASSIGN NAME = "l.decimal" VALUE = "{ '.' IN l.value }">
	<MvIF EXPR = "{ l.decimal }">
		<MvASSIGN NAME = "l.leftpart" VALUE = "{ substring( l.value, 1, l.decimal - 1 ) }">
		<MvASSIGN NAME = "l.rightpart" VALUE = "{ substring( l.value, l.decimal + 1, l.len - l.decimal ) }">
	<MvELSE>
		<MvASSIGN NAME = "l.leftpart" VALUE = "{ l.value }">
		<MvASSIGN NAME = "l.rightpart" VALUE = "">
	</MvIF>
		
	<MvIF EXPR = "{ NOT ( isdigit( l.leftpart ) AND isdigit( l.rightpart ) ) }">
		<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01608">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a number</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvIF EXPR = "{ len( l.leftpart ) GT l.left }">
		<MvIF EXPR = "{ l.left EQ 1 }">
			<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01609">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a number with 1 digit or less to the left of the decimal point</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		<MvELSE>
			<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01610">
				<MvLOCALIZED-TOKEN NAME = "digits" VALUE = "{ l.left }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a number with %digits% digits or less to the left of the decimal point</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvIF EXPR = "{ len( l.rightpart ) GT l.right }">
		<MvIF EXPR = "{ l.right EQ 1 }">
			<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01611">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a number with 1 digit or less to the right of the decimal point</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		<MvELSE>
			<MvLOCALIZED NAME = "g.Validation_Message" ID = "MER-ADM-01612">
				<MvLOCALIZED-TOKEN NAME = "digits" VALUE = "{ l.right }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a number with %digits% digits or less to the right of the decimal point</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
		</MvIF>
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>

<MvFUNCTION NAME = "Validate_Image_Extension" PARAMETERS = "old_image, old_image_ext var" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.valid" VALUE = 0>
	
	<MvASSIGN NAME = "l.pos" VALUE = 2>
	<MvASSIGN NAME = "l.old_image_ext" VALUE = "{ ltrim( rtrim( gettoken( l.old_image, '.', l.pos ) ) ) }">
	
	<MvWHILE EXPR = "{ len( l.old_image_ext ) NE 0 }">
		<MvIF EXPR = "{ NOT ( ltrim( rtrim( gettoken( l.old_image, '.', l.pos + 1 ) ) ) ) }">
			<MvASSIGN NAME = "l.old_image_ext" VALUE = "{ ltrim( rtrim( gettoken( l.old_image, '.', l.pos ) ) ) }">
			<MvWHILESTOP>
		</MvIF>

		<MvASSIGN NAME = "l.old_image_ext" VALUE = "{ ltrim( rtrim( gettoken( l.old_image, '.', l.pos ) ) ) }">
		<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">		
	</MvWHILE>

	<MvASSIGN NAME = "l.pos" VALUE = 1>
	<MvASSIGN NAME = "l.image" VALUE = "{ ltrim( rtrim( gettoken( Domain.d.img_ext, ',', l.pos ) ) ) }">

	<MvWHILE EXPR = "{ len( l.image ) NE 0 }">
		<MvIF EXPR = "{ l.image EQ l.old_image_ext }">
			<MvASSIGN NAME = "l.valid" VALUE = 1>
			<MvWHILESTOP>
		</MvIF>

		<MvASSIGN NAME = "l.image" VALUE = "{ ltrim( rtrim( gettoken( Domain.d.img_ext, ',', l.pos ) ) ) }">
		<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	</MvWHILE>
	
	<MvFUNCTIONRETURN VALUE = "{ l.valid }">
</MvFUNCTION>

<MvCOMMENT>
|
| Wizards
|
</MvCOMMENT>

<MvFUNCTION NAME = "Action_Wizard">
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code( g.Module_Code ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.module" VALUE = "{ Modules.d.module }">
		<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.can_do" VALUE = "{ WizardModule_Privileges() }">

		<MvIF EXPR = "{ l.can_do }">
			<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.valid" VALUE = "{ WizardModule_Validate() }">
			<MvIF EXPR = "{ l.valid }">
				<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.ok" VALUE = "{ WizardModule_Action() }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Wizard" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvIF EXPR = "{ g.Load_Fields }">
		<MvASSIGN NAME = "g.Step" VALUE = 1>
		<MvASSIGN NAME = "g.New_Step" VALUE = 1>
	</MvIF>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code( g.Module_Code ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.module" VALUE = "{ Modules.d.module }">
		<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.can_use" VALUE = "{ WizardModule_Privileges() }">

		<MvIF EXPR = "{ l.can_use }">
			<MvIF EXPR = "{ g.New_Step GT g.Step }">
				<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.valid" VALUE = "{ WizardModule_Validate_Step( g.Step ) }">
				<MvIF EXPR = "{ l.valid }">
					<MvASSIGN NAME = "g.Step" VALUE = "{ g.New_Step }">
				</MvIF>
			<MvELSE>
				<MvIF EXPR = "{ g.New_Step LT g.Step }">
					<MvASSIGN NAME = "g.Step" VALUE = "{ g.New_Step }">
				</MvIF>
			</MvIF>

			<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.logo" VALUE = "{ WizardModule_Logo() }">
			<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.title" VALUE = "{ WizardModule_Title( g.Step ) }">

			<MvEVAL EXPR = "{ Wizard_BeginScreen( l.logo, l.title ) }">
			<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.ok" VALUE = "{ WizardModule_Content( g.Step, g.Load_Fields ) }">
			<MvEVAL EXPR = "{ Wizard_EndScreen() }">
		</MvIF>

	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Store Wizards
|
</MvCOMMENT>

<MvFUNCTION NAME = "Action_StoreWizard">
	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code( g.Module_Code ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.module" VALUE = "{ Modules.d.module }">
		<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.can_do" VALUE = "{ StoreWizardModule_Privileges() }">

		<MvIF EXPR = "{ l.can_do }">
			<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.valid" VALUE = "{ StoreWizardModule_Validate() }">
			<MvIF EXPR = "{ l.valid }">
				<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.ok" VALUE = "{ StoreWizardModule_Action() }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_StoreWizard" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvIF EXPR = "{ g.Load_Fields }">
		<MvASSIGN NAME = "g.Step" VALUE = 1>
		<MvASSIGN NAME = "g.New_Step" VALUE = 1>
	</MvIF>

	<MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{ Module_Find_Code( g.Module_Code ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.module" VALUE = "{ Modules.d.module }">

		<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.can_use" VALUE = "{ StoreWizardModule_Privileges() }">
		<MvIF EXPR = "{ l.can_use }">
			<MvIF EXPR = "{ g.New_Step EQ g.Step }">
				<MvIF EXPR = "{ ( ( len( g.Module_Wizard_Validate ) EQ 0 ) AND ( g.Module_New_Step GT g.Module_Step ) ) OR
								( g.Module_Wizard_Validate EQ 'Yes' ) }">
					<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.valid" VALUE = "{ StoreWizardModule_Validate_Step( g.Step ) }">
					<MvIF EXPR = "{ l.valid }">
						<MvASSIGN NAME = "g.Module_Step" VALUE = "{ g.Module_New_Step }">
					</MvIF>
				<MvELSE>
					<MvASSIGN NAME = "g.Module_Step" VALUE = "{ g.Module_New_Step }">
				</MvIF>
			<MvELSE>
				<MvIF EXPR = "{ ( ( len( g.Wizard_Validate ) EQ 0 )	AND ( g.New_Step GT g.Step ) ) OR
								( g.Wizard_Validate EQ 'Yes' ) }">
					<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.valid" VALUE = "{ StoreWizardModule_Validate_Step( g.Step ) }">
					<MvIF EXPR = "{ l.valid }">
						<MvASSIGN NAME = "g.Step" VALUE = "{ g.New_Step }">
					</MvIF>
				<MvELSE>
					<MvASSIGN NAME = "g.Step" VALUE = "{ g.New_Step }">
				</MvIF>
			</MvIF>

			<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.logo" VALUE = "{ StoreWizardModule_Logo() }">
			<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.title" VALUE = "{ StoreWizardModule_Title( g.Step ) }">

			<MvEVAL EXPR = "{ Wizard_BeginScreen( l.logo, l.title ) }">
			<MvDO FILE = "{ g.Module_Root $ l.module }" NAME = "l.ok" VALUE = "{ StoreWizardModule_Content( g.Step, g.Load_Fields ) }">
			<MvEVAL EXPR = "{ Wizard_EndScreen() }">
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvCOMMENT>
|
| Wizard Utilities
|
</MvCOMMENT>

<MvFUNCTION NAME = "Wizard_BeginScreen" PARAMETERS = "logo, title" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<HEAD>
	<TITLE><MvEVAL EXPR = "{ l.title }"></TITLE>
	<MvIF EXPR = "{ g.Secure }">
		<BASE HREF = "{ g.secure_baseurl }">
	<MvELSE>
		<BASE HREF = "{ g.baseurl }">
	</MvIF>
	<MvEVAL EXPR = "{ JavaScript_SetVariables( 'g', 'Screen' ) }">
<SCRIPT LANGUAGE = "JavaScript">
<!--
function FieldError( field, message )
{
	if ( field.length )
	{
		document.forms[ Screen ].elements[ field ].select();
		document.forms[ Screen ].elements[ field ].focus();
	}

	alert( message );
}

function Wizard_Next()
{
	document.forms[ Screen ].elements[ 'New_Step' ].value = parseInt( document.forms[ Screen ].elements[ 'Step' ].value ) + 1;
	document.forms[ Screen ].submit();
}

function Wizard_Previous()
{
	document.forms[ Screen ].elements[ 'New_Step' ].value = parseInt( document.forms[ Screen ].elements[ 'Step' ].value ) - 1;
	document.forms[ Screen ].submit();
}

function Wizard_Finish()
{
	document.forms[ Screen ].elements[ 'New_Step' ].value = 0;
	document.forms[ Screen ].elements[ 'Action' ].value = 'WIZZ';
	document.forms[ Screen ].submit();
}

function Wizard_Skip( steps )
{
	document.forms[ Screen ].elements[ 'New_Step' ].value = parseInt( document.forms[ Screen ].elements[ 'Step' ].value ) + steps;
	document.forms[ Screen ].submit();
}

function Wizard_Goto( step, validate )
{
	document.forms[ Screen ].elements[ 'New_Step' ].value = step;

	if ( validate )
	{
		document.forms[ Screen ].elements[ 'Wizard_Validate' ].value = 'Yes';
	}
	else
	{
		document.forms[ Screen ].elements[ 'Wizard_Validate' ].value = 'No';
	}

	document.forms[ Screen ].submit();
}

function StoreWizard_Finish()
{
	document.forms[ Screen ].elements[ 'New_Step' ].value = 0;
	document.forms[ Screen ].elements[ 'Action' ].value = 'SWIZ';
	document.forms[ Screen ].submit();
}

function Module_Wizard_Next()
{
	document.forms[ Screen ].elements[ 'Module_New_Step' ].value = parseInt( document.forms[ Screen ].elements[ 'Module_Step' ].value ) + 1;
	document.forms[ Screen ].submit();
}

function Module_Wizard_Previous()
{
	module_step = parseInt( document.forms[ Screen ].elements[ 'Module_Step' ].value );
	if ( module_step > 1 )
	{
		document.forms[ Screen ].elements[ 'Module_New_Step' ].value = module_step - 1;
	}
	else
	{
		document.forms[ Screen ].elements[ 'New_Step' ].value = parseInt( document.forms[ Screen ].elements[ 'Step' ].value ) - 1;
	}

	document.forms[ Screen ].submit();
}

function Module_Wizard_Finish()
{
	document.forms[ Screen ].elements[ 'New_Step' ].value = parseInt( document.forms[ Screen ].elements[ 'Step' ].value ) + 1;
	document.forms[ Screen ].submit();
}

function Module_Wizard_Goto( step, validate )
{
	document.forms[ Screen ].elements[ 'Module_New_Step' ].value = step;

	if ( validate )
	{
		document.forms[ Screen ].elements[ 'Module_Wizard_Validate' ].value = 'Yes';
	}
	else
	{
		document.forms[ Screen ].elements[ 'Module_Wizard_Validate' ].value = 'No';
	}

	document.forms[ Screen ].submit();
}

//-->
</SCRIPT>
	</HEAD>

	<MvIF EXPR = "{ len( g.Error_Field ) OR ( len( g.Error_Field_Message ) ) }">
		<BODY BGCOLOR = "#ffffff" BACKGROUND = "{ 'graphics/' $ s.miva_language $ '/wizards/blade_bg.gif' }" ONLOAD = "{ 'FieldError( \'' $ JavaScriptEncode( g.Error_Field ) $ '\', \'' $ JavaScriptEncode( g.Error_Field_Message ) $ '\' );' }">
	<MvELSE>
		<BODY BGCOLOR = "#ffffff" BACKGROUND = "{ 'graphics/' $ s.miva_language $ '/wizards/blade_bg.gif' }">
	</MvIF>

	<FORM NAME = "{ encodeentities( g.Screen ) }" METHOD = "POST" ACTION = "{ g.sessionurl }">
	<MvHIDE FIELDS = "g.IsSimpleMode, g.Screen, g.Step, g.Module_Code">
	<INPUT TYPE = "hidden" NAME = "Wizard_Validate" VALUE = "">
	<INPUT TYPE = "hidden" NAME = "Have_Fields" VALUE = "1">
	<INPUT TYPE = "hidden" NAME = "New_Step" VALUE = "{ encodeentities( g.Step ) }">
	<INPUT TYPE = "hidden" NAME = "Action" VALUE = "">

	<MvIF EXPR = "{ len( g.Store_Code ) }">
		<MvHIDE FIELDS = "g.Store_Code">
	</MvIF>

	<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
	<TR><TD ALIGN = "left" VALIGN = "top">
		<IMG BORDER = 0 ALT = "{ encodeentities( l.title ) }" SRC = "{ encodeentities( l.logo ) }">
	</TD><TD ALIGN = "right" VALIGN = "top" NOWRAP>
		<MvLOCALIZED NAME = "l.restart_text" ID = "MER-ADM-00847">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Restart</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.foo" VALUE = "{ User_Find_ID( g.Admin_User_ID ) }">
		<MvIF EXPR = "{ l.foo }">
			<MvIF EXPR = "{ Users.d.smod }">
				<MvLOCALIZED NAME = "l.close_text" ID = "MER-ADM-01517">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Skip</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ len( g.Store_Code ) }">
					<A HREF = "{ g.sessionurl $ 'Screen=' $ encodeattribute( g.Screen ) $ '&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Module_Code=' $ encodeattribute( g.Module_Code ) }"><IMG SRC = "{ 'graphics/' $ s.miva_language $ '/wizards/restart.gif' }" BORDER = 0 ALT = "{ l.restart_text }"></A><A HREF = "{ g.sessionurl $ 'Screen=STPR&Store_Code=' $ encodeentities( g.Store_Code ) }"><IMG SRC = "{ 'graphics/' $ s.miva_language $ '/wizards/skip.gif' }" BORDER = 0 ALT = "{ l.close_text }"></A>
				<MvELSE>
					<A HREF = "{ g.sessionurl $ 'Screen=' $ encodeattribute( g.Screen ) $ '&Module_Code=' $  encodeattribute( g.Module_Code ) }"><IMG SRC = "{ 'graphics/' $ s.miva_language $ '/wizards/restart.gif' }" BORDER = 0 ALT = "{ l.restart_text }"></A><A HREF = "{ g.sessionurl $ 'Screen=STPR' }"><IMG SRC = "{ 'graphics/' $ s.miva_language $ '/wizards/skip.gif' }" BORDER = 0 ALT = "{ l.close_text }"></A>
				</MvIF>
			<MvELSE>
				<MvLOCALIZED NAME = "l.close_text" ID = "MER-ADM-00848">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Close</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvIF EXPR = "{ len( g.Store_Code ) }">
					<A HREF = "{ g.sessionurl $ 'Screen=' $ encodeattribute( g.Screen ) $ '&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Module_Code=' $ encodeattribute( g.Module_Code ) }"><IMG SRC = "{ 'graphics/' $ s.miva_language $ '/wizards/restart.gif' }" BORDER = 0 ALT = "{ l.restart_text }"></A><A HREF = "#" ONCLICK = "window.close(); return false;"><IMG SRC = "{ 'graphics/' $ s.miva_language $ '/wizards/close.gif' }" BORDER = 0 ALT = "{ l.close_text }"></A>
				<MvELSE>
					<A HREF = "{ g.sessionurl $ 'Screen=' $ encodeattribute( g.Screen ) $ '&Module_Code=' $ encodeattribute( g.Module_Code ) }"><IMG SRC = "{ 'graphics/' $ s.miva_language $ '/wizards/restart.gif' }" BORDER = 0 ALT = "{ l.restart_text }"></A><A HREF = "#" ONCLICK = "window.close(); return false;"><IMG SRC = "{ 'graphics/' $ s.miva_language $ '/wizards/close.gif' }" BORDER = 0 ALT = "{ l.close_text }"></A>
				</MvIF>
			</MvIF>
		</MvIF>
		</FONT>
	</TD></TR>

	<TR><TD ALIGN = "left" VALIGN = "top" COLSPAN = 2>
</MvFUNCTION>

<MvFUNCTION NAME = "Wizard_EndScreen" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	</TD></TR>
	</TABLE>
	</FORM>
	</BODY>
</MvFUNCTION>

<MvFUNCTION NAME = "Wizard_FieldError" PARAMETERS = "step, field, message" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "g.Step" VALUE = "{ l.step }">
	<MvASSIGN NAME = "g.New_Step" VALUE = "{ l.step }">
	<MvASSIGN NAME = "g.Error_Field" VALUE = "{ l.field }">
	<MvASSIGN NAME = "g.Error_Field_Message" VALUE = "{ l.message }">
	<MvASSIGN NAME = "g.Data_Entry_Error" VALUE = 1>

	<MvFUNCTIONRETURN VALUE = 0>
</MvFUNCTION>

<MvFUNCTION NAME = "Wizard_Module_FieldError" PARAMETERS = "step, field, message" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "g.Module_Step" VALUE = "{ l.step }">
	<MvASSIGN NAME = "g.Module_New_Step" VALUE = "{ l.step }">
	<MvASSIGN NAME = "g.Error_Field" VALUE = "{ l.field }">
	<MvASSIGN NAME = "g.Error_Field_Message" VALUE = "{ l.message }">
	<MvASSIGN NAME = "g.Data_Entry_Error" VALUE = 1>

	<MvFUNCTIONRETURN VALUE = 0>
</MvFUNCTION>

<MvFUNCTION NAME = "Wizard_Module_HideFields" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvHIDE FIELDS = "g.Module_Step">
	<INPUT TYPE = "hidden" NAME = "Module_New_Step" VALUE = "{ encodeentities( g.Module_Step ) }">
	<INPUT TYPE = "hidden" NAME = "Module_Have_Fields" VALUE = "1">
	<INPUT TYPE = "hidden" NAME = "Module_Wizard_Validate" VALUE = "">

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Help_Button" PARAMETERS = "help" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawButton_Reset" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvLOCALIZED NAME = "l.text" ID = "MER-ADM-01530">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Reset</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<INPUT TYPE = "button" VALUE = "{ l.text }" ONCLICK = "{ 'ResetForm( \'' $ encodeattribute( g.Screen ) $ '\', \'' $ encodeentities( g.Tab ) $ '\' );' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_Search" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00720">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Search</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'search.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'search.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_Select" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00721">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Select</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'select.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'select.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_Lookup" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00722">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Lookup</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'search.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'search.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_All" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00723">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">All</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'all_p.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'all.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_Unassigned" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00844">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Unassigned</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'uassgn_p.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'uassgn.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_Assigned" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00845">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Assigned</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'assign_p.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'assign.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButtonNew_All" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-01484">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">All</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'all_down1.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'all_up.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_EditHere" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00724">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Edit Here</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'edith_p.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'edith.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_Uncategorized" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00725">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Uncategorized</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'uncat_p.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'uncat.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_Previous" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00726">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Previous</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'prev.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'prev.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_Next" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00727">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Next</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'next.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'next.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_Edit" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt"  ID = "MER-ADM-01378">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Edit</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'edit.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'edit.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_Refresh" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00729">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Refresh</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'refresh.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'refresh.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_Upload" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00730">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Upload File</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'upload.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'upload.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_Links" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00731">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Links</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'link.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'link.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_Help" PARAMETERS = "pressed" STANDARDOUTPUTLEVEL = "">
	<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00732">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Help</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'help.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'help.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawImgButton_NewX" PARAMETERS = "pressed, alt" STANDARDOUTPUTLEVEL = "">
	<MvIF EXPR = "{ l.pressed }">
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'newb_p.gif' }">
	<MvELSE>
		<MvASSIGN NAME = "l.image" VALUE = "{ g.AdminGraphics_Path $ 'newb.gif' }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ '<IMG ALT = "' $ l.alt $ '" BORDER = 0 SRC = "' $ l.image $ '">' }">
</MvFUNCTION>

<MvFUNCTION NAME = "DrawCheck_Assigned" PARAMETERS = "checked" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvIF EXPR = "{ checked }">
		<MvLOCALIZED NAME = "l.alt"  ID = "MER-ADM-01381">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Assigned</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<IMG ALT = "{ l.alt }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'check.gif' }">
	<MvELSE>
		&nbsp;
	</MvIF>
</MvFUNCTION>

<MvFUNCTION NAME = "DrawCheck_Taxable" PARAMETERS = "checked" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvIF EXPR = "{ checked }">
		<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00734">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Taxable</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<IMG ALT = "{ l.alt }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'check.gif' }">
	<MvELSE>
		&nbsp;
	</MvIF>
</MvFUNCTION>

<MvFUNCTION NAME = "DrawCheck_Active" PARAMETERS = "checked" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvIF EXPR = "{ checked }">
		<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-01382">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Active</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<IMG ALT = "{ l.alt }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'check.gif' }">
	<MvELSE>
		&nbsp;
	</MvIF>
</MvFUNCTION>

<MvFUNCTION NAME = "DrawCheck_Method" PARAMETERS = "checked" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvIF EXPR = "{ checked }">
		<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-01383">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Method</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<IMG ALT = "{ l.alt }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'check.gif' }">
	<MvELSE>
		&nbsp;
	</MvIF>
</MvFUNCTION>

<MvFUNCTION NAME = "DrawCheck_Default" PARAMETERS = "checked" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvIF EXPR = "{ checked }">
		<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00785">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Default</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<IMG ALT = "{ l.alt }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'check.gif' }">
	<MvELSE>
		&nbsp;
	</MvIF>
</MvFUNCTION>

<MvFUNCTION NAME = "DrawCheck_Required" PARAMETERS = "checked" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvIF EXPR = "{ checked }">
		<MvLOCALIZED NAME = "l.alt" ID = "MER-ADM-00735">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Required</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<IMG ALT = "{ l.alt }" BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'check.gif' }">
	<MvELSE>
		&nbsp;
	</MvIF>
</MvFUNCTION>

<MvFUNCTION NAME = "Show_BoldNA" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<B>
	<MvLOCALIZED ID = "MER-ADM-00736">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">N/A</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	</B>
	<MvFUNCTIONRETURN VALUE = "">
</MvFUNCTION>

<MvFUNCTION NAME = "Show_NA" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvLOCALIZED ID = "MER-ADM-00737">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">N/A</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvFUNCTIONRETURN VALUE = "">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_CheckAll" PARAMETERS = "check_remove" STANDARDOUTPUTLEVEL = "text,html, compresswhitespace">
	<BR>
	<MvLOCALIZED NAME = "l.check_all" ID = "MER-ADM-01613">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Check All</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvLOCALIZED NAME = "l.uncheck_all" ID = "MER-ADM-01614">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Uncheck All</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<A HREF = "{ 'JavaScript:CheckAll( \'' $ l.check_remove $ '\', 1 );' }"><IMG BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'checkall.gif' }" ALT = "{ l.check_all }"></A>
	&nbsp;
	<A HREF = "{ 'JavaScript:CheckAll( \'' $ l.check_remove $ '\', 0 );' }"><IMG BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'uncheckall.gif' }" ALT = "{ l.uncheck_all }"></A>

	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>
