$(document).ready(function() {
	var URL= "http://www.ztgame.com/global/";
	var wl110= "http://www.ztgame.com/";
	var IeHeight = $("body").css("backgroundPositionY");
	var FfHeight = $("body").css("backgroundPosition");
	var xy;
	var FaHeight;
	if(FfHeight){
		 xy = FfHeight.split(" ");
		 var x = xy[0];
		 var y = xy[1];
		 FaHeight=parseInt(y)+43;
	}else{
		var y=IeHeight.replace(/px/, "");
		if(isNaN(parseInt(y)))
			FaHeight=43;
		else
			FaHeight=parseInt(y)+43;
	}
	
	$("body").css({"background-position":"center "+FaHeight+"px"});
	$("head").prepend('<link href="'+URL+'css/menu.css" type="text/css" rel="stylesheet">');
	var html='<script type="text/javascript">function sho(){document.getElementById("ztgame_list").style.display="block";}function hid(){document.getElementById("ztgame_list").style.display="none";}</script><div id="ztgame_menu"><div id="ztgame_main"><div id="ztgame_site" onmouseout="javascript:hid();" onmouseover="javascript:sho();"><span>巨人产品目录大全</span><div id="ztgame_list"><img src="'+URL+'images/menus/scl_top.gif" class="scl_com" /><div id="ztgame_listbg"><ul><li class="ztgame_ts"><img src="'+URL+'images/menus/ztgame_01.jpg" /></li><li class="els"><a href="http://els.ztgame.com/" target="_blank">艾尔之光</a></li><li class="lh"><a href="http://lh.ztgame.com/" target="_blank">龙魂</a></li><li class="xt"><a href="http://xt.ztgame.com/" target="_blank">仙途</a></li><li class="zt2"><a href="http://zt2.ztgame.com/" target="_blank">征途2</a></li><li class="allods"><a href="http://allods.ztgame.com/" target="_blank">巫师之怒</a></li><li class="sg"><a href="http://sg.ztgame.com/" target="_blank">三国战魂</a></li></ul><ul><li class="ztgame_ts"><img src="'+URL+'images/menus/ztgame_02.jpg" /></li><li class="zt"><a href="http://zt.ztgame.com/" target="_blank">征途</a></li><li class="zthj"><a href="http://zthj.ztgame.com/" target="_blank">征途怀旧版</a></li><li class="lszt"><a href="http://ls.ztgame.com/" target="_blank">绿色征途</a></li><li class="ztsj"><a href="http://ztsj.ztgame.com/" target="_blank">征途时间版</a></li><li class="jr"><a href="http://jr.ztgame.com/" target="_blank">巨人</a></li><li class="kok3"><a href="http://kok3.ztgame.com/" target="_blank">万王之王3</a></li><li class="xsg"><a href="http://www.xiaoshagua.com/" target="_blank">我的小傻瓜</a></li></ul><ul><li class="ztgame_ts"><img src="'+URL+'images/menus/ztgame_03.jpg" /></li><li class="hjgd"><a href="http://gd.ztgame.com/" target="_blank">黄金国度</a></li><li style="background:none;">&nbsp;</li><li class="ztgame_ts"><img src="'+URL+'images/menus/ztgame_04.jpg" /></li><li class="dd"><a href="http://dudu.ztgame.com/" target="_blank">嘟嘟语音</a></li><li style="background:none;">&nbsp;</li><li class="ztgame_ts"><img src="'+URL+'images/menus/ztgame_05.jpg" /></li><li class="jd"><a href="http://www.ggsafe.com/" target="_blank">巨盾</a></li></ul><div class="clear"></div></div><img src="'+URL+'images/menus/scl_bot.gif" class="scl_com" /></div></div><div id="ztgame_link"><span id="link1"><a href="http://me.ztgame.com/user_manage/login.jsp" target="_blank">帐号服务</a></span><span id="link2"><a href="http://pay.ztgame.com:81/qfillcard.php" target="_blank">充值服务</a></span><span id="link3"><a href="http://kf.ztgame.com/" target="_blank">客服中心</a></span></div><a href="http://www.ztgame.com" target="_blank"><img id="ztgame_logo" src="'+URL+'images/menus/menu_log.jpg" /></a><div id="ztgame_news"><ul><!--LIST--><li><a target="_blank" href="http://zt.ztgame.com/">《征途》亿元回馈嘉年华即将开启！狂送豪礼一整夏！</a></li><li><a target="_blank" href="http://zt2.ztgame.com/html/news/20110624/130891344918.shtml">庆祝建党90周年 《征途2》7月1日加开新区</a></li><li><a target="_blank" href="http://dudu.ztgame.com">《嘟嘟》最专业的游戏语音平台！</a></li><li><a target="_blank" href="http://els.ztgame.com/ ">史上最华丽的漫画格斗网游《艾尔之光》</a></li><li><a target="_blank" href="http://ls.ztgame.com/">《绿色征途》7月9日新区开启 六大活动任您畅玩</a></li><li><a target="_blank" href=""></a></li><!--LIST_END--></ul></div></div></div>';
	$("body").prepend(html);
	$("body").append('<a href=" http://sh.cyberpolice.cn" target="_blank" style="display:block;margin-top:-70px;position:absolute;right:20px;"><img src="'+wl110+'images/wl110.jpg" /></a>');
	
	//去除未成年标识
	var fcm = document.getElementById('globalscript');
	if(fcm!=null && fcm!=undefined){
		var fcmArgs = fcm.getAttribute('data');
		if(fcmArgs!=null && fcmArgs!=undefined){
			var logoObj = document.getElementById('ztgame_logo');
			if(logoObj!=null && logoObj!=undefined)logoObj.src=URL+'images/menus/menu_log2.jpg';
		}
	}
	
	$("#ztgame_news").Scroll({line:1,speed:600,timer:3000});
});


(function($){
$.fn.extend({
        Scroll:function(opt,callback){
                //参数初始化
                if(!opt) var opt={};
                var _this=this.eq(0).find("ul:first");
                var lineH=_this.find("li:first").height(), //获取行高
                     line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10), //每次滚动的行数，默认为一屏，即父容器高度
                     speed=opt.speed?parseInt(opt.speed,10):500, //卷动速度，数值越大，速度越慢（毫秒）
                     timer=opt.timer?parseInt(opt.timer,10):3000; //滚动的时间间隔（毫秒）
                if(line==0) line=1;
                var upHeight=0-line*lineH;
                //滚动函数
                scrollUp=function(){
                        _this.animate({
                                marginTop:upHeight
                        },speed,function(){
                                for(i=1;i<=line;i++){
                                        _this.find("li:first").appendTo(_this);
                                }
                                _this.css({marginTop:0});
                        });
                }
                //鼠标事件绑定
                _this.hover(function(){
                        clearInterval(timerID);
                },function(){
                        timerID=setInterval("scrollUp()",timer);
                });
                timerID=setInterval("scrollUp()",timer);
        }        
})
})(jQuery);
