	// ===============================================================
	// 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 = "";
	
	
	// Cache
	// _______________________________________________________________________
	var PROPERTY_REC_INVOICE_ID = -1;
	var PROPERTY_EDIT_MODE = false;
	var PROPERTY_EDIT_ROW_INDEX = -1;
	var INPUT_INSTANCE = null;
	
	
	// Dialog Controls [Optional]
	// _______________________________________________________________________
	var REC_INVOICE_REFERENCE_TXT = null;
	var REC_INVOICE_ACC_GROUP_ID_CMB = null;
	var REC_INVOICE_DISCOUNT_OTHER_TXT = null;
	var REC_INVOICE_AMOUNT_DUE_TXT = null;
	var REC_INVOICE_AMOUNT_RETURN_TXT = null;
	var REC_INVOICE_AMOUNT_ADJUSTMENT_TXT = null;
	var REC_INVOICE_AMOUNT_PAID_TXT = null;
	var REC_INVOICE_REMARKS_TXT = null;
	var REC_INVOICE_REC_EMPLOYEE_ID_CMB = null;
	var REC_INVOICE_DATE_DELIVERY_DTP = null;
	var REC_INVOICE_DATE_DUE_DTP = null;
	var REC_INVOICE_STATUS_CMB = null;
	
	var SEARCH_REC_INVOICE_DATE_DELIVERY_CMB = null;
	var SEARCH_REC_INVOICE_DATE_ISSUED_CMB = null;
	var SEARCH_REC_INVOICE_DATE_DUE_CMB = null;
	var SEARCH_REC_INVOICE_DATE_FULLPAY_CMB = null;
	
	var PARAM_REC_INVOICE_ID_FILE_FP = null;
	
	
	// DGV Controls
	// _______________________________________________________________________
	var INVOICE_DGV = null;
	var INVOICE_LINE_DGV = null;
	var INVOICE_RTN_DGV = null;
	var INVOICE_LAST_GET_MAP_ARRAY = 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_INVOICE"))
		{
			PROPERTY_PARENT_ID = JSVC_COOKIE.VAR_READ("PROPERTY_PARENT_ID_INVOICE");
		}	
		else
		{
			window.location = JSCUS_CACHE.AUTH_REDIRECT_URL[JSCUS_CACHE.LOGIN_CLASS];
			window.close();
		}
		if(JSVC_COOKIE.VAR_ISSET("PROPERTY_PARENT_DESCRIPTION_INVOICE"))
		{
			PROPERTY_PARENT_DESCRIPTION = JSVC_COOKIE.VAR_READ("PROPERTY_PARENT_DESCRIPTION_INVOICE");
			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];	
		}
	
		// Restore Cache on reload
		// ...........................................	
		if
		(
			JSVC_COOKIE.VAR_ISSET("PROPERTY_PARENT_ID_INVOICE") || 
			JSVC_COOKIE.VAR_ISSET("PROPERTY_PARENT_DESCRIPTION_INVOICE")
		)
		{
			  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_INVOICE', 
						PROPERTY_PARENT_ID, 
						5, 
						CURRENT_ROOT_PATH
					);
					
					// Cache Description
					JSVC_COOKIE.VAR_ADD
					(
						'PROPERTY_PARENT_DESCRIPTION_INVOICE', 
						PROPERTY_PARENT_DESCRIPTION, 
						5, 
						CURRENT_ROOT_PATH
					);
			  };
		}
		
		// Assign Fixed Parent (Must remove auto-populate at ch.js and HTTP_PARENT_LOAD at eh.js)
		// ...........................................
		/*
		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("PARENT_SELECT_CMB"))
		{
			JSOC_CMB.VAR_ADD
			(
				"PARENT_SELECT_CMB", 
				PROPERTY_PARENT_ID,
				PROPERTY_PARENT_DESCRIPTION
			);
		}
		*/
	};