function pause(millis)
{
var date = new Date();
var curDate = null;

do { curDate = new Date(); }
while(curDate-date < millis);
}
function pomoc(e, definicja){
if(!e) e=window.event;
var x=e.clientX+document.body.scrollLeft;
var y=e.clientY+document.body.scrollTop;
//alert(x + ' '+ y);
var div = document.createElement("div");
div.setAttribute("style", "width:100px; height:200px; background-color:black;");
x=x+20;
y=y+10;
//var definicja = document.getElementById("Definicja").getAttribute("def");
pause(200);
var text="<div  style=\"border-style:solid;border:medium;padding:3px; width:200px; height:auto; background-color:#FFE446;position:absolute; top:"+y+"px;left:"+x+"px; z-index:10;\">"+definicja+"</div> ";
wstaw(text);
//setTimeout(wyczysc(),2000);
}
function wstaw(text){
var def = document.getElementById("def");
def.style.display = "";
def.innerHTML = text;
}
function wyczysc(){
var def = document.getElementById("def");
def.innerHTML = "";
def.style.display = "none";
}
function prepareDef(){

  var przyg = document.getElementsByTagName("*");
  //alert(przyg.length)
  for (var i=0;i<przyg.length;i++){
  if(przyg[i].getAttribute('def')){
  //alert(przyg[i].id)
  //przyg[i].setAttribute("onMouseOver","pomoc(event,this.getAttribute('def'))");
  //przyg[i].setAttribute("onMouseOut","wyczysc()");
  //przyg[i].onmouseover = new Function("alert('test');");
  //przyg[i].addEventListener('click',alert("dzialm sobie),false);
  //przyg[i].setAttribute("onMouseOut","wyczysc()");
  przyg[i].onmouseover=function (event) { pomoc(event,this.getAttribute('def')); };
  przyg[i].onmouseout=function () { wyczysc() };
  //alert(przyg[i].getAttribute("onMouseOver"));
    /*przyg[i].onmouseover = function(){
      return pomoc(event,this.getAttribute('def'));
      };
    przyg[i].onmouseout = function(){
      wyczysc();
      };*/
    }
    }
    return false;
}
