// JavaScript Document
var dOpa = "50";
var offHeight;
var object;

function login(object2){
	object=object2;
	if(object=="reg"){document.all.tags("html")[0].className="hiddens"};
	offHeight = window.screen.height;
	var div = document.createElement("DIV");
	div.id = "errMsg";
	div.style.left = 0;
	div.style.top = 0;
	div.style.width=document.body.clientWidth;
	div.style.height = document.body.clientHeight;
	div.style.position = "absolute";
	div.style.display = "";
	div.style.zIndex = "999";
	div.style.filter = "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
	div.style.backgroundColor="#2A4A6B";
	document.body.appendChild(div);
	focusDiv();
	HideElement("SELECT");
}

function focusDiv(){
		var div = document.createElement("DIV");
	div.id = "loginForm";
	div.style.position = "absolute";
    div.onMouseDown="catchFlyBar()";
	div.onMouseUp="releaseFlyBar()";
	div.style.zIndex="1000";
	div.style.width = "692px";
	div.style.display = "none";
	div.innerHTML = getHtml();
	document.body.appendChild(div);
	var loginDiv = document.getElementById("loginForm");
	//alert(document.body.offsetWidth);
	loginDiv.style.left = (document.body.offsetWidth-692)/2;
	//loginDiv.style.top = (document.body.offsetHeight-361)/2 + document.body.scrollTop;
	loginDiv.style.top = 50;
	loginDiv.style.display = "block";
	
}

/*window.onload = function(){
	var div = document.createElement("DIV");
	div.id = "loginForm";
	div.style.position = "absolute";
    div.onMouseDown="catchFlyBar()";
	div.onMouseUp="releaseFlyBar()";
	div.style.zIndex="1000";
	div.style.height = "692px";
	div.style.display = "none";
	div.innerHTML = getHtml();
	document.body.appendChild(div);
}*/

function getHtmls(){
	var sHtml = "";
	sHtml += '<a href="javascript:hiddenFlashLoginWindow()">登陆</a>';
	return sHtml;
}
function getHtml(){
	var sHtml = "";
	var url="";
   switch(object){
   case "no_reg":
                url="no_reg.html";
				title="&nbsp;"
				break;
   case "reg":
                url="reg1.html";
				title="&nbsp;"
				break;
   case "reg_good":
                url="reg_good.html"
				title="<img src=\"images/reg_good_title.gif\" style=\"margin-left:250px;margin-top:20px\" id=\"reg_good_title\"  align=\"absmiddle\" >&nbsp;"
				break;
   case "diaocha":
                url="diaoc.html"
				title="&nbsp;"
				break;
   case "exam":
                url="exam.asp"
				title="&nbsp;"
				break;
   case "link":
                url="link_apply.asp"
				title="&nbsp;"
				break;
   default:
                url="reg1.html"
				title="&nbsp;"
   }
	//sHtml += '<div id="loginForm" style="position:absolute; z-index:1000; height: 364px;border:1px #666 solid; background-color:#666666;display:none">';
sHtml += '<table width="692" border="0" cellspacing="0" cellpadding="0"><tr>';
sHtml += '<td colspan="3"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="692" height="14">';
sHtml += '<param name="movie" value="images/top.swf" />';
sHtml += '<param name="quality" value="high" />';
sHtml += '<param name="wmode" value="transparent"/>';
sHtml += '<embed src="images/top.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="692" height="14"></embed>';
sHtml += '</object></td></tr><tr>';
sHtml += '<td width="13"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="13" height="463">';
sHtml += '<param name="movie" value="images/left.swf">';
sHtml += '<param name="quality" value="high">';
sHtml += '<param name="wmode" value="transparent">';
sHtml += '<embed src="images/left.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="13" height="463"></embed>';
sHtml += '</object></td>';
sHtml += '<td width="666" valign="top" background="images/11021.gif"><table width="100%" height="70" border="0" cellpadding="0" cellspacing="0" background="images/reg_main_top.gif">';
sHtml += '<tr><td>'+ title +'</td>';
sHtml += '<td width="30" valign="top" style="padding-top:5px"><table width="25"  border="0" cellspacing="0" cellpadding="0">';
sHtml += '<tr><td align="right"><img src="images/11024.gif" width="17" height="17" style="cursor:hand;" onclick="hiddenFlashLoginWindow();" /></td>';
sHtml += '</tr></table></td></tr></table>';
sHtml += '<table width="100%" height="372" border="0" cellpadding="0" cellspacing="0" background="images/reg_sub_bg.gif">';
sHtml += '<tr><td><iframe marginheight="0" marginwidth="0" height="372" width="666" frameborder="0" scrolling="no" src="'+ url +'" id="ifra"></iframe></td>';
sHtml += '</tr></table><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>';
sHtml += '<td><img src="images/reg_main_foot.gif" width="666" height="21" /></td></tr></table></td>';
sHtml += '<td width="13"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="13" height="463">';
sHtml += '<param name="movie" value="images/right.swf">';
sHtml += '<param name="quality" value="high">';
sHtml += '<param name="wmode" value="transparent"/>';
sHtml += '<embed src="images/right.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="13" height="463"></embed>';
sHtml += '</object></td></tr><tr>';
sHtml += '<td colspan="3"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="692" height="17">';
sHtml += '<param name="movie" value="images/foot.swf" />';
sHtml += '<param name="quality" value="high" />';
sHtml += '<param name="wmode" value="transparent"/>';
sHtml += '<embed src="images/foot.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="692" height="17"></embed>';
sHtml += '</object></td></tr></table>';
  // sHtml += '</div>';
	return sHtml;
}


function getNameAndPwd(userName ,pwd)
	{
		var errorMsg=""; 
		if( userName == "" )
		{
			errorMsg = "请输入您的用户名！";
		}

		else if( userName.length >32 )
		{
			errorMsg = "用户名不能超过32个字符";
		}

		else if(pwd =="")
		{
			errorMsg = "请输入登录密码";
		}

	    if( errorMsg != "" )
		{	
			document.all.Msg.innerHTML = errorMsg;
		}
		else
		{
			document.loginFrm.autologon(userName,pwd);
		}
	}


	//在flash里面显示错误信息
	/*function showErrorMsg( errorMsg )
	{
		document.all.Msg.innerHTML = errorMsg;
		document.all.username.value = "";
		document.all.password.value = "";
		
	}*/
	
	function openWindow()
	{
	  window.open("Forgetpasswd.asp","忘记密码","height=180,width=300,top=300,left=320,toolbar =no,menubar=no,scrollbars=no,resizable=no,location=no,scrollbars=no");
	}
	

	//隐藏flash登陆框
	function hiddenFlashLoginWindow()
	{
		    //设置flash的那个层为隐藏
		//document.all.username.value = "";
		//document.all.password.value = "";
		//document.all.Msg.innerHTML = "友情提示：<br>经常修改登录密码，在离开时别忘了退出。";
		var aa = document.getElementById("loginForm");
		var bb = document.getElementById("errMsg");
		function setDivToNone(){
			//aa.style.display = "none";
			document.body.removeChild(aa);
			document.body.removeChild(bb);
			document.all.tags("html")[0].className="shows";
			ShowElement("SELECT");
		}
		setDivToNone();
	}

	//显示帮组窗口
	function showHelpWindow()
	{

	}
	
//首页网站地图样式开始
function showLayer(){
	var obj = document.getElementById("siteMapDiv");
	obj.style.display="block";
	//aa.innerHTML=document.documentElement.scrollTop;
	//obj.style.top = document.body.offsetHeight + document.documentElement.scrollTop - 550;
	obj.style.left = document.body.offsetWidth / 2 -150;
}
function hideLayer(){
	var obj = document.getElementById("siteMapDiv");
	obj.style.display="none";
}
//隐藏网页元素
function HideElement(strElementTagName){
	try{
		for(i=0;i<window.document.all.tags(strElementTagName).length; i++){
			var objTemp = window.document.all.tags(strElementTagName)[i];
			objTemp.style.visibility = "hidden";
		}
	}catch(e){
		alert(e.message);
	}
}

function ShowElement(strElementTagName){
	try{
		for(i=0;i<window.document.all.tags(strElementTagName).length; i++){
			var objTemp = window.document.all.tags(strElementTagName)[i];
			objTemp.style.visibility = "visible";
		}
	}catch(e){
		alert(e.message);
	}
}