<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/
|
| dBase III Database Layer
| $Source: /home/cvs/merchant/Merchant/features/agr/agr_ad.mv,v $
|
| Prefix         : MER-AGR-AD-
| Next Error Code: 14   
| Next Text ID   : 50   
|
</MvCOMMENT>

<MvFUNCTION NAME = "AGR_Navigation" STANDARDOUTPUTLEVEL = "text,html,compresswhitespace" ERROROUTPUTLEVEL = "syntax, expression">
	<MvLOCALIZED NAME = "l.label" ID = "MER-AGR-AD-00000">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Availability Groups</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.ok" VALUE = "{ LeftNavigation_Level( 2, 'AGRP(' $ Stores.d.id $ ')', '', '', l.label ) }">

	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_add" VALUE = "{ CanI( 'AGRP', 0, 1, 0, 0 ) }">
		<MvIF EXPR = "{ l.can_add }">	
			<MvLOCALIZED NAME = "l.label" ID = "MER-AGR-AD-00001">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Availability Group</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvDO FILE = "{ g.Module_Admin }" NAME = "{ l.left_nav }" VALUE = "{ LeftNavigation_Dot( 3, 'Screen=AGRP&Store_Code=' $ encodeattribute( Stores.d.code ), 'Main', l.label ) }">
		</MvIF>

		<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.found" VALUE = "{ AvailabilityGroup_FindFirst() }">
		<MvWHILE EXPR = "{ l.found }">
			<MvDO FILE = "{ g.Module_Admin }" NAME = "l.leftNavigation" VALUE = "{ LeftNavigation_Dot( 3, 'Screen=AGRP&Store_Code=' $ encodeattribute( Stores.d.code ) $ '&Edit_AvailabilityGroup=' $ encodeattribute( AvailabilityGroups.d.name ), 'Main', encodeentities( AvailabilityGroups.d.name ) ) }">
			<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.found" VALUE = "{ AvailabilityGroup_FindNext() }">
		</MvWHILE>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvCOMMENT>
|
| Availability Groups
|
</MvCOMMENT>

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

	<MvIF EXPR = "{ NOT len( g.AvailabilityGroup_Name ) }">
		<MvLOCALIZED NAME = "l.error_message" ID = "MER-AGR-AD-00002">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a availability group name</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvFUNCTIONRETURN VALUE = "{ FieldError( 'AGRP', 'AvailabilityGroup_Name', l.error_message ) }">
	<MvELSE>
		<MvIF EXPR = "{ ( len( g.Edit_AvailabilityGroup ) EQ 0 ) OR ( toupper( g.AvailabilityGroup_Name ) NE toupper( g.Edit_AvailabilityGroup ) ) }">
			<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.found" VALUE = "{ AvailabilityGroup_Find_Name( g.AvailabilityGroup_Name ) }">
			<MvIF EXPR = "{ l.found }">
				<MvLOCALIZED NAME = "l.error_message" ID = "MER-AGR-AD-00003">
					<MvLOCALIZED-TOKEN NAME = "group" VALUE = "{ g.AvailabilityGroup_Name }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">An availability group with the name '%group%' already exists</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvFUNCTIONRETURN VALUE = "{ FieldError( 'AGRP', 'AvailabilityGroup_Name', l.error_message ) }">
			</MvIF>
		</MvIF>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

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

	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_add" VALUE = "{ CanI( 'AGRP', 0, 1, 0, 0 ) }">

	<MvIF EXPR = "{ l.can_add }">
		<MvIF EXPR = "{ AvailabilityGroup_Validate() }">
			<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.agrp_id" VALUE = "{ AvailabilityGroup_Insert( g.AvailabilityGroup_Name ) }">
			<MvIF EXPR = "{ NOT l.agrp_id }">
				<MvASSIGN NAME = "l.ok" VALUE = 0>
			<MvELSE>
				<MvASSIGN NAME = "g.Edit_AvailabilityGroup" VALUE = "{ g.AvailabilityGroup_Name }">
				<MvLOCALIZED NAME = "g.Message" ID = "MER-AGR-AD-00004">
					<MvLOCALIZED-TOKEN NAME = "group" VALUE = "{ encodeentities( g.AvailabilityGroup_Name ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Availability Group '%group%' added</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Module_Admin }" NAME = "l.update" VALUE = "{ Update_LeftNavigation() }">
			</MvIF>
		</MvIF>
	</MvIF>

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


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

	<MvIF EXPR = "{ AvailabilityGroup_Validate() }">
		<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroup_Find_Name( g.Edit_AvailabilityGroup ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "l.original_name" VALUE = "{ AvailabilityGroups.d.name }">

			<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroup_Update( AvailabilityGroups.d.id, g.AvailabilityGroup_Name ) }">
			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_modify" VALUE = "{ CanI( 'CUST', 1, 0, 0, 0 ) }">
				<MvIF EXPR = "{ l.can_modify }">
					<MvASSIGN NAME = "l.customer" VALUE = 1>
					<MvWHILE EXPR = "{ l.ok AND ( l.customer LE g.AvailabilityGroup_Customer_Count ) }">
						<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.assigned" VALUE = "{ AvailabilityGroupXCustomer_Find( AvailabilityGroups.d.id, g.AvailabilityGroup_Customer_ID[ l.customer ] ) }">

						<MvIF EXPR = "{ g.AvailabilityGroup_Customer_Assigned[ l.customer ] }">
							<MvIF EXPR = "{ NOT l.assigned }">
								<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroupXCustomer_Insert( AvailabilityGroups.d.id, g.AvailabilityGroup_Customer_ID[ l.customer ] ) }">
							</MvIF>
						<MvELSE>
							<MvIF EXPR = "{ l.assigned }">
								<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroupXCustomer_Delete( AvailabilityGroups.d.id, g.AvailabilityGroup_Customer_ID[ l.customer ] ) }">
							</MvIF>
						</MvIF>

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

			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_modify" VALUE = "{ CanI( 'CTGY', 1, 0, 0, 0 ) }">
				<MvIF EXPR = "{ l.can_modify }">
					<MvASSIGN NAME = "l.category" VALUE = 1>
					<MvWHILE EXPR = "{ l.ok AND ( l.category LE g.AvailabilityGroup_Category_Count ) }">
						<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.assigned" VALUE = "{ AvailabilityGroupXCategory_Find( AvailabilityGroups.d.id, g.AvailabilityGroup_Category_ID[ l.category ] ) }">

						<MvIF EXPR = "{ g.AvailabilityGroup_Category_Assigned[ l.category ] }">
							<MvIF EXPR = "{ NOT l.assigned }">
								<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroupXCategory_Insert( AvailabilityGroups.d.id, g.AvailabilityGroup_Category_ID[ l.category ] ) }">
							</MvIF>
						<MvELSE>
							<MvIF EXPR = "{ l.assigned }">
								<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroupXCategory_Delete( AvailabilityGroups.d.id, g.AvailabilityGroup_Category_ID[ l.category ] ) }">
							</MvIF>
						</MvIF>

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

			<MvIF EXPR = "{ l.ok }">
				<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_modify" VALUE = "{ CanI( 'PROD', 1, 0, 0, 0 ) }">
				<MvIF EXPR = "{ l.can_modify }">
					<MvASSIGN NAME = "l.product" VALUE = 1>
					<MvWHILE EXPR = "{ l.ok AND ( l.product LE g.AvailabilityGroup_Product_Count ) }">
						<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.assigned" VALUE = "{ AvailabilityGroupXProduct_Find( AvailabilityGroups.d.id, g.AvailabilityGroup_Product_ID[ l.product ] ) }">

						<MvIF EXPR = "{ g.AvailabilityGroup_Product_Assigned[ l.product ] }">
							<MvIF EXPR = "{ NOT l.assigned }">
								<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroupXProduct_Insert( AvailabilityGroups.d.id, g.AvailabilityGroup_Product_ID[ l.product ] ) }">
							</MvIF>
						<MvELSE>
							<MvIF EXPR = "{ l.assigned }">
								<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroupXProduct_Delete( AvailabilityGroups.d.id, g.AvailabilityGroup_Product_ID[ l.product ] ) }">
							</MvIF>
						</MvIF>

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

			<MvIF EXPR = "{ l.ok }">
				<MvLOCALIZED NAME = "g.Message" ID = "MER-AGR-AD-00005">
					<MvLOCALIZED-TOKEN NAME = "group" VALUE = "{ encodeentities( l.original_name ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Availability Group '%group%' updated</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvASSIGN NAME = "g.Edit_AvailabilityGroup" VALUE = "{ g.AvailabilityGroup_Name }">

				<MvDO FILE = "{ g.Module_Admin }" NAME = "l.update" VALUE = "{ Update_LeftNavigation() }">
			</MvIF>
		</MvIF>
	</MvIF>

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

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

	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_delete" VALUE = "{ CanI( 'AGRP', 0, 0, 0, 1 ) }">
	<MvIF EXPR = "{ l.can_delete }">
		<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroup_Find_Name( g.AvailabilityGroup_Name ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroup_Delete( AvailabilityGroups.d.id ) }">
			<MvIF EXPR = "{ l.ok }">
				<MvLOCALIZED NAME = "g.Message" ID = "MER-AGR-AD-00006">
					<MvLOCALIZED-TOKEN NAME = "group" VALUE = "{ encodeentities( g.AvailabilityGroup_Name ) }">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Availability Group '%group%' deleted</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvASSIGN NAME = "g.Edit_AvailabilityGroup" VALUE = "">
				<MvASSIGN NAME = "g.Tab" VALUE = "">

				<MvDO FILE = "{ g.Module_Admin }" NAME = "l.update" VALUE = "{ Update_LeftNavigation() }">
			</MvIF>
		</MvIF>
	</MvIF>

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

<MvFUNCTION NAME = "Screen_AvailabilityGroups" STANDARDOUTPUTLEVEL = "text,html,compresswhitespace">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	<MvLOCALIZED NAME = "l.title" ID = "MER-AGR-AD-00007">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Add Availability Group</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvASSIGN NAME = "l.action" VALUE = "IAGP">

	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_modify"		VALUE = "{ CanI( 'AGRP', 0, 0, 1, 0 ) }">
	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_customer_view"	VALUE = "{ CanI( 'CUST', 1, 0, 0, 0 ) }">
	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_customer_add"	VALUE = "{ CanI( 'CUST', 0, 1, 0, 0 ) }">
	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_category_view"	VALUE = "{ CanI( 'CTGY', 1, 0, 0, 0 ) }">
	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_category_add"	VALUE = "{ CanI( 'CTGY', 0, 1, 0, 0 ) }">
	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_product_view"	VALUE = "{ CanI( 'PROD', 1, 0, 0, 0 ) }">
	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_product_add"	VALUE = "{ CanI( 'PROD', 0, 1, 0, 0 ) }">
	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_agr_add"		VALUE = "{ CanI( 'AGRP', 0, 1, 0, 0 ) }">

	<MvIF EXPR = "{ len( g.Edit_AvailabilityGroup ) EQ 0 AND l.can_agr_add EQ 0 }">
		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.ok"	VALUE = "{ Screen_Blank() }">
		<MvFUNCTIONRETURN VALUE = "{ l.ok }">
	</MvIF>

	<MvIF EXPR = "{ len( g.Edit_AvailabilityGroup ) }">
		<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroup_Find_Name( g.Edit_AvailabilityGroup ) }">
		<MvIF EXPR = "{ l.ok }">
			<MvLOCALIZED NAME = "l.title" ID = "MER-AGR-AD-00008">
				<MvLOCALIZED-TOKEN NAME = "group" VALUE = "{ encodeentities( AvailabilityGroups.d.name ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Edit Availability Group: %group%</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvIF EXPR = "{ g.Load_Fields }">
				<MvASSIGN NAME = "g.AvailabilityGroup_Name" VALUE = "{ AvailabilityGroups.d.name }">
			</MvIF>
		</MvIF>
	<MvELSE>
		<MvIF EXPR = "{ g.Load_Fields }">
			<MvASSIGN NAME = "g.AvailabilityGroup_Name" VALUE = "">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ NOT g.Have_List_Fields }">
		<MvASSIGN NAME = "g.AvailabilityGroup_Customer_Stack" VALUE = "">
		<MvASSIGN NAME = "g.AvailabilityGroup_Customer_Search" VALUE = "">
		<MvASSIGN NAME = "g.AvailabilityGroup_Customer_Show" VALUE = "All">

		<MvASSIGN NAME = "g.AvailabilityGroup_Customer_Offset" VALUE = 0>
		<MvASSIGN NAME = "g.AvailabilityGroup_Customer_Display" VALUE = "{ g.Admin_User_PageLen }">

		<MvASSIGN NAME = "g.AvailabilityGroup_Category_Stack" VALUE = "">
		<MvASSIGN NAME = "g.AvailabilityGroup_Category_Search" VALUE = "">
		<MvASSIGN NAME = "g.AvailabilityGroup_Category_Show" VALUE = "All">

		<MvASSIGN NAME = "g.AvailabilityGroup_Category_Offset" VALUE = 0>
		<MvASSIGN NAME = "g.AvailabilityGroup_Category_Display" VALUE = "{ g.Admin_User_PageLen }">

		<MvASSIGN NAME = "g.AvailabilityGroup_Product_Stack" VALUE = "">
		<MvASSIGN NAME = "g.AvailabilityGroup_Product_Search" VALUE = "">
		<MvASSIGN NAME = "g.AvailabilityGroup_Product_Show" VALUE = "All">

		<MvASSIGN NAME = "g.AvailabilityGroup_Product_Offset" VALUE = 0>
		<MvASSIGN NAME = "g.AvailabilityGroup_Product_Display" VALUE = "{ g.Admin_User_PageLen }">
	<MvELSE>
		<MvASSIGN NAME = "g.AvailabilityGroup_Customer_Display" VALUE = "{ int( g.AvailabilityGroup_Customer_Display ) }">
		<MvIF EXPR = "{ g.AvailabilityGroup_Customer_Display LT 1 }">
			<MvASSIGN NAME = "g.AvailabilityGroup_Customer_Display" VALUE = 1>
		</MvIF>

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

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

	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.begin_screen" VALUE = "{ BeginScreen( l.title, l.action, 'Help:agrp.html' ) }">
		<INPUT TYPE = "hidden" NAME = "Have_List_Fields" VALUE = 1>

		<MvIF EXPR = "{ len( g.Edit_AvailabilityGroup ) }">
			<INPUT TYPE = "hidden" NAME = "Edit_AvailabilityGroup" VALUE = "{ encodeentities( g.Edit_AvailabilityGroup ) }">
		</MvIF>

		<MvLOCALIZED NAME = "l.tabs" ID = "MER-AGR-AD-00009">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">AGRP:Availability Group</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvIF EXPR = "{ len( g.Edit_AvailabilityGroup ) }">
			<MvIF EXPR = "{ l.can_customer_view }">
				<MvLOCALIZED NAME = "l.moretabs" ID = "MER-AGR-AD-00010">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">CUST:Customers</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.moretabs }">
			</MvIF>

			<MvIF EXPR = "{ l.can_category_view }">
				<MvLOCALIZED NAME = "l.moretabs" ID = "MER-AGR-AD-00011">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">CTGY:Categories</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.moretabs }">
			</MvIF>

			<MvIF EXPR = "{ l.can_product_view }">
				<MvLOCALIZED NAME = "l.moretabs" ID = "MER-AGR-AD-00012">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">PROD:Products</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvASSIGN NAME = "l.tabs" VALUE = "{ l.tabs $ ',' $ l.moretabs}">
			</MvIF>
		</MvIF>

		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.drwatabs" VALUE = "{ DrawTabs( 'AGRP', l.tabs ) }">
		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.begin_cotent" VALUE = "{ BeginContent() }">

		<MvIF EXPR = "{ g.Tab EQ 'AGRP' }">
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-AGR-AD-00013">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Availability Group Name:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<INPUT TYPE = "text" SIZE = "40" NAME = "AvailabilityGroup_Name" VALUE = "{ encodeentities( g.AvailabilityGroup_Name ) }">
			</TD></TR>
			</TABLE>
		<MvELSE>
			<INPUT TYPE = "hidden" NAME = "AvailabilityGroup_Name" VALUE = "{ encodeentities( g.AvailabilityGroup_Name ) }">
		</MvIF>

		<MvIF EXPR = "{ l.can_customer_view }">
			<MvIF EXPR = "{ g.Tab EQ 'CUST' }">
				<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
				<TR><TD ALIGN = "left" VALIGN = "middle" WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "hidden" NAME = "AvailabilityGroup_Customer_Show" VALUE = "{ encodeentities( g.AvailabilityGroup_Customer_Show ) }">
					<A HREF = "JavaScript:ListReloadField( 'AvailabilityGroup_Customer_Offset', 'AvailabilityGroup_Customer_Stack', 'AvailabilityGroup_Customer_Show', 'All' );">
					<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_all" VALUE = "{ DrawImgButton_All( g.AvailabilityGroup_Customer_Show EQ 'All' ) }">
					<MvEVAL EXPR = "{ l.button_all }"></A>
					<A HREF = "JavaScript:ListReloadField( 'AvailabilityGroup_Customer_Offset', 'AvailabilityGroup_Customer_Stack', 'AvailabilityGroup_Customer_Show', 'Unassigned' );">
					<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_unassign" VALUE = "{ DrawImgButton_Unassigned( g.AvailabilityGroup_Customer_Show EQ 'Unassigned' ) }">
					<MvEVAL EXPR = "{ l.button_unassign }"></A>

					<A HREF = "JavaScript:ListReloadField( 'AvailabilityGroup_Customer_Offset', 'AvailabilityGroup_Customer_Stack', 'AvailabilityGroup_Customer_Show', 'Assigned' );">
					<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_assign" VALUE = "{ DrawImgButton_Assigned( g.AvailabilityGroup_Customer_Show EQ 'Assigned' ) }">
					<MvEVAL EXPR = "{ l.button_assign }"></A>
					</FONT>

				</TD><TD ALIGN = "right" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-AGR-AD-00014">
						<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.AvailabilityGroup_Customer_Search" VALUE = "{ ltrim( rtrim( g.AvailabilityGroup_Customer_Search ) ) }">
					<INPUT TYPE = "text" NAME = "AvailabilityGroup_Customer_Search" VALUE = "{ encodeentities( g.AvailabilityGroup_Customer_Search ) }" SIZE = 20>
					<A HREF = "JavaScript:ListReload( 'AvailabilityGroup_Customer_Offset', 'AvailabilityGroup_Customer_Stack' );">
					<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_search" VALUE = "{ DrawImgButton_Search(0) }">
					<MvEVAL EXPR = "{ l.button_search }"></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-AGR-AD-00015">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Assigned</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT><BR>
					<MvLOCALIZED NAME = "l.check_all" ID = "MER-AGR-AD-00044">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Check All</MvLOCALIZED-TEXT>
					</MvLOCALIZED>

					<MvLOCALIZED NAME = "l.uncheck_all" ID = "MER-AGR-AD-00045">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Uncheck All</MvLOCALIZED-TEXT>
					</MvLOCALIZED>

					<MvIF EXPR = "{ l.can_modify }">
						<A HREF = "JavaScript:CheckAll( 'AvailabilityGroup_Customer_Assigned', 1 );"><IMG BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'checkall.gif'}" ALT = "{ l.check_all }"></A>
						&nbsp;
						<A HREF = "JavaScript:CheckAll( 'AvailabilityGroup_Customer_Assigned', 0 );"><IMG BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'uncheckall.gif' }" ALT = "{ l.uncheck_all }"></A>
					</MvIF>
				</TD><TD BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
					<MvLOCALIZED ID = "MER-AGR-AD-00016">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Login</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD BGCOLOR = "#000080" NOWRAP>
					<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
					<MvLOCALIZED ID = "MER-AGR-AD-00017">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Pass. Recovery Email</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT>
				</TD><TD BGCOLOR = "#000080" WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
					<MvLOCALIZED ID = "MER-AGR-AD-00018">
						<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">
					<MvLOCALIZED NAME = "l.alt" ID = "MER-AGR-AD-00019">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">New Customer</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvIF EXPR = "{ l.can_customer_add }">
						<A HREF = "{ g.sessionurl $ 'Screen=CUST&Store_Code=' $ encodeattribute( g.Store_Code) }">
						<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_newx" VALUE = "{ DrawImgButton_NewX( 0, l.alt ) }">
						<MvEVAL NAME = "{ l.button_newx }"></A>
					<MvELSE>
						&nbsp;
					</MvIF>
					</FONT>
				</TD></TR>

				<MvASSIGN NAME = "l.shown" VALUE = 0>
				<MvASSIGN NAME = "l.lastoffset" VALUE = 0>

				<MvIF EXPR = "{ ( g.AvailabilityGroup_Customer_Show EQ 'All' ) OR ( g.AvailabilityGroup_Customer_Show EQ 'Unassigned' ) }">
					<MvASSIGN NAME = "l.assigned" VALUE = 0>
				</MvIF>

				<MvIF EXPR = "{ g.AvailabilityGroup_Customer_Show EQ 'Assigned' }">
					<MvASSIGN NAME = "l.assigned" VALUE = 1>
				</MvIF>

				<MvIF EXPR = "{ g.AvailabilityGroup_Customer_Show EQ 'All' }">
					<MvDO FILE = "{ g.Module_Feature_CUS_DB }" NAME = "l.nextoffset" VALUE = "{ Customer_FindOffset_All( g.AvailabilityGroup_Customer_Offset, g.AvailabilityGroup_Customer_Search ) }">
				</MvIF>

				<MvIF EXPR = "{ g.AvailabilityGroup_Customer_Show EQ 'Unassigned' }">
					<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.nextoffset" VALUE = "{ AvailabilityGroup_Customer_FindOffset_Unassigned( AvailabilityGroups.d.id, g.AvailabilityGroup_Customer_Offset, g.AvailabilityGroup_Customer_Search ) }">
				</MvIF>

				<MvIF EXPR = "{ g.AvailabilityGroup_Customer_Show EQ 'Assigned' }">
					<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.nextoffset" VALUE = "{ AvailabilityGroup_Customer_FindOffset_Assigned( AvailabilityGroups.d.id, g.AvailabilityGroup_Customer_Offset, g.AvailabilityGroup_Customer_Search ) }">
				</MvIF>

				<MvWHILE EXPR = "{ ( l.shown LT g.AvailabilityGroup_Customer_Display ) AND l.nextoffset }">
					<MvIF EXPR = "{ g.AvailabilityGroup_Customer_Show EQ 'All' }">
						<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.assigned" VALUE = "{ AvailabilityGroupXCustomer_Find( AvailabilityGroups.d.id, Customers.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 }" VALIGN = "top">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ l.can_modify }">
							<MvIF EXPR = "{ l.assigned }">
								<INPUT TYPE = "checkbox" NAME = "{ 'AvailabilityGroup_Customer_Assigned[' $ l.shown $ ']' }" VALUE = "Yes" CHECKED ONCLICK = "SetModified();">
							<MvELSE>
								<INPUT TYPE = "checkbox" NAME = "{ 'AvailabilityGroup_Customer_Assigned[' $ l.shown $ ']' }" VALUE = "Yes" ONCLICK = "SetModified();">
							</MvIF>
						<MvELSE>
							<MvDO FILE = "{ g.Module_Admin }" NAME = "l.checkall" VALUE = "{ DrawCheck_Assigned( l.assigned ) }">
							<MvEVAL EXPR = "{ l.checkall }">
						</MvIF>
						</FONT>
					</TD><TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "hidden" NAME = "{ 'AvailabilityGroup_Customer_ID[' $ l.shown $ ']' }" VALUE = "{ encodeentities( Customers.d.id ) }">
						<MvEVAL EXPR = "{ encodeentities( Customers.d.login ) }">
						</FONT>
					</TD><TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvEVAL EXPR = "{ encodeentities( Customers.d.pw_email ) }">
						</FONT>
					</TD><TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ ( len( Customers.d.ship_fname ) EQ 0 ) AND ( len( Customers.d.ship_lname ) EQ 0 ) }">
							&nbsp;
						<MvELSE>
							<MvEVAL EXPR = "{ encodeentities( Customers.d.ship_fname $ ' ' $ Customers.d.ship_lname ) }">
						</MvIF>
						</FONT>
					</TD><TD ALIGN = "right" BGCOLOR = "{ l.bgcolor }" VALIGN = "top">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<A HREF = "{ g.sessionurl $ 'Screen=CUST&Store_Code=' $ encodeattribute( g.Store_Code) $ '&Edit_Customer=' $ encodeattribute( Customers.d.login ) }">
						<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_edit" VALUE = "{ DrawImgButton_Edit('0') }"><MvEVAL EXPR = "{ l.button_edit }"></A>
						</FONT>
					</TD></TR>

					<MvASSIGN NAME = "l.lastoffset" VALUE = "{ l.nextoffset }">

					<MvIF EXPR = "{ g.AvailabilityGroup_Customer_Show EQ 'All' }">
						<MvDO FILE = "{ g.Module_Feature_CUS_DB }" NAME = "l.nextoffset" VALUE = "{ Customer_FindNext_All( l.nextoffset, g.AvailabilityGroup_Customer_Search ) }">
					</MvIF>

					<MvIF EXPR = "{ g.AvailabilityGroup_Customer_Show EQ 'Unassigned' }">
						<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.nextoffset" VALUE = "{ AvailabilityGroup_Customer_FindNext_Unassigned( AvailabilityGroups.d.id, l.nextoffset, g.AvailabilityGroup_Customer_Search ) }">
					</MvIF>

					<MvIF EXPR = "{ g.AvailabilityGroup_Customer_Show EQ 'Assigned' }">
						<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.nextoffset" VALUE = "{ AvailabilityGroup_Customer_FindNext_Assigned( AvailabilityGroups.d.id, l.nextoffset, g.AvailabilityGroup_Customer_Search ) }">
					</MvIF>
				</MvWHILE>

				<TR><TD BGCOLOR = "#000080" ALIGN = "left" VALIGN = "middle" NOWRAP>
					<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
					<MvHIDE FIELDS = "g.AvailabilityGroup_Customer_Stack, g.AvailabilityGroup_Customer_Offset">
					<MvIF EXPR = "{ g.AvailabilityGroup_Customer_Show EQ 'All' }">
						<MvIF EXPR = "{ l.shown }">
							<B><MvEVAL EXPR = "{ g.AvailabilityGroup_Customer_Offset + 1 }">-<MvEVAL EXPR = "{ l.lastoffset }"></B>
						<MvELSE>
							<B>0-0</B>
						</MvIF>
					<MvELSE>
						<MvDO FILE = "{ g.Module_Admin }" NAME = "l.na" VALUE = "{ Show_BoldNA() }">
					</MvIF>
					</FONT>
				</TD><TD BGCOLOR = "#000080" ALIGN = "right" VALIGN = "middle" COLSPAN = 4>
					<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
					<MvIF EXPR = "{ len( g.AvailabilityGroup_Customer_Stack ) }">
						<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListPrevious( \'AvailabilityGroup_Customer_Offset\', \'AvailabilityGroup_Customer_Stack\' );">' }">
						<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_prev" VALUE = "{ DrawImgButton_Previous('0') }">
						<MvEVAL EXPR = "{ l.button_prev $ '</A>' }">
					</MvIF>

					 <INPUT TYPE = "text" NAME = "AvailabilityGroup_Customer_Display" VALUE = "{ encodeentities( g.AvailabilityGroup_Customer_Display ) }" SIZE = 5> 
					 <A HREF = "JavaScript:ListReload( 'AvailabilityGroup_Customer_Offset', 'AvailabilityGroup_Customer_Stack' );">
					 <MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_refresh" VALUE = "{ DrawImgButton_Refresh('0') }">
					 <MvEVAL EXPR = "{ l.button_refresh }"></A>
					 <INPUT TYPE = "hidden" NAME = "AvailabilityGroup_Customer_Count" VALUE = "{ encodeentities( l.shown ) }">

					 <MvIF EXPR = "{ l.nextoffset }">
						<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListNext( \'AvailabilityGroup_Customer_Offset\', \'AvailabilityGroup_Customer_Stack\', ' $ l.lastoffset $ ' );">' }">
						<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_next" VALUE = "{ DrawImgButton_Next('0') }">
						<MvEVAL EXPR = "{ l.button_next $ '</A>' }">
					 </MvIF>
					</FONT>
				</TD></TR>
				</TABLE>
			<MvELSE>
				<MvHIDE FIELDS = "g.AvailabilityGroup_Customer_Stack, g.AvailabilityGroup_Customer_Search, g.AvailabilityGroup_Customer_Show, g.AvailabilityGroup_Customer_Offset, g.AvailabilityGroup_Customer_Display">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.can_category_view }">

			<MvIF EXPR = "{ g.Tab EQ 'CTGY' }">
				<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
				<TR><TD ALIGN = "left" VALIGN = "middle" WIDTH = "100%">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<INPUT TYPE = "hidden" NAME = "AvailabilityGroup_Category_Show" VALUE = "{ encodeentities( g.AvailabilityGroup_Category_Show ) }">
					<A HREF = "JavaScript:ListReloadField( 'AvailabilityGroup_Category_Offset', 'AvailabilityGroup_Category_Stack', 'AvailabilityGroup_Category_Show', 'All' );">
					<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_all" VALUE = "{ DrawImgButton_All( g.AvailabilityGroup_Category_Show EQ 'All' ) }">
					<MvEVAL EXPR = "{ l.button_all }"></A>

					<A HREF = "JavaScript:ListReloadField( 'AvailabilityGroup_Category_Offset', 'AvailabilityGroup_Category_Stack', 'AvailabilityGroup_Category_Show', 'Unassigned' );">
					<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_unassign" VALUE = "{ DrawImgButton_Unassigned( g.AvailabilityGroup_Category_Show EQ 'Unassigned' ) }">
					<MvEVAL EXPR = "{ l.button_unassign }"></A>

					<A HREF = "JavaScript:ListReloadField( 'AvailabilityGroup_Category_Offset', 'AvailabilityGroup_Category_Stack', 'AvailabilityGroup_Category_Show', 'Assigned' );">
					<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_assign" VALUE = "{ DrawImgButton_Assigned( g.AvailabilityGroup_Category_Show EQ 'Assigned' ) }">
					<MvEVAL EXPR = "{ l.button_assign }"></A>
					</FONT>
				</TD><TD ALIGN = "right" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-AGR-AD-00020">
						<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.AvailabilityGroup_Category_Search" VALUE = "{ ltrim( rtrim( g.AvailabilityGroup_Category_Search ) ) }">
					<INPUT TYPE = "text" NAME = "AvailabilityGroup_Category_Search" VALUE = "{ encodeentities( g.AvailabilityGroup_Category_Search ) }" SIZE = 20>
					<A HREF = "JavaScript:ListReload( 'AvailabilityGroup_Category_Offset', 'AvailabilityGroup_Category_Stack' );">
					<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_search" VALUE = "{ DrawImgButton_Search(0) }">
					<MvEVAL EXPR = "{ l.button_search }"></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-AGR-AD-00021">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Assigned</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT><BR>
					<MvLOCALIZED NAME = "l.check_all" ID = "MER-AGR-AD-00046">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Check All</MvLOCALIZED-TEXT>
					</MvLOCALIZED>

					<MvLOCALIZED NAME = "l.uncheck_all" ID = "MER-AGR-AD-00047">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Uncheck All</MvLOCALIZED-TEXT>
					</MvLOCALIZED>

					<MvIF EXPR = "{ l.can_modify }">
						<A HREF = "JavaScript:CheckAll( 'AvailabilityGroup_Category_Assigned', 1 );"><IMG BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'checkall.gif' }" ALT = "{ l.check_all }"></A>
						&nbsp;
						<A HREF = "JavaScript:CheckAll( 'AvailabilityGroup_Category_Assigned', 0 );"><IMG BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'uncheckall.gif' }" ALT = "{ l.uncheck_all }"></A>
					</MvIF>
				</TD><TD BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
					<MvLOCALIZED ID = "MER-AGR-AD-00022">
						<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-AGR-AD-00023">
						<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">
					<MvIF EXPR = "{ l.can_category_add }">
						<MvLOCALIZED NAME = "l.alt" ID = "MER-AGR-AD-00024">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">New Category</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						<A HREF = "{ g.sessionurl $ 'Screen=CTGY&Store_Code=' $ encodeattribute( g.Store_Code ) }">
						<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_newx" VALUE = "{ DrawImgButton_NewX( 0, l.alt ) }">
						<MvEVAL EXPR = "{ l.button_newx }"></A>
					<MvELSE>
						&nbsp;
					</MvIF>
					</FONT>
				</TD></TR>

				<MvASSIGN NAME = "l.shown" VALUE = 0>
				<MvASSIGN NAME = "l.lastoffset" VALUE = 0>

				<MvIF EXPR = "{ ( g.AvailabilityGroup_Category_Show EQ 'All' ) OR ( g.AvailabilityGroup_Category_Show EQ 'Unassigned' ) }">
					<MvASSIGN NAME = "l.assigned" VALUE = 0>
				</MvIF>

				<MvIF EXPR = "{ g.AvailabilityGroup_Category_Show EQ 'Assigned' }">
					<MvASSIGN NAME = "l.assigned" VALUE = 1>
				</MvIF>

				<MvIF EXPR = "{ g.AvailabilityGroup_Category_Show EQ 'All' }">
					<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.nextoffset" VALUE = "{ Category_FindOffset_All( g.AvailabilityGroup_Category_Offset, g.AvailabilityGroup_Category_Search ) }">
				</MvIF>

				<MvIF EXPR = "{ g.AvailabilityGroup_Category_Show EQ 'Unassigned' }">
					<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.nextoffset" VALUE = "{ AvailabilityGroup_Category_FindOffset_Unassigned( AvailabilityGroups.d.id, g.AvailabilityGroup_Category_Offset, g.AvailabilityGroup_Category_Search ) }">
				</MvIF>

				<MvIF EXPR = "{ g.AvailabilityGroup_Category_Show EQ 'Assigned' }">
					<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.nextoffset" VALUE = "{ AvailabilityGroup_Category_FindOffset_Assigned( AvailabilityGroups.d.id, g.AvailabilityGroup_Category_Offset, g.AvailabilityGroup_Category_Search ) }">
				</MvIF>

				<MvWHILE EXPR = "{ ( l.shown LT g.AvailabilityGroup_Category_Display ) AND l.nextoffset }">
					<MvIF EXPR = "{ g.AvailabilityGroup_Category_Show EQ 'All' }">
						<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.assigned" VALUE = "{ AvailabilityGroupXCategory_Find( AvailabilityGroups.d.id, Categories.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 }" VALIGN = "top">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ l.can_modify }">
							<MvIF EXPR = "{ l.assigned }">
								<INPUT TYPE = "checkbox" NAME = "{ 'AvailabilityGroup_Category_Assigned[' $ l.shown $ ']' }" VALUE = "Yes" CHECKED ONCLICK = "SetModified();">
							<MvELSE>
								<INPUT TYPE = "checkbox" NAME = "{ 'AvailabilityGroup_Category_Assigned[' $ l.shown $ ']' }" VALUE = "Yes" ONCLICK = "SetModified();">
							</MvIF>
						<MvELSE>
							<MvDO FILE = "{ g.Module_Admin }" NAME = "l.checkass" VALUE = "{ DrawCheck_Assigned( l.assigned ) }">
							<MvEVAL EXPR = "{ l.checkass }">
						</MvIF>
						</FONT>
					</TD><TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top" NOWRAP>
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "hidden" NAME = "{ 'AvailabilityGroup_Category_ID[' $ l.shown $ ']' }" VALUE = "{ encodeentities( Categories.d.id ) }">
						<MvEVAL EXPR = "{ encodeentities( Categories.d.code ) }">
						</FONT>
					</TD><TD BGCOLOR = "{ l.bgcolor }" WIDTH = "100%" VALIGN = "top">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ len( Categories.d.name ) }">
							<MvEVAL EXPR = "{ encodeentities( Categories.d.name ) }">
						<MvELSE>
							&nbsp;
						</MvIF>
						</FONT>
					</TD><TD ALIGN = "right" BGCOLOR = "{ l.bgcolor }" VALIGN = "top">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<A HREF = "{ g.sessionurl $ 'Screen=CTGY&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Edit_Category=' $ encodeattribute( Categories.d.code ) }">
						<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_edit" VALUE = "{ DrawImgButton_Edit('0') }">
						<MvEVAL EXPR = "{ l.button_edit }"></A>
						</FONT>
					</TD></TR>

					<MvASSIGN NAME = "l.lastoffset" VALUE = "{ l.nextoffset }">

					<MvIF EXPR = "{ g.AvailabilityGroup_Category_Show EQ 'All' }">
						<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.nextoffset" VALUE = "{ Category_FindNext_All( l.nextoffset, g.AvailabilityGroup_Category_Search ) }">
					</MvIF>

					<MvIF EXPR = "{ g.AvailabilityGroup_Category_Show EQ 'Unassigned' }">
						<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.nextoffset" VALUE = "{ AvailabilityGroup_Category_FindNext_Unassigned( AvailabilityGroups.d.id, l.nextoffset, g.AvailabilityGroup_Category_Search ) }">
					</MvIF>

					<MvIF EXPR = "{ g.AvailabilityGroup_Category_Show EQ 'Assigned' }">
						<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.nextoffset" VALUE = "{ AvailabilityGroup_Category_FindNext_Assigned( AvailabilityGroups.d.id, l.nextoffset, g.AvailabilityGroup_Category_Search ) }">
					</MvIF>
				</MvWHILE>

				<TR><TD BGCOLOR = "#000080" ALIGN = "left" VALIGN = "middle" NOWRAP>
					<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
					<MvHIDE FIELDS = "g.AvailabilityGroup_Category_Stack, g.AvailabilityGroup_Category_Offset">
					<MvIF EXPR = "{ g.AvailabilityGroup_Category_Show EQ 'All' }">
						<MvIF EXPR = "{ l.shown }">
							<B><MvEVAL EXPR = "{ g.AvailabilityGroup_Category_Offset + 1 }">-<MvEVAL EXPR = "{ l.lastoffset }"></B>
						<MvELSE>
							<B>0-0</B>
						</MvIF>
					<MvELSE>
						<MvDO FILE = "{ g.Module_Admin }" NAME = "l.na" VALUE = "{ 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.AvailabilityGroup_Category_Stack ) }">
						<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListPrevious( \'AvailabilityGroup_Category_Offset\', \'AvailabilityGroup_Category_Stack\' );">' }">
						<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_prev" VALUE = "{ DrawImgButton_Previous('0') }">
						<MvEVAL EXPR = "{ l.button_prev $ '</A>' }">
					</MvIF>

					 <INPUT TYPE = "text" NAME = "AvailabilityGroup_Category_Display" VALUE = "{ encodeentities( g.AvailabilityGroup_Category_Display ) }" SIZE = 5> <A HREF = "JavaScript:ListReload( 'AvailabilityGroup_Category_Offset', 'AvailabilityGroup_Category_Stack' );">
					 <MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_refresh" VALUE = "{ DrawImgButton_Refresh('0') }">
					 <MvEVAL EXPR = "{ l.button_refresh }"></A>
					 <INPUT TYPE = "hidden" NAME = "AvailabilityGroup_Category_Count" VALUE = "{ encodeentities( l.shown ) }">

					 <MvIF EXPR = "{ l.nextoffset }">
						<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListNext( \'AvailabilityGroup_Category_Offset\', \'AvailabilityGroup_Category_Stack\', ' $ l.lastoffset $ ' );">' }">
						<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_next" VALUE = "{ DrawImgButton_Next('0') }">
						<MvEVAL EXPR = "{ l.button_next $ '</A>' }">
					 </MvIF>
					</FONT>
				</TD></TR>
				</TABLE>
			<MvELSE>
				<MvHIDE FIELDS = "g.AvailabilityGroup_Category_Stack, g.AvailabilityGroup_Category_Search, g.AvailabilityGroup_Category_Show, g.AvailabilityGroup_Category_Offset, g.AvailabilityGroup_Category_Display">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.can_product_view }">
			<MvIF EXPR = "{ g.Tab EQ 'PROD' }">
				<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.AvailabilityGroup_Product_Show">
					<A HREF = "JavaScript:ListReloadField( 'AvailabilityGroup_Product_Offset', 'AvailabilityGroup_Product_Stack', 'AvailabilityGroup_Product_Show', 'All' );">
					<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_all" VALUE = "{ DrawImgButton_All( g.AvailabilityGroup_Product_Show EQ 'All' ) }">
					<MvEVAL EXPR = "{ l.button_all }"></A>

					<A HREF = "JavaScript:ListReloadField( 'AvailabilityGroup_Product_Offset', 'AvailabilityGroup_Product_Stack', 'AvailabilityGroup_Product_Show', 'Unassigned' );">
					<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_unassign" VALUE = "{ DrawImgButton_Unassigned( g.AvailabilityGroup_Product_Show EQ 'Unassigned' ) }">
					<MvEVAL EXPR = "{ l.button_unassign }"></A>

					<A HREF = "JavaScript:ListReloadField( 'AvailabilityGroup_Product_Offset', 'AvailabilityGroup_Product_Stack', 'AvailabilityGroup_Product_Show', 'Assigned' );">
					<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_assign" VALUE = "{ DrawImgButton_Assigned( g.AvailabilityGroup_Product_Show EQ 'Assigned' ) }">
					<MvEVAL EXPR = "{ l.button_assign }"></A>

					</FONT>
				</TD><TD ALIGN = "right" VALIGN = "middle">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
					<MvLOCALIZED ID = "MER-AGR-AD-00025">
						<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.AvailabilityGroup_Product_Search" VALUE = "{ ltrim( rtrim( g.AvailabilityGroup_Product_Search ) ) }">
					<INPUT TYPE = "text" NAME = "AvailabilityGroup_Product_Search" VALUE = "{ encodeentities( g.AvailabilityGroup_Product_Search ) }" SIZE = 20>
					<A HREF = "JavaScript:ListReload( 'AvailabilityGroup_Product_Offset', 'AvailabilityGroup_Product_Stack' );">
					<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_search" VALUE = "{ DrawImgButton_Search(0) }"><MvEVAL EXPR = "{ l.button_search }"></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-AGR-AD-00026">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Assigned</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					</B></FONT><BR>
					<MvLOCALIZED NAME = "l.check_all" ID = "MER-AGR-AD-00048">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Check All</MvLOCALIZED-TEXT>
					</MvLOCALIZED>

					<MvLOCALIZED NAME = "l.uncheck_all" ID = "MER-AGR-AD-00049">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Uncheck All</MvLOCALIZED-TEXT>
					</MvLOCALIZED>

					<MvIF EXPR = "{ l.can_modify }">
						<A HREF = "JavaScript:CheckAll( 'AvailabilityGroup_Product_Assigned', 1 );"><IMG BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'checkall.gif' }" ALT = "{ l.check_all }"></A>
						&nbsp;
						<A HREF = "JavaScript:CheckAll( 'AvailabilityGroup_Product_Assigned', 0 );"><IMG BORDER = 0 SRC = "{ g.AdminGraphics_Path $ 'uncheckall.gif' }" ALT = "{ l.uncheck_all }"></A>			
					</MvIF>
				</TD><TD BGCOLOR = "#000080">
					<FONT FACE = "Arial, Helvetica" SIZE = "-1" COLOR = "#ffffff"><B>
					<MvLOCALIZED ID = "MER-AGR-AD-00027">
						<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-AGR-AD-00028">
						<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">
					<MvLOCALIZED NAME = "l.alt" ID = "MER-AGR-AD-00029">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">New Product</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvIF EXPR = "{ l.can_product_add }">
						<A HREF = "{ g.sessionurl $ 'Screen=PROD&Store_Code=' $ encodeattribute( g.Store_Code ) }">
						<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_newx" VALUE = "{ DrawImgButton_NewX( 0, l.alt ) }"><MvEVAL EXPR = "{ l.button_newx }"></A>
					<MvELSE>
						&nbsp;
					</MvIF>
					</FONT>
				</TD></TR>

				<MvASSIGN NAME = "l.shown" VALUE = 0>
				<MvASSIGN NAME = "l.lastoffset" VALUE = 0>

				<MvIF EXPR = "{ ( g.AvailabilityGroup_Product_Show EQ 'All' ) OR ( g.AvailabilityGroup_Product_Show EQ 'Unassigned' ) }">
					<MvASSIGN NAME = "l.assigned" VALUE = 0>
				</MvIF>

				<MvIF EXPR = "{ g.AvailabilityGroup_Product_Show EQ 'Assigned' }">
					<MvASSIGN NAME = "l.assigned" VALUE = 1>
				</MvIF>

				<MvIF EXPR = "{ g.AvailabilityGroup_Product_Show EQ 'All' }">
					<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.nextoffset" VALUE = "{ Product_FindOffset_All( g.AvailabilityGroup_Product_Offset, g.AvailabilityGroup_Product_Search ) }">
				</MvIF>

				<MvIF EXPR = "{ g.AvailabilityGroup_Product_Show EQ 'Unassigned' }">
					<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.nextoffset" VALUE = "{ AvailabilityGroup_Product_FindOffset_Unassigned( AvailabilityGroups.d.id, g.AvailabilityGroup_Product_Offset, g.AvailabilityGroup_Product_Search ) }">
				</MvIF>

				<MvIF EXPR = "{ g.AvailabilityGroup_Product_Show EQ 'Assigned' }">
					<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.nextoffset" VALUE = "{ AvailabilityGroup_Product_FindOffset_Assigned( AvailabilityGroups.d.id, g.AvailabilityGroup_Product_Offset, g.AvailabilityGroup_Product_Search ) }">
				</MvIF>

				<MvWHILE EXPR = "{ ( l.shown LT g.AvailabilityGroup_Product_Display ) AND l.nextoffset }">
					<MvIF EXPR = "{ g.AvailabilityGroup_Product_Show EQ 'All' }">
						<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.assigned" VALUE = "{ AvailabilityGroupXProduct_Find( AvailabilityGroups.d.id, Products.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 }" VALIGN = "top">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ l.can_modify }">
							<MvIF EXPR = "{ l.assigned }">
								<INPUT TYPE = "checkbox" NAME = "{ 'AvailabilityGroup_Product_Assigned[' $ l.shown $ ']' }" VALUE = "Yes" CHECKED ONCLICK = "SetModified();">
							<MvELSE>
								<INPUT TYPE = "checkbox" NAME = "{ 'AvailabilityGroup_Product_Assigned[' $ l.shown $ ']' }" VALUE = "Yes" ONCLICK = "SetModified();">
							</MvIF>
						<MvELSE>
							<MvDO FILE = "{ g.Module_Admin }" NAME = "l.checkass" VALUE = "{ DrawCheck_Assigned( l.assigned ) }">
						</MvIF>
						</FONT>
					</TD><TD BGCOLOR = "{ l.bgcolor }" VALIGN = "top">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<INPUT TYPE = "hidden" NAME = "{ 'AvailabilityGroup_Product_ID[' $ l.shown $ ']' }" VALUE = "{ encodeentities( Products.d.id ) }">
						<MvEVAL EXPR = "{ encodeentities( Products.d.code ) }">
						</FONT>
					</TD><TD BGCOLOR = "{ l.bgcolor }" WIDTH = "100%" VALIGN = "top">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<MvIF EXPR = "{ len( Products.d.name ) }">
							<MvEVAL EXPR = "{ encodeentities( Products.d.name ) }">
						<MvELSE>
							&nbsp;
						</MvIF>
						</FONT>
					</TD><TD ALIGN = "right" BGCOLOR = "{ l.bgcolor }" VALIGN = "top">
						<FONT FACE = "Arial, Helvetica" SIZE = "-1">
						<A HREF = "{ g.sessionurl $ 'Screen=PROD&Store_Code=' $ encodeattribute( g.Store_Code ) $ '&Edit_Product=' $ encodeattribute( Products.d.code ) }">
						<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_edit" VALUE = "{ DrawImgButton_Edit('0') }"><MvEVAL EXPR = "{ l.button_edit }"></A>
						</FONT>
					</TD></TR>

					<MvASSIGN NAME = "l.lastoffset" VALUE = "{ l.nextoffset }">

					<MvIF EXPR = "{ g.AvailabilityGroup_Product_Show EQ 'All' }">
						<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.nextoffset" VALUE = "{ Product_FindNext_All( l.nextoffset, g.AvailabilityGroup_Product_Search ) }">
					</MvIF>

					<MvIF EXPR = "{ g.AvailabilityGroup_Product_Show EQ 'Unassigned' }">
						<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.nextoffset" VALUE = "{ AvailabilityGroup_Product_FindNext_Unassigned( AvailabilityGroups.d.id, l.nextoffset, g.AvailabilityGroup_Product_Search ) }">
					</MvIF>

					<MvIF EXPR = "{ g.AvailabilityGroup_Product_Show EQ 'Assigned' }">
						<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.nextoffset" VALUE = "{ AvailabilityGroup_Product_FindNext_Assigned( AvailabilityGroups.d.id, l.nextoffset, g.AvailabilityGroup_Product_Search ) }">
					</MvIF>
				</MvWHILE>

				<TR><TD BGCOLOR = "#000080" ALIGN = "left" VALIGN = "middle" NOWRAP>
					<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
					<MvHIDE FIELDS = "g.AvailabilityGroup_Product_Stack, g.AvailabilityGroup_Product_Offset">
					<MvIF EXPR = "{ g.AvailabilityGroup_Product_Show EQ 'All' }">
						<MvIF EXPR = "{ l.shown }">
							<B><MvEVAL EXPR = "{ g.AvailabilityGroup_Product_Offset + 1 }">-<MvEVAL EXPR = "{ l.lastoffset }"></B>
						<MvELSE>
							<B>0-0</B>
						</MvIF>
					<MvELSE>
						<MvDO FILE = "{ g.Module_Admin }" NAME = "l.na" VALUE = "{ Show_BoldNA() }">
						<MvEVAL EXPR = "{ l.na }">
					</MvIF>
					</FONT>
				</TD><TD BGCOLOR = "#000080" ALIGN = "right" VALIGN = "middle" COLSPAN = 3>
					<FONT FACE = "Arial, Helvetica" COLOR = "#ffffff" SIZE = "-1">
					<MvIF EXPR = "{ len( g.AvailabilityGroup_Product_Stack ) }">
						<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListPrevious( \'AvailabilityGroup_Product_Offset\', \'AvailabilityGroup_Product_Stack\' );">' }">
						<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_prev" VALUE = "{ DrawImgButton_Previous('0') }"><MvEVAL EXPR = "{ l.button_prev $ '</A>' }">
					</MvIF>

					 <INPUT TYPE = "text" NAME = "AvailabilityGroup_Product_Display" VALUE = "{ encodeentities( g.AvailabilityGroup_Product_Display ) }" SIZE = 5> <A HREF = "JavaScript:ListReload( 'AvailabilityGroup_Product_Offset', 'AvailabilityGroup_Product_Stack' );">
					 <MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_refresh" VALUE = "{ DrawImgButton_Refresh('0') }"><MvEVAL EXPR = "{ l.button_refresh }"></A>
					 <INPUT TYPE = "hidden" NAME = "AvailabilityGroup_Product_Count" VALUE = "{ encodeentities( l.shown ) }">

					 <MvIF EXPR = "{ l.nextoffset }">
						<MvEVAL EXPR = "{ '<A HREF = "JavaScript:ListNext( \'AvailabilityGroup_Product_Offset\', \'AvailabilityGroup_Product_Stack\', ' $ l.lastoffset $ ' );">' }">
						<MvDO FILE = "{ g.Module_Admin }" NAME = "l.button_next" VALUE = "{ DrawImgButton_Next('0') }"><MvEVAL EXPR = "{ l.button_next $ '</A>' }">
					 </MvIF>
					</FONT>
				</TD></TR>
				</TABLE>
			<MvELSE>
				<MvHIDE FIELDS = "g.AvailabilityGroup_Product_Stack, g.AvailabilityGroup_Product_Search, g.AvailabilityGroup_Product_Show, g.AvailabilityGroup_Product_Offset, g.AvailabilityGroup_Product_Display">
			</MvIF>
		</MvIF>

		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.end_content" VALUE = "{ EndContent() }">

		<MvIF EXPR = "{ len( g.Edit_AvailabilityGroup ) }">
			<MvDO FILE = "{ g.Module_Admin }" NAME = "l.buttons" VALUE = "{ DrawButtons( 'UAGP:[UPDATE]:AGRP:0:1:0,DAGP:[DELETE]:AGRP:0:0:1' ) }">
		<MvELSE>
			<MvDO FILE = "{ g.Module_Admin }" NAME = "l.buttons" VALUE = "{ DrawButtons( 'IAGP:[ADD]:AGRP:1:0:0' ) }">
		</MvIF>

		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.buttons" VALUE = "{ EndScreen() }">
	</MvIF>

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

<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 = "AGR_Provision_Add_Update_AvailabilityGroup" PARAMETERS = "version, store_code, delimiter, data">
	<MvASSIGN NAME = "l.ok" VALUE = "1">

	<MvASSIGN NAME = "l.pos" VALUE = "1">

	<MvASSIGN NAME = "l.name" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">

	<MvIF EXPR = "{ len( l.name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-AGR-AD-00030">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				Availability Group Name Required.
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-AGR-AD-00000', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.found" VALUE = "{ AvailabilityGroup_Find_Name( l.name ) }">
	
	<MvIF EXPR = "{ NOT l.found }">	
		<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroup_Insert( l.name ) }">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>
	
<MvFUNCTION NAME = "AGR_Provision_Delete_AvailabilityGroup" PARAMETERS = "version, store_code, delimiter, data">
	<MvASSIGN NAME = "l.ok" VALUE = "1">

	<MvASSIGN NAME = "l.pos" VALUE = "1">

	<MvASSIGN NAME = "l.name" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">

	<MvIF EXPR = "{ len( l.name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-AGR-AD-00031">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				Availability Group Name Required.
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-AGR-AD-00001', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.found" VALUE = "{ AvailabilityGroup_Find_Name( l.name ) }">
	
	<MvIF EXPR = "{ l.found }">	
		<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroup_Delete( AvailabilityGroups.d.id ) }">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>
	
<MvFUNCTION NAME = "AGR_Provision_AvailabilityGroup_Add_Customer" PARAMETERS = "version, store_code, delimiter, data">
	<MvASSIGN NAME = "l.ok" VALUE = "1">

	<MvASSIGN NAME = "l.pos" VALUE = "1">

	<MvASSIGN NAME = "l.group_name" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">

	<MvASSIGN NAME = "l.customer_login" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">

	<MvIF EXPR = "{ len( l.group_name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-AGR-AD-00032">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				Availability Group Name Required.
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-AGR-AD-00002', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ len( l.customer_login ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-AGR-AD-00033">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				Customer Login Required.
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-AGR-AD-00003', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroup_Find_Name( l.group_name ) }">
	<MvIF EXPR = "{ NOT l.ok }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvWHILE EXPR = "{ len( l.customer_login ) }">
		<MvDO FILE = "{ g.Module_Feature_CUS_DB }" NAME = "l.ok" VALUE = "{ Customer_Find_Login( l.customer_login ) }">

		<MvIF EXPR = "{ NOT l.ok }">
			<MvFUNCTIONRETURN VALUE = "0">
		</MvIF>

		<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.found" VALUE = "{ AvailabilityGroupXCustomer_Find( AvailabilityGroups.d.id, Customers.d.id ) }">

		<MvIF EXPR = "{ NOT l.found }">
			<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroupXCustomer_Insert( AvailabilityGroups.d.id, Customers.d.id ) }">
		</MvIF>
		<MvASSIGN NAME = "l.customer_login" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
		<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	</MvWHILE>

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

<MvFUNCTION NAME = "AGR_Provision_AvailabilityGroup_Remove_Customer" PARAMETERS = "version, store_code, delimiter, data">
	<MvASSIGN NAME = "l.ok" VALUE = "1">

	<MvASSIGN NAME = "l.pos" VALUE = "1">

	<MvASSIGN NAME = "l.group_name" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">

	<MvASSIGN NAME = "l.customer_login" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">

	<MvIF EXPR = "{ len( l.group_name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-AGR-AD-00034">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				Availability Group Name Required.
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-AGR-AD-00004', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ len( l.customer_login ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-AGR-AD-00035">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				Customer Login Required.
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-AGR-AD-00005', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroup_Find_Name( l.group_name ) }">
	<MvIF EXPR = "{ NOT l.ok }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvWHILE EXPR = "{ len( l.customer_login ) }">
		<MvDO FILE = "{ g.Module_Feature_CUS_DB }" NAME = "l.ok" VALUE = "{ Customer_Find_Login( l.customer_login ) }">

		<MvIF EXPR = "{ NOT l.ok }">
			<MvFUNCTIONRETURN VALUE = "0">
		</MvIF>

		<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.found" VALUE = "{ AvailabilityGroupXCustomer_Find( AvailabilityGroups.d.id, Customers.d.id ) }">

		<MvIF EXPR = "{ l.found }">
			<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroupXCustomer_Delete( AvailabilityGroups.d.id, Customers.d.id ) }">
		</MvIF>
		<MvASSIGN NAME = "l.customer_login" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
		<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	</MvWHILE>

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

<MvFUNCTION NAME = "AGR_Provision_AvailabilityGroup_Add_Product" PARAMETERS = "version, store_code, delimiter, data">
	<MvASSIGN NAME = "l.ok" VALUE = "1">

	<MvASSIGN NAME = "l.pos" VALUE = "1">

	<MvASSIGN NAME = "l.group_name" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">

	<MvASSIGN NAME = "l.product_code" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">

	<MvIF EXPR = "{ len( l.group_name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-AGR-AD-00036">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				Availability Group Name Required.
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-AGR-AD-00006', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ len( l.product_code ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-AGR-AD-00037">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				Product Login Required.
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-AGR-AD-00007', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroup_Find_Name( l.group_name ) }">
	<MvIF EXPR = "{ NOT l.ok }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvWHILE EXPR = "{ len( l.product_code ) }">
		<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.ok" VALUE = "{ Product_Find_Code( l.product_code ) }">

		<MvIF EXPR = "{ NOT l.ok }">
			<MvFUNCTIONRETURN VALUE = "0">
		</MvIF>

		<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.found" VALUE = "{ AvailabilityGroupXProduct_Find( AvailabilityGroups.d.id, Products.d.id ) }">

		<MvIF EXPR = "{ NOT l.found }">
			<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroupXProduct_Insert( AvailabilityGroups.d.id, Products.d.id ) }">
		</MvIF>
		<MvASSIGN NAME = "l.product_code" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
		<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	</MvWHILE>

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

<MvFUNCTION NAME = "AGR_Provision_AvailabilityGroup_Remove_Product" PARAMETERS = "version, store_code, delimiter, data">
	<MvASSIGN NAME = "l.ok" VALUE = "1">

	<MvASSIGN NAME = "l.pos" VALUE = "1">

	<MvASSIGN NAME = "l.group_name" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">

	<MvASSIGN NAME = "l.product_code" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">

	<MvIF EXPR = "{ len( l.group_name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-AGR-AD-00038">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				Availability Group Name Required.
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-AGR-AD-00008', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ len( l.product_code ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-AGR-AD-00039">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				Product Login Required.
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-AGR-AD-00009', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroup_Find_Name( l.group_name ) }">
	<MvIF EXPR = "{ NOT l.ok }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvWHILE EXPR = "{ len( l.product_code ) }">
		<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.ok" VALUE = "{ Product_Find_Code( l.product_code ) }">

		<MvIF EXPR = "{ NOT l.ok }">
			<MvFUNCTIONRETURN VALUE = "0">
		</MvIF>

		<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.found" VALUE = "{ AvailabilityGroupXProduct_Find( AvailabilityGroups.d.id, Products.d.id ) }">

		<MvIF EXPR = "{ l.found }">
			<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroupXProduct_Delete( AvailabilityGroups.d.id, Products.d.id ) }">
		</MvIF>
		<MvASSIGN NAME = "l.product_code" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
		<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	</MvWHILE>

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

<MvFUNCTION NAME = "AGR_Provision_AvailabilityGroup_Add_Category" PARAMETERS = "version, store_code, delimiter, data">
	<MvASSIGN NAME = "l.ok" VALUE = "1">

	<MvASSIGN NAME = "l.pos" VALUE = "1">

	<MvASSIGN NAME = "l.group_name" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">

	<MvASSIGN NAME = "l.Category_code" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">

	<MvIF EXPR = "{ len( l.group_name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-AGR-AD-00040">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				Availability Group Name Required.
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-AGR-AD-00010', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ len( l.Category_code ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-AGR-AD-00041">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				Category Login Required.
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-AGR-AD-00011', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroup_Find_Name( l.group_name ) }">
	<MvIF EXPR = "{ NOT l.ok }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvWHILE EXPR = "{ len( l.Category_code ) }">
		<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.ok" VALUE = "{ Category_Find_Code( l.Category_code ) }">

		<MvIF EXPR = "{ NOT l.ok }">
			<MvFUNCTIONRETURN VALUE = "0">
		</MvIF>

		<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.found" VALUE = "{ AvailabilityGroupXCategory_Find( AvailabilityGroups.d.id, Categories.d.id ) }">

		<MvIF EXPR = "{ NOT l.found }">
			<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroupXCategory_Insert( AvailabilityGroups.d.id, Categories.d.id ) }">
		</MvIF>
		<MvASSIGN NAME = "l.Category_code" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
		<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	</MvWHILE>

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

<MvFUNCTION NAME = "AGR_Provision_AvailabilityGroup_Remove_Category" PARAMETERS = "version, store_code, delimiter, data">
	<MvASSIGN NAME = "l.ok" VALUE = "1">

	<MvASSIGN NAME = "l.pos" VALUE = "1">

	<MvASSIGN NAME = "l.group_name" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">

	<MvASSIGN NAME = "l.Category_code" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">

	<MvIF EXPR = "{ len( l.group_name ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-AGR-AD-00042">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				Availability Group Name Required.
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-AGR-AD-00012', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvIF EXPR = "{ len( l.Category_code ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-AGR-AD-00043">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">
				Category Login Required.
			</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-AGR-AD-00013', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>

	<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroup_Find_Name( l.group_name ) }">
	<MvIF EXPR = "{ NOT l.ok }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvWHILE EXPR = "{ len( l.Category_code ) }">
		<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.ok" VALUE = "{ Category_Find_Code( l.Category_code ) }">

		<MvIF EXPR = "{ NOT l.ok }">
			<MvFUNCTIONRETURN VALUE = "0">
		</MvIF>

		<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.found" VALUE = "{ AvailabilityGroupXCategory_Find( AvailabilityGroups.d.id, Categories.d.id ) }">

		<MvIF EXPR = "{ l.found }">
			<MvDO FILE = "{ g.Module_Feature_AGR_DB }" NAME = "l.ok" VALUE = "{ AvailabilityGroupXCategory_Delete( AvailabilityGroups.d.id, Categories.d.id ) }">
		</MvIF>
		<MvASSIGN NAME = "l.Category_code" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
		<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	</MvWHILE>

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