

var PROPERTY_CHILD_FILES = null;
var PROPERTY_ACC_GROUP_ID;
var PROPERTY_CAT_PRODUCT_ID;
var INDEX_HOLDER = 0;

var SEARCH_SPB = null;
var SEARCH_SKU = null;
var SEARCH_SM = null;
var SEARCH_PD = null;
var SEARCH_TS = null;

var PER_BRANCH_DGV = null;
var SKU_SALES_DGV = null;
var SM_NM_DGV = null;
var PD_DGV = null;

var SEARCH_CMD_IDENTIFIER = 0;

function FORM_INITIALIZE()
{
	if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_DATE_FROM_TS_DTP"))
	{
		JSOC_ELEMENT.VAR_VALUE("SEARCH_DATE_FROM_TS_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_DATE_TO_TS_DTP"))
	{
		JSOC_ELEMENT.VAR_VALUE("SEARCH_DATE_TO_TS_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_DATE_FROM_SPB_DTP"))
	{
		JSOC_ELEMENT.VAR_VALUE("SEARCH_DATE_FROM_SPB_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_DATE_FROM_SKU_DTP"))
	{
		JSOC_ELEMENT.VAR_VALUE("SEARCH_DATE_FROM_SKU_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_DATE_FROM_SM_DTP"))
	{
		JSOC_ELEMENT.VAR_VALUE("SEARCH_DATE_FROM_SM_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_DATE_FROM_PD_DTP"))
	{
		JSOC_ELEMENT.VAR_VALUE("SEARCH_DATE_FROM_PD_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_SPB"))
	{
		SEARCH_SPB = JSOC_ELEMENT.VAR_GET("SEARCH_SPB");
		SEARCH_SPB.onclick = function(){HTTP_LOAD_SALES_PER_BRANCH()};
	}
	if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_SKU"))
	{
		SEARCH_SKU = JSOC_ELEMENT.VAR_GET("SEARCH_SKU");
		SEARCH_SKU.onclick = function(){HTTP_LOAD_SALES_PER_SKU()};
	}
	if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_SM"))
	{
		SEARCH_SM = JSOC_ELEMENT.VAR_GET("SEARCH_SM");
		SEARCH_SM.onclick = function(){HTTP_LOAD_SALES_NONMOVING()};
	}
	if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_PD"))
	{
		SEARCH_PD = JSOC_ELEMENT.VAR_GET("SEARCH_PD");
		SEARCH_PD.onclick = function(){SEARCH_CMD_IDENTIFIER = 3; HTTP_LOAD_PENDING_DELIVERIES()};
	}
	if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_TS"))
	{
		SEARCH_TS = JSOC_ELEMENT.VAR_GET("SEARCH_TS");
		SEARCH_TS.onclick = function(){HTTP_TOTAL_SALES()};
	}
}