замена алерта ... как раз висит 3 секунды и удаляется по клику ...
замечания принимаются )))
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script language="JavaScript" type="text/javascript">
function position(b) {
b = typeof b == "string" ? document.getElementById(b) : b;
var a = document.documentElement,
c = document.body,
e = self.pageXOffset || a && a.scrollLeft || c && c.scrollLeft || 0;
t = self.pageYOffset || a && a.scrollTop || c && c.scrollTop || 0;
var f = b.offsetHeight,
g = b.offsetWidth,
d = document.compatMode == "CSS1Compat" && !window.opera ? a.clientWidth : c.clientWidth;
a = document.compatMode == "CSS1Compat" && !window.opera ? a.clientHeight : c.clientHeight;
if (document.compatMode == "CSS1Compat" && window.opera) {
d = window.innerWidth;
a = window.innerHeight
}
b.style.left = Math.floor(e + (d - g) / 2) + "px";
b.style.top = Math.floor(t + (a - f) / 2) + "px"
};
window.alert = function (b) {
b = b.replace(/\n/gim, "<br />");
var a = document.createElement("div");
a.style.position = "absolute";
a.style.color = "#0000FF";
a.style.backgroundColor = "#FFFACD";
a.style.border = "1px solid #000";
a.style.padding = "0px 4px";
a.innerHTML = b;
document.onmousedown = function () {
a && document.body.removeChild(a);
c && window.clearTimeout(c);
document.onmousedown = null
};
document.body.appendChild(a);
position(a);
var c = window.setTimeout(function () {a && document.body.removeChild(a);document.onmousedown = null}, 3E3)
};
</script>
</head>
<body>
<a href="#" onclick="alert('замена алерта'); return 0">кликни</a>
</body>
</html>