// JavaScript Document
 // JavaScript Document

  function menu_top_hover(id,idFont) {
	  
		document.getElementById(idFont).style.color="#656565";

	  		document.getElementById(id).style.backgroundColor="#fff"; 
	
	  
  }
  function menu_top_out(id,idFont) {
		 document.getElementById(idFont).style.color="#fff";
		 document.getElementById(id).style.backgroundColor="#30629a";   
  }
	function onload_do() {
		    mint.fx.Round("", "all", 'small',20);
	}
	
	function menu2_hover(id) {
		if(document.getElementById(id)!=null) { document.getElementById(id).className="menu2_hover"; }
	
		
	}
	function menu2_out(id) {
		if(document.getElementById(id)!=null) { document.getElementById(id).className="menu2_out"; }
	}
	function menu3_hover(id) {
		document.getElementById(id).style.backgroundImage="url(images/back_subsection_menu3_hover.gif)";
	}
		function menu3_out(id) {
		document.getElementById(id).style.backgroundImage="url(images/back_subsection_menu3.gif)";
	}
	function wysrodkuj_wzgledem_diva(id1,id2) {
		
		if(document.getElementById(id1).clientWidth!=null) {
		contener = document.getElementById(id1).clientWidth;
		to_center = document.getElementById(id2).clientWidth;
		contener = contener/2;
		to_center = to_center/2;
		wartosc = contener - to_center;
		
		document.getElementById(id2).style.left = wartosc+"px";
		}
		
	}
function schowaj_pokaz() {
		
		
	var article = document.getElementById('contener_article');	
	var leftMenu = document.getElementById('contener_menu3'); 
	var ShowHideIcon = document.getElementById('ShowHide_icon');
	var browserName = navigator.appName;
	if(browserName!="Microsoft Internet Explorer") {
 schowajButton = document.getElementById('schowajButton');
	}
	//alert(navigator.appName);

	if(leftMenu.style.display=="none") {
		
		leftMenu.style.display="block";
		schowajButton.innerHTML = "Ukryj lewe menu";
		article.style.width="683px";
		wysrodkuj_wzgledem_diva('contener_article','article_txt');
		ShowHideIcon.src = 'images/icon_hide_menu.gif';
	
		
	} else 
	{
		leftMenu.style.display="none";
		schowajButton.innerHTML = "Pokaż lewe menu";
		article.style.width="100%";
			wysrodkuj_wzgledem_diva('contener_article','article_txt');
				ShowHideIcon.src = 'images/icon_show_menu.gif';
	}



	}

	function OnLoad() {
		
		if(document.getElementById('contener_article')!=null) {
	//	wysrodkuj_wzgledem_diva('contener_article','article_txt'); //centrowanie naglowka artykulu
		}
		////////// zakladki artykulu ///////////////
		
		var tabs = mint.gui.CreateTabWidget("content_zakladki","zakladki");
		   tabs.fading = true;
//alert('aaaaaa');
	controller_tabs = "libary/script_zakladki.php?";
	
idTmp = document.getElementById('contener_artykul_zakladki');
if (idTmp!=null) {

	
	if(navigator.appName == "Microsoft Internet Explorer"){
	
	tabs.OnSelect = function(item) {
					zawartosc = document.getElementById('content_zakladki');
		zawartosc.innerHTML = "";
		
				selectedTab = document.getElementById(item.name);
		selectedTab.childNodes[1].style.backgroundImage="url(images/corner_zakladki_left_active.gif)";
		selectedTab.childNodes[2].style.backgroundImage="url(images/back_zakladka_active.gif)";
		selectedTab.childNodes[3].style.backgroundImage="url(images/corner_zakladki_right_active.gif)";
		selectedTab.childNodes[2].className="zakladka_txt_active";
		
	}
	
		tabs.OnDeselect = function(item) {
		zawartosc = document.getElementById('content_zakladki');


		deselectedTab = document.getElementById(item.name);
		selectedTab.childNodes[1].style.backgroundImage="url(images/corner_zakladki_left.gif)";
		selectedTab.childNodes[2].style.backgroundImage="url(images/back_zakladka.gif)";
		selectedTab.childNodes[3].style.backgroundImage="url(images/corner_zakladki_right.gif)";
		selectedTab.childNodes[2].className="zakladka_txt";

	}
		

	
		for(i=0;i<idTmp.childNodes.length;i++) {
		nazwaZakladki = idTmp.childNodes[i].getAttribute('id');
		idZakladki = idTmp.childNodes[i].childNodes[1].getAttribute('id');
	//	alert(nazwaZakladki);
	//	alert(idZakladki);
		
		tabs.AddItem(nazwaZakladki, nazwaZakladki, "text",controller_tabs+"id="+idZakladki);
	
	}

	
} else 
{

	tabs.OnSelect = function(item) {

		selectedTab = document.getElementById(item.name);
		selectedTab.childNodes[2].style.backgroundImage="url(images/corner_zakladki_left_active.gif)";
		selectedTab.childNodes[4].style.backgroundImage="url(images/back_zakladka_active.gif)";
		selectedTab.childNodes[6].style.backgroundImage="url(images/corner_zakladki_right_active.gif)";
		selectedTab.childNodes[4].className="zakladka_txt_active";
		
	}
	
	tabs.OnDeselect = function(item) {
		deselectedTab = document.getElementById(item.name);
		selectedTab.childNodes[2].style.backgroundImage="url(images/corner_zakladki_left.gif)";
		selectedTab.childNodes[4].style.backgroundImage="url(images/back_zakladka.gif)";
		selectedTab.childNodes[6].style.backgroundImage="url(images/corner_zakladki_right.gif)";
		selectedTab.childNodes[4].className="zakladka_txt";

	}
		
		for(i=1;i<idTmp.childNodes.length;i++) {
		nazwaZakladki = idTmp.childNodes[i].getAttribute('id');
	//	alert(nazwaZakladki);
		idZakladki = idTmp.childNodes[i].childNodes[3].getAttribute('id');
		
	//	alert(nazwaZakladki);
	//	alert(idZakladki);
		i=i+1;
		tabs.AddItem(nazwaZakladki, nazwaZakladki, "text",controller_tabs+"id="+idZakladki);
	
	}

	}	

}

  
	}
	
	function new_window() {

		var msg = window.open('article_new_window.php', 'okienko','top=0,left=0,width='+(screen.availWidth)+',height='+(screen.availHeight)+',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
		

// wstawiamy zawartość
content = document.getElementById("contener_article");
// msg.document.open();
// alert(window.opener);
 // msg.document.getElementById("contener_article").innerHTML=content.innerHTML;
// msg.document.write(content.innerHTML);
// msg.document.write('dupaaaaaaaaaaaa');
// msg.document.close();
		
	}
	
  function hrefMenuTop(adres) {
  
  window.location=adres;
  
  }
