
/**
*首页新闻选项卡
**/

 var swapNews = {
		swap:function (str){
			var liSyn = $("synthesize");
			var liNews = $("news");
			var liBull = $("bulletin");
			var liActi = $("activity");
			var liEdition = $("edition");

			var ulSyn = $("ulSynthesize");
			var ulNews  = $("ulNews");
			var ulBull = $("ulBulletin");
			var ulActi = $("ulActivity");
			var ulEdition = $("ulEdition");

			switch(str) {
				case "synthesize":
					liSyn.className = "Tag1on";
					liNews.className = "Tag2";
					liBull.className = "Tag3";
					liActi.className = "Tag4";
					liEdition.className = "Tag5";

					ulSyn.style.display = "";
					ulNews.style.display = "none";
					ulBull.style.display = "none";
					ulActi.style.display = "none";
					ulEdition.style.display = "none";
					break;
				case "news":
					liSyn.className = "Tag1";
					liNews.className = "Tag2on";
					liBull.className = "Tag3";
					liActi.className = "Tag4";
					liEdition.className = "Tag5";

					ulSyn.style.display = "none";
					ulNews.style.display = "";
					ulBull.style.display = "none";
					ulActi.style.display = "none";
					ulEdition.style.display = "none";
					break;
				case "bulletin":
					liSyn.className = "Tag1";
					liNews.className = "Tag2";
					liBull.className = "Tag3on";
					liActi.className = "Tag4";
					liEdition.className = "Tag5";

					ulSyn.style.display = "none";
					ulNews.style.display = "none";
					ulBull.style.display = "";
					ulActi.style.display = "none";
					ulEdition.style.display = "none";
					break;
				case "activity":
					liSyn.className = "Tag1";
					liNews.className = "Tag2";
					liBull.className = "Tag3";
					liActi.className = "Tag4on";
					liEdition.className = "Tag5";

					ulSyn.style.display = "none";
					ulNews.style.display = "none";
					ulBull.style.display = "none";
					ulActi.style.display = "";
					ulEdition.style.display = "none";
					break;
				case "edition":
					liSyn.className = "Tag1";
					liNews.className = "Tag2";
					liBull.className = "Tag3";
					liActi.className = "Tag4";
					liEdition.className = "Tag5on";

					ulSyn.style.display = "none";
					ulNews.style.display = "none";
					ulBull.style.display = "none";
					ulActi.style.display = "none";
					ulEdition.style.display = "";
					break;
				default:
					break;
			}
		}
 }


 /**
*首页论坛热帖选项卡
**/

 var swapForum = {
		swap:function (str){
			var liPlayer = $("player_hot");
			var liNew = $("new_psp");
			var liHigh = $("high_psp");
			var liConsortia = $("consortia_news");
			
			var ulPlayer = $("ulPlayer");
			var ulNew  = $("ulNew");
			var ulHigh = $("ulHigh");
			var ulConsortia = $("ulConsortia");

			switch(str) {
				case "player":
					liPlayer.className = "Tag1on";
					liNew.className = "Tag2";
					liHigh.className = "Tag3";
					liConsortia.className = "Tag4";

					ulPlayer.style.display = "";
					ulNew.style.display = "none";
					ulHigh.style.display = "none";
					ulConsortia.style.display = "none";
					break;
				case "new":
					liPlayer.className = "Tag1";
					liNew.className = "Tag2on";
					liHigh.className = "Tag3";
					liConsortia.className = "Tag4";

					ulPlayer.style.display = "none";
					ulNew.style.display = "";
					ulHigh.style.display = "none";
					ulConsortia.style.display = "none";
					break;
				case "high":
					liPlayer.className = "Tag1";
					liNew.className = "Tag2";
					liHigh.className = "Tag3on";
					liConsortia.className = "Tag4";

					ulPlayer.style.display = "none";
					ulNew.style.display = "none";
					ulHigh.style.display = "";
					ulConsortia.style.display = "none";
					break;
				case "consortia":
					liPlayer.className = "Tag1";
					liNew.className = "Tag2";
					liHigh.className = "Tag3";
					liConsortia.className = "Tag4on";

					ulPlayer.style.display = "none";
					ulNew.style.display = "none";
					ulHigh.style.display = "none";
					ulConsortia.style.display = "";
					break;
				default:
					break;
			}
		}
}

var swapGameQA = {
	swap:function (str){
		if (str == 'question') {
			$("question").innerHTML = '<img src="http://pic.uuzu.com/10_images/newNo1_on.gif" />';
			$("capture").innerHTML = '<img src="http://pic.uuzu.com/10_images/newNo2.gif" />';

			$("div_question").style.display = "";
			$("div_capture").style.display = "none";
		}
		else {
			$("capture").innerHTML = '<img src="http://pic.uuzu.com/10_images/newNo2_on.gif" />';
			$("question").innerHTML = '<img src="http://pic.uuzu.com/10_images/newNo1.gif" />';

			$("div_question").style.display = "none";
			$("div_capture").style.display = "";
		}
	}
}

/**页面用户登陆**/
var Login = {
	lUrl:window.location.href,
	checkFrm:function() {
		var errMsg = "";
		if(document.loginFrm.username.value == "" || document.loginFrm.username.value == "用户名") {
			errMsg += "请填写您的用户名!\n";
		}
		if(document.loginFrm.password1.value == "" ) {
			errMsg += "请填写您的密码!\n";
		}
	
		if(errMsg == "") {
			Cookie.set("tenusername",$("username").value);
			document.loginFrm.submit();
		} else {
			alert(errMsg);
		}
	},
	
	checkLogin:function() {
		var UNICKNAME = Cookie.get("uuzu_UNICKNAME");
		var tenusername = Cookie.get("tenusername");
		tenusername = tenusername==""?"用户名":tenusername;
		var html ="";
		if(typeof(UNICKNAME) != "undefined" && UNICKNAME != null && UNICKNAME != ""){
				  html = "<table width='210' align='center' border='0' cellspacing='0' cellpadding='0'>";
				  html+="<tr>";
				  html+="<td colspan='2' height='35' align='left' class='loginName' valign='top' style='padding-left:8px;'>"+UNICKNAME+"您好，欢迎登录！</td>";
				  html+="</tr>";
				  html+="<tr>";
				  html+="<td align='center'><a href='https://passport.uuzu.com/10/login.php?serv=t.10.uuzu.com' target='_blank' onfocus='blur();' class='enterGame'></a></td>";
				  html+="<td align='center'><a href='javascript:void(0);' onclick='Login.logout();return false;' onfocus='blur();' class='outerGame'></a></td>";
				  html+="</tr>";
				  html+="</table>";
				  
				  html +="<table width='210' border='0' cellspacing='0' cellpadding='0' align='center'>";
				  html +="<tr>";
				  html +="	<td align='left' height='70' valign='bottom'><button class='ActiveButton' onClick='window.open(\"https://passport.uuzu.com/10/login.php?serv=t.10.uuzu.com\", \"_blank\");'></button></td>";
				  html +="	<td align='right' valign='bottom'><button class='NewuserButton' onClick='window.open(\"http://bbs.uuzu.com/viewthread.php?tid=121764&extra=page%3D1\", \"_blank\");'></button></td>";
				  html +="</tr>";
				  html +="</table>";
		} else {
			html = "<form id='loginFrm' name='loginFrm' action='https://passport.uuzu.com/login.php' method='post' onsubmit='Login.checkFrm();return false;'>";
			html +="<input type='hidden' id='act' name='act' value='login'>";
			html +="	<input type='hidden' id='rurl' name='rurl' value='"+this.lUrl+"'>";
			html +="	<table width='195' border='0' cellspacing='0' cellpadding='0' align='center'>";
			html +="           <tr>";
			html +="             <td><input type='text' name='username' id='username' class='name' value='"+tenusername+"' onclick=\"if($(this).value=='用户名')$(this).value='';\" /></td>";
			html +="			 <td rowspan='2' valign='middle'><input type='submit' class='LoginButton' value='' tabindex='-1'></td>";
			html +="          </tr>";
			html +="         <tr>";
			html +="         <td><div id='myPas'><input type='text' name='password1' id='password1' class='code' value='密码' style='display:' onclick=\"$(this).value='';\" style='display:' onFocus='javascript:outTP1();' /></div></td>";
			html +="         </tr>";
			html +="		 <tr>";
			html +="			<td colspan='2' align='center' valign='bottom' height='20'><img src='http://pic.uuzu.com/10_images/LoginThree.gif' border='0' usemap='#Map' /></td>";
			html +="		 </tr>";
			html +="	</table>"; 
			html +="    </form>";

			html +="<table width='210' border='0' cellspacing='0' cellpadding='0' align='center'>";
			html +="<tr>";
			html +="	<td align='left' height='70' valign='bottom'><button class='RegisterButton' onclick='window.open(\"https://passport.uuzu.com/member/register.php\", \"_blank\");'></button></td>";
			html +="	<td align='right' valign='bottom'><button class='NewuserButton' onClick='window.open(\"http://bbs.uuzu.com/viewthread.php?tid=121764&extra=page%3D1\", \"_blank\");'></button></td>";
		    html +="</tr>";
		    html +="</table>";

		}
		document.write(html);
		if(tenusername != "用户名" && UNICKNAME == ''){
			$("password1").focus();
		}
	},
			
	logout:function(){
		window.location.href="https://passport.uuzu.com/logout.php?rurl=" + window.location;
	} 
}


function outTP1(){
	document.loginFrm.password1.style.display = "none";
	if(navigator.userAgent.indexOf("MSIE")>0) {
		input1 = document.createElement("<input type='password' name='password' id='password' class='code' style='display:'>");
	}
	else{
		input1 = document.createElement("input");
		input1.setAttribute("type", "password");
		input1.setAttribute("name", "password");
		input1.setAttribute("id", "password");
		input1.setAttribute("class", "code");
	}
	
	var div1 = document.getElementById('myPas');
	div1.appendChild(input1);
	document.loginFrm.password.focus();
}

//添加收藏加
function addfavorite(title,url) {
	if (window.sidebar) {
		window.sidebar.addPanel(title, url,"");
	} else if( document.all ) {
		window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
		return true;
	}
}

//收藏10年
function addFav(){
	addfavorite("十年","http://10.uuzu.com");
}

