     import org.hola.ZExternalInterface;
     import flash.net.URLRequest;
     import flash.net.URLStream;
-    import flash.net.URLRequestHeader;
-    import flash.net.URLRequestMethod;
     import flash.utils.ByteArray;
     import flash.utils.getTimer;
     import flash.utils.Timer;

        }

        private function onopen(e : Event) : void { _connected = true; }

        private function onerror(e : ErrorEvent) : void {
            _delete();
            if (!_events.error)
                return;
            _trigger('onRequestEvent', {req_id: _req_id, event: 'error',
                error: e.text, text: e.toString()});
        }

        private function onprogress(e : ProgressEvent) : void {
            _size = e.bytesTotal;
            if (!_events.progress)
                return;
            _trigger('onRequestEvent', {req_id: _req_id, event: 'progress',
                loaded: e.bytesLoaded, total: e.bytesTotal,
                text: e.toString()});
        }

        private function onstatus(e : HTTPStatusEvent) : void {
            if (!_events.status)
                return;
            // XXX bahaa: get redirected/responseURL/responseHeaders
            _trigger('onRequestEvent', {req_id: _req_id, event: 'status',
                status: e.status, text: e.toString()});
        }

        private function oncomplete(e : Event) : void {
            _delete();
            if (!_events.complete)
                return;
            _trigger('onRequestEvent', {req_id: _req_id, event: 'complete',
                size: _size, text: e.toString()});
        }

        private function decode(str : String) : void {
            if (!str)

        }

        protected function _trigger(cb : String, data : Object) : void {
            if (!_hola_managed)
                return ZErr.log('invalid trigger'); // XXX arik: ZErr.throw
            ExternalInterface.call('window.hola_'+cb,
                {objectID: ExternalInterface.objectID, data: data});
        }
