function initWGuiTabs() {
	var divs=document.getElementsByTagName('menu');

	for (i=0;i<divs.length;i++) {	// pozreme vsety menu
		if (divs[i].getAttribute('rel').indexOf('WGuiTabs')!=0) {continue;}
		var lis=divs[i].getElementsByTagName('li');
		for(j=0;j<lis.length;j++) {	//pozreme a nastavime vsetky polozky menu
			lis[j].onmousedown=function () {
				//najskor zrusime zvyraznenie
				var tbutts=this.parentNode.childNodes;
				for(i=0;i<tbutts.length;i++) {
					if (tbutts[i].nodeName.toLowerCase().indexOf('li')==-1) continue;
					tbutts[i].setAttribute('class','');
					tbutts[i].setAttribute('className','');	
				}
				var lid=this.getAttribute('id').replace(/WGuiTabsMenuItem_/gi,"");	//z id vyextrahujeme cislo
				var par=this.parentNode.getAttribute('rel');
				
				//najskor skryjeme vsetky divy a kliknuty zobrazime
				var hdivs=document.getElementsByTagName('div');
				for(k=0;k<hdivs.length;k++) {
					if (!hdivs[k].getAttribute('rel') || (hdivs[k].getAttribute('rel') && hdivs[k].getAttribute('rel').indexOf(par)!=0)) {continue;}

					if (hdivs[k].getAttribute('id').indexOf('WGuiTabsContent_'+lid)==0) {
						hdivs[k].style.display='block';
					} else {hdivs[k].style.display='none';}
				}
				
				this.setAttribute('class','act');
				this.setAttribute('className','act');
			}
		}
		
	}
}

function formatBotMenu() {
	var mdiv=document.getElementById('botflashmenu');
	var bicons=document.getElementById('right-bottom-icons');
	var menu1=document.getElementById('menu1');
	
	mdiv.style.top=(icore.getElYPos(bicons)-15)+'px';
	mdiv.style.left=(icore.getElXPos(menu1)+2)+'px';
	mdiv.style.visibility='visible';
}


function initGui() {	
	initWGuiTabs();
	//formatBotMenu();
	//icore.addListener(window, 'resize', function() {formatBotMenu();});
}

