
	var SEARCH_CMD = null;
	var SEARCH_CMD2 = null;
	var EXPORT_BBI = null;
	var EXPORT_BBI2 = null;

	var TRANSFLOW_SMRY_DGV = null;
	var POS_SHIFT_DGV = null;

	var ROW_INDEX = 1;

	var TRANSACTION_COUNT = 0;

	function FORM_INITIALIZE()
	{
		JSOC_ELEMENT.VAR_VALUE("PAGE_TITLE_LBL", "Transaction Flow Summary as of : " + JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_NOW(), "MMMM DD, YYYY"));	

		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_CMD"))
		{
			SEARCH_CMD = JSOC_ELEMENT.VAR_GET("SEARCH_CMD");
			if(JSVC_VAR.VAR_ISSET(HTTP_LOAD_TRANS_COUNT))
			{
				// Prepare Save callback
				var CALLBACK_HANDLER = 
					function(IS_SUCCESS)
					{
						// Abort on failure
						if(IS_SUCCESS == false)
						{
							return;
						}
						
						HTTP_LOAD_BRANCH_PRODUCT();
					}
				
				// Add OnClick event
				SEARCH_CMD.onclick = 
					function()
					{
						RESET_DATA();
						HTTP_LOAD_TRANS_COUNT(CALLBACK_HANDLER);
					}
			}
		}

		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("EXPORT_BBI"))
		{
			EXPORT_BBI = JSOC_ELEMENT.VAR_GET("EXPORT_BBI");
			EXPORT_BBI.onclick = function()
			{
				JSRC_EXCEL.REF_EXPORT('TRANSFLOW_SMRY_DGV');
			};
		}

		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("EXPORT_BBI2"))
		{
			EXPORT_BBI2 = JSOC_ELEMENT.VAR_GET("EXPORT_BBI2");
			EXPORT_BBI2.onclick = function()
			{
				//JSRC_EXCEL.REF_EXPORT('TRANSFLOW_SMRY_DGV');
				JSRC_EXCEL.REF_EXPORT('POS_SHIFT_DGV');
			};
		}	
	}

	function RESET_DATA()
	{
		JSOC_ELEMENT.VAR_VALUE("SALES_BY_PRODUCT_TOTAL_COUNT", "0");
		JSOC_ELEMENT.VAR_VALUE("SALES_BY_PRODUCT_TOTAL_SALES", "0.00");
		JSOC_ELEMENT.VAR_VALUE("TRANS_FLOW_BEG_CASH", "0.00");
		JSOC_ELEMENT.VAR_VALUE("TRANS_FLOW_ACT_CASH", "0.00");
		JSOC_ELEMENT.VAR_VALUE("TRANS_FLOW_CASH_IN", "0.00");
		JSOC_ELEMENT.VAR_VALUE("TRANS_FLOW_CASH_OUT", "0.00");
		JSOC_ELEMENT.VAR_VALUE("TRANS_FLOW_SHORT_OVER", "0.00");
	}

	

