function List_show(id){
	obj1=eval("document.all.news_content"+id);
	for(i=1;i<3;i++){
	    obj2=eval("document.all.newZM"+i);
	    if(i==id){
		    obj2.background="images/new_t_10.jpg";
		}else{
		     obj2.background="";
		}
	}
	document.all.news_content.innerHTML=obj1.innerHTML;
}

function List_show1(id){
	obj11=eval("document.all.land_content"+id);
	for(i=1;i<3;i++){
	    obj21=eval("document.all.landZM");
	     obj211=eval("document.all.tdland_content");
	    if(i==id && id==1){
		    obj21.src="images/index_15-1.gif";
		    obj211.background="images/index_15-2.gif";
		}else if(i==id && id==2){
		     obj21.src="images/index_15-11.gif";
		      obj211.background="images/index_115-2.gif";
		}else{
		
		}
	}
	document.all.land_content.innerHTML=obj11.innerHTML;
}

function List_show2(id){
	obj12=eval("document.all.note_content"+id);
	for(i=1;i<4;i++){
	    obj22=eval("document.all.noteZM");
	    if(i==id && id==1){
		     obj22.src="images/sm1.jpg";
		}else if(i==id && id==2){
		     obj22.src="images/sm2.jpg";
		}else if(i==id && id==3){
		     obj22.src="images/sm3.jpg";
		}else{
		
		}
	}
	document.all.note_content.innerHTML=obj12.innerHTML;
}

function List_show3(id){
	obj12=eval("document.all.xxgk_content"+id);
	for(i=1;i<4;i++){
	    obj22=eval("document.all.xxgkZM");
	    if(i==id && id==1){
		     obj22.src="images/xx1.jpg";
		}else if(i==id && id==2){
		     obj22.src="images/xx2.jpg";
		}else if(i==id && id==3){
		     obj22.src="images/xx3.jpg";
		}else{
		
		}
	}
	document.all.xxgk_content.innerHTML=obj12.innerHTML;
}

function usersubmit(){
    var typesubmit=document.getElementById("typesubmit");
    if(typesubmit.value=="Email"){
    	var username=document.getElementById("usernamelogin");
		var userpassword=document.getElementById("userpasswordlogin");
		var userrand=document.getElementById("userrandlogin");
		if(username.value==""){
		   alert("Email不能为空");
		   return false;
		}
		if(userpassword.value==""){
		   alert("密码不能为空");
		   return false;
		}
		if(userrand.value==""){
		   alert("验证码不能为空");
		   return false;
		}
		mailform.saveUser.value ="";
		mailform.username.value = username.value;
		mailform.SecEx.value = "";
		var str = encode(userpassword.value, parseInt(mailform.picnum.value));
		mailform.pwhidden.value = str;
		mailform.submit();
		g("mask").style.display = "none";
        g("login").style.display = "none";
    }else{
        var username=document.getElementById("usernamelogin");
		var userpassword=document.getElementById("userpasswordlogin");
		var userrand=document.getElementById("userrandlogin");
		if(username.value==""){
		   alert("用户名或Email不能为空");
		   return false;
		}
		if(userpassword.value==""){
		   alert("密码不能为空");
		   return false;
		}
		if(userrand.value==""){
		   alert("验证码不能为空");
		   return false;
		}
		var url = "index.do?method=userLogin";
	    var sendcontent=encodeURI("username="+username.value+"&password="+userpassword.value+"&userrand="+userrand.value+"");
		ajaxRequest_submit(url, document.getElementById("userlogin"),sendcontent);
		setTimeout("hiddensubmit()", 1000);
	    }
	}

function hiddensubmit(){
	var login=document.getElementById("userloginok");
	if(login.innerText=="登陆成功"){
	   g("mask").style.display = "none";
       g("login").style.display = "none";
	    mailform.saveUser.value = "";
		mailform.SecEx.value = "";
		mailform.username.value = document.getElementById("mailusername").value;
		mailform.pwhidden.value = encode(document.getElementById("mailpassword").value, parseInt(mailform.picnum.value));
		document.getElementById("userloginimages").innerHTML='<img src="images/dlcg.jpg" width="205" height="56" border="0" usemap="#Map"> <map name="Map"><area shape="rect" coords="16,6,96,27" href="showcustom/custom.jsp" target="_blank"><area shape="rect" coords="106,6,180,27" href="javascript:managerLogin.submit();"><area shape="rect" coords="15,29,96,49" href="javascript:mailform.submit();"><area shape="rect" coords="106,29,180,49" href="close.jsp"></map>';
	    document.forms['loginformform'].username.value = document.getElementById("uploadusername").value;
		document.forms['loginformform'].password.value = document.getElementById("uploadpassword").value;
		document.forms['managerLogin'].name.value = document.getElementById("uploadusername").value;
		document.forms['managerLogin'].pwd.value = document.getElementById("uploadpassword").value;
	}else{
		
	}
}

function encode(datastr, bassnum) {
	var tempstr;
	var tchar;
	var newdata = "";

	for (var i = 0; i < datastr.length; i++)
	{
		tchar = 65535 + bassnum - datastr.charCodeAt(i);
		tchar = tchar.toString();

		while(tchar.length < 5)
		{
			tchar = "0" + tchar;
		}

		newdata = newdata + tchar;
	}

	return newdata;
}

function jccx_search(){
	var ywcxlx=document.getElementById("ywcxlx");
	var ywcxtdblggxmbh=document.getElementById("ywcxtdblggxmbh");
	var ywcxtdblggqlr=document.getElementById("ywcxtdblggqlr");
	if(ywcxlx.value==""){
	   alert("请选择查询类型");
	   return false;
	}
	if(ywcxtdblggxmbh.value==""){
	  alert("项目编号不能为空");
	  return false;
	}
	if(ywcxtdblggqlr.value==""){
	  alert("权利人不能为空");
	  return false;
	}
}
