var isLogin = 0; if(!isLogin){ var submitlink =document.getElementById("wen_submit"); if(submitlink){ submitlink.onclick=function(e){ e=e||window.event; var tag = e.srcElement || e.target; openDialog("/max-dialogs/login.aspx",function(r){ location.replace(tag.href);}); return false; }; } }