// JavaScript Document
function show_html(str)
{
//document.all.main.style.display='none';
var ran=Math.random();
var urls,heights;
urls="";

if(web_app_webname!=web_app_local) {urls="ref_web="+web_app_local;}
if(str=="reg"){heights=600; urls="http://"+web_app_webname+"/reg/reg.jsp?"+urls+"&"+ran;}
else if(str=="reg_room"){heights=420; urls="http://"+web_app_webname+"/room/reg_room.jsp?"+urls;}
else if(str=="reg_rooms"){heights=600; urls="http://"+web_app_webname+"/reg/reg.jsp?web_act=reg_room&"+urls;}
else if(str=="change_room"){heights=600; urls="http://"+web_app_webname+"/reg/reg.jsp?web_act=change_roomreg&"+urls;}
else if(str=="change_reg"){heights=600;urls="http://"+web_app_webname+"/reg/reg.jsp?web_act=change_reg&"+urls+"&"+ran;}
else if(str=="about_us"){heights=600;urls="/about_us.jsp";}
else if(str=="host_list"){heights=1200;urls="/host_list.html";}
else if(str=="goback"){document.all.web_action.height=0;document.all.main.style.display="";if(window.add_show_obj){add_show_obj.style.display='none';}return;}
else{return;}
	document.all.main.style.display="none";
	var ifm=document.all.web_action;
	//window.frames["web_action"];
	//if(!ifm){ifm=document.createElement("<iframe id='web_action' frameborder=0 marginheight=0 marginwidth=0 hspace=0 vspace=0 scrolling=auto "+urls+"></iframe>");appendChild(ifm);}
	if(ifm){if(heights>0){ifm.height=heights};ifm.src=urls;}
	//alert(ifm.height);
}
//更新验证码
function change_code()
{   
	var url=top.document.all.KeyCode.src;
	
	var num=url.indexOf('?',0);
	if(num>0) url=url.substring(0,num);   
	top.show_code.style.display='';
	top.document.all.CdKey.value='';
	top.document.all.KeyCode.src=url+"?temp="+Math.random();
	//alert(top.document.all.KeyCode.src);
	}
function check(forms)
{
var str,chk;
var urls,heights;
urls="";

var ran=Math.random();

if(web_app_webname!=web_app_local) {urls="ref_web="+web_app_local;}
//alert(urls);
	 with(forms)
	 {
		chk=msg_chk(chk_obj(user_name.value,"str",3,12),"用户名");
		if(!chk) {user_name.focus(); return false;}
		chk=msg_chk(chk_obj(passwd.value,"str",5,12),"密码");
		if(!chk) {passwd.focus(); return false;}
		chk=msg_chk(chk_obj(CdKey.value,"int",4,4),"验证码");
		if(!chk) {CdKey.focus(); return false;}
	  }
	  
	 
	  submit_data("web_action",forms,"http://"+web_app_webname+"/reg/reg.jsp?web_act=login&"+urls+"&"+ran);
	 return true;
	  // alert("http://"+web_app_webname+"/reg/reg.jsp?web_act=login&"+urls+"&"+ran);
 }
 function top_login(forms)
 
{
	if (check(forms)){ forms.submit();}
}
 function show_newsLid(table,id,menuid)
{
	window.top.location.href='/index.jsp?table='+table+'&web_act=newslist&id='+id+'&menuid='+menuid;
	
}
function show_newsid(table,id)
{
	go_url("/news/shownews.jsp?table="+table+"&id="+id,"new");
	
}

 