function pokaz_obiekt(id_tab,id_rys,plik1,plik2,gdzie)
{
	rysunek = gdzie.getElementById(id_rys);
	
	if(gdzie.getElementById(id_tab))
	{
		obiekt = gdzie.getElementById(id_tab);
	}
	else
	{
		rysunek.style.display = 'none';
		return;
	}
	
	if(obiekt.style.display =='none')
	{
		obiekt.style.display = 'block';
		rysunek.src = plik1;
		//menu_drzewo = menu_drzewo + id_tab + ';';
	}
	else
	{
		obiekt.style.display = 'none';
		rysunek.src = plik2;
		//menu_drzewo = menu_drzewo.replace(id_tab+';','');
	}
}

function pokaz_bledy_polaczeni(bledy)
{
	//jesli nie ma zadnych bledow to wychodzimy z funkcji
	if(bledy=="")
	{
		return;
	}
	
	bledy_wyswietl = "";
	bledy_poprawione = bledy.split('##');
	
	for(i=0;i<bledy_poprawione.length;i++)
	{
		bledy_wyswietl += bledy_poprawione[i]+'\n';
	}
	
	alert(bledy_wyswietl);
}

function dodaj_pole(tekst,wartosc,gdzie)
{
	
	opcja = document.createElement('OPTION');
	opcja.text = tekst;
	opcja.value = wartosc;
	
	if (navigator.appName == "Netscape")
	{
		gdzie.add(opcja,null);
	}
	else
	{
		gdzie.add(opcja);
	}
}

function pokaz_ukryj_menu(obiekt,akcja)
{
	ob = document.getElementById(obiekt).style;
	
	if(akcja=='pokaz')
	{
		ob.display = 'block';
	}
	else if(akcja=='ukryj')
	{
		ob.display = 'none';
	}
}

function zmien_kolor(bgcolor,font_color,obiekt)
{
	ob = document.getElementById(obiekt).style;
	if(bgcolor!='')
	{	
		ob.backgroundColor = bgcolor;
	}
	if(font_color!='')
	{
		ob.color = font_color;
	}
}

//ta funkcje nalezy poprawic tak aby tylko ta ramka w ktorej wystepuje zdarzenie onload zmieniala wysokosc
function auto_iframe1()
{
	/*
   if (parent != self && document.body && (document.body.scrollHeight || document.body.offsetHeight))
   {
	   alert('a');
      var undefined;
      if (isNaN(parseInt(margines))) var margines = 20;

      if (parent.document.getElementById) parent.document.getElementById('autoiframe').height = 1;
      else if (parent.document.all) parent.document.all['autoiframe'].height = 1;
      var wysokosc = document.body.scrollHeight != undefined ? document.body.scrollHeight : document.body.offsetHeight;
      if (wysokosc)
      {
        if (parent.document.getElementById)
        {
          parent.document.getElementById('autoiframe').height = wysokosc + margines;
          parent.document.getElementById('autoiframe').scrolling = 'no';
        }
        else if (parent.document.all)
        {
          parent.document.all['autoiframe'].height = wysokosc + margines;
          parent.document.all['autoiframe'].scrolling = 'no';
        }
      }
   }
   */
   if(parent!=self)
   {
	   //pobieramy wszystkie obiekty iframe
	   obiekt_iframe = parent.document.getElementsByTagName("IFRAME");
	   //sprawdzamy czy wystepuje jakis obiekt iframe na stronie
		if(obiekt_iframe.length>0)
		{
	   		for(i=0;i<obiekt_iframe.length;i++)
	   		{
		   		if(obiekt_iframe[i].getAttribute("auto_rozwijanie")=="tak")
		   		{
			   		wysokosc = document.body.scrollHeight != undefined ? document.body.scrollHeight : document.body.offsetHeight;
			   		obiekt_iframe[i].style.height = wysokosc+20;
		   		}
	   		}
		}
	}
   
   //
   //parent.document.getElementById('autoiframe').style.height = wysokosc;
   
}