var tempid = 1;
function ShowHelp(id){
	if(tempid!=id){
		document.getElementById('h_'+id).style.display="inline";
		document.getElementById('help_'+id).style.display="inline";
		document.getElementById('h_'+tempid).style.display="none";
		document.getElementById('help_'+tempid).style.display="none";
		tempid=id;
	}
}
function GOTOSY(){
	window.location.href='http://12.34.com';
	
}
function closeRegister(){
	//alert('1');
	document.getElementById('door0').style.display="inline";
	document.getElementById('door1').style.display="none";
}
function register(){
	//alert('2');
	document.getElementById('register').style.display="";
}
function showWeekOrMon(id){
	switch(id){
		case 1:
			document.getElementById('rank_pic_1').style.display="inline";
			document.getElementById('rank_pic_2').style.display="none";
			document.getElementById('rank_1').style.display="inline";
			document.getElementById('rank_2').style.display="none";
			break;
		case 2:	
			document.getElementById('rank_1').style.display="none";
			document.getElementById('rank_2').style.display="inline";
			document.getElementById('rank_pic_1').style.display="none";
			document.getElementById('rank_pic_2').style.display="inline";
			break;
		}
	
}
function ShowJ(id){

	document.getElementById('b'+id+'1').style.display="none";
	document.getElementById('b'+id+'2').style.display="block";

}
function CloseJ(id){
	
	document.getElementById('b'+id+'1').style.display="block";
	document.getElementById('b'+id+'2').style.display="none";

}
function gotoHotRoomByUrl(url){
	var newwin = window.open("","","scrollbars=yes,resizeable=yes");
	if(document.all){
		newwin.moveTo(0,0);
		newwin.resizeTo(screen.width,screen.height);
	}
	newwin.location = url;
}
function gotoDT(){
	url='http://12.34.com/game/guest/hall-0-0.html';
	var newwin = window.open("","","scrollbars=yes,resizeable=yes");
	if(document.all){
		newwin.moveTo(0,0);
		newwin.resizeTo(screen.width,screen.height);
	}
	newwin.location = url;
}
function test(){
	document.getElementById('door0').style.display="none";
	document.getElementById('door').style.display="inline";
}
function register(){
	document.getElementById('door0').style.display="none";
	document.getElementById('door1').style.display="inline";
}
function Show_God(Tab_num) {
	document.getElementById("a_" + Tab_num ).style.display = "block";
}
function Show_Dea(Dab_num) {
	document.getElementById("a_" + Dab_num ).style.display = "none";
}
function getEle(name){
	return document.getElementById(name);
}
function legalLoginName(name){
    if(name.indexOf("\'") != -1 || name.indexOf("\"")!= -1){
        return false;
    }
    return true; 
}
function checkLoginNew(){
	var name = getEle('name').value;
	var pwd = getEle('pwd').value;
	//var oDOMWarningSpan = getEle('warnSpan');
	//用户名为空
	if(name == ''){
		alert('用户名不能为空');
		return false;
	}else if(pwd == ''){
		alert('密码不能为空');
		//oDOMWarningSpan.innerHTML = '密码不能为空';
		return false;
	}else if(!legalLoginName(name)){
		alert('用户名不合法');
		//oDOMWarningSpan.innerHTML = '用户名不合法';
		return false;
	}
	var form = document.getElementById('form1');
	form.submit();
	//oDOMWarningSpan.innerHTML = '';
	return true;
	
}
function gotoGame(url){
	//已经登录
	if(url != '') {
		winOpen(url);
	}else{
		alert('您当前尚未登陆，请在左上方登录后进入游戏');
		//location.reload(true);
	}
}
/**
 * 打开一个新的窗口
 */
function winOpen(url){
	var newwin = window.open("","","scrollbars=yes,resizeable=yes");
	if(document.all){
		newwin.moveTo(0,0);
		newwin.resizeTo(screen.width,screen.height);
	}
	newwin.location = url;
}

