var flashObject = document.getElementById('flash');

(function () {

    var forward = [
        'showStartGiftSpef',
        'maxWindow',
        'sendChatMessage',
        'ConnectVideoChannelSuccess',
        'onLiveNetSpeedTest',
        'initFlash',
        'consolelog',
        'inputbox_show',
        'inputbox_pos',
        'inputbox_clear',
        'inputbox_text',
        'http_request',
        'http_post',
        'request_cookies',
	'flashStatistics'
    ];

    window.setParam = function (args) {
        var ar1 = decodeURIComponent(args);
        flashObject.setParam(ar1);
    }
    window.stopConnect = function () {
        flashObject.stopConnect();
    }
    window.inputbox_enterpress = function () {
        flashObject.inputbox_enterpress();
    }
    window.http_response = function (type,args) {
        var ar1 = decodeURIComponent(args);
        flashObject.http_response(type,ar1);
    }
    window.on_get_cookies = function (version,cookies) {
        var ver = decodeURIComponent(version);
        var cook = decodeURIComponent(cookies);
        flashObject.on_get_cookies(ver,cook);
    }
    forward.forEach(function (v) {
        (function (name) {
            window[name] = function ()
            {
                return window.videologic[name].apply(window.videologic, arguments);
            };
        })(v);
    });

})();