function trim(s)
{
  while (s.substring(0,1) == ' ')
  {
    s = s.substring(1,s.length);
  }
  while (s.substring(s.length-1,s.length) == ' ')
  {
    s = s.substring(0,s.length-1);
  }
  return s;
}

function maxLength1(o,m)
{
   o.value = o.value.substr(0,m);
}

function maxLength2(e,o,m)
{
  // poniewaÂ¿ Gecko zdarzenie onkeypress wysté¯µje
  // takÂ¿e po naciÂ¶nié¢©u klawiszy nie alfanumerycznych 
  // (event.keyCode!=0), naciÂ¶nié¢©a takiego klawisza 
  // nie jest anulowane
  if(!o.all&&e.keyCode!=0)return!0;
  // anulowanie lub nie w zaleÂ¿noÂ¶ci od liczby znakíª”í¸  // z jednoczesnym odÂ¶wierzeniem pola wyÂ¶wietlajÂ±cego 
  // liczbèŸºnakíª”í¸  return (o.value.length)<m
}

function maxLength3(o,m)
{
   if (o.value.length > m) o.value = o.value.substr(0,m);
}

function napisz1(lin)
{
document.write('<a href=\"'+lin+'\">');
}

function napisz1g(lin)
{
document.write('<a href=\"'+lin+'\" rel=\"external\" class=\"tytul\">');
}

function napisz1s(lin)
{
document.write('<a href=\"'+lin+'\" onMouseOver=\"window.status=\'\'; return true\" onClick=\"window.status=\'\'; return true\">');
}

function napisz2()
{
document.write('<\/a>');
}

/*****************************************
  Copyright (c) 2004 Tomasz Elendt- Elu¶
this script is free for non-commercial use
*****************************************/
function tooltip(d,E,b,i,a){
  d=document;E=d.documentElement;b=d.body;if(!E)return;
  for(i=0;a=b.getElementsByTagName("a")[i];i++){
    if(a.title){
      with(a.t=d.createElement("div")){
        id="tooltip"
        innerHTML=a.title.replace(/\|/g,"<br />")
      }
      a.onmouseover=function(e){
        with(this){title="";onmousemove(e)}
        b.appendChild(this.t)
      }
      a.onmouseout=function(x){
        with(this){title=t.innerHTML.replace(/<br \/>/g,"\|")}
        if(x=d.getElementById("tooltip"))b.removeChild(x)
      }
      a.onmousemove=function(e){
        e=e||event;with(this.t.style){
         left=e.clientX+(E.scrollLeft||b.scrollLeft)+"px"
         top=e.clientY+(E.scrollTop||b.scrollTop)+"px"
        }
      }
    }
  }
}
function addEvent(O,E,F,x){
  return(x=O.addEventListener)?x(E,F,1):(x=O.attachEvent)?x('on'+E,F):!1
}
addEvent(window,'load',tooltip);
