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(pole,nazwa,adres,img1,img2,frm)
{
  wartosc = window.prompt(nazwa,adres);
   if (wartosc!=false && wartosc!=null)
   {

	if (img1!="img") bbcode(pole,'['+img1+wartosc+']','[/'+img2+']');
	else
	{
	tekst=' [img]'+wartosc;
	bbcode(pole,tekst,'[/img]');
       	};
   };
};

function okienko_adres(pole,nazwa,adres,nazwa2,tytul,frm)
{
  wartosc = window.prompt(nazwa,adres);

   if (wartosc!=false && wartosc!=null)
   {
        wartosc2 = window.prompt(nazwa2,tytul);
        if (wartosc2!=false && wartosc2!=null)
        {
                tekst=' [url='+wartosc+']'+wartosc2;
                bbcode(pole,tekst,'[/url]');
	};
   };
};

function bbcode(pole,tag,tag2,z)
{
if (document.selection)
{
	tekst=document.selection.createRange().text;
	document.getElementById(pole).focus();
	document.selection.createRange().text=tag+tekst+tag2;
}
else
{
	tekst=document.getElementById(pole).value.substring(document.getElementById(pole).selectionEnd||0,document.getElementById(pole).selectionStart||0);
        if ((document.getElementById(pole).selectionStart || document.getElementById(pole).selectionStart=='0')) document.getElementById(pole).value=document.getElementById(pole).value.substring(0,document.getElementById(pole).selectionStart)+tag+tekst+tag2+document.getElementById(pole).value.substring(document.getElementById(pole).selectionEnd,document.getElementById(pole).value.length);
	else document.getElementById(pole).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)
}

