//jsjam-flatten: document //jsjam-keep: NID //jsjam-keep: PPID //jsjam-keep: PID //jsjam-keep: BC //jsjam-keep: js //jsjam-keep: show_navs //jsjam-keep: hide_navs //jsjam-keep: submitted //jsjam-keep: no_submit_guard //jsjam-keep: preventDefault //jsjam-keep: popup //jsjam-keep: autofocus function addHandler(target,eventName,handlerName) { if ( target.addEventListener ) { target.addEventListener(eventName, function(e){return target[handlerName](e);}, false); } else if ( target.attachEvent ) { target.attachEvent("on" + eventName, function(e){return target[handlerName](e);}); } else { var originalHandler = target["on" + eventName]; if ( originalHandler ) { target["on" + eventName] = function(e){originalHandler(e);return target[handlerName](e);}; } else { target["on" + eventName] = target[handlerName]; } } } // dynamically add nid=X&js=1&ppid=N to href function a_show_navs(e) { // disable all page submissions if (!this.no_submit_guard && (window.submitted++) && (window.submitted <= 3) && (this.href.indexOf("AMCBackHandler.html") == -1) ) { // If nid parameter exists, then alert, and return [BZ22862] if (this.href.indexOf("nid") > -1) { alert("Page already submitted"); if (e.preventDefault) e.preventDefault(); return false; }else{ // if it has no nid parameter, then the page is being accessed from // another menu element; may not need to alert. window.submitted=0; } } if (!this.no_navs) { if (this.href.search(new RegExp('([?&])nid=([^&]*)(&.*)?$'))==-1){ this.href += this.href.indexOf("?")==-1 ? "?nid="+NID : "&nid="+NID; } else if (RegExp.$2 != NID){ if ((this.href.search(new RegExp('([?&])jxid=([^&]*)(&.*)?$'))==-1) && (RegExp.$2 != 8) && (RegExp.$2 != 11)) { this.href = this.href.replace( new RegExp('([?&])(nid=([^&]*))((&).*)?$'), RegExp.$1 + 'nid=' + NID + RegExp.$4); } } if (this.href.search(new RegExp('[?&]ppid='))==-1) this.href += "&ppid="+PPID; if (this.href.search(new RegExp('[?&]pid='))==-1) this.href += "&pid="+PID; if (this.href.search(new RegExp('[?&]bc='))==-1) this.href += "&bc="+BC; this.href += "&js=1"; } return true; } // dynamically remove nid=X from href function a_hide_navs() { this.href = this.href.replace(new RegExp('([?&])(nid=([^&]*))(&.*)?$'), RegExp.$1 == "?" ? (RegExp.$4 == "&" ? "?" : "") : RegExp.$4); return true; } function a_popup(e, name, options) { this.no_submit_guard=true; window.open(this.href, name, options); if (e.preventDefault) e.preventDefault(); return false; } // dynamically enable nid/js form controls function form_show_navs(e) { // disable all page submissions if (!this.no_submit_guard && (window.submitted++) && (window.submitted <= 3)) { alert("Form already submitted"); if (e.preventDefault) e.preventDefault(); return false; } //for (var submit_i=0; submit_i tags var a_elems = document.getElementsByTagName("a"); for (var a_i=0; a_i tags for (var form_i=0; form_i