

	var PROPERTY_REC_JORDER_ID = 0;
	var PROPERTY_REC_JORDER_CODE = '';


	var JOB_ORDER_DGV = null;
	var JOB_ORDER_TASK_DELIVER_DGV = null;
	var JOB_ORDER_TASK_RETURN_DGV = null;

	var APPROVE_BBI = null;
	var CANCEL_BBI = null;
	var REJECT_BBI = null;
	var SEARCH_CMD = null;
	var SAVE_BBI = null;

	var STATUS_ID = 0;
	var CMB_STATUS_IDENTIFIER = 0;

	function FORM_INITIALIZE()
	{
		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SAVE_BBI"))
		{
    		SAVE_BBI = JSOC_ELEMENT.VAR_GET("SAVE_BBI");     
			if(JSVC_VAR.VAR_ISSET(HTTP_SAVE))
			{
				// Prepare Save callback
				var CALLBACK_HANDLER = 
					function(IS_SUCCESS)
					{
						// Abort on failure
						if(IS_SUCCESS == false)
						{
							return;
						}

						// Show record saved messageBox
						JSVC_INFO.VAR_RECORD_SAVED('');
					}
				
				// Add OnClick event
				SAVE_BBI.onclick = 
					function()
					{
						HTTP_SAVE(CALLBACK_HANDLER);
					}
			}
		}

		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("APPROVE_BBI"))
		{
    		APPROVE_BBI = JSOC_ELEMENT.VAR_GET("APPROVE_BBI");     
			if(JSVC_VAR.VAR_ISSET(HTTP_APPROVE))
			{
				// Prepare Save callback
				var CALLBACK_HANDLER = 
					function(IS_SUCCESS)
					{
						// Abort on failure
						if(IS_SUCCESS == false)
						{
							return;
						}
						
						HTTP_SEARCH();

						// Show record saved messageBox
						JSVC_INFO.VAR_RECORD_SAVED('');
					}
				
				// Add OnClick event
				APPROVE_BBI.onclick = 
					function()
					{
						STATUS_ID = 1;
						HTTP_APPROVE(CALLBACK_HANDLER);
					}
			}
		}

		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("REJECT_BBI"))
		{
    		REJECT_BBI = JSOC_ELEMENT.VAR_GET("REJECT_BBI");     
			if(JSVC_VAR.VAR_ISSET(HTTP_APPROVE))
			{
				// Prepare Save callback
				var CALLBACK_HANDLER = 
					function(IS_SUCCESS)
					{
						// Abort on failure
						if(IS_SUCCESS == false)
						{
							return;
						}
						
						HTTP_SEARCH();

						// Show record saved messageBox
						JSVC_INFO.VAR_RECORD_SAVED('');
					}
				
				// Add OnClick event
				REJECT_BBI.onclick = 
					function()
					{
						STATUS_ID = 2;
						HTTP_APPROVE(CALLBACK_HANDLER);
					}
			}
		}

		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_CMD"))
		{
			SEARCH_CMD = JSOC_ELEMENT.VAR_GET("SEARCH_CMD");
			SEARCH_CMD.onclick = function(){HTTP_SEARCH()};
		}	
	}