(function(){

var style=[];
style.push('.common-header{position:absolute;width:100%;height:60px;background:#1E1E1E;z-index:19;top:0;left:0}');
style.push('.web-logo{width:205px;height:60px;color:#fff;display:block;overflow:hidden;background:url(//game.gtimg.cn/images/jxqy/logo.png) 0 0 no-repeat;background-size:50px 50px;float:left;background-position:5px 5px;text-decoration:none}');
style.push('.common-header .p-common{padding:10px 0 0 60px}');
style.push('.p-common dt h1{font-size:16px;color: #E4E4E4;}');
style.push('.p-common dd{margin:3px 0;font-size:12px;color:#929292;-webkit-transform:scale(.8);transform:scale(.8);transform-origin:0 0}');
style.push('.btn-down{position:absolute;right:42px;top:15px;width:100px;height:30px;background:url(//game.gtimg.cn/images/jxqy/m/web201605m/sprite1464248431230.png) no-repeat 0 0;background-size:153px auto;text-indent:-999px;}');
style.push('.btn_nav_slide{position:absolute;right:5px;top:15px;width:25px;height:25px}');
style.push('.draw,.draw:before,.draw:after{width:25px;height:2px;background:#fff;position:absolute;-webkit-transition:all .5s;-webkit-transform-style:preserve-3d;-webkit-backface-visibility:hidden}');
style.push('.draw{left:50%;top:50%;-webkit-transform:translate(-50%)}');
style.push('.draw:before{content:"";top:-7px}');
style.push('.draw:after{content:"";top:7px}');
style.push('.G_close .draw{background:transparent}');
style.push('.G_close .draw:before{top:0;-webkit-transform:rotate(45deg);background:#bc3129}');
style.push('.G_close .draw:after{top:0;-webkit-transform:rotate(-45deg);background:#bc3129}');
style.push('.common_nav{width:0;height:0;position:fixed;right:0;top:60px;z-index:9999;opacity:0;-webkit-transition:all .5s;-webkit-transform-style:preserve-3d;-webkit-backface-visibility:hidden}');
style.push('.common_nav ul{width:100%;overflow:hidden;text-align:center}');
style.push('.common_nav li{display:block;height:46px;width:100%;line-height:46px;position:relative;border-top:1px solid #2c2c2c}');
style.push('.common_nav a{color:#fff;display:block;font-size:14px;height:46px;line-height:46px;text-decoration:none}');
style.push('.G_open{width:100%;height:100%;top:60px;opacity:1;background:#1e1919;-webkit-transform:scale3d(1,1,1)}');
style.push('@media screen and (min-width:768px){.web-logo{width:300px}');
style.push('.p-common dt h1{font-size:22px}.p-common dd{font-size:16px}}');

var game = {
    name : '剑侠情缘',
    solgon : '美术重制 焕新公测',
    navs : [
        ["首页",'/m/main.shtml'],
        ["热门活动","/webplat/info/news_version3/22500/22501/22502/22504/m15192/list_1.shtml"],
		["新闻中心","/webplat/info/news_version3/22500/22501/22502/m15192/list_1.shtml"],
		["游戏攻略","/webplat/info/news_version3/22500/22501/22503/m15197/list_1.shtml"],
		["游戏图库","javascript:alert(\'敬请期待！\')"],
		["官方论坛","//jxqy.gamebbs.qq.com/"],
		["CDKEY兑换","/act/agile/48347/index.html"]
    ]
}
var ss = document.createElement('style');
    ss.innerText = style.join("");
    document.getElementsByTagName('head')[0].appendChild(ss);
var hd = '<div class="cover-content clear"><a href="/m/main.shtml" class="web-logo" onclick="PTTSendClick(\'banner\',\'topLogo\',\'logo\')"><dl class="p-common"><dt><h1>'+game.name+'</h1></dt><dd>'+game.solgon+'</dd></dl></a><a href="/d/index.html" class="btn-down" onclick="PTTSendClick(\'banner\',\'down\',\'下载\')" title="立即下载">立即下载</a><div id="btnNavSlide" class="btn_nav_slide"><i class="draw" title="导航开关"></i></div></div>',
    header = document.createElement('div');
    header.className = "common-header";
    header.id = "top";
    hd += '<nav id="commonNav" class="common_nav"><div class="cover_content"><ul>';
    for(var i=0;i<game.navs.length;i++){
        hd += '<li><a onclick="PTTSendClick(\'nav\',\'link'+(i+0)+'\',\'导航'+(i+0)+'\')" href="'+game.navs[i][1]+'">'+game.navs[i][0]+'</a></li>';
    }
    hd += '</ul></div></nav>';
    header.innerHTML = hd;
    document.getElementsByTagName('body')[0].insertBefore(header,document.getElementsByTagName('body')[0].childNodes[0]);

function menuInit($){
    $("#btnNavSlide").bind("touchstart", function() {
        if ($(".G_open").length) {
            $("#commonNav").removeClass("G_open");
            $("#btnNavSlide").removeClass("G_close");
            $("body").unbind("touchmove", false);
        } else {
            $("#commonNav").addClass("G_open");
            $("#btnNavSlide").addClass("G_close");
            $("body").bind("touchmove", false);
        }
    });
}
if(typeof Zepto != "undefined"){
    menuInit(Zepto);    
}else{
    var ele = document.createElement('script');
    ele.src = "//game.gtimg.cn/images/js/zepto/zepto.min.js";
    document.getElementsByTagName('body')[0].appendChild(ele);
    ele.onload = function(){
        menuInit(Zepto);
    }
}
	
})()