var pe = null;

var app = {
    // Application Constructor
    initialize: function() {
        this.bindEvents();
    },

    // Bind Event Listeners
    bindEvents: function() {
        document.addEventListener('deviceready', this.onDeviceReady, false);
    },

    onDeviceReady: function() {
        console.log('device is ready!');

        pe = window.plugins.pokktExtension;

        pe.setDebug(true);

        // pe.setPokktConfig('cc41e865391d6ea371b18aff27cc10e6', '4a069e89fe4a4e4f58a26f8bff2974ba');
        pe.setPokktConfig('d572bd855ed1c299ca5491b5df54d42b', '6414dc853a151b4dfe7d04a171e38bd8');
        //set Callback values
        var extraParams = {};
        extraParams.Network = "POKKT";
        pe.setCallbackExtraParams(JSON.stringify(extraParams));

        //setAdplayerconfig
        var adPlayerConfig = pe.createAdPlayerViewConfig();
        pe.setAdPlayerViewConfig(JSON.stringify(adPlayerConfig));

    },

    onClickAdDemoScreen1: function() {
        window.location = "VideoScreen.html";
    },

    onClickAdDemoScreen2: function() {
        window.location = "interstitialScreen.html";
    },

    onClickShowBanner: function() {
        window.location = "Banner.html";
    },
    onClickMore: function() {
        window.location = "Setting.html";
    },
    exportLog: function() {
        pe.exportLog();
    }
};
