User:Floydian/vector.js

$(function{	//If I knew jQuery, this would be so much easier:	if (typeof(VectorMenuToTabs)=="undefined") VectorMenuToTabs = {ids: ["p-cactions"]};	for (var j=0; j<VectorMenuToTabs.ids.length; j++)	{		root = document.getElementById( VectorMenuToTabs.ids[j] );		if (!root) return;		var innerDiv = root.getElementsByTagName( 'div' )[0];		if (!innerDiv) return;		var ul = innerDiv.children[0];		if (!ul || ul.tagName!="UL") return;		for (var i=0; i<ul.children.length; i++)		{			var li = ul.children[i];			if (!li || li.tagName!="LI" || li.children.length<1) continue;			var a = li.children[0];			if (!a || a.tagName!="A" || a.childNodes.length!=1 || a.childNodes[0].nodeType!=3) continue;			var span = document.createElement("span");			var text = a.childNodes[0];			a.removeChild(text);			span.appendChild(text);			a.appendChild(span);		}		root.className = root.className.replace( /(^| )vectorMenu( |$)/, "$1vectorTabs$2" ); root.appendChild(ul); root.removeChild(innerDiv); } });