var tisshow=0;//0小窗口没有显示，1小窗口已显
function creatediv()
{            
    var msgw,msgh,bordercolor;
    msgw=407;//提示窗口的宽度
    msgh=266;//提示窗口的高度
    var sWidth,sHeight;
    if( top.location == self.location )
        doc = document;
    var docElement = doc.documentElement;
    sWidth=docElement.clientWidth;
    sHeight = docElement.clientHeight;
    if( docElement.scrollHeight > sHeight )
        sHeight = docElement.scrollHeight;
    var bgObj=document.createElement("div");
    bgObj.setAttribute('id','bgDiv');
    bgObj.style.position="absolute";
    bgObj.style.top="0";
    bgObj.style.left="0";
    bgObj.style.background="#CCCCCC";
    bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
    bgObj.style.opacity="0.6";
    bgObj.style.width=sWidth + "px";
    bgObj.style.height=sHeight + "px";
    bgObj.style.zIndex = "10000";
    document.body.appendChild(bgObj);
        
    var msgObj=document.createElement("div");
    msgObj.setAttribute("id","msgDiv");
    msgObj.setAttribute("align","left");
    msgObj.style.position = "absolute";
    msgObj.style.left = "50%";
    msgObj.style.background="#5487c0";
    msgObj.style.marginLeft = "-190px" ;  //窗口距离左边的距离
    msgObj.style.top = (document.documentElement.clientHeight/2+document.documentElement.scrollTop-200)+"px";    
	////窗口距离上边的距离
    msgObj.style.width = msgw + "px";
    msgObj.style.height =msgh + "px";
    msgObj.style.zIndex = "10001";
    msgObj.innerHTML = "<form id='formllg' name='formllg' method='get' action='other/login22.aspx'><table width='407' height='266' border='0' cellpadding='0' cellspacing='0' ><tr valign='top'><td height='266'><div class='dl_sclose'><a href='javascript:void(0);' onclick='delWinD();return false;' style='color:#FFFFFF;'>关闭</a></div><div class='ghy_ball'>用户名<input type='text' name='username22' id='username22' /></div><div class='ghy_ball'>密　码<input type='password' name='pwd22' id='pwd22' /></div><div class='gdx_butall'><div class='dx_but'> <input type='button' name='Submit3' class='dx_but' value='' onClick='javascript:fsllg(document.formllg);'/></button></div><div class='dx_but2g'><button onClick='javascript:fsllg2(document.formllg);'></button></div></div></td></tr></table></form>";
    document.body.appendChild(msgObj); 
}
function delWinD()
{
   document.getElementById("bgDiv").style.display="none";
   document.getElementById("msgDiv").style.display="none";
   tisshow=0;
}

function fsllg(obj) {
    if (document.getElementById("username22").value.length == 0) {
        document.getElementById("username22").focus();
        alert("用户名或密码不能为空!");
        return false;
    }
    else if (document.getElementById("pwd22").value.length == 0) {
        document.getElementById("pwd22").focus();
        alert("用户名或密码不能为空!");
        return false;
    }
    else {
        obj.submit();
    }
}

function fsllg2(obj) {
    location.href='/index.aspx';
}
function tshow()
{   
    tisshow=1;
    if(!document.getElementById("msgDiv"))//小窗口不存在
        creatediv();
    else
    {
        document.getElementById("bgDiv").style.display="";
        document.getElementById("msgDiv").style.display="";
        document.getElementById("msgDiv").style.top=(document.documentElement.clientHeight/2+document.documentElement.scrollTop-200)+"px";
		////窗口距离上边的距离
    }  
}
