点击任意链接弹窗(24小时只弹一次)

如何让人点击网页任何一个地方,首先进入广告页面? 下面的代码应该有用:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<head>
<title>点击任意链接弹窗24小时只弹一次_中国E盟 sem.org.cn</title>
<script language="javascript">
//写入COOKIE
function setCookie(name,value){
var Days = 1;
var exp = new Date();
exp.setTime(exp.getTime() + Days*24*60*60*1000);
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}
//读取COOKIE
function getCookie(name){
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
if(arr=document.cookie.match(reg)) return unescape(arr[2]);
else return null;
}

window.attachEvent("onload", function(){
if (getCookie("popWin")) return false;
var o = document.getElementsByTagName("a");
for (var i=0; i<o.length; i++){
    o[i].attachEvent("onclick", function(){
      if (!getCookie("popWin")){
        setCookie("popWin", "true");
        window.open("http://www.sem.org.cn/?baidu.com", "popWin", "toolbar=yes, menubar=yes,

scrollbars=yes, resizable=yes, location=yes, status=yes");
        window.focus();
        }
      });
    }
});
</script>
</head>
<body>
<a href="http://www.baidu.com">点击任意链接弹窗(24小时只弹一次)</a>
</span>
</div>
</body>
</html>