// Wyslij wiadomosc
function goSnail(end,to,dom) {
	var pref1 = 'mail';
	var dot ='.';
	var pref3 = ':';
	var pref2 = 'to';
	var mal = '@';
	location.href = pref1+pref2+pref3+to+mal+dom+dot+end;
}

function showSnail(end,to,dom) {
	var pref1 = 'mail';
	var dot ='.';
	var pref3 = ':';
	var pref2 = 'to';
	var mal = '@';		
	document.write('<a href="'+pref1+pref2+pref3+to+mal+dom+dot+end+'">'+to+mal+dom+dot+end+"</a>");
}


// Zamiast getElementById
function getObj(id) {
    return document.getElementById(id);
}


// Max dlugosc dla textarea
function maxLength(f, x) {
	if (f.value.length > x-1) {
		f.value = f.value.substr(0,x)
	}
}

function CreateEl(t,c){
	var x=document.createElement(t);
	x.className=c;
	x.style.display="block";
	return(x);
}

// ========================================================
// ToolTip
// Dozwolone tagi - [b] [/b] [br]
function tooltip(d,E,b,i,a){  
  d=document;
  E=d.documentElement;
  b=d.body;
  
  if(x=d.getElementById("tooltip"))b.removeChild(x);

  if(!E)return;
  for(i=0;a=b.getElementsByTagName("a")[i];i++){
    if(a.title){
      with(a.t=d.createElement("div")){
		id="tooltip"
		s='<div class=\"bubble-1\"></div><div class=\"bubble-2\">';
		e='</div>';
		innerHTML=s+a.title.replace(/\[b\]/g,"<b>").replace(/\[\/b\]/g,"</b>").replace(/\[br\]/g,"<br />")+e
		style.filter="alpha(opacity:85)";
		style.KHTMLOpacity="0.85";
		style.MozOpacity="0.85";
		style.opacity="0.85";
      }
      a.onmouseover=function(e){
        with(this){title="";onmousemove(e)}
        b.appendChild(this.t)
      }
      a.onmouseout=function(x){
        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)+-5+"px"
         top=e.clientY+(E.scrollTop||b.scrollTop)+14+"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);

