function openHelpWindow(url) { helpWindow = window.open(url,'helpwin','width=502,height=325,scrollbars=yes'); } function closeHelpWindow() { helpWindow.close(); } function redirect(url) { window.location.replace(url) } // From http://www.sitepoint.com/article/standards-compliant-world function externalLinks() { if (!document.getElementsByTagName) return; var anchors = document.getElementsByTagName("a"); for (var i=0; i < anchors.length; i++) { var anchor = anchors[i]; if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank"; } } // Provide a central way to make certain forms clickable only one time. singleClicker = { clicked : false, firstClickCheck : function() { if (this.clicked) { alert('You have already submitted this form. Click "Reset" or reload this page to be able to submit it again, or continue to wait for the results page to appear.'); return false; } else { this.clicked = true; return true; } }, reset : function() { this.clicked = false; } } // http://developer.mozilla.org/en/docs/Using_Firefox_1.5_caching : function onLoad() { // IE calls all of these functions every time a page is visited, either // by requesting it or by navigating to it with the back/forward // buttons. Firefox only calls onLoad() whenever it requests a page, not // when loading it via back/forward. externalLinks(); onPageShow(); } function onPageShow() { singleClicker.reset(); } window.onload = onLoad; window.onpageshow = onPageShow;