function get(tag){
	return document.getElementById(tag);
}

function ericreg(){
	var sH = document.body.scrollHeight; //窗口的高度
	var sW = document.body.scrollWidth; //窗口的宽度
	var width=160 , height=90; //设置div的大小
	var left=(sW-width)/2 , top=260; //设置div的位置

var str="";
// 整个div的大小和位子
str+="<div id='ericdiv1' style='z-index:1;background-color:white;position:absolute;border:2px solid #FA7F12;left:"+left+";top:"+top+";width:"+width+";height:"+height+";'>";
//--begin灰色top
str+="<div style='padding-bottom:2px;background-color:#FA7F12;width:100%;height:16px;color:white;'>";
// 灰色div的设置
str+=" <div style='float:left;height:16px;overflow:hidden;margin:0px;padding:4px 0px 0px 5px;width:"+(width-25)+";font-size:12px;'>温馨提示</div>";
// 灰色div右侧的按钮
 //str+=" <span style='width:14px;font-family:webdings;cursor:hand;'>0</span>"; 
str+=" <span style='width:14px;font-family:webdings;cursor:hand;' onclick='hide()'>r</span>";
str+="</div>";
//--end
 //--begin白色div
str+="<div style=' margin:10px 5px 10px 10px;word-break:break-all;'>";
// 白色div中的信息
str+="<table cellpadding='4' cellspacing='0' border='0' class='border' align=left>  <form method='post' name='form_pwd' action='/reg/index.asp'>    <tr class='tdbg' valign='top'>       <td colspan='2' align='left'>请选择注册类型：</td>    </tr>    <tr class='tdbg' valign='top'>       <td align='left'><input type='radio' name='type' value='T' checked>教员 <input type='radio' name='type' value='S'>学员</td>      <td align='left'><input name='g' type='image' id='g' src='/images/go.gif' border='0'></td>    </tr>  </form></table>";
str+="</div>";
//--end
 str+="</div>";
document.body.insertAdjacentHTML("afterBegin",str);
	//get('regxz').innerHTML = str;
	//alert("点到了");
}

//检查登录
function mlogin()
{
	if (m_login.userEricname.value.length==0||m_login.userEricname.value.length<3||m_login.userEricname.value.length>8) {alert("请输入用户名称，长度控制在4-8位！");m_login.userEricname.select();return false;}
	if (m_login.userEricname.value=="news"||m_login.userEricname.value=="product"||m_login.userEricname.value=="wwww") {alert("用户名非法，请重新输入！");m_login.userEricname.select();return false;}
	if (m_login.uuserPs.value.length==0) {alert("请输入密码！");m_login.uuserPs.select();return false;}
}

function ericlogin(){

	var sH = document.body.scrollHeight; //窗口的高度
	var sW = document.body.scrollWidth; //窗口的宽度
	var width=200 , height=90; //设置div的大小
	var left=(sW-width)/2 , top=260; //设置div的位置

var str="";
// 整个div的大小和位子
str+="<div id='ericdiv2' style='z-index:1;background-color:white;position:absolute;border:2px solid #FA7F12;left:"+left+";top:"+top+";width:"+width+";height:"+height+";'>";
//--begin灰色top
str+="<div style='padding-bottom:2px;background-color:#FA7F12;width:100%;height:16px;color:white;'>";
// 灰色div的设置
str+=" <div style='float:left;height:16px;overflow:hidden;margin:0px;padding:4px 0px 0px 5px;width:"+(width-25)+";font-size:12px;'>请选择登录类型：</div>";
// 灰色div右侧的按钮
 //str+=" <span style='width:14px;font-family:webdings;cursor:hand;'>0</span>"; 
str+=" <span style='width:14px;font-family:webdings;cursor:hand;' onclick='hides()'>r</span>";
str+="</div>";
//--end
 //--begin白色div
str+="<div style=' margin:10px 5px 10px 10px;word-break:break-all;'>";
// 白色div中的信息
str+="<table cellpadding='4' cellspacing='0' border='0' class='border' align=left><form method='post' name='m_login' action='/member/login.asp'  onsubmit='return mlogin();'><tr class='tdbg' valign='top'><td colspan='2' align='left'><input type='radio' name='type' value='T' checked>教员<input type='radio' name='type' value='S'>学员</td></tr><tr class='tdbg'><td align='left'>帐号</td><td align='left'><input name='userEricname' type='text' id='userEricname' class='input100'></td></tr><tr class='tdbg'><td align='left'>密码</td><td align='left'><input name='userPs' type='password' id='userPs' class='input100'></td></tr><tr class='tdbg'><td align='left'>&nbsp;</td> <td align='left'><input name='g' type='image' id='g2' src='/images/go.gif' border='0'></td></tr></form></table>";
str+="</div>";
//--end
 str+="</div>";
document.body.insertAdjacentHTML("afterBegin",str);
	//get('regxz').innerHTML = str;
	//alert("点到了");
}

function hide(){
	document.getElementById( "ericdiv1").style.display = "none";
}
function hides(){
	document.getElementById( "ericdiv2").style.display = "none";
}
