var str ='
';
document.write(str);
var topBar_init = function(){
//样式
var h = document.getElementsByTagName("head")[0];
var link = document.createElement("link");
link.type ="text/css";
link.rel = "stylesheet";
link.href = '//img.game2.cn/css/topBar.css';
h.appendChild(link);
//检测ie6-9
if(/MSIE [6789]\.0/.test(navigator.userAgent)){
document.getElementsByTagName('body')[0].className += ' ie';
}
//数据
var topBar_games = {"2":{"G":[{"code":"sha","client":"http:\/\/sha.game2.cn\/download\/game2_sha.exe","name":"\u653b\u94e9\u52a0\u5f3a\u7248","goodenter":"http:\/\/sha.game2.cn\/"},{"code":"gsls","client":"https:\/\/gsls.game2.cn\/download\/game2_gsls.exe","name":"\u653b\u94e9\u7eff\u8272\u7248","goodenter":"http:\/\/gsls.game2.cn\/"},{"code":"mir","client":"http:\/\/mir.game2.cn\/download\/game2_mir.exe","name":"\u653b\u94e9\u5c60\u9f99\u7248","goodenter":"http:\/\/mir.game2.cn\/"}],"H":[{"code":"hdzy","client":"","name":"\u6df7\u6c8c\u6218\u57df","goodenter":"https:\/\/www.game2.cn\/v2\/#\/hdzy"}],"J":[{"code":"jyjx","client":"http:\/\/jyjx.game2.cn\/download\/game2_jyjx.exe","name":"\u4e5d\u9634\u7edd\u5b66","goodenter":"http:\/\/jyjx.game2.cn\/"},{"code":"jhb","client":"","name":"\u5251\u9b42\u699c","goodenter":"https:\/\/jhb.game2.cn"}]},"1":{"A":[{"code":"aojian","client":"https:\/\/aojian.game2.cn\/download\/game2_aojian.exe","name":"\u50b2\u5251","goodenter":"http:\/\/aojian.game2.cn\/"}],"B":[{"code":"bzsc","client":"https:\/\/bzsc.game2.cn\/download\/game2_bzsc.exe","name":"\u767e\u6218\u6c99\u57ce","goodenter":"http:\/\/bzsc.game2.cn\/"}],"C":[{"code":"cqsser","client":"https:\/\/download.game2.cn\/cqss2\/game2_cqss2.exe","name":"\u4f20\u5947\u76db\u4e162","goodenter":"https:\/\/cqsser.game2.cn\/"},{"code":"cqbz","client":"https:\/\/cqbz.game2.cn\/download\/cqbz.exe","name":"\u4f20\u5947\u9738\u4e3b","goodenter":"http:\/\/cqbz.game2.cn\/"},{"code":"cjzg","client":"http:\/\/cjzg.game2.cn\/download\/game2_cjzg.exe","name":"\u88c1\u51b3\u6218\u6b4c","goodenter":"http:\/\/cjzg.game2.cn\/"},{"code":"zjty","client":"","name":"\u4f20\u5947\u4e16\u754c\u4e4b\u4ed7\u5251\u5929\u6daf","goodenter":"http:\/\/www.game2.cn"},{"code":"cqsserh","client":"","name":"\u4f20\u5947\u76db\u4e162 H5","goodenter":"https:\/\/cqsser.game2.cn\/"},{"code":"cqbzh","client":"","name":"\u4f20\u5947\u9738\u4e3bh5","goodenter":"http:\/\/cqbz.game2.cn\/"}]},"4":{"Q":[{"code":"qj","client":"","name":"\u4e03\u7edd","goodenter":"https:\/\/qj.game2.cn\/"}],"S":[{"code":"smzd","client":"","name":"\u795e\u9b54\u4e4b\u9053","goodenter":"https:\/\/smzd.game2.cn\/"},{"code":"snjs","client":"https:\/\/download.game2.cn\/snjs\/game2_snjs.exe","name":"\u5c11\u5e74\u6c5f\u5c71","goodenter":"https:\/\/snjs.game2.cn\/"},{"code":"sgcs","client":"https:\/\/download.game2.cn\/sgcs\/g2cs.exe","name":"\u4e0a\u53e4\u4f20\u8bf4","goodenter":"http:\/\/sgcs.game2.cn\/"}],"T":[{"code":"ts","client":"http:\/\/ts.game2.cn\/download\/game2_ts.exe","name":"\u5929\u4e66\u6b8b\u5377","goodenter":"http:\/\/ts.game2.cn\/"},{"code":"tjwan","client":"","name":"\u5929\u754c-\u65b0","goodenter":"https:\/\/www.game2.cn\/v2\/#\/tjwan"}]},"5":{"W":[{"code":"wjcq","client":"https:\/\/download.game2.cn\/wjcq\/wjcq.exe","name":"\u7ef4\u4eac\u4f20\u5947","goodenter":"https:\/\/wjcq.game2.cn\/"},{"code":"wzzxer","client":"https:\/\/download.game2.cn\/wzzx2\/wzzx2.exe","name":"\u738b\u8005\u4e4b\u5fc32","goodenter":"https:\/\/wzzxer.game2.cn\/"},{"code":"wjcqh","client":"","name":"\u7ef4\u4eac\u4f20\u5947H5","goodenter":"https:\/\/wjcq.game2.cn"},{"code":"wzzxerh","client":"","name":"\u738b\u8005\u4e4b\u5fc32 H5","goodenter":"https:\/\/wzzxer.game2.cn\/"},{"code":"wl","client":"","name":"\u5367\u9f99-\u5c0f\u6e38\u620f-\u5df2\u4e0b\u67b6","goodenter":"https:\/\/wl.game2.cn"},{"code":"wolong","client":"","name":"\u5367\u9f99","goodenter":"https:\/\/wolong.game2.cn\/"}],"X":[{"code":"xianyu","client":"","name":"\u4ed9\u57df","goodenter":"http:\/\/xianyu.game2.cn\/"}],"Z":[{"code":"zjtyh","client":"","name":"\u4ed7\u5251\u5929\u6dafH5","goodenter":"http:\/\/www.game2.cn"}]},"3":{"L":[{"code":"lsaj","client":"https:\/\/lsaj.game2.cn\/download\/game2_lsaj.exe","name":"\u7eff\u8272\u50b2\u5251","goodenter":"http:\/\/lsaj.game2.cn\/"},{"code":"lsxy","client":"https:\/\/lsxy.game2.cn\/download\/game2_lsxy.exe","name":"\u7eff\u8272\u4ed9\u57df","goodenter":"http:\/\/lsxy.game2.cn\/"}],"M":[{"code":"ms","client":"http:\/\/ms.game2.cn\/download\/game2_ms.exe","name":"\u706d\u795e","goodenter":"http:\/\/ms.game2.cn\/"}]},"0":{"1":[{"code":"cscyh","client":"","name":"19sf","goodenter":"http:\/\/www.game2.cn"}]}};
var topBar_hotgames = [{"code":"hdzy","login_url":"http:\/\/www.game2.cn\/website4\/type\/server\/gc\/hdzy\/gid\/439\/","goodenter":"https:\/\/www.game2.cn\/v2\/#\/hdzy"},{"code":"cqsser","login_url":"http:\/\/www.game2.cn\/website4\/type\/server\/gc\/cqsser\/gid\/420\/","goodenter":"https:\/\/cqsser.game2.cn\/"}];
var host = window.location.host;
if(host=='jlc.game2.cn'){
host='9.game2.cn';
}
if(host=='aojian2.game2.cn'){
host='www.aojian2.net';
}
//初始化
a:for(var _i in topBar_games){
b:for(var _j in topBar_games[_i]){
for(var _k in topBar_games[_i][_j]){
if (topBar_games[_i][_j][_k].goodenter==('http://'+host+'/')){
if( topBar_games[_i][_j][_k].client ){
jQuery('.topBar .l1').show();
jQuery('.topBar .l1 a').attr('href',topBar_games[_i][_j][_k].client);
}
jQuery('.topBar .l2 a').attr('href',"//www.game2.cn/shortcut.php?name="+encodeURIComponent(topBar_games[_i][_j][_k].name)+"&url="+host);
jQuery('.topBar .a1').attr('href',"http://pay.game2.cn/pay/g/"+topBar_games[_i][_j][_k].code+"/");
break a;
}
}
}
}
for (var i in topBar_hotgames){
if (topBar_hotgames[i].goodenter != ('http://'+host+'/') ) {
jQuery('.topBar .to5Rec').html('');
break;
}
}
//加入收藏
jQuery('.topBar .l3').click(function(){
try {
window.external.addFavorite(window.location, document.title);
} catch (e) {
try {
window.sidebar.addPanel(document.title, window.location, "");
} catch (e) {
alert("加入收藏失败,请使用Ctrl+D进行添加");
}
}
return false;
});
//设为主页
jQuery('.topBar .l4').click(function(){
try{
this.style.behavior='url(#default#homepage)';
this.setHomePage(window.location);
}catch(e){
if(window.netscape){
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}catch(e){
alert("抱歉,此操作被浏览器拒绝!\n\n请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为'true'");
}
}else{
alert("抱歉,您所使用的浏览器无法完成此操作。\n\n您需要手动将【"+window.location+"】设置为首页。");
}
}
return false;
});
//切换游戏
jQuery('.topBar .to5Div h3 a').bind('click',function(){
var $that = jQuery(this);
var type = $that.attr('data-type');
$that.addClass('on');
$that.siblings().removeClass('on');
if (type=='0') {
jQuery('.topBar .to5Con').hide();
jQuery('.topBar .to5Rec').show();
}else{
jQuery('.topBar .to5Con').hide();
var $_type = jQuery('.topBar .to5Con[data-type="'+type+'"]');
if($_type.length){
$_type.show();
}else{
var str = '';
jQuery('.topBar .to5Content').append(str);
}
}
return false;
});
//下拉
jQuery('.topBar .topBar_hover').hover(
function(){
var height = jQuery(this).attr('data-height');
jQuery(this).find('.topBar_show').css('height',height).show();
},
function(){jQuery(this).find('.topBar_show').hide();}
);
}
function topBar_loadScript(url, callback) {
var script = document.createElement("script");
script.type = "text/javascript";
// IE
if (script.readyState) {
script.onreadystatechange = function () {
if (script.readyState == "loaded" || script.readyState == "complete") {
script.onreadystatechange = null;
callback();
}
};
} else {
script.onload = function () {
callback();
};
}
script.src = url;
document.body.appendChild(script);
}
if(!window.jQuery){
topBar_loadScript("//script.game2.cn/jquery-1.7.2.min.js", topBar_init);
}else{
topBar_init();
}