
licz=0;
function ShowPicture(nazwa,szer,wys) {
 config='left='+(20+20*licz)+',top='+(20+20*licz)+',width='+szer+',height='+wys+',innerheight='+wys+',innerwidth='+szer+',toolbar=no,titlebar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no';
 kitekSC='oknoUSP' + licz;
 newwindow=window.open('',kitekSC,config)
 newwindow.document.write('<HTML><HEAD>');
 newwindow.document.write('<META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\">');
 newwindow.document.write('<TITLE>Foto</TITLE>');
 newwindow.document.write('<SCRIPT language=\"javascript\">');
 newwindow.document.write('setTimeout(');
 newwindow.document.write('\"self.close()');
 newwindow.document.write(';\",50000)');
 newwindow.document.write('</');
 newwindow.document.write('SCRIPT>');
 newwindow.document.write('</HEAD>');
 newwindow.document.write('<BODY bgcolor=white leftmargin=0 topmargin=0 marginheight=0 marginwidth=0>');
 newwindow.document.write('<DIV ALIGN=center><A HREF=# onclick=\"javascript:self.close();\"><IMG SRC='+nazwa+' BORDER=0 TITLE=\"Kliknij aby zamkn-Š\"></A>');
 newwindow.document.write('</DIV>');
 newwindow.document.write('</BODY></HTML>');
 licz+=1;
}

function chmurka(e,v){  
 if(v.title){  
  var t=document.createElement('div');  
  t.className='chmurka';  
  t.innerHTML=v.title;  
  v.title='';  
  v.move=function(e){  
   e=e||event;  
   t.style.left=e.clientX+15+(document.documentElement.scrollLeft||document.body.scrollLeft)+'px'   
   t.style.top=e.clientY+22+(document.documentElement.scrollTop||document.body.scrollTop)+'px'   
  }  
  v.move(e);  
  document.body.appendChild(t);  
  v.onmousemove=function(e){v.move(e)}  
  v.onmouseout=function(e){  
   v.title=t.innerHTML;  
   document.body.removeChild(t);  
  }  
 }  
}  


function number_format(a, b, c, d) 
{
 a = Math.round(a * Math.pow(10, b)) / Math.pow(10, b);
 e = a + '';
 f = e.split('.');
 if (!f[0]) 
 {
  f[0] = '0';
 }
 if (!f[1]) 
 {
  f[1] = '';
 }
 if (f[1].length < b) 
 {
  g = f[1];
  for (i=f[1].length + 1; i <= b; i++) 
	{
   g += '0';
  }
  f[1] = g;
 }
 if(d != '' && f[0].length > 3) 
 {
  h = f[0];
  f[0] = '';
  for(j = 3; j < h.length; j+=3) 
	{
   i = h.slice(h.length - j, h.length - j + 3);
   f[0] = d + i + f[0] + '';
  }
  j = h.substr(0, (h.length % 3 == 0) ? 3 : (h.length % 3));
  f[0] = j + f[0];
 }
 c = (b <= 0) ? '' : c;
 return f[0] + c + f[1];
}

function przecinek(info) 
{
 var p_temp = ""+info;
 var p1_temp = null;
 var p2_temp = null;
 if (p_temp.indexOf(",")>-1) 
 {
  var p1_temp=p_temp.substring(0,p_temp.indexOf(","));
  var p2_temp=p_temp.substring(p_temp.indexOf(",")+1);
  p_temp=p1_temp+"."+p2_temp;
 };
 p_temp = parseFloat(p_temp);
 if (isNaN(p_temp)) {p_temp = 0};
 return p_temp;
}

function allowSigns(e) 
{
 var allowedText = "0123456789.,";
 var key;
 var keychar;
 
 if (window.event)
  key = window.event.keyCode;
 else if (e)
  key = e.which;
 else
  return true;
 
 keychar = String.fromCharCode(key);
 
 if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27))
  return true;
 else if ((allowedText.indexOf(keychar) > -1))
  return true;
 else
  return false;
}

function allowDomeny(e) 
{
 var allowedText = "0123456789_-abcdefghijklmmnoprstuvwxyz";
 var key;
 var keychar;
 
 if (window.event)
  key = window.event.keyCode;
 else if (e)
  key = e.which;
 else
  return true;
 
 keychar = String.fromCharCode(key);
 
 if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27))
  return true;
 else if ((allowedText.indexOf(keychar) > -1))
  return true;
 else
  return false;
}

/* Funkcja pozwala tylko na liczby */
function onlyNumbers(e) 
{
 var allowedText = "0123456789";
 var key;
 var keychar;
 
 if (window.event)
  key = window.event.keyCode;
 else if (e)
  key = e.which;
 else
  return true;
 
 keychar = String.fromCharCode(key);
 
 if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27))
  return true;
 else if ((allowedText.indexOf(keychar) > -1))
  return true;
 else
  return false;
}

function nwin(page)
{
 sx = screen.availWidth;
 sy = screen.availHeight;
 x = sx;
 y = screen.availHeight;
 
 px = (sx/2)-(x/2);
 py = (sy/2)-(y/2);
 var nwi = window.open(page,'mwin','top='+py+',left='+px+',width='+sx+',height='+y+',resizable=no,scrollbars=yes,status=yes,toolbar=yes,menubar=yes,fullscreen=yes,width='+screen.width+',height='+screen.height, true);
 nwi.focus();
 return;
}


