var uuzu = {
	global:function() {
		jQuery(".WeatherPost").weather();
		jQuery("#homepage").click(function(){
			jQuery.HomePage();return false;
		});
		jQuery("#favorite").click(function(){
			jQuery.Favorite();return false;
		});
		jQuery("#toploginlink").attr("href","https://passport.uuzu.com/login.php?rurl="+window.location);
		jQuery("#loginForm").login({
	    	url:"/src/ajax.php"
	    });
		jQuery(".Moredluqu").login({
	    	url:"/src/ajax.php",
	    	username:"#username2",
			password:"#password2",
			logintype:0
	    });
		jQuery(".Moredluqu").hover(function(){},function(){
			jQuery(".dsishizu").hide();
		});
		jQuery("#logoutForm .cao_z2,#toplogoutForm .dlsl").logout({
	    	url:"/src/ajax.php"
	    });
		jQuery.initLogin();
		
		jQuery(".icon_gubi").bind("click",function(){
			jQuery("#Msg").hide();
			return false;
		});
		jQuery(".moregn").bind("click",function(){
			if(jQuery(".MapPostBar").css("display")!="block"){
				jQuery(".MapPostBar").show();
			}else{
				jQuery(".MapPostBar").hide();
			}
			return false;
		});
		jQuery("#toploginlink,.Moredluqu").NavPop({
			popPanel:".Moredluqu"
		});
		jQuery(".moregn").hover(function(){
			jQuery(".MapPostBar").show();
		},function(){});
		jQuery(".MapPostBar").NavPop({
			popPanel:".MapPostBar"
		});
		var date = new Date();
		// '今天是：' + date.getFullYear() + '年' + date.getMonth() + '月' +
		// date.getDate() + '日 ';
		jQuery("#MapTops").html("今天是" + date.getFullYear() + "年" + (date.getMonth()+1) + "月" + date.getDate() + "日 ，欢迎来到游族！");
	},
	index:function() {
		uuzu.global();
		// 获取大眼睛广告信息
		jQuery.ajax({
			url:"http://pic.uuzu.com/vda_images/internal_7/internal_7.js?ff10051801",
			type:"get",
			dataType:"Script",
			success:function(data) {
				var html="";
				for(var i=0;i<arrSlidePic.length;i++) {
					html+='<li style="display:none;"><a title="'+arrSlidePic[i][2]+'" href="'+arrSlidePic[i][1]+'"><img src="http://pic.uuzu.com/vda_images/'+arrSlidePic[i][0]+'" width="432" height="390" border="0" /></a></li>';
				}
				jQuery(".dyj_picqu").html(html);
				jQuery("#hotimage").TopHotImage({
					speed : 500,
					timer : 4000
				});
			}
		});
		jQuery(".wanjiabGroup").BbsMenu();
		jQuery(".htd").Action();
		jQuery(".mmshowbar").ImageList({
			next: ".rightPost",
	        prev: ".leftPost",
	        frame: ".mmshowzu",
	        child: "li",
	        auto: true,
	        width : 150
		});
		jQuery("#links").bind("click",function(){
			if(jQuery("#morelinks").css("display")!="block"){
				jQuery("#morelinks").show();
			}else{
				jQuery("#morelinks").hide();
			}
			return false;
		});
	},
	game:function() {
		uuzu.global();
	},
	activity:function() {
		uuzu.global();
		jQuery("a",jQuery(".pagenumQu")).addClass("pashu");
		jQuery("a:eq("+jQuery(".pagenumQu").attr("rel")+")",jQuery(".pagenumQu")).removeClass("pashu");
		jQuery("a:eq("+jQuery(".pagenumQu").attr("rel")+")",jQuery(".pagenumQu")).addClass("pacurrent");
		
		l();
		function l() {
			var url="/uactivity.php?cat_type="+jQuery("#cat_type").val()+"&web_type="+jQuery("#web_type").val()
			jQuery.ajax({
				url:url,
				type:"get",
				success:function(data) {
					jQuery(".kaifubiaoBar").html(data);
					jQuery("#cat_type,#web_type").bind("change",function(){
						l();
					});
					c();
				}
			});
		}
		
		function c() {
			jQuery("a",jQuery(".kaifudate_biao")).click(function(){
				return false;
			});
			jQuery("a",jQuery(".kaifudate_biao")).hover(function(e){
				var url="/uactivitylist.php?web_type="+jQuery("#web_type").val()+"&date="+jQuery(this).attr("rel");
				var top =jQuery(this).offset().top-40;
				var left=jQuery(this).offset().left+95;
				var tleft=jQuery(".kaifudate_biao").position().left;
				jQuery.ajax({
					url:url,
					type:"get",
					error:function() {
					},
					success:function(data) {
						jQuery("#kaifuMsg").html(data);
						if(left-tleft>389){
							jQuery("#kaifuMsg").removeClass("ShenfenPost_L");
							jQuery("#kaifuMsg").addClass("ShenfenPost_R");
							jQuery("#kaifuMsg").css({ 
								"top" :top + "px", 
								"left" :left-280-95  + "px"
							}); 
						}else {
							jQuery("#kaifuMsg").removeClass("ShenfenPost_R");
							jQuery("#kaifuMsg").addClass("ShenfenPost_L");
							jQuery("#kaifuMsg").css({ 
								"top" :top + "px", 
								"left" :left+ "px"
							}); 
						}
						jQuery("#kaifuMsg").show();
						
					}
				});
			},function(){
				jQuery("#kaifuMsg").hide();
			});
			
			jQuery("#kaifuMsg").hover(function(){
				jQuery("#kaifuMsg").show();
			},function(){
				jQuery("#kaifuMsg").hide();
			});
		}
		
	},
	info:function() {
		uuzu.global();
		jQuery("#infoshow").InfoImageShow({
			speed : 500,
			timer : 4000
		});
		jQuery(".zxztgroup").Tabs({
			className:"current",
			pdiv:".zuantiQu"
		});
		jQuery(".zxgonglvgroup").Tabs({
			className:"current",
			pdiv:".gonglueQu"
		});
		jQuery(".mvqzonebigzu").Tabs({
			className:"current",
			pdiv:".mvqzshowbar"
		});
	},
	infolist:function() {
		uuzu.global();
		jQuery("#cat_type,#web_type").bind("change",function(){
			window.location.href= "?cat_type="+jQuery("#cat_type").val()+"&web_type="+jQuery("#web_type").val();
		});
	},
	infoshow:function() {
		uuzu.global();
		jQuery(".leibie").share();
	},
	gallery:function() {
		uuzu.global();
		jQuery("#galleryshow").GalleryImageShow({
			speed : 500,
			timer : 4000
		});
		
	},
	gallerylist:function() {
		uuzu.global();
		jQuery("#cat_type,#web_type").bind("change",function(){
			window.location.href= "?cat_type="+jQuery("#cat_type").val()+"&web_type="+jQuery("#web_type").val();
		});
	},
	galleryshow:function() {
		uuzu.global();
		jQuery(".bagsshowZu").ImageList({
			next: ".rightPost",
	        prev: ".leftPost",
	        frame: ".mmshowzu",
	        child: "li",
	        auto: true,
	        width : 150
		});
		
		jQuery(".TKshowBar").galleryshow();
	}
};
(function(jQuery){
	jQuery.extend({
		Favorite:function(o) {
			o = jQuery.extend({
				webUrl : "http://www.uuzu.com",
				webName : "游族官网"
	    	}, o);
			if(jQuery.browser.msie) {
				window.external.AddFavorite(o.webUrl,o.webName);
			}else if(jQuery.browser.safari){
				 window.sidebar.addPanel(o.webName, o.webUrl, "");
			}else if(jQuery.browser.mozilla){
			}else if(jQuery.browser.opera) {
			}else {
			}
			return false;
		},
		HomePage:function(o) {
			o = jQuery.extend({
				webUrl : "http://www.uuzu.com",
				webName : "游族官网"
	    	}, o);
			if(jQuery.browser.msie) {
				document.body.style.behavior = 'url(#default#homepage)';
	            document.body.setHomePage(window.location.href);
			}else if(jQuery.browser.safari){
				window.sidebar.addPanel(o.webName, o.webUrl, "");
			}else if(jQuery.browser.mozilla){
			}else if(jQuery.browser.opera) {
			}else {
			}
			return false;
		}
	});
	jQuery.fn.extend({
		share:function(o) {
			o = jQuery.extend({
				url:window.location,
				title:encodeURIComponent(document.title),
				height:200,
				width:200,
				toolbar:"no",
				menubar:"no",
				scrollbars:"no",
				resizable:"no",
				location:"no",
				status:"no"
			}, o);
			jQuery("a",jQuery(this)).each(function(){
				jQuery(this).bind("click",function(){
					var url="";
					switch(jQuery(this).attr("rel")) {
					case "sl":
						url="http://service.weibo.com/share/share.php?url="+o.url+"&appkey=&title=&pic=&ralateUid=2150092351";
						break;
					case "rr":
						url="http://share.renren.com/share/buttonshare.do?link="+o.url+"&title="+o.title;
						break;
					case "kx":
						url="http://www.kaixin001.com/repaste/share.php?rtitle="+o.title+"&rurl="+o.url+"&rcontent="+o.title;
						break;
					case "qb":
						url="http://v.t.qq.com/share/share.php?title="+o.title+"&url="+o.url+"&appkey=&site=&pic=";
						break;
					case "db":
						url="http://www.douban.com/recommend/?url="+o.url+"&title="+o.title;
						break;
					case "qz":
						url="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+o.url;
						break;
					default:
							break;
					}
					window.open(url,"游族", "height=500, width=600");
					return false;
				});
			});
		},
		// 天气获取
		weather : function(o) {
			o = jQuery.extend({
				cityid : "101020100"
			}, o);
			var showDiv=jQuery(this);
			var html=jQuery.Cookie("uuzu_WEATHER");
			if(html!=null) {
				showDiv.html(html);
				return;
			}
			var url="http://61.4.185.48:81/g/";// "/src/weather.php?type=ip";
			jQuery.ajax({
				url:url,
				type:"get",
				dataType:"Script",
				error:function() {
					
				},
				success:function(data) {
					o.cityid=id;
					var url="/src/weather.php?cityid="+o.cityid;
					jQuery.ajax({
						url:url,
						type:"get",
						dataType:"JSON",
						error:function(data) {
							showDiv.html("ERROR");
						},
						success:function(data) {
							var a=data.weatherinfo["temp1"].split("~");
							if(a[0]>a[1]) {
								var b=a[0];
								a[0]=a[1];
								a[1]=b;
							}
							data.weatherinfo["temp1"]=a[0]+"~"+a[1];
							var html='<span class="w_city">'+data.weatherinfo["city"]+'</span>\
								<span class="w_tubiao"><img src="http://pic.uuzu.com/uuzu_new/images/weather/s_a'+data.weatherinfo["img1"]+'.jpg" alt="'+data.weatherinfo["weather1"]+'" /></span>\
								<span class="w_wendu">'+data.weatherinfo["temp1"]+'</span>\
								<span class="w_tianq">'+data.weatherinfo["weather1"]+'</span>';
							jQuery.Cookie("uuzu_WEATHER", html,{ path: '/', expires: 0,domain:'uuzu.com' });
							showDiv.html(html);
						}
					});
				}
			});
		},
		// 首页焦点文字滚动特效
		TopHotText:function(o) {
			o = jQuery.extend({
	        	speed : "normal",
				line : 2,
				timer : 1000
	    	}, o);
			return this.each(function() {
				var ul = jQuery( "ul:eq(0)", jQuery(this) );
				var timerID;
				var li = ul.children();
				var liHight=jQuery(li[0]).height();
				var upHeight=0-o.line*liHight;
				var scrollUp=function(){
					ul.animate({marginTop:upHeight},o.speed,function(){
						for(i=0;i<o.line;i++){
							 ul.find("li:first").appendTo(ul);
		                }
		               	ul.css({marginTop:0});
					});
				};
				var autoPlay=function(){
					timerID = window.setInterval(scrollUp,o.timer);
				};
				var autoStop = function(){
		            window.clearInterval(timerID);
		        };
				ul.hover(autoStop,autoPlay).mouseout();
	    	});
		},
		// 首页焦点图片特效
		TopHotImage:function(o) {
			o = jQuery.extend({
	        	speed : "normal",
				timer : 1000
	    	}, o);
			return this.each(function(){
				var currentImage;
				var currentIndex = -1;
				var interval;
				var timerID;
				var currDiv=jQuery(this);
				function showImage(index) {
					jQuery('.dyj_picqu li:eq('+currentIndex+')',currDiv).hide(); 
				    jQuery('.dyj_picqu li:eq('+index+')',currDiv).fadeTo(o.speed,1); 
				    jQuery('.dyj_nmuqu li',currDiv).removeClass('current');
				    jQuery('.dyj_nmuqu li:eq('+index+')',currDiv).addClass('current');
				    jQuery(".dyj_jiaodian li:first").html("<a title=\""+jQuery('.dyj_picqu li:eq('+index+') a',currDiv).attr("title")+"\" href=\""+jQuery('.dyj_picqu li:eq('+index+') a',currDiv).attr("href")+"\">"+jQuery('.dyj_picqu li:eq('+index+') a',currDiv).attr("title")+"</a>");
				    currentIndex=index;
				}
				function showNext(){
				    var len = jQuery(".dyj_nmuqu li",currDiv).length;
				    var next = currentIndex < (len-1) ? currentIndex + 1 : 0;
				    showImage(next);
				}
				showNext();
				timerID = setInterval(showNext, o.timer);
				jQuery('.dyj_nmuqu li',jQuery(this)).hover(function(){
					clearInterval(timerID);
			    	var count = jQuery(this).attr('rel');
			    	showImage(parseInt(count)-1);
			    },function(){
			    	timerID = setInterval(showNext, o.timer);
			    });
				jQuery('.dyj_picqu li',jQuery(this)).hover(function(){
					clearInterval(timerID);
			    },function(){
			    	timerID = setInterval(showNext, o.timer);
			    });
			});
		},
		
		// 首页论坛鼠标特效
		BbsMenu:function(o){
			o=jQuery.extend({
			},o||{});
			var BbsList=this;
			return this.hover(function(){
				jQuery(BbsList).each(function() {
					jQuery(this).find("div:eq(1)").removeClass("zuozexinsi");
					jQuery(this).find("div:eq(1)").addClass("zuozexinsi_none");
				});
				jQuery(this).find("div:eq(1)").removeClass("zuozexinsi_none");
				jQuery(this).find("div:eq(1)").toggleClass("zuozexinsi");
			},function(){
				
			});
		},
		
		// /首页最新活动效果
		Action:function(o) {
			o=jQuery.extend({
			},o||{});
			var ActonList=this;
			return this.hover(function(){
				if(jQuery(this).find("div").css("display")!="block"){
					jQuery(ActonList).each(function() {
						jQuery(this).find("h2").show();
						jQuery(this).find("div").hide();
					});
					jQuery(this).find("h2").hide();
					jQuery(this).find("div").fadeTo(500,1); 
				}
				
			},function(){
				
			});
		},
		ImageList:function(o) {
			o=jQuery.extend({
				next : "buttonNext",
				prev : "buttonPrev",
				frame : "viewerFrame",
				width : 120,
				child : "li",
				auto : true
			},o||{});
			var _btnNext = jQuery(o.next);
			var _btnPrev = jQuery(o.prev);
			var _imgFrame = jQuery(o.frame);
			var _width = o.width;
			var _child = o.child;
			var _auto = o.auto;
			var _itv;
			var turnLeft = function() {
				_btnPrev.unbind("click", turnLeft);
				if (_auto)
					autoStop();
				_imgFrame.animate({
					marginLeft : -_width
				}, 'fast', '', function() {
					_imgFrame.find(_child + ":first").appendTo(_imgFrame);
					_imgFrame.css("marginLeft", 0);
					_btnPrev.bind("click", turnLeft);
					if (_auto)
						autoPlay();
				});
			};

			var turnRight = function() {
				_btnNext.unbind("click", turnRight);
				if (_auto)
					autoStop();
				_imgFrame.find(_child + ":last").clone().show().prependTo(_imgFrame);
				_imgFrame.css("marginLeft", -_width);
				_imgFrame.animate({
					marginLeft : 0
				}, 'fast', '', function() {
					_imgFrame.find(_child + ":last").remove();
					_btnNext.bind("click", turnRight);
					if (_auto)
						autoPlay();
				});
			};

			_btnNext.css("cursor", "hand").click(turnRight);
			_btnPrev.css("cursor", "hand").click(turnLeft);

			var autoPlay = function() {
				_itv = window.setInterval(turnLeft, 3000);
			};
			var autoStop = function() {
				window.clearInterval(_itv);
			};
			if (_auto)
				autoPlay();
		},
		
		InfoImageShow:function(o) {
			o=jQuery.extend({
				speed : "normal",
				timer : 1000
			},o||{});
			return this.each(function(){
				var currentImage;
				var currentIndex = -1;
				var interval;
				var timerID;
				var currDiv=jQuery(this);
				function showImage(index) {
					jQuery('.sylhBigtuzu li:eq('+currentIndex+')',currDiv).hide(); 
				    jQuery('.sylhBigtuzu li:eq('+index+')',currDiv).fadeTo(o.speed,1); 
				    jQuery('.Xiaotushowzu li',currDiv).removeClass('current');
				    jQuery('.Xiaotushowzu li:eq('+index+')',currDiv).addClass('current');
				    currentIndex=index;
				}
				function showNext(){
				    var len = jQuery(".Xiaotushowzu li",currDiv).length;
				    var next = currentIndex < (len-1) ? currentIndex + 1 : 0;
				    showImage(next);
				}
				function showPriv(){
				    var len = jQuery(".Xiaotushowzu li",currDiv).length;
				    var priv = currentIndex > 0 ? currentIndex - 1 : len-1;
				    showImage(priv);
				}
				showNext();
				timerID = setInterval(showNext, o.timer);
				jQuery('.Xiaotushowzu li',jQuery(this)).click(function(){
			    	var count = jQuery(this).attr('rel');
			    	showImage(parseInt(count)-1);
			    	return false;
			    });
				jQuery('.leftPost',jQuery(this)).click(function(){
					showPriv();
					return false;
			    });
				jQuery('.rightPost',jQuery(this)).click(function(){
					showNext();
					return false;
			    });
				jQuery('.sylhBigtuzu li,.Xiaotushowzu li,.rightPost,.leftPost',jQuery(this)).hover(function(){
					clearInterval(timerID);
			    },function(){
			    	timerID = setInterval(showNext, o.timer);
			    });
			});
		},
		GalleryImageShow:function(o) {
			o=jQuery.extend({
				speed : "normal",
				timer : 1000
			},o||{});
			return this.each(function(){
				var currentImage;
				var currentIndex = -1;
				var interval;
				var timerID;
				var currDiv=jQuery(this);
				function showImage(index) {
					jQuery('.sylhBigtuzu li:eq('+currentIndex+')',currDiv).hide(); 
				    jQuery('.sylhBigtuzu li:eq('+index+')',currDiv).fadeTo(o.speed,1); 
				    jQuery('.Xiaotushowzu li',currDiv).removeClass('stu_1cur');
				    jQuery('.Xiaotushowzu li:eq('+index+')',currDiv).addClass('stu_1cur');
				    currentIndex=index;
				}
				function showNext(){
				    var len = jQuery(".Xiaotushowzu li",currDiv).length;
				    var next = currentIndex < (len-1) ? currentIndex + 1 : 0;
				    showImage(next);
				}
				function showPriv(){
				    var len = jQuery(".Xiaotushowzu li",currDiv).length;
				    var priv = currentIndex > 0 ? currentIndex - 1 : len-1;
				    showImage(priv);
				}
				showNext();
				timerID = setInterval(showNext, o.timer);
				jQuery('.Xiaotushowzu li',jQuery(this)).click(function(){
			    	var count = jQuery(this).attr('rel');
			    	showImage(parseInt(count)-1);
			    	return false;
			    });
				jQuery('.leftPost',jQuery(this)).click(function(){
					showPriv();
					return false;
			    });
				jQuery('.rightPost',jQuery(this)).click(function(){
					showNext();
					return false;
			    });
				jQuery('.sylhBigtuzu li,.Xiaotushowzu li',jQuery(this)).hover(function(){
					clearInterval(timerID);
			    },function(){
			    	timerID = setInterval(showNext, o.timer);
			    });
			});
		},
		galleryshow:function(o) {
			o=jQuery.extend({
				speed : "normal",
				timer : 1000,
				purl:jQuery(".tkSide_01 a").attr("href"),
				nurl:jQuery(".tkSide_02 a").attr("href")
			},o||{});
			return this.each(function(){
				var currentImage;
				var currentIndex = -1;
				var interval;
				var timerID;
				var currDiv=jQuery(this);
				function showImage(index) {
					var len = jQuery(".tkSidelhn li",currDiv).length;
					jQuery('.tkpic_tu li:eq('+currentIndex+')',currDiv).hide(); 
				    jQuery('.tkpic_tu li:eq('+index+')',currDiv).fadeTo(o.speed,1); 
				    jQuery('.tkSidelhn li',currDiv).removeClass('current');
				    if(index>0){
				    	if(index>currentIndex){
					    	jQuery(".tkSidelhn").animate({marginTop:-97*(index-1)},o.speed,function(){
					    		jQuery(".tkSidelhn").css("marginTop", -97*(index-1));
					    		jQuery('.tkSidelhn li:eq('+index+')',currDiv).addClass('current');
							});
					    	
					    } else {
					    	jQuery(".tkSidelhn").animate({marginTop:-97*(index-1)},o.speed,function(){
					    		jQuery('.tkSidelhn li:eq('+index+')',currDiv).addClass('current');
					    		jQuery(".tkSidelhn").css("marginTop", -97*(index-1));
							});
					    }
				    } else {
				    	jQuery('.tkSidelhn li:eq('+index+')',currDiv).addClass('current');
				    }
				    jQuery(".tkpic_jsbt",currDiv).html(jQuery('.tkSidelhn li:eq('+index+') a',currDiv).attr("title"));
				    currentIndex=index;
				}
				function showNext(){
				    var len = jQuery(".tkSidelhn li",currDiv).length;
				    if(currentIndex<len-1) {
				    	showImage(currentIndex+1);
				    } else {
				    	this.disabled=true;
				    	window.location.href=o.nurl;
				    }
				}
				function showPriv(){
				    var len = jQuery(".tkSidelhn li",currDiv).length;
				    // var priv = currentIndex > 0 ? currentIndex - 1 : len-1;
				    if(currentIndex>0) {
				    	showImage(currentIndex-1);
				    } else {
				    	this.disabled=true;
				    	window.location.href=o.purl;
				    }
				    
				}
				showNext();
				// timerID = setInterval(showNext, o.timer);
				jQuery('.tkSidelhn li',jQuery(this)).click(function(){
			    	var count = jQuery(this).attr('rel');
			    	showImage(parseInt(count)-1);
			    	return false;
			    });
				jQuery('.tubiaoqu_left,.picIcon_up,.tu_up',jQuery(this)).click(function(){
					showPriv();
					return false;
			    });
				jQuery('.tubiaoqu_right,.picIcon_next,.tu_next',jQuery(this)).click(function(){
					showNext();
					return false;
			    });
				jQuery(".tubiaoqu_left,.tubiaoqu_right",jQuery(this)).hover(function(){
					jQuery(".tubiaoqu_left").show();
			    	jQuery(".tubiaoqu_right").show();
			    },function(){
			    	
			    });
				jQuery('.tkpic_tu li',jQuery(this)).hover(function(){
					jQuery(".tubiaoqu_left").fadeTo(1000,0.8);
					jQuery(".tubiaoqu_right").fadeTo(1000,0.8);
			    },function(){
			    	jQuery(".tubiaoqu_left").hide();
			    	jQuery(".tubiaoqu_right").hide();
			    });
				
				jQuery(".picIcon_yuantu").click(function(){
					// url=jQuery('.tkSidelhn li:eq('+currentIndex+')
					// img',currDiv).attr("src");
					// var img=jQuery('.tkpic_tu li:eq('+currentIndex+')
					// img',currDiv).attr("src");
					var img = jQuery('.tkpic_tu li:eq('+currentIndex+') img',currDiv);
					var theimage = new Image();
					theimage.src = img.attr("src");
					window.open (img.attr("src"), "newwindow", "height="+(theimage.height+20)+", width="+(theimage.width+20)+", scrollbars=no, resizable=no");
					return false;
				});
			});
		},
		NavPop:function(o) {
			o=jQuery.extend({
				popPanel:null
			},o||{});
			return this.each(function(){
				var pop = jQuery(o.popPanel);
				jQuery(this).hover(function(){
					pop.show();
				},function(){
					pop.hide();
				});
			});
		},
		Tabs: function(o) {
			o=jQuery.extend({
				firstOn:0,
				className:"selected",
				eventName:"all",
				loadName:"加载中...",
				fadeIn:"normal",
				autoFade:false,
				autoFadeTime:3,
				pdiv:null
			},o||{});
			return this.each(function(){
				var target=jQuery(this),tabs=target.find("ul:eq(0) li");
				if(o.pdiv) {
					var div=jQuery(o.pdiv);
				} else {
					var div = target.children().not("ul,span");
				}
				
				function Tabs() {
					if(jQuery(this).hasClass(o.className)) {
						return false;
					}
					tabsShow(div,jQuery(this));
					return false;
				}
				
				function tabsShow(div,li,index) {
					div.stop(true,true).hide();
					if(typeof(index)=="number") {
						if (li.find("a").attr("rel")) 
							ajax(div, li);
	                    jQuery(div[index]).stop(true,true).fadeIn(o.fadeIn);
	                    tabs.stop(true, true).removeClass(o.className);
	                    jQuery(tabs[index]).stop(true, true).addClass(o.className);
					} else {
						var tabBody = div.filter(li.find("a").attr("href"));
	                    if (li.find("a").attr("rel")) ajax(div, li);
	                    tabBody.stop(true,true).fadeIn(o.fadeIn);
	                    tabs.stop(true, true).removeClass(o.className);
	                    li.stop(true, true).addClass(o.className);
					}
				}
				
				function ajax(div, li) {
	                var href = li.find("a").attr("href");
	                var rel = li.find("a").attr("rel");     // ajax请求url
	                var i = div.filter(href);                 // 当前div
	                if (rel) {                                      // 如果ajax请求url不为空，只ajax一次
	                    i.html(o.loadName);
	                    jQuery.ajax({
	                        url: rel,
	                        cache: false,
	                        success: function (html) {
	                            i.html(html);
	                        },
	                        error: function () {
	                            i.html('加载错误，请重试！');
	                        }
	                    });
	                    li.find("a").removeAttr("rel");  // 只ajax一次
	                }
	            }
				if (o.autoFade) {
	                var index = o.firstOn + 1;
	                setInterval(function () {
	                    if (index >= div.length) {
	                        index = 0;
	                    }
	                    tabsShow(div, jQuery(this), index++);
	                }, o.autoFadeTime * 1000);
	            }
				tabs.bind(o.eventName == 'all' ? 'click mouseover' : o.eventName, Tabs).filter(':first').trigger(o.eventName == 'all' ? 'click' : o.eventName);
			});
		}
	});
})(jQuery);

(function(jQuery){
	jQuery.extend({
		//获取jQuery_GET
		GET:function(name) {
			var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|jQuery)"); 
			var r = window.location.search.substr(1).match(reg); 
			if (r!=null) return unescape(r[2]); return null;
		},
		// Cookie扩展
		Cookie:function(name,value,options){
			if (typeof value != 'undefined') {
		        options = options || {};
		        if (value === null) {
		            value = '';
		            options.expires = -1;
		        }
		        var expires = '';
		        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
		            var date;
		            if (typeof options.expires == 'number') {
		                date = new Date();
		                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
		            } else {
		                date = options.expires;
		            }
		            expires = '; expires=' + date.toUTCString();
		        }
		        var path = options.path ? '; path=' + (options.path) : '';
		        var domain = options.domain ? '; domain=' + (options.domain) : '';
		        var secure = options.secure ? '; secure' : '';
		        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
		    } else {
		        var cookieValue = null;
		        if (document.cookie && document.cookie != '') {
		            var cookies = document.cookie.split(';');
		            for (var i = 0; i < cookies.length; i++) {
		                var cookie = jQuery.trim(cookies[i]);
		                if (cookie.substring(0, name.length + 1) == (name + '=')) {
		                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
		                    break;
		                }
		            }
		        }
		        return cookieValue;
		    }
		},
		// 代码安全扩展
		urlencode:function(str) {
			str = encodeURIComponent(str);
			str = str.replace(/\~/g, "%7E");
			str = str.replace(/\!/g, "%21");
			str = str.replace(/\*/g, "%2A");
			str = str.replace(/\(/g, "%28");
			str = str.replace(/\)/g, "%29");
			str = str.replace(/\'/g, "%27");
			return str;
		}
	});
})(jQuery);
(function(jQuery){
	jQuery.extend({
		initLogin:function(o) {
			o=jQuery.extend({
				loginForm:"#loginForm,#toploginForm",
				logoutForm:"#logoutForm,#toplogoutForm"
			},o||{});
			if(jQuery.Cookie("uuzu_UNICKNAME")) {
				jQuery(o.loginForm).hide();
		    	jQuery(o.logoutForm).show();
		    	jQuery.initUser();
		    	
			} else {
				jQuery(o.loginForm).show();
		    	jQuery(o.logoutForm).hide();
			}
		},
		getUserCard:function(url) {
			var date=new Date();
			jQuery.ajax({
				url:url+"?v="+date.getTime(),
				type:"get",
				error:function() {
				},
				success:function(data) {
					jQuery("#userCard0,#userCard1").html(data);
				}
			});
		},
		initUser:function() {
			jQuery.changeTimer("/src/timer.php");
			var level=jQuery.Cookie("uuzu_LEVEL");
			var timer=jQuery.Cookie("uuzu_TIMER");
			jQuery.getUserCard("/src/cards.php");
			
			if(level==null || timer==null) {
				jQuery.getLevelInfo("/src/timer.php");
			} else {
				jQuery.changeTimer("/src/timer.php");
				jQuery.uuzuLevel(level,timer);
			}
			jQuery("#userCard0").NavPop({
				popPanel:"#userCard0"
			});
			
			jQuery("#userCard1").NavPop({
				popPanel:"#userCard1"
			});
			jQuery(".user_name").click(function(){
				if(jQuery("#userCard0").css("display")=="block"){
					jQuery("#userCard0").fadeOut(250);
				} else {
					jQuery("#userCard0").fadeTo(500,1);
				}
				return false;
			});
			jQuery(".user_photo").click(function(){
				if(jQuery("#userCard1").css("display")=="block"){
					jQuery("#userCard1").fadeOut(250);
				} else {
					jQuery("#userCard1").fadeTo(500,1);
				}
				return false;
			});
			setInterval(function(){
				jQuery.changeTimer("/src/timer.php");
			},1000*60*5);
		},
		changeTimer:function(url) {
			if(jQuery.Cookie("uuzu_UAUTH")==null){
				jQuery.Cookie("uuzu_TIMER",null,{ path: '/', expires: -1,domain:'uuzu.com' });
				return null;
			} else {
				var date=new Date();
				jQuery.ajax({
					url:url+"?action=changetimer&v="+date.getTime(),
					type:"get",
					error:function() {},
					success:function(data) {
						jQuery.Cookie("uuzu_TIMER",data.time_temp,{ path: '/', expires: 0,domain:'uuzu.com' });
					}
				});
			}
		},
		getLevelInfo:function(url) {
			if(jQuery.Cookie("uuzu_UAUTH")==null){
				jQuery.Cookie("uuzu_LEVEL",null,{ path: '/', expires: -1,domain:'uuzu.com' });
				return null;
			} else {
				var date=new Date();
				jQuery.ajax({
					url:url+"?action=getLevelInfo&v="+date.getTime(),
					type:"get",
					dataType:"JSON",
					error:function() {
					},
					success:function(data) {
						jQuery.Cookie("uuzu_LEVEL",data.level,{ path: '/', expires: 0,domain:'uuzu.com' });
						jQuery.Cookie("uuzu_TIMER",data.time_temp,{ path: '/', expires: 0,domain:'uuzu.com' });
						jQuery.uuzuLevel(data.level,data.time_temp);
					}
				});
			}
		},
		uuzuLevel:function(level,time_temp) {
			var strHtml = "";
		    var step = level%10;
		    var grade = parseInt(level/10);
		    
		    for(var i=5;i>0;i--){
		        if(i == grade) {
		        	strHtml += '<img src="http://pic.uuzu.com/uuzu_new/images/icon/level/step'+step+'.gif"><img src="http://pic.uuzu.com/uuzu_new/images/icon/level/grade'+i+'.gif">';
		        } else if(i < grade){
		        	strHtml += '<img src="http://pic.uuzu.com/uuzu_new/images/icon/level/grade'+i+'.gif">';
		        } else{
		        	strHtml += '<img src="http://pic.uuzu.com/uuzu_new/images/icon/level/grade'+i+'uc.gif">';
		        }
		    }
		    if(grade == 0){
		     	strHtml += '<img src="http://pic.uuzu.com/uuzu_new/images/icon/level/step'+step+'.gif">';
		    }
		    var userPic = jQuery.Cookie("uuzu_USERPIC");
		    if(userPic==null||userPic=="") {
		    	userPic="http://pic.uuzu.com/uuzu_new/images/icon/head/default_small.gif";
		    } else {
		    	userPic=decodeURIComponent(userPic)
		    }
		    
		    var html='';
			html= '<p class="user_name"><a href="#" target="_self">'+jQuery.Cookie("uuzu_UNICKNAME")+'</a></p>';
		    html+= '<div id="userCard0" style="display:none;position: absolute;z-index: 333;top:25px;padding-left:65px;"></div>';
		    html+= '<div class="user_level"><span  class="level_num">Lv'+level+'</span><span title="等级:'+level+'" class="level_icon">'+strHtml+'</span></div>'
		    html+= '<p class="user_photo"><a target="_self" title="'+jQuery.Cookie("uuzu_UNICKNAME")+'" href="#"><img src="'+userPic+'" alt="'+jQuery.Cookie("uuzu_UNICKNAME")+'" width="48" height="48" border="0" /></a></p>';
		    html+='<div id="userCard1" style="display:none;position: absolute;z-index: 333;top:60px; padding-left:5px;"></div>';
		    jQuery(".mild",jQuery("#logoutForm")).html(html);
		    jQuery("#tun").html(jQuery.Cookie("uuzu_UNICKNAME"));
		    if(time_temp == "-1"){
	            jQuery(".onlinetime").html("两小时+");
	            return;
	        }else {
	        	var tmpTime = time_temp.split(":");
	 	        h = tmpTime[0];
	 	        i = tmpTime[1];
	 	        s = tmpTime[2];
	 	       function inittime() {
	 	    	  if(s>=59){
		 	            s =0;
		 	            i++;
		 	        } else{
		 	            s++;
		 	        }
		 	        
		 	        if(i>=59){
		 	            i = 0;
		 	            h++;
		 	        }
	
		 	        if(h>=2){
		 	        	jQuery(".onlinetime").html("两小时+");
		 	        } else{
		 	        	jQuery(".onlinetime").html(h+":"+(i<10?"0"+i:i)+":"+(s<10?"0"+s:s));
		 	        }
	 	       }
	 	      inittime();
	 	      	setInterval(inittime,1000);
	        }
		}
	});
	jQuery.fn.extend({
		login:function(o) {
			function error(data,type) {
				if(type==1) {
					jQuery("#Msgtext").html(data);
					jQuery("#Msg").show();
					setTimeout(function(){
						jQuery("#Msg").hide();
					},5000);
				} else {
					jQuery("#Msgtext2").html(data);
					jQuery(".dsishizu").show();
					setTimeout(function(){
						jQuery(".dsishizu").hide();
					},5000);
				}
			}
			function success(data,type) {
				if (objLogin.status == 1) {
					jQuery.Cookie("uuzu_UNICKNAME", objLogin.nickname,{ path: '/', expires: 0,domain:'uuzu.com' });
					jQuery.Cookie("uuzu_UAUTH", objLogin.uauth,{ path: '/', expires: 0,domain:'uuzu.com' });
					jQuery(".Moredluqu").hide();
					jQuery.initLogin();
					jQuery(o.password).val("");
				} else if (objLogin.status == 3) { // logout failed
					window.location.href = objLogin.url;
				} else if (objLogin.status == 0) {
					if (objLogin.message == '您输入的密码有误，请重试!') {
						jQuery(o.password).val("");
						jQuery(o.password).focus();
					} else if (objLogin.message == '无此通行证!') {
						jQuery(o.password).val("");
						jQuery(o.username).val("");
						jQuery(o.username).focus();		
					}
					error("<p class=\"warnjshi\"><img src=\"http://pic.uuzu.com/uuzu_new/images/layout/icon_warn.gif\" />登陆失败</p><p class=\"warntxt\">"+objLogin.message+"</p><p class=\"warntxt\">&nbsp;</p>",type);
				} else {
					
				}
			}
			o=jQuery.extend({
				username:"#username",
				usernameMsg:"<p class=\"warntxt\">请输入用户名！</p>",
				password:"#password",
				passwordMsg:"<p class=\"warntxt\">请输入密码！</p>",
				url:"#",
				type:"get",
				dataType:"script",
				timeout:10000,
				data:null,
				error:error,
				success:success,
				complete:null
			},o||{});
			
			jQuery(":submit",jQuery(this)).bind('click',function(e){
				var msg="<p class=\"warnjshi\"><img src=\"http://pic.uuzu.com/uuzu_new/images/layout/icon_warn.gif\" />请输入完整信息</p>",flag=0;
				if(jQuery(o.username).val()=="") {
					msg+=o.usernameMsg;
					flag=1;
				}
				if(jQuery(o.password).val()=="") {
					msg+=o.passwordMsg;
					flag=flag==1?1:2;
				}
				if(msg!="<p class=\"warnjshi\"><img src=\"http://pic.uuzu.com/uuzu_new/images/layout/icon_warn.gif\" />请输入完整信息</p>") {
					if(flag==1) {
						jQuery("#Msg").css({"top":"145px"})
						jQuery(o.username).focus();	
					}else if(flag==2){
						jQuery("#Msg").css({"top":"197px"})
						jQuery(o.password).focus();	
					}
					o.error(msg,o.logintype);
					return false;
				}
				
				var date=new Date();
				var params = "act=login&username=" + jQuery.urlencode(jQuery(o.username).val()) + "&password=" + jQuery.urlencode(jQuery(o.password).val());
				o.url+="?type=login&params=" + jQuery.urlencode(params) + "&time=" + date.getTime();
				jQuery.ajax({
					url:o.url,
					type:o.type,
					dataType:o.dataType,
					timeout:o.timeout,
					data:o.data,
					error:function() {
						o.error("新的错误！");
					},
					success:function(data) {
						if(objLogin.status == 1) {
							
						}else if(objLogin.status == 2) {
							
						}
						if(o.success){
							o.success(data,o.logintype);
						}
					},
					complete:function(data) {
						if(o.complete) {
							o.complete(data);
						}
					}
				});
		    	return false;
		    });
		},
		logout:function(o) {
			function error(data) {
				alert(data);
			}
			function success(data) {
				if (objLogin.status == 2) { // logout success
					jQuery.Cookie("uuzu_UNICKNAME", null,{ path: '/', expires: -1,domain:'uuzu.com' });
					jQuery.Cookie("uuzu_UAUTH", null,{ path: '/', expires: -1,domain:'uuzu.com' });
					jQuery.Cookie("uuzu_LEVEL",null,{ path: '/', expires: -1,domain:'uuzu.com' });
					jQuery.Cookie("uuzu_USERPIC",null,{ path: '/', expires: -1,domain:'uuzu.com' });
					jQuery.Cookie("uuzu_WEATHER",null,{ path: '/', expires: -1,domain:'uuzu.com' });
					jQuery.initLogin();
				}else if (objLogin.status == 3) { // logout failed
					window.location.href = objLogin.url;
				} else {
					
				}
			}
			o=jQuery.extend({
				url:"#",
				type:"get",
				dataType:"script",
				timeout:10000,
				data:null,
				error:error,
				success:success,
				complete:null
			},o||{});
			jQuery(this).bind("click",function(e){
				var msg="";
				if(jQuery(o.username).val()=="") {
					msg+=o.usernameMsg;
				}
				if(jQuery(o.password).val()=="") {
					msg+="\n"+o.passwordMsg;
				}
				if(msg!="") {
					o.error(msg);
					return false;
				}
				var params = "rurl=" + window.location;
				o.url+="?type=loginout&params=" + jQuery.urlencode(params);
				jQuery.ajax({
					url:o.url,
					type:o.type,
					dataType:o.dataType,
					timeout:o.timeout,
					data:o.data,
					error:function() {
						o.error("未知错误！");
					},
					success:function(data) {
						if(o.success){
							o.success(data);
						}
					},
					complete:function(data) {
						if(o.complete) {
							o.complete(data);
						}
					}
				});
		    	return false;
		    });
		}
	});
})(jQuery);


jQuery(function($){
	
	/**
	 * 浮动工具条
	 * @aliang
	 * 2011-10-21
	 */
	function flowBox(){

		var srcURL = 'http://pic.uuzu.com/common/images/flowbox/';

		var bodyWidth = 960;

		//invalid for 1024x? or the browser's width can not hold
		if(window.screen.width == 1024 || (bodyWidth + 62 + 11) > $(window).width()) return;

		var plinks = [
			{imgSrc:'caoact_03.gif', link:'https://passport.uuzu.com/member/register.php'},//平台注册
			{imgSrc:'caoact_05.gif', link:'#'},//领取礼包
			{imgSrc:'caoact_07.gif', link:'https://passport.uuzu.com/payment/alipay_bank.php'},//游戏充值
			{imgSrc:'caoact_09.gif', link:'http://bbs.uuzu.com/'},//游戏论坛
			{imgSrc:'caoact_11.gif', link:'http://cs.uuzu.com/myservice/myservice.php'},//常见问题
			{imgSrc:'caoact_13.gif', link:'https://passport.uuzu.com/member/my.php'},//完善资料
			{imgSrc:'caoact_15.gif', link:'http://www.uuzu.com/'}//返回首页
		];

		var $wrap = $('<div class="fudongQu" style="padding:0;width:62px;height:483px;background:url('+srcURL+'caoact_bg.gif) repeat-y;"></div>');
		var html = '<p class="fudot_top" style="padding:0 0 4px 0;margin:0;"><img src="'+srcURL+'caoact_top.gif" /></p>';
		
		$.each(plinks, function(i, obj){
			html += '<p style="padding:8px 0;margin:0;"><a href="'+obj.link+'"><img src="' + srcURL+obj.imgSrc + '" border="0" /></a></p>';
		});

		html += '<p class="fudot_end" style="padding:4px 0 0;margin:0;"><img style="vertical-align:bottom;" src="'+srcURL+'caoact_end.gif" border="0" /></p>';
		$wrap.append(html);
		
		$('body').append($wrap);

		if($.browser.msie && $.browser.version == '6.0'){
			$(window).scroll(function(){
				 reset();
			}).scroll();
		}else{
			$(window).resize(function(){
				resize();
			}).resize();
		}

		function resize(){
			var offsetTop = parseInt($(window).height() - $wrap.height()) - 5; //parseInt(($(window).height() - $wrap.height()) / 2);
			if(offsetTop < 0) offsetTop = 0;
			var offsetLeft = parseInt(($(window).width() - bodyWidth) / 2 - $wrap.width()) - 11;

			if(offsetLeft < 0) offsetLeft = 0;

			$wrap.css({
				'position': 'fixed',
				'top': offsetTop,
				'left': offsetLeft
			});
		}

		function reset(){
			var offsetTop = document.documentElement.scrollTop+document.documentElement.clientHeight - $wrap.height() - 5;
			if(offsetTop < 0) offsetTop = 0;
			var offsetLeft = parseInt(($(window).width() - bodyWidth) / 2 - $wrap.width()) - 11;

			if(offsetLeft < 0) offsetLeft = 0;

			$wrap.css({
				'position': 'absolute',
				'top': offsetTop,
				'left': offsetLeft
			});
		}

		return $wrap;
	}

	flowBox();
});
