<script>
	var panels = new Array();
	function addcattab(id, text, title)
	{
		var ccc = document.getElementById('categories');
		var tab_id = id + '-tab';
		var tab_title = (title) ? (' title="' + title  + '"') : '';
		var _li = document.createElement('li');
		_li.id = tab_id;
		_li.className = 'tab';
		_li.innerHTML = '<a href="' + "#tabs" + '" class="cattab" data-subpanel="' + id + '" role="tab" aria-controls="' + id + '"' + tab_title + '><span>' + text + "</span></a>";
		ccc.appendChild(_li);
	}

	function is_in_array(elem, array)
	{
		for (var i = 0, length = array.length; i < length; i++) {
			// === is correct (IE)
			if (array[i] === elem) {
				return i;
			}
		}

		return -1;
	}

	function nextTag(node) { 
		var node = node.nextSibling; 
		return (node && node.nodeType != 1) ? nextTag(node) : node; 
	}
</script>
<div id="tabs" class="sub-panels" role="tablist">
	<ul id="categories" class="tabs"></ul>
</div>