window.game_msg = {
    openid:null,
    voice:true,
    houtai_kaiguan:false,

    score:0,
    highest_score:0,
    Opportunity:0,
    last_score:0,

    hammer_time:1,
    refresh_time:1,
    Opportunity_add_time:1,

    node_msg_arr:[],
    fenxiang_fuhuo:true,
    shipin_fuhuo:true,
    fuhuobi:0,

    danger_tip:true,
    daojishi:true,

    share_tip:"通讯失败",
}


var original = JSON.parse(JSON.stringify(game_msg));

var quju_video = {
    "video":["adunit-c8d40609ee9eb7c5","adunit-c3fdd16a5d6cb145"],
    // "video1":"adunit-dcb9cb2094a1287f",
    // "video2":"adunit-e279d64bcd2916e0",
    // "video3":"adunit-587290e2221f421d",
    "banner1":"adunit-43e3aeec58ceb86d",
    "banner2":"adunit-5ba5ced3e2e3629b",
    "banner3":"adunit-40a9edef99dd0632",

    // "banner4":"adunit-154ca85a22ee1bbb",
    // "banner5":"adunit-781a7e29a213afd0"
}

var quju_rand = function(min,max){
    return Math.floor(Math.random()*(max-min+1) + min);
}
// var bannerAd_last = null;
// var bannerid_last = null;

// window.bannerAd_last = null;
// window.bannerid_last = null;

window.banner_rand = null;

var banner_fn5 = function(){
    adSdk.createBannerAdByAdId1({},quju_video.banner1);
    adSdk.createBannerAdByAdId2({},quju_video.banner2);
    adSdk.createBannerAdByAdId3({},quju_video.banner3);

    // adSdk.createBannerAdByAdId4({},quju_video.banner4);
    // adSdk.createBannerAdByAdId5({},quju_video.banner5);

    // adSdk.createBannerAdByAdId({}).hide();
}
var banner_choose = function(){
    window.banner_rand = quju_rand(1,3);
    if(window.banner_rand ==1){
        adSdk.createBannerAdByAdId1({},quju_video.banner1).show();
    }
    if(window.banner_rand ==2){
        adSdk.createBannerAdByAdId2({},quju_video.banner2).show();
    }
    if(window.banner_rand ==3){
        adSdk.createBannerAdByAdId3({},quju_video.banner3).show();
    }
    // if(window.banner_rand ==4){
    //     adSdk.createBannerAdByAdId4({},quju_video.banner4).show();
    // }
    // if(window.banner_rand ==5){
    //     adSdk.createBannerAdByAdId5({},quju_video.banner5).show();
    // }
}

var banner_show = function(old){
    if(old){
            adSdk.createBannerAdByAdId1({},window.quju_video.banner1).hide();
            adSdk.createBannerAdByAdId2({},window.quju_video.banner2).hide();
            adSdk.createBannerAdByAdId3({},window.quju_video.banner3).hide();  
    }else{
        banner_choose();
    }
}

// window.quju_global = quju_global;
window.original = original;
window.quju_video = quju_video;
window.quju_rand = quju_rand;
window.banner_show = banner_show;
window.banner_fn5 = banner_fn5;

window.send_data_to_sub = function(mydata){
    var openDataContext = wx.getOpenDataContext();
    openDataContext.postMessage(mydata);
}