myurl = "http://shipbrook.net/jeff/blog"; function BDNN_reloadPage(init) { // Brain-Dead Netscape Navigator (version 4). if (init==true) with (navigator) { if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.BDNN_pgW=innerWidth; document.BDNN_pgH=innerHeight; onresize=BDNN_reloadPage; } } else if (innerWidth!=document.BDNN_pgW || innerHeight!=document.BDNN_pgH) location.reload(); } function TogglePopups() { if (!document.userprefs) return; newstate = document.userprefs.popupcomments.checked; if (newstate) { regexp = /\/\?entry=(\d+)#comments$/; } else { regexp = /javascript:PopupComments\((\d+)\);/; } for (var i = 0; i < document.links.length; i++) { found = document.links[i].href.match(regexp); if (found) { oldhref = document.links[i].href; if (newstate) { document.links[i].href = "javascript:PopupComments(" + found[1] + ");"; document.links[i].target = "_self"; } else { document.links[i].href = myurl + "/?entry=" + found[1] + "#comments"; if (document.userprefs.newwindow.checked) { document.links[i].target = "_blank"; } else { document.links[i].target = "_self"; } } } } } function ToggleNewWindow() { if (!document.userprefs) return; newstate = document.userprefs.newwindow.checked; regexp = /javascript:PopupComments\(\d+\);/; for (var i = 0; i < document.links.length; i++) { found = (document.links[i].href.search(regexp) != -1); if (!found) { if (document.links[i].href.substr(0,myurl.length) == myurl) { found = 1; } } if (newstate) { if (!found) document.links[i].target = "_blank"; } else { document.links[i].target = "_self"; } } } function PopupComments( entryno ) { target = "?function=comments&entry="+entryno; window.open(target,'_blank','scrollbars=yes,resizable=yes,menubar=no,status=no,width=530,height=350'); } function EnforcePrefs() { TogglePopups(); ToggleNewWindow(); } BDNN_reloadPage(true);