// JavaScript Document

function $(o){ //获取对象 
if(typeof(o) == "string") 
return document.getElementById(o); 
return o; 
}

function show_login()
{
	$('bg').style.display='block';
	var h=screen.availHeight;
	$('bg').style.height = h+"px";
	var myWidth=document.body.clientWidth;
	var target=$('login_div');
	var cWidth=target.style.width;
	var divWidth=parseInt(cWidth);
	left =(myWidth - divWidth) / 2+"px";
	target.style.left=left;
	target.style.display='block';
}

function hidelogin(str)
{
	$("bg").style.display='none';
	$(str).style.display='none';
}

function checkPwd()
{
	var pwd1=document.forms['myform'].elements['pwd'].value;
	var pwdr=document.forms['myform'].elements['pwd2'].value;
	if(pwd1==pwdr) return true;
	else{
		alert ("两次密码不符，请重新输入！");
		return false;
	}
}

/*function checkAll()
{
	var oForm=document.forms['myform'];
	var pwd=document.getElementById('pwd');
	var pwd2=document.getElementById('pwd2');
	if(oForm.elements['name'].value=='' || oForm.elements['email'].value=='' || pwd.value=='' || pwd2.value=='' || chechPwd())
	{
		alert ("请填写完整表单！");
		return false;
	}else return true;
}*/

function dis_nav(a)
{
    var oLi=document.getElementById('nav_ul').getElementsByTagName('a');
    oLi.item(a).className="hover";
}

function change_tab(a,b)
{
    var str="ul_"+a;
    var atr="div_"+a;
    var oLi=document.getElementById(str).getElementsByTagName('li');
    var oDiv=document.getElementById(atr).getElementsByTagName('div');
    //alert(oDiv.item(b));
    for(i=0;i<oLi.length;i++)
    {
        if(i==b){
            oLi.item(b).className="active";
            oDiv.item(b).style.display="block";
        }else{
            oLi.item(i).className="";
            oDiv.item(i).style.display="none";
        }
    }
}