	// ===============================================================
	// Global Var
	// ===============================================================
	
	// Edit Handler
	// _______________________________________________________________________
	var EDIT_HANDLER = function(){};	
	EDIT_HANDLER.REF_IS_MODIFIED = false;
	EDIT_HANDLER.HAS_NEWLY_SAVED_DATA = false;
	var PROPERTY_PARENT_ID = 0;
	var PROPERTY_PARENT_DESCRIPTION = "";
	var PROPERTY_PARENT_JOLINE = 0;	
	
	// Cache
	// _______________________________________________________________________
	var PROPERTY_REC_POSRESERVE_ID = -1;
	var PROPERTY_EDIT_MODE = false;
	var PROPERTY_EDIT_ROW_INDEX = -1;
	var INPUT_INSTANCE = null;
	
	
	// Buttons [Optional]
	// _______________________________________________________________________
	var ADD_BBI = null;
	var SAVE_BBI = null;
	var DELETE_BBI = null;
	var CANCEL_BBI = null;
	var NAVIGATION_BACK_BBI = null;
	var ADD_PRODUCT = null;
	var APPROVE_BBI = null;
	var DELIVERED_BBI = null;
	var ADD_CLIENT = null;
	var CHANGE_BBI = null;
	var UPDATE_BBI = null;
	
	var SEARCH_CMD = null;
	var PRINT_BBI = null;
	var EXPORT_BBI = null;

	var IS_APPROVE = 0;
	var IS_JO_STATUS = 0;
	var UPDATED_INDEX = 0;
	var STATUS_CHK = 0;

	var STATIC_PROD_ID = 15; //500 ML
	var STATIC_PROD_ID2 = 29; //200 ML
	var STATIC_PROD_ID3 = 2; //5 Gal New
	var STATIC_PROD_ID4 = 37; //5 Gallon Red Label

	var STATIC_PROD_ID5 = 10; //
	var STATIC_PROD_ID6 = 13; //

	var STATIC_PROD_ID7 = 14; //
	var STATIC_PROD_ID8 = 16; //
	var STATIC_PROD_ID9 = 17; //
	var STATIC_PROD_ID10 = 18; //
	var STATIC_PROD_ID11 = 19; //
	var STATIC_PROD_ID12 = 20; //
	var STATIC_PROD_ID13 = 21; //
	var STATIC_PROD_ID14 = 22; //
	var STATIC_PROD_ID15 = 23; //
	var STATIC_PROD_ID16 = 24; //
	var STATIC_PROD_ID17 = 25; //
	var STATIC_PROD_ID18 = 26; //
	var STATIC_PROD_ID19 = 27; //
	var STATIC_PROD_ID20 = 28; //
	var STATIC_PROD_ID21 = 30; //
	var STATIC_PROD_ID22 = 31; //
	var STATIC_PROD_ID23 = 32; //
	var STATIC_PROD_ID24 = 33; //
	var STATIC_PROD_ID25 = 34; //
	var STATIC_PROD_ID26 = 35; //
	var STATIC_PROD_ID27 = 36; //
	var STATIC_PROD_ID28 = 38; //
	var STATIC_PROD_ID29 = 39; //
	var STATIC_PROD_ID30 = 40; //
	var STATIC_PROD_ID31 = 41; //
	var STATIC_PROD_ID32 = 42; //
	var STATIC_PROD_ID33 = 43; //
	var STATIC_PROD_ID34 = 44; //
	var STATIC_PROD_ID35 = 45; //
	var STATIC_PROD_ID36 = 46; //
	var STATIC_PROD_ID37 = 47; //
	var STATIC_PROD_ID38 = 48; //
	var STATIC_PROD_ID39 = 49; //
	var STATIC_PROD_ID40 = 50; //
	var STATIC_PROD_ID41 = 51; //
	var STATIC_PROD_ID42 = 52; //
	var STATIC_PROD_ID43 = 53; //
	var STATIC_PROD_ID44 = 54; //
	var STATIC_PROD_ID45 = 55; //
	
	var STATIC_PROD_RET_ID = 10; //NEW EMPTY ITEM -8
	var STATIC_PROD_RET_ID2 = 14; //OLD EMPTY ITEM -1
	var REB_STOCKIN_QTY = 0; //NEW EMPTY QTY
	var REB_STOCKIN_QTY2 = 0; //OLD ITEM QTY
	
	var SKIP = 0;
	var DGV_INDEX = 0;

	// Dialog Controls [Optional]
	// _______________________________________________________________________
	var REC_POSRESERVE_ACC_GROUP_ID_CMB = null;
	var REC_POSRESERVE_REC_CLIENT_ID_CMB = null;
	var REC_POSRESERVE_REFERENCE_CODE_TXT = null;
	var REC_POSRESERVE_DATE_EXPECTED_DTP = null;
	var REC_POSRESERVE_REMARKS_TXT = null;
	var REC_POSRESERVE_STATUS_CMB = null;
	var PARAM_REC_POSRESERVE_ID_FILE_FP = null;
	
	
	// DGV Controls
	// _______________________________________________________________________
	var POS_RESERVE_DGV = null;
	var PRODUCT_BRANCH_DGV = null;

	// ===============================================================
	// Initialize Controls
	// ===============================================================     
	function FORM_INITIALIZE()
	{
		// Load Cache Parent Data [Add Redirects if this is a required data.]
		// ...........................................
		if(JSVC_COOKIE.VAR_ISSET("PROPERTY_PARENT_ID_POS_RESERVE"))
		{
			PROPERTY_PARENT_ID = JSVC_COOKIE.VAR_READ("PROPERTY_PARENT_ID_POS_RESERVE");
		}	
		else
		{
			//window.location = JSCUS_CACHE.AUTH_REDIRECT_URL[JSCUS_CACHE.LOGIN_CLASS];
			//window.close();
		}
		if(JSVC_COOKIE.VAR_ISSET("PROPERTY_PARENT_DESCRIPTION_POS_RESERVE"))
		{
			PROPERTY_PARENT_DESCRIPTION = JSVC_COOKIE.VAR_READ("PROPERTY_PARENT_DESCRIPTION_POS_RESERVE");
			if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("PAGE_PARENT_DESCRIPTION_TXT") == true)
			{
				JSOC_ELEMENT.VAR_VALUE("PAGE_PARENT_DESCRIPTION_TXT", PROPERTY_PARENT_DESCRIPTION);			
			}
			if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("PAGE_PARENT_DESCRIPTION_LBL") == true)
			{
				JSOC_ELEMENT.VAR_VALUE("PAGE_PARENT_DESCRIPTION_LBL", PROPERTY_PARENT_DESCRIPTION);			
			}
			if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("PAGE_TITLE_LBL") == true)
			{
				JSOC_ELEMENT.VAR_VALUE("PAGE_TITLE_LBL", JSOC_ELEMENT.VAR_VALUE("PAGE_TITLE_LBL") + " : " + PROPERTY_PARENT_DESCRIPTION);	
			}
		}	
		else
		{
			//window.location = JSCUS_CACHE.AUTH_REDIRECT_URL[JSCUS_CACHE.LOGIN_CLASS];	
		}
		JSCUS_QUICK_SAVE.CUS_SAVE_INITIALIZE();
	
		// Restore Cache on reload
		// ...........................................	
		if
		(
			JSVC_COOKIE.VAR_ISSET("PROPERTY_PARENT_ID_POS_RESERVE") || 
			JSVC_COOKIE.VAR_ISSET("PROPERTY_PARENT_DESCRIPTION_POS_RESERVE")
		)
		{
			  window.onbeforeunload = function(event)
			  {
					// Get Current Root path
					var CURRENT_ROOT_PATH = JSCUS_CACHE.ROOT_PATH + JSVC_STR.VAR_MID(JSVC_STR.VAR_DLEFT(JSCUS_CACHE.AUTH_REDIRECT_URL[JSCUS_CACHE.LOGIN_CLASS], JSCUS_CACHE.SERVER_URL.length), 1, 1);
				
					// Cache Primary Key
					JSVC_COOKIE.VAR_ADD
					(
						'PROPERTY_PARENT_ID_POS_RESERVE', 
						PROPERTY_PARENT_ID, 
						5, 
						CURRENT_ROOT_PATH
					);
					
					// Cache Description
					JSVC_COOKIE.VAR_ADD
					(
						'PROPERTY_PARENT_DESCRIPTION_POS_RESERVE', 
						PROPERTY_PARENT_DESCRIPTION, 
						5, 
						CURRENT_ROOT_PATH
					);
			  };
		}
		
 		// Cache Class Properties
		// ...........................................
		if(JSVC_COOKIE.VAR_ISSET("PROPERTY_REC_POSRESERVE_ID"))
		{
			PROPERTY_REC_POSRESERVE_ID = JSVC_COOKIE.VAR_READ("PROPERTY_REC_POSRESERVE_ID");
		}	
		if(JSVC_COOKIE.VAR_ISSET("PROPERTY_EDIT_MODE"))
		{
			PROPERTY_EDIT_MODE = JSVC_COOKIE.VAR_READ("PROPERTY_REC_POSRESERVE_ID");
		}
	
		// Initialize: Modals
		// ...........................................
		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("POS_RESERVE_MODAL") == true)
		{
			// Display Modal
			JSOC_DIALOG.VAR_MODAL("POS_RESERVE_MODAL", false);
		}
				

		// Initialize: Ribbon Buttons [Add Search]
		// ...........................................
		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_CMD"))
		{
			SEARCH_CMD = JSOC_ELEMENT.VAR_GET("SEARCH_CMD");
			SEARCH_CMD.onclick =
			    function()
			    {
			        SKIP = 0;
			        STATUS_CHK = 0;
			        HTTP_SEARCH();
			    };
		}
		
		// Initialize: Ribbon Buttons [Add Print]
		// ...........................................
		// if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("PRINT_BBI"))
		// {
		// 	PRINT_BBI = JSOC_ELEMENT.VAR_GET("PRINT_BBI");
		// 	PRINT_BBI.onclick = function()
		// 	{
		// 		window.print();
		// 	};
		// }		
		
		// Initialize: Ribbon Buttons [Add Search]
		// ...........................................
		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("EXPORT_BBI"))
		{
			EXPORT_BBI = JSOC_ELEMENT.VAR_GET("EXPORT_BBI");
			EXPORT_BBI.onclick = function()
			{
				JSRC_EXCEL.REF_EXPORT('POS_RESERVE_DGV');
			};
		}

		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_POSRESERVE_DATE_RECORDED_FROM_DTP"))
		{
			JSOC_ELEMENT.VAR_VALUE("SEARCH_REC_POSRESERVE_DATE_RECORDED_FROM_DTP", JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_ADD('DAY', 0, JSVC_DATE.VAR_NOW()), "YYYY-MM-DD") + "T00:00");
		}
		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_POSRESERVE_DATE_RECORDED_TO_DTP"))
		{
			JSOC_ELEMENT.VAR_VALUE("SEARCH_REC_POSRESERVE_DATE_RECORDED_TO_DTP", JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_ADD('DAY', 0, JSVC_DATE.VAR_NOW()), "YYYY-MM-DD") + "T00:00");
		}	
	};