User:Rein Of Terror/monobook.js

/**** MyWikiLinks * (c) Rein Of Terror */ function addBar { document.getElementById('p-navigation').innerHTML += ' '+ ' '+  ' my wiki links '+ ' '+ 'Titles'+ 'Armor'+ 'Builds'+ 'Greens</li>'+ '<a href=\"/wiki/Mission\">Missions</a></li>'+ '<a href=\"/wiki/Quest\">Quests</a></li>'+ '<a href=\"/wiki/Vanquishing\">Vanquishing</a></li>'+ '<a href=\"/wiki/Dungeon\">Dungeons</a></li>'+ '<a href=\"/wiki/Treasure\">Treasure</a></li>'+ '<a href=\"/wiki/Skill\">Skills</a></li>'+ '<a href=\"/wiki/Elite_skill\">Elite Skills</a></li>'+ '<a href=\"/wiki/List_of_elite_skills_by_capture_location\"> - Location </a>'+ '<a href=\"/wiki/List_of_elite_skills_by_campaign\"> - Campaign </a>'+ '<a href=\"/wiki/List_of_elite_skills\"> - List </a>'+ '<a href=\"/wiki/List_of_common_skills\">Common Skills</a></li>'+ '</ul> '; } //Close addBar addOnloadHook(addBar); //Call addBar on load

/* =========================================================== *\ ** SkillCheck install file. ** ** Copyright (c) Alex Barley <ale_jrb> 2008. ** ** All rights are reserved. ** ** For help with this script, visit                           ** **          User:Ale_jrb/Scripts/SkillCheck                   ** \* =========================================================== */ addScript('User:Ale jrb/Scripts/SkillCheck/skillcheck.js'); /* =========================================================== *\ ** If you are seeing this because you are uninstalling this   ** ** script, I'd love to know why. Let me know how it can be    ** ** improved at User_talk:Ale_jrb. ** \* =========================================================== */

/**** Guild Wars Wiki Tools * (c) 2007 by Patrick Westerhoff [poke] */ var head = document.getElementsByTagName( 'head' )[0]; head.appendChild( document.createElement( 'script' ) ); head.lastChild.src = '/index.php?title=User:Poke/GuildWarsWikiTools.js&action=raw&ctype=text/javascript'; head.lastChild.type = 'text/javascript';

// GuildWatch - by User:Ale_jrb

// Begin options --

var enableimgmove = true;

// End options

function importScript(page, lang) { var url = wgScriptPath + '/index.php?title=' + encodeURIComponent(page.replace(' ','_')) + '&action=raw&ctype=text/javascript&dontcountme=s'; if (lang) url = 'http://' + lang + '.wikipedia.org' + url; var s = document.createElement('script'); s.src = url; s.type='text/javascript'; document.getElementsByTagName('head')[0].appendChild(s); }

// Need the addPortlet function... importScript('User:Ale_jrb/portlet.js');

// Get the Guild Watch function... importScript('User:Ale_jrb/guildwatch.js');

// Get the editing functions... importScript('User:Ale_jrb/guildwatchfuncs.js');

// install User:Cacycle/wikEd in-browser text editor document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js' + '&action=raw&ctype=text/javascript"></' + 'script>');

// Guild Wars Wiki Ajaxifier, by User:Galil var script = document.createElement('script'); script.src = '/index.php?title=User:Galil/GWW_Ajaxifier/ajaxifier.js&action=raw&ctype=text/javascript'; script.type = 'text/javascript'; document.getElementsByTagName('head')[0].appendChild(script);

// //Version: 3.1 //============================================================ // en: ADD SOME EXTRA BUTTONS TO THE EDITPANEL // de: FÜGE NEUE BUTTON IN DIE WERKZEUGLEISTE //============================================================ // Vorschläge für neue Buttons werden gerne entgegengenommen // Die Reihenfolge und Anzahl der Buttons ist über die (alphabetische) Variable XEBOrder wählbar. //================================ //Control Variables // //rmEditButtons - Removes standard toolbar buttons //XEBOrder - The order in which the buttons are displayed if (!self.page) var page = { win:self, minW:0, minH:0, MS:isIE&&!isOp }; page.elmPos=function(e,p) { var x=0,y=0,w=p?p:this.win; e=e?(e.substr?(isNS4?w.document.anchors[e]:getRef(e,w)):e):p; if(isNS4){if(e&&(e!=p)){x=e.x;y=e.y};if(p){x+=p.pageX;y+=p.pageY}} if (e && this.MS && navigator.platform.indexOf('Mac')>-1 && e.tagName=='A') { e.onfocus = new Function('with(event){self.tmpX=clientX-offsetX;' +   'self.tmpY=clientY-offsetY}'); e.focus;x=tmpX;y=tmpY;e.blur } else while(e){x+=e.offsetLeft;y+=e.offsetTop;e=e.offsetParent} return{x:x,y:y}; };

var isDOM=document.getElementById?1:0, isIE=document.all?1:0, isNS4=navigator.appName=='Netscape'&&!isDOM?1:0, isOp=self.opera?1:0, isDyn=isDOM||isIE||isNS4;

document.write(''); if(typeof XEBPopups== 'undefined')XEBPopups=true; if(typeof XEBHideDelay== 'undefined')XEBHideDelay=0.5; //Time before the popup disappears after the mouse moves out if(typeof XEBExtendEditSummary == 'undefined')XEBExtendEditSummary=true; // Is the edit summary extended after a popup //fills the variable mwCustomEditButtons (s. function in /wikibits.js), with buttons for the Toolbar function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText){ mwCustomEditButtons.push({ "imageFile": imageFile,  "speedTip": speedTip,  "tagOpen": tagOpen,  "tagClose": tagClose,  "sampleText": sampleText}); } if (typeof usersignature == 'undefined') var usersignature = '-- \~\~\~\~'; var Isrc='http://upload.wikimedia.org/wikipedia/commons/'; // English Wikipedia creates 11 extra buttons which are stored in mwCustomEditButtons // rather than mwEditButtons. However, there is no guarantee it will always be 11 // so we count them here. var enExtraButtons=mwCustomEditButtons.length; var BDict={ 'A':['e/e9/Button_headline2.png','Secondary headline','\n===','===','Secondary headline'], 'B':['1/13/Button_enter.png','Line break',' ',,], 'C':['5/5f/Button_center.png','Center',' \n','\n<\/div>','Centred text'], 'D':['e/ea/Button_align_left.png','Left-Align',' \n','\n<\/div>','Left-aligned text'], 'D1':['a/a5/Button_align_right.png','Right-Align',' \n','\n<\/div>','Right-aligned text'], 'E':['0/04/Button_array.png','Table','\n{| class="wikitable" \n|- \n| 1 || 2\n|- \n| 3 || 4','\n|}\n',''], 'F':['1/1e/Button_font_color.png','Insert coloured text','<span style="color: ','">Coloured text<\/span>','ColourName'], 'FS':['1/1b/Button_miss_signature.png','Unsigned post',,,'user name or IP'], 'G':, 'H':['7/74/Button_comment.png','Comment',"",'Comment'], 'I1':['6/6a/Button_sup_letter.png','Superscript',' ','<\/sup>','Superscript text'], 'I2':['a/aa/Button_sub_letter.png','Subscript',' ','<\/sub>','Subscript text'], 'J1':['5/58/Button_small.png','Small',' ','<\/small>','Small Text'], 'J2':['5/56/Button_big.png','Big text',' ','<\/big>','Big text'], 'K':['b/b4/Button_category03.png','Category',"",'Category name'], 'L':['8/8e/Button_shifting.png','Insert tab(s)',':','',':'], 'M':['f/fd/Button_blockquote.png','Insert block of quoted text','<blockquote style="border: 1px solid blue; padding: 2em;">\n','\n<\/blockquote>','Block quote'], 'N':['4/4b/Button_nbsp.png','nonbreaking space',' ',,], 'O':['2/23/Button_code.png','Insert code',' ' +'Size:<SELECT NAME="textSize">' +'<OPTION VALUE="small">small' +'<OPTION VALUE="normal">[Normal]' +'<OPTION VALUE="big">big' +'</SELECT> <\/td><\/tr>' +'<\/form>' +'Sample:' +' Text "'		+' <button onClick="javascript:XEBInsertFormattedText">Insert '		+'<button onClick="hideXEBPopup">Cancel ';	curPopup.setInnerHTML(mt);	return true; } function XEBUpdateSampleText {	f=document.XEBPopupImageForm; } //==================== function XEBMenuMouseOut(e) {	var targ;	if (!e) var e = window.event;	if (e.target) targ = e.target;	else if (e.srcElement) targ = e.srcElement;	targ.style.color='black'; } function XEBMenuMouseOver(e) {	var targ;	if (!e) var e = window.event;	if (e.target) targ = e.target;	else if (e.srcElement) targ = e.srcElement;	targ.style.color='red'; } //======================================================================= // Other functions //======================================================================= function XEBgetElementsByClassName(parent,clsName,htmltag){ 	var arr = new Array; 	var elems = parent.getElementsByTagName(htmltag); for ( var cls, i = 0; ( elem = elems[i] ); i++ ){ if ( elem.className == clsName ){ arr[arr.length] = elem; }	}	return arr; } function extendSummary(newText) {	if(!XEBExtendEditSummary)return; s=document.editform.elements['wpSummary'].value; s+=(s=='')?newText:' +'+newText; document.editform.elements['wpSummary'].value=s; } function bug(msg) {	if(wgUserName=='MarkS')alert(msg); } //

function addStrikeoutButton {

editingTools = document.getElementById('toolbar');

if (editingTools != null) {

StrikeTextButton = " <a href=\"javascript:insertTags(' ',' ','Insert text here');\"><img src=\"http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png\" alt=\"Strike\" title=\"Strike-through text\"></a>"; editingTools.innerHTML = editingTools.innerHTML + StrikeTextButton; } }

window.onload = addStrikeoutButton;

// A small piece of JS writen by User:MatthewFenton, This is my first piece of JS. function welcome { if (document.title.indexOf('Editing User talk:') == 0) { document.editform.wpTextbox1.value = document.editform.wpTextbox1.value + '==' + 'Welcome' + '==\n' + '\n' + ''; document.editform.wpSummary.value = 'Welcome a user to Wikipedia using JS WW'; } } function welcome_tab { add_link('javascript:welcome', 'Welcome'); }

if (document.title.indexOf('Editing User talk:') == 0) { addOnloadHook(welcome_tab); }

// CHECK THAT I'VE REMEMBERED TO SIGN TALK PAGES AND IF SURE DO IT AUTOMATIC: // *** aut. signing / (automatische Unterschrift) *** User:Olliminatore/signing.js // created 23.04.2006 by User:Olliminatore // updated 23.04.2006 by en:User:Ilmari Karonen // current version 1.56 13.03.2007 // Interwiki de:User:Olliminatore/signing.js // String.prototype.trim = function{return this.replace(/^\s*|\s*$/g,"")}; if (typeof usersignature == 'undefined') usersignature = ' --\~\~\~\~\n'; if (typeof regpages == 'undefined') { // list of all none talk pages var regpages = [ ':Village pump', ':Articles for deletion', ':Requests for ', ':Reference desk', ':Deletion review', ':Templates for deletion', '.*noticeboard.*', ':checkuser', ':arbitration', ':feedback', ':page protection', 'mediation)',   ':Bot requests',    ':Help desk',    ':Editor review',    ':Adminship survey',    ':Cleanup',    ':Miscellany for deletion',    ':New contributors\' help page',    ':Media copyright questions'    ]; }     // regarded pages type encoded if (wgCanonicalNamespace.match(/talk$/i)) var regpages = ""; for (p in regpages) if (wgPageName.indexOf(regpages[p]) != -1){regpages=false; break} if (!regpages) addOnloadHook(function{ if (!(window.editform = document.forms['editform'])) return; // Add a new checkbox to the Wiki editOptions. sigBox = document.createElement("input"); sigBox.setAttribute('type','checkbox'); sigBox.setAttribute('name','wpSigning'); sigBox.setAttribute('id','wpSigning'); sigBox.setAttribute('checked','checked'); sigBox.defaultChecked=true; neuB = document.createElement("label"); neuB.appendChild(sigBox); neuB.appendChild(document.createTextNode("Sign")); neuB.setAttribute('for','wpSigning'); neuB.setAttribute('title','Sign this edit automatic.'); function setSigBox { // switch enable box if (editform.wpMinoredit.checked) sigBox.setAttribute('disabled','disabled'); else sigBox.removeAttribute('disabled'); };   var txtarea=editform.elements['wpTextbox1']; var txtOld=txtarea.value.trim; // txtOld_l=txtOld.length var txtOldEnd=txtOld.slice(-24); var sig = /~{3}/g; if (!tNode){ //editform.insertBefore(neuB, editform.elements['wpWatchthis']); // maybe FIXME: raised an NS_DOM_ERR! var tNode = editform.elements['wpMinoredit'].parentNode; // DOM workaround!? tNode.divs = tNode.getElementsByTagName("DIV"); tNode.divs = tNode.divs.item(tNode.divs.length-1); // last div tNode.insertBefore(neuB, tNode.divs); setSigBox; }   function doSign(event){ if(editform.onsubmit==''){ // only once! removeEvent(editform.wpSave,"click",doSign); removeEvent(editform.wpPreview,"click",doSign); }       if(editform.onsubmit=='') removeEvent(editform.wpSave,"click",doSign); // only once! if(editform.wpMinoredit.checked || !sigBox.checked) return; txtarea.focus; var cOld = txtOld.match(/ .*?~{3}.*?<\/nowiki>/g); // exception for nowiki if (cOld) cOld = cOld.length; cNew = txtarea.value.match(sig); if (cNew) cNew = cNew.length; if (cNew > cOld){ // if there are a sign, check for true var cNew2 = txtarea.value.match(/\{\{subst\:unsig.*?~{3}\}\}/); // exception for Template:unsigned cNew -= (cNew2)?cNew2.length:0; }       if(cNew <= cOld){ // if nothing then search a set position txt=txtarea.value.trim; txtEnd=txt.slice(-24); if(txtOldEnd!=txtEnd) return txtarea.value = txt + usersignature; // aut. underwrite else { // post between pos = getCaretPos(txtarea); pos = txt.indexOf('\n', pos); // go to the post-end txtEnds = txt.substr(pos,24).replace(/(^\s*)/,""); // after txtpEnds = txt.slice(pos-18,pos); // before oldp = txtOld.indexOf(txtEnds); if(oldp!=-1 && oldp < pos - 3 && txtOld.indexOf(txtpEnds+RegExp.$1+txtEnds)==-1) // if some added return txtarea.value = txt.slice(0,pos).trim + usersignature + txt.slice(pos+1); }        // FIXME: then the edit-end is not found!? }       else if(!sig.test(txtOld) || cOld < cNew) return; if (event) event=(window.Event)? event.target: event.srcElement; if (event.name == 'wpPreview') return; // not for preview return editform.onsubmit=new Function("editform.onsubmit='';"         +"return confirm('No signing was found. Continue anyway?')"); //warn if saving without signature };   addEvent(editform.wpSave,"click", doSign); addEvent(editform.wpPreview,"click", doSign); addEvent(editform.wpMinoredit,"click", setSigBox); }); function getCaretPos(txtObj){   if (txtObj.setSelectionRange) return txtObj.selectionStart; // NS like    else if(!document.selection) return 0;  // not IE like    var c="\001", pos=0;    var range=document.selection.createRange;    var txt=range.text, dul=range.duplicate;    dul.moveToElementText(txtObj);    range.text=txt+c;    pos=(dul.text.indexOf(c));    range.moveStart('character',-1);    range.text="";    return pos; }; /* add/removeEvent Original idea by John Resig Tweaked by Scott Andrew LePera, Dean Edwards and Peter-Paul Koch Fixed for IE by Tino Zijdel (crisp) @date 2005-10 */ function addEvent(obj,type,fn){if(obj.addEventListener){obj.addEventListener(type,fn,false)}else if(obj.attachEvent){var eProp=type+fn;obj["e"+eProp]=fn;obj[eProp]=function{obj["e"+eProp](window.event)};obj.attachEvent("on"+type,obj[eProp])}else{obj['on'+type]=fn}}; function removeEvent(obj,type,fn){if(obj.removeEventListener){obj.removeEventListener(type,fn,false)}else if(obj.detachEvent){var eProp=type+fn;obj.detachEvent("on"+type,obj[eProp]);obj['e'+eProp]=null;obj[eProp]=null}else{obj['on'+type]=null}}; // *** end ***

(function {    var oldAddButton = addButton;    if (typeof(oldAddButton) != 'function') return;    addButton = function  {        if (arguments.length > 2)            arguments[2] = arguments[2].replace(/^--(~+)$/, '—$1');        oldAddButton.apply(this, arguments);    }; });

//

// Add date and time to your monobook "personal menu" list at the very top of the page. // Created by User:Mathwiz2020

// Indicate where you would like the time to appear: // 1 is first (before username), 2 is second (before talk link), ... 7 is last (after log out link) insertBeforeNum = 7;

// Do NOT edit below this line unless you're experiened in javascript insertBeforeArr = new Array("","pt-userpage","pt-mytalk","pt-preferences","pt-watchlist","pt-mycontris","pt-logout",""); insertBefore = insertBeforeArr[insertBeforeNum];

function makeTime { var li = document.createElement( 'li' ); li.id = 'pt-time';

var mySpan = document.createElement( 'span' ); mySpan.appendChild( document.createTextNode( 'date and time' ) );

li.appendChild( mySpan );

if ( insertBefore ) {   var before = document.getElementById( insertBefore ); before.appendChild( li, before ); } else // append to end (right) of list {   document.getElementById( 'pt-logout' ).parentNode.appendChild( li ); }

getTime; }

if     ( window.addEventListener ) window.addEventListener ( 'load', makeTime, false ); else if ( window.attachEvent     ) window.attachEvent      ( 'onload', makeTime      );

function getTime {   var time    = new Date; var date   = time.getUTCDate; var months = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' '); month  = months[time.getUTCMonth]; var year   = time.getUTCFullYear; var hours  = '0' + time.getUTCHours; hours  = hours.substr(hours.length-2, hours.length); var minutes = '0' + time.getUTCMinutes; minutes = minutes.substr(minutes.length-2, minutes.length); var seconds = '0' + time.getUTCSeconds; seconds = seconds.substr(seconds.length-2, seconds.length); var curTime = hours + ":" + minutes + ":" + seconds + ", " + date + " " + month + " " + year + " (UTC)"; datePlace  = document.getElementById('pt-time').childNodes[0].childNodes[0]; datePlace.replaceData(0, datePlace.length, curTime); doTime     = window.setTimeout("getTime", 1000); }

if (wgNamespaceNumber >= 0) addOnloadHook(function{ var pCactions = document.getElementById('p-cactions'); if (!pCactions) return; var caMain = pCactions.getElementsByTagName('li')[0]; var caTalk = document.getElementById('ca-talk'); var caEdit = document.getElementById('ca-edit'); if (!caEdit) caEdit = document.getElementById('ca-viewsource'); var caHistory = document.getElementById('ca-history'); if (!caMain || !caTalk || !caEdit || !caHistory) return; var el_move, el_create, id2; if (wgNamespaceNumber % 2) { //talk space  el_move = caTalk; el_create = caMain; id2 = ''; } else {   el_move = caMain; el_create = caTalk; id2 = 'discussion'; } caEdit.firstChild.innerHTML = 'edit'; caHistory.firstChild.innerHTML = 'hist'; el_move.parentNode.insertBefore(caHistory, el_move.nextSibling); el_move.parentNode.insertBefore(caEdit, el_move.nextSibling); var href = el_create.firstChild.getAttribute('href', 2); if (el_create.className.indexOf('new') < 0){ addPortletLink('p-cactions', href + '?action=history', 'hist',    'ca-history-'+id2, id2+' history', '', el_create.nextSibling); addPortletLink('p-cactions', href + '?action=edit', 'edit',    'ca-edit-'+id2, 'Edit '+id2, '', el_create.nextSibling); }  caMain.style.marginRight = '0.3em'; caTalk.style.marginRight = '0.3em'; caTalk.style.marginLeft = '1.6em'; }) //

// *** COMMON CROSS-BROWSER COMPATIBILITY CODE *** var isDOM=document.getElementById?1:0, isIE=document.all?1:0, isNS4=navigator.appName=='Netscape'&&!isDOM?1:0, isOp=self.opera?1:0, isDyn=isDOM||isIE||isNS4; var cssName = isIE?'divmenuIE':'divmenu'; document.write(''); function getRef(i, p) { p=!p?document:p.navigator?p.document:p; return isIE ? p.all[i] : isDOM ? (p.getElementById?p:p.ownerDocument).getElementById(i) : isNS4 ? p.layers[i] : null; }; function getSty(i, p) { var r=getRef(i, p); return r?isNS4?r:r.style:null; }; if (!self.LayerObj) var LayerObj = new Function('i', 'p', 'this.ref=getRef(i, p); this.sty=getSty(i, p); return this'); function getLyr(i, p) { return new LayerObj(i, p) }; function LyrFn(n, f) { LayerObj.prototype[n] = new Function('var a=arguments,p=a[0],px=isNS4||isOp?0:"px"; ' + 'with (this) { '+f+' }'); }; LyrFn('x','if (!isNaN(p)) sty.left=p+px; else return parseInt(sty.left)'); LyrFn('y','if (!isNaN(p)) sty.top=p+px; else return parseInt(sty.top)'); var aeOL = []; function addEvent(o, n, f, l) { var a = 'addEventListener', h = 'on'+n, b = , s = ; if (o[a] && !l) return o[a](n, f, false); o._c |= 0; if (o[h]) { b = '_f' + o._c++; o[b] = o[h]; } s = '_f' + o._c++; o[s] = f; o[h] = function(e) { e = e || window.event; var r = true; if (b) r = o[b](e) != false && r; r = o[s](e) != false && r;  return r; }; aeOL[aeOL.length] = { o: o, h: h }; }; addEvent(window, 'unload', function { for (var i = 0; i < aeOL.length; i++) with (aeOL[i]) { o[h] = null;  for (var c = 0; o['_f' + c]; c++) o['_f' + c] = null; } }); // *** CORE MENU OBJECT AND FUNCTIONS *** function FSMenu(myName, nested, cssProp, cssVis, cssHid) { // This is the base object that users create. // It stores menu properties, and has a 'menus' associative array to store a list of menu nodes, // and allow timeouts to refer to nodes by name (e.g. menuObject.menus.nodeName). this.myName = myName; this.nested = nested; // Some CSS settings users can specify. this.cssProp = cssProp; this.cssVis = cssVis; this.cssHid = cssHid; this.cssLitClass = ''; // The 'root' menu only exists for list menus, and is created in the activation function. // For non-nested menus, here's an imaginary node that acts as a parent to other nodes. this.menus = { root: new FSMenuNode('root', true, this) }; this.menuToShow = []; this.mtsTimer = null; // Other configurable defaults. this.showDelay = 0; this.switchDelay = 125; this.hideDelay = 500; this.showOnClick = 0; this.animations = []; this.animSpeed = 100; // Free memory onunload in IE. if (isIE && !isOp) addEvent(window, 'unload', new Function(myName + ' = null')); }; FSMenu.prototype.show = function(mN) { with (this) { // Set menuToShow to the function parameters. Use a loop to copy values so we don't leak memory. menuToShow.length = arguments.length; for (var i = 0; i < arguments.length; i++) menuToShow[i] = arguments[i]; // Use a timer to call a virtual 'root' menu over function for non-nested menus. // For nested/list menus event bubbling will call the real root menu node over function. clearTimeout(mtsTimer); if (!nested) mtsTimer = setTimeout(myName + '.menus.root.over', 10); }}; FSMenu.prototype.hide = function(mN) { with (this) { // Clear the above timer and route the hide event to the appropriate menu node. clearTimeout(mtsTimer); if (menus[mN]) menus[mN].out; }}; function FSMenuNode(id, isRoot, obj) { // Each menu is represented by a FSMenuNode object. // This is the node constructor function, with the properties and functions needed by that node. // It's passed its own name in the menus[] array, whether this is a root level menu (boolean), // and a reference to the parent FSMenu object. this.id = id; this.isRoot = isRoot; this.obj = obj; this.lyr = this.child = this.par = this.timer = this.visible = null; this.args = []; var node = this; // These next per-node over/out functions are an example of closures in JavaScript. // Since they're instantiated here, they can use the node's variables as if they were their own. this.over = function(evt) { with (node) with (obj) { // Basically, over gets called when the onmouseover event reaches the menu container, // which might be a DIV or UL tag in the document. The event source is a tag inside // that container that calls FSMenu.show and sets the menuToShow array (see above). // Browsers will then 'bubble' the event upwards, reaching this function which is set // as the onmouseoover/focus/click handler on a menu container. This picks up the // properties in menuToShow and shows the given menu as a child of this one. // Note that for non-nested menus there is a default timer (mtsTimer) that will mimic // an outermost 'root' menu that picks up the event if no other menus intercept it first. // Ensure NS4 calls the show/hide function within this layer first. if (isNS4 && evt && lyr.ref) lyr.ref.routeEvent(evt); // Stop this menu hiding itself and intercept the default root show handler (if any). clearTimeout(timer); clearTimeout(mtsTimer); // A quick check; if this menu isn't visible, show it (i.e. cancel any animation). if (!isRoot && !visible) node.show; if (menuToShow.length) {  // Pull information out of menuToShow[]. var a = menuToShow, m = a[0]; if (!menus[m] || !menus[m].lyr.ref) menus[m] = new FSMenuNode(m, false, obj); // c = reference to new child menu that will be shown. var c = menus[m]; // Just clear the menuToShow array and return if we're "showing" the current menu...! if (c == node) {   menuToShow.length = 0; return; }  // Otherwise, stop any impending show/hide of the child menu, and check if it's a new child. clearTimeout(c.timer); if (c != child && c.lyr.ref) {   // We have a genuinely new child menu to show. Give it some properties, set a timer to show it. // Again, try and avoid memory leaks, but copy over the a/menuToShow arguments. c.args.length = a.length; for (var i = 0; i < a.length; i++) c.args[i] = a[i]; // Decide which delay to use -- switchDelay if we already have a child menu, showDelay otherwise. var delay = child ? switchDelay : showDelay; c.timer = setTimeout('with(' + myName + ') { menus["' + c.id + '"].par = menus["' +    node.id + '"]; menus["' + c.id + '"].show }', delay ? delay : 1); }  // Try, try, try to avoid leaking memory... :).   menuToShow.length = 0;  }  // For non-nested menus, mimic event bubbling.  if (!nested && par) par.over; }}; this.out = function(evt) { with (node) with (obj) {  // Basically the same as over, this cancels impending events and sets a hide timer.  if (isNS4 && evt && lyr && lyr.ref) lyr.ref.routeEvent(evt);  clearTimeout(timer);  // We never hide the root menu. Otherwise, mimic event-bubbling for non-nested menus.  if (!isRoot)  {   timer = setTimeout(myName + '.menus["' + id + '"].hide', hideDelay);   if (!nested && par) par.out;  } }}; // Finally, now we have created our menu node, get a layer object for the right ID'd element // in the page, and assign it onmouseout/onmouseover events. Don't do for virtual root node. if (this.id != 'root') with (this) with (lyr = getLyr(id)) if (ref) {  if (isNS4) ref.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT); addEvent(ref, 'mouseover', this.over); addEvent(ref, 'mouseout', this.out); // For nested UL/LI menus, assign focus/blur events for accessibility. if (obj.nested) {  addEvent(ref, 'focus', this.over); addEvent(ref, 'click', this.over); addEvent(ref, 'blur', this.out); } } }; FSMenuNode.prototype.show = function { with (this) with (obj) { // This is called to show the menu node of which it's a method. // It sets the parent's child to this, and hides any existing children of the parent node. if (!lyr || !lyr.ref) return; if (par) { if (par.child && par.child != this) par.child.hide; par.child = this; } // This pulls values out of the stored args[] array, and uses the page.elmPos function in the // cross-browser code to find the pixel position of the parent item + menu. var offR = args[1], offX = args[2], offY = args[3], lX = 0, lY = 0, doX = +offX!='undefined', doY = +offY!='undefined'; if (self.page && offR && (doX||doY)) { with (page.elmPos(offR, par.lyr ? par.lyr.ref : 0)) lX = x, lY = y; if (doX) lyr.x(lX + eval(offX)); if (doY) lyr.y(lY + eval(offY)); } // Highlight the triggering element, if any. if (offR) lightParent(offR, 1); // Show the menu and trigger any 'onshow' events. visible = 1; if (obj.onshow) obj.onshow(id); setVis(1); }}; FSMenuNode.prototype.hide = function { with (this) with (obj) { // Same as show above, but this clears the child/parent settings and hides the menu. if (!lyr || !lyr.ref) return; // This is an NS4 hack as its mouse events are notoriously unreliable. Remove as needed. if (isNS4 && self.isMouseIn && isMouseIn(lyr.ref)) return show; // Dim the triggering element. if (args[1]) lightParent(args[1], 0); // Route the hide call through any child nodes, and clear the par/child references. if (child) child.hide; if (par && par.child == this) par.child = null; // Hide the menu node element, and trigger an 'onhide' event if set. if (lyr) { visible = 0; if (obj.onhide) obj.onhide(id); setVis(0); } }}; FSMenuNode.prototype.lightParent = function(elm, lit) { with (this) with (obj) { // This is passed a reference to the parent triggering element, and whether it is lit or not. if (!cssLitClass || isNS4) return; // By default the cssLitClass value is appended/removed to any existing class. // Otherwise, if hiding, remove all trailing instances of it (in case of script errors). if (lit) elm.className += (elm.className?' ':'') + cssLitClass; else elm.className = elm.className.replace(new RegExp('(\\s*' + cssLitClass + ')+$'), ''); }}; FSMenuNode.prototype.setVis = function(sh) { with (this) with (obj) { // This is passed one parameter by the core script, whether its menu is shown (boolean). // It sets the chosen CSS property of the menu element, and repeatedly calls itself if // one or more animations have been specified in the animations property. lyr.timer |= 0; lyr.counter |= 0; with (lyr) { clearTimeout(timer); if (sh && !counter) sty[cssProp] = cssVis; if (isDOM && animSpeed < 100) for (var a = 0; a < animations.length; a++) animations[a](ref, counter); counter += animSpeed*(sh?1:-1); if (counter>100) { counter = 100 } else if (counter<=0) { counter = 0; sty[cssProp] = cssHid } else if (isDOM) timer = setTimeout(myName + '.menus["' + id + '"].setVis(' + sh + ')', 50); } }}; // *** LIST MENU ACTIVATION *** FSMenu.prototype.activateMenu = function(id, subInd) { with (this) { if (!isDOM || !document.documentElement) return; var a, ul, li, parUL, mRoot = getRef(id), nodes, count = 1; // Because IE sucks, we emulate onfocus/blur event bubbling for accessibility. if (isIE) { var aNodes = mRoot.getElementsByTagName('a'); for (var i = 0; i < aNodes.length; i++) {  addEvent(aNodes[i], 'focus', new Function('e', 'var node = this.parentNode; while(node) { ' + 'if (node.onfocus) setTimeout(node.onfocus, 1, e); node = node.parentNode }')); addEvent(aNodes[i], 'blur', new Function('e', 'var node = this.parentNode; while(node) { ' + 'if (node.onblur) node.onblur(e); node = node.parentNode }')); } } // Loop through all sub-lists under the given menu. var lists = mRoot.getElementsByTagName('ul'); for (var i = 0; i < lists.length; i++) { // Find a parent LI node, if any, by recursing upwards from the UL. Quit if not found. li = ul = lists[i]; while (li) {  if (li.nodeName.toLowerCase == 'li') break; li = li.parentNode; } if (!li) continue; // Next, find the parent UL to that LI node. parUL = li; while (parUL) {  if (parUL.nodeName.toLowerCase == 'ul') break; parUL = parUL.parentNode; } a = null; for (var j = 0; j < li.childNodes.length; j++) if (li.childNodes[j].nodeName.toLowerCase == 'a') a = li.childNodes[j]; if (!a) continue; // We've found a menu node by now, so give it an ID and event handlers. var menuID = myName + '-id-' + count++; // Only assign a new ID if it doesn't have one already. if (ul.id) menuID = ul.id; else ul.setAttribute('id', menuID); // Attach focus/mouse events to the triggering anchor tag. // Check if this link will be triggered onclick instead of onmouseover. // If so, we only respect mouseovers/focuses when the menu is visible from a click. var sOC = (showOnClick == 1 && li.parentNode == mRoot) || (showOnClick == 2); var eShow = new Function('with (' + myName + ') { ' +  'var m = menus["'+menuID+'"], pM = menus["' + parUL.id + '"];' +   (sOC ? 'if ((pM && pM.child) || (m && m.visible))' : '') +  ' show("' + menuID + '", this) }'); var eHide = new Function(myName + '.hide("' + menuID + '")'); addEvent(a, 'mouseover', eShow); addEvent(a, 'focus', eShow); addEvent(a, 'mouseout', eHide); addEvent(a, 'blur', eHide); if (sOC) addEvent(a, 'click', new Function('e', myName + '.show("' + menuID +  '", this); if (e.cancelable && e.preventDefault) e.preventDefault; ' + 'e.returnValue = false; return false')); // Prepend an arrow indicator to the anchor tag content if given. if (subInd) a.insertBefore(subInd.cloneNode(true), a.firstChild); } // Finally, create/activate the root node. menus[id] = new FSMenuNode(id, true, this); }};

//ImportScript - for all your JS needs

//Start AVT options //AVTSysop should only be set to 'true' if you are a sysop and wish to use the sysop deletion and blocking functions. If you're not a sysop, the links won't work and may break your installation =P //AVTCompatibilityMode should be set to 'true' if you wish to use this script with Poke's GWWT, as it gets rid of duplicate tabs. I'm still not entirely sure it'll work, though - the css files may be incompatible (bugger if I know). //AVTDeltabs should be set to 'true' if you want to use AVT's deletion tagging function. If you'd like to just use those in GWWT or none at all, set this variable to 'false.'

var AVTSysop = true, AVTCompatibilityMode = true, AVTDeltabs = true; //Creates basic configuration. Note that this should be in the installer file

//Start AVT. This script was written by [XoO]MisterPepe and released under the GFDL 1.2+ For patch notes, please see User:MisterPepe/AVT //Requires addPortletLink and addLIMenu (js and css), but these will be installed by default when using the installer function

//End installer update

function importScript(page, lang) { var url = wgScriptPath + '/index.php?title=' + encodeURIComponent(page.replace(' ','_')) + '&action=raw&ctype=text/javascript&dontcountme=s'; if (lang) url = 'http://' + lang + '.wikipedia.org' + url; var s = document.createElement('script'); s.src = url; s.type='text/javascript'; document.getElementsByTagName('head')[0].appendChild(s); }

// Installing teh AVT goodness importScript('User:MisterPepe/AVT/code.js');