LexLuter,
...
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script language="JavaScript">
function LogIn(){
loggedin=false;
username="";
password="";
addnewusername="";
username=prompt("Name: Primer","");
//username=username.toLowerCase();
password=prompt("Password - Primer","");
//password=password.toLowerCase();
if (username=="Primer" && password=="Primer") {
loggedin=true;
//window.location="http://localhost/engine/messages/inbox";
}
if (username=="Primer2" && password=="Primer2") {
loggedin=true;
// window.location="ndex.html";
}
// и так далее...
if (loggedin==false) {
alert("Неверный пароль или имя пользователя!");
}
else remov()
}
</script>
<script>
jQuery.fn.center = function () {
var w = $(window);
this.css("position", "absolute");
this.css("top", (w.height() - this.height()) / 2 + w.scrollTop() + "px");
this.css("left", (w.width() - this.width()) / 2 + w.scrollLeft() + "px");
return this;
}
function creatOverlay() {
var docHeight = $(document).height();
$("<div id='overlay'><\/div>")
.appendTo("body")
.height(docHeight)
.css({
'opacity': 0.8,
'position': 'fixed',
'top': 0,
'left': 0,
'background-color': '#000000',
'width': '100%',
'z-index': 5000
})
//$(this).clone()
.appendTo("body").center().css({
'z-index': 5001
})
//.attr({ 'id': 'cln' })
LogIn()
}
function remov() {
$("#overlay, #cln").remove();
}
$(document).on({
"click": creatOverlay
}, "input")
//$(document).on({"click": remov}, "#overlay, #cln")
</script>
</head>
<body bgcolor="#923947">
<center>
<form>
<input type="button" value="Block This Page">
</form>
</center>
</body>
</html>