
	// ===============================================================
	// Trims empty spaces and perform convertion for numeric fields.
	// ===============================================================
	function FIX_INPUT()
	{
		// Fix String Fields
		// ...........................................
		JSOC_INPUT_TEXT.CTL_TRIM(ACC_APK_CODE_TXT);
		JSOC_INPUT_TEXT.CTL_TRIM(ACC_APK_SERIAL_TXT);
		
		// Fix Numeric Fields (if field type is not number.)
		// ...........................................


		// Fix Password Fields
		// ...........................................
	};

		
	// ===============================================================
	// Request Save
	// ===============================================================
	function HTTP_SAVE(CALLBACK_METHOD)
	{

		// Sanitize User Inputs
		// _______________________________________________________________________
		FIX_INPUT();

		// Validate Null [String Input]
		// _______________________________________________________________________
		if(JSOC_INPUT_TEXT.CTL_VALIDATE(ACC_APK_CODE_TXT, "Business Code", null, 1, 140) == false)
		{
			ACC_APK_CODE_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
			ACC_APK_CODE_TXT.focus();
			return false;
		}
		if(JSOC_INPUT_TEXT.CTL_VALIDATE(ACC_APK_SERIAL_TXT, "Serial Code", null, 1, 140) == false)
		{
			ACC_APK_SERIAL_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
			ACC_APK_SERIAL_TXT.focus();
			return false;
		}		 

		
		// Save item [Prepare]
		// _______________________________________________________________________
		var SAVE_MAP_ARRAY = JSCUS_SQL._ACCOUNT._APK.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_APK_CODE", JSOC_ELEMENT.VAR_VALUE(ACC_APK_CODE_TXT));					
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_APK_SERIAL", JSOC_ELEMENT.VAR_VALUE(ACC_APK_SERIAL_TXT));		
		
		
		// Declare Post Request Handler
		// _______________________________________________________________________
		var RESPONSE_HANDLER = 			
			function(IS_SUCCESS, HTTP_RESPONSE)
			{
				// Disable Dialogs
				// ...........................................
				CUS_SEND_DIALOG_TRY_DISMISS();
				
				// Handle Error
				// ...........................................
				if(IS_SUCCESS === false)
				{
					METHOD_UNABLE_TO_SEND_REQUEST(CALLBACK_METHOD);	
					return;
				}
				
				// Catch JSON Error
				// ...........................................
				else if(JSRC_JSON.REF_IS_JSTRING(HTTP_RESPONSE) == false)
				{
					METHOD_SERVER_ISSUE(CALLBACK_METHOD, HTTP_RESPONSE);
					return;			
				}
					
				// Invalid Serial Number
				// ...........................................
				var JSON_OBJECT = JSRC_JSON.REF_CREATE(HTTP_RESPONSE);
				if(JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT") <= 0)
				{
					JSOC_DIALOG.VAR_MESSAGE_BOX
					(
						'Invalid serial code', 'Validate Device',
						JSOC_DIALOG.MSGBOX_TYPE_OK_ONLY,
						JSOC_DIALOG.MSGBOX_ICON_ERROR,
						function(){}
					);
					return;
				}
		
				// Apply settings to apk
				// ...........................................
				else
				{
					var APK_DESCRIPTION = JSRC_JSON.REF_READ(JSON_OBJECT, "ACC_APK_DESCRIPTION", 1);
					var APK_DEFAULT_URL = JSRC_JSON.REF_READ(JSON_OBJECT, "ACC_APK_SETTINGS_A", 1);
					var APK_ORIENTATION_IS_PORTRAIT = JSRC_JSON.REF_READ(JSON_OBJECT, "ACC_APK_SETTINGS_B", 1);
					var APK_ORIENTATION_IS_LANDSCAPE = JSRC_JSON.REF_READ(JSON_OBJECT, "ACC_APK_SETTINGS_C", 1);
					
					Android.SETTINGS('WEBSITE_URL', APK_DEFAULT_URL);
					Android.SETTINGS('SCREEN_ROTATE_PORTRAIT', APK_ORIENTATION_IS_PORTRAIT); 
					Android.SETTINGS('SCREEN_ROTATE_LANDSCAPE', APK_ORIENTATION_IS_LANDSCAPE);
		
					JSOC_DIALOG.VAR_MESSAGE_BOX
					(
						'Serial code verified. [' + APK_DESCRIPTION + '] Applying app configurations, please restart the app after few seconds...', 'Validate Device',
						JSOC_DIALOG.MSGBOX_TYPE_OK_ONLY,
						JSOC_DIALOG.MSGBOX_ICON_SUCCESS,
						function()
						{
							Android.WINDOW_SHUTDOWN();
						}
					);
					
					return;				
				}
			};
			
			
		// Save Item [Send Request]
		// _______________________________________________________________________
		JSOC_DIALOG.VAR_LOADING_SPINNER(true);
		JSCUS_SQL._ACCOUNT._APK.CUS_VALIDATE
		(
			SAVE_MAP_ARRAY,
			RESPONSE_HANDLER
		);
		
	};