function UsunWczytywanie()
{
	if (document.getElementById)
		document.getElementById('loading').style.visibility='hidden';
	else
	{
		if(document.layers) //NS4
			document.loading.visibility = 'hidden';
		else //IE4
			document.all.loading.style.visibility = 'hidden';
 	};
};

function pr()
{
	if (!window.print)
	{
		alert("Musisz mieć NS4.x lub IE5,\naby użyć drukowania!")
		return;
	}
	window.print()
}

function openClose(id)
{
   if(document.getElementById) {
      element = document.getElementById(id);
   } else if(document.all) {
      element = document.all[id];
   } else return;

   if(element.style) {
      if(element.style.display == 'block' ){
         element.style.display = 'none';
      } else {
         element.style.display = 'block';
      }
   }
}
function okno(nazwa,width,height)
{ 
okienko=window.open(nazwa, "Zoom", "width="+width+", height="+height+", top=50, left=50, scroolbar=auto");
};

function okno(nazwa,width,height,tytul)
{
okienko=window.open(nazwa, tytul, "width="+width+", height="+height+", top=50, left=50, scroolbar=auto");
};

function okno_oferta(nazwa)
{ 
okienko_oferta=window.open(nazwa, "Podgląd", "width=500, height=500, top=0, left=0, scrollbars=yes");
};

function usun(tekst)
{
i = CONFIRM("Czy na pewno chcesz usunąć to zlecenie?");
if (i==true) window.location.replace(tekst);
};

function help()
{ 
okienko=window.open('help.htm','Help', 'width=600, height=500, top=50, left=50, scrollbars=yes,resizable=no,menubar=no, toolbar=no');
};


function okienko_proba(nazwa,szer,wys)
{
okienko_oferta=window.open(nazwa, "Podgląd", "width="+szer+", height="+wys+", top=300, left=300, scrollbars=yes");
};

function Ustaw_czcionke()
{
	wartosc="";
        if (document.dodaj.czcionka.selectedIndex!=0)
		wartosc+=' face=%'+document.dodaj.czcionka.options[document.dodaj.czcionka.selectedIndex].value+'%';
        if (document.dodaj.rozmiary.selectedIndex!=0)
		wartosc+=' size=%'+document.dodaj.rozmiary.options[document.dodaj.rozmiary.selectedIndex].value+'%';
        if (document.dodaj.kolory.selectedIndex!=0)
		wartosc+=' color=%'+document.dodaj.kolory.options[document.dodaj.kolory.selectedIndex].value+'%';

	if (wartosc!="") bbcode('[font'+wartosc+']','[/font]');
};

function bbcode(tag,tag2,z)
{
if (document.selection)
{
	tekst=document.selection.createRange().text;
	document.getElementById('opis').focus();
	document.selection.createRange().text=tag+tekst+tag2;
}
else
{
	tekst=document.getElementById('opis').value.substring(document.getElementById('opis').selectionEnd||0,document.getElementById('opis').selectionStart||0);
        if ((document.getElementById('opis').selectionStart || document.getElementById('opis').selectionStart=='0')) document.getElementById('opis').value=document.getElementById('opis').value.substring(0,document.getElementById('opis').selectionStart)+tag+tekst+tag2+document.getElementById('opis').value.substring(document.getElementById('opis').selectionEnd,document.getElementById('opis').value.length);
	else document.getElementById('opis').value+=tag+tekst+tag2;
};
};

function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=no,menubar=no' );
}

function high(which2)
{
theobject=which2
highlighting=setInterval("highlightit(theobject)",30)
}
function low(which2)
{
clearInterval(highlighting)
if (which2.style.MozOpacity)
which2.style.MozOpacity=0.3
else if (which2.filters)
which2.filters.alpha.opacity=30
}
function highlightit(cur2){
if (cur2.style.MozOpacity<1)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}

