<!DOCTYPE html>
<html>
<head>
<style>
#fillBackground {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #fff;
}
</style>
</head>
<body>
<div id="fillBackground">
<a id="enter_site" href="">Зайти</a><br/>
<a id="exit_site" href="">Не Зайти</a>
</div>
<div>Сомнительная инфа :)</div>
<script type="text/javascript">
var Cookie = {
set: function(name, value, expires, path, domain, secure) {
document.cookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
},
get: function(name) {
var prefix = name + "=";
var cookieStartIndex = document.cookie.indexOf(prefix);
if (cookieStartIndex == -1) return null;
var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length;
return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
},
del: function(name, path, domain) {
if ( this.get( name ) ) {
document.cookie = name + "=" +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
}
if ( Cookie.get("test") != "1" ) {
document.getElementById( 'fillBackground' ).style.display = 'block';
}
document.getElementById( 'enter_site' ).onclick = function() {
Cookie.set("test", "1");
document.getElementById( 'fillBackground' ).style.display = 'none';
return false;
}
document.getElementById( 'exit_site' ).onclick = function() {
location.href = "http://javascript.ru/";
return false;
}
</script>
</body>
</html>