function G(id){
return document.getElementById(id);
};
function GC(t){
return document.createElement(t);
};
String.prototype.trim = function(){
return this.replace(/(^\s*)|(\s*$)/g, '');
};
function isIE(){
return (document.all && window.ActiveXObject && !window.opera) ? true : false;
}
function cancelSign(){
G("sign_div").style.display = 'none';
G("cover_div").style.display = 'none';
document.body.style.overflow = '';
};
function popCoverDiv(){
if (G("cover_div")) {
G("cover_div").style.display = '';
} else {
var coverDiv = GC('div');
document.body.appendChild(coverDiv);
coverDiv.id = 'cover_div';
with(coverDiv.style) {
position = 'absolute';
background = '#CCCCCC';
left = '0px';
top = '0px';
var bodySize = getBodySize();
width = bodySize[0] + 'px'
height = bodySize[1] + 'px';
zIndex = 98;
if (isIE()) {
filter = "Alpha(Opacity=60)";
} else {
opacity = 0.6;
}
}
}
}
function getBodySize(){
var bodySize = [];
with(document.documentElement) {
bodySize[0] = (scrollWidth>clientWidth)?scrollWidth:clientWidth;
bodySize[1] = (scrollHeight>clientHeight)?scrollHeight:clientHeight;
}
return bodySize;
}
function popSign(az_id){
var loginDivWidth = 300;
var sign_in_flow = '<div style="background:#FF9900;">登陆</div><div>e-mail:</div><div>'
+ '<input type="text" id="sign_email" maxlength="64" size="30"/>'
+ '</div><div>password:</div><div><input type="password" id="sign_pwd" size="30"/>'
+ '</div><div><input type="button" value="login" id="sign_button"/> '
+ '<input type="button" value="cancel" onclick="cancelSign();"/></div>';
if (G("sign_div")) {
G("sign_div").style.display = '';
} else {
var signDiv = GC('div');
document.body.appendChild(signDiv);
signDiv.id = 'sign_div';
signDiv.align = "center";
with (signDiv.style) {
position = 'absolute';
left = (document.documentElement.clientWidth - loginDivWidth)/2 + 'px';
top = (document.documentElement.clientHeight - 300)/2 + 'px';
width = loginDivWidth + 'px';
zIndex = 99;
background = '#FFFFFF';
border = '#66CCFF solid 1px';
}
}
G("sign_div").innerHTML = sign_in_flow;
}
function popSignFlow(az_id) {
popCoverDiv();
popSign(az_id);
document.body.style.overflow = "hidden";
}
</script>
</head><body><div>
<input type="text" value="PHP学习网"/><p>
<input type="button" onclick="popSignFlow(6);" value="login"/>
<br>
<a href="
www.phpshao.cn">www.phpshao.cn</a><br>dsfk<br> sda fsda<br><br>sd<br><br>sd<br><br><br><br><br>
</p>
</div></body></html>