diff options
Diffstat (limited to 'web/js.js')
-rw-r--r-- | web/js.js | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -40,19 +40,17 @@ YAHOO.util.Event.onContentReady('mapForm', function() { }); YAHOO.util.Event.onContentReady('email_alert', function() { - this.onclick = function() { - if (this.on) { + YAHOO.util.Event.addListener(this, 'click', function(e) { + YAHOO.util.Event.preventDefault(e); + if (YAHOO.util.Dom.getStyle('email_alert_box', 'display') == 'block') { YAHOO.util.Dom.setStyle('email_alert_box', 'display', 'none'); - this.on = false; } else { var pos = YAHOO.util.Dom.getXY(this); pos[0] -= 20; pos[1] += 20; YAHOO.util.Dom.setStyle('email_alert_box', 'display', 'block'); YAHOO.util.Dom.setXY('email_alert_box', pos); - this.on = true; } - return false; - } + }); }); // I love the global |