User:Inarius/bluecloud.js

// User:Lupin/popups.js

document.write(' ');

simplePopups=false; popupAdminLinks=true; popupStructure='menus'; popupFixRedirs=true; popupFixDabs=true; popupPreviewFirstParOnly=false; popupExtraUserMenu=true; popupUseQueryInterface = false; function siteArticlePath{ return 'wiki'; } function siteBotInterfacePath{ return 'w'; }

// --- /*   Written by Jonathan Snook, http://www.snook.ca/jonathan Add-ons by Robert Nyman, http://www.robertnyman.com function getElementsByClassName(oElm, strTagName, strClassName){ var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName); var arrReturnElements = new Array; strClassName = strClassName.replace(/\-/g, "\\-"); var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)"); var oElement; for(var i=0; i<arrElements.length; i++){ oElement = arrElements[i]; if(oRegExp.test(oElement.className)){ arrReturnElements.push(oElement); }		}	return (arrReturnElements) } // --- // Array support for the push method in IE 5 if(typeof Array.prototype.push != "function"){ Array.prototype.push = ArrayPush; function ArrayPush(value){ this[this.length] = value; } } // --- /*	How to call the function: To get all a elements in the document with a "info-links" class: getElementsByClassName(document, "a", "info-links"); // ---

// Creates the Article Tags group header in #nav_right // Adds div.articletag elements to above group // Appends any div.nav_toc_append to #nav_right // Moves any existing #nav_toc to #nav_right function domNavToc {	//var errNode = document.createTextNode( "No Sidebar" ); var navRight = document.getElementById( 'nav_right' );

if( !navRight ) { return 0; }	// Append all .nav_toc classed elements under #nav_toc_append var len; var articleTags; var navTocElements; var bodyContent = document.getElementById('bodyContent'); if(document.getElementsBySelector) { articleTags = document.getElementsBySelector('#bodyContent div.articletag'); navTocElements = document.getElementsBySelector('#bodyContent div.nav_toc_append'); }	else if(bodyContent && getElementsByClassName) { articleTags = getElementsByClassName(bodyContent,'div','articletag'); navTocElements = getElementsByClassName(bodyContent,'div','nav_toc_append'); }	else { return 0; }

var hasArticleTags = articleTags.length > 0; if (hasArticleTags) {		navRight.innerHTML += ' Article Tags ' var articleTagBox = document.getElementById('articletags'); }

len = navTocElements.length; for(var i = 0; i < len; i++) {		var navTocAppend = navTocElements[i]; if( navTocAppend ) { var navTocAppendClone = navTocAppend.cloneNode(true); var oRegExp = new RegExp("(^|\\s)" + "articletag" + "(\\s|$)"); if(hasArticleTags && oRegExp.test(navTocAppend.className)) { articleTagBox.appendChild(navTocAppendClone); }			else { navRight.appendChild(navTocAppendClone); }			//not the right way to do this if(navTocAppendClone.style.display) {thisNavTocClone.style.display = 'block';} if(navTocAppendClone.visibility) {thisNavTocClone.visibility = 'visible';} navTocAppend.parentNode.removeChild(navTocAppend); }	}

// Append errNode if navToc doesn't exist var navToc  = document.getElementById( 'nav_toc' ); if( !navToc ) { //navRight.appendChild( errNode ); return 0; }

var navToc2 = navToc.cloneNode(true); navToc.parentNode.removeChild(navToc); navRight.appendChild( navToc2 );

navToc2.style.display = 'block'; }