var _ie6a = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"";
var _ie6a2 = _ie6a + _templates_dir;
var _ie6ascale = "\",sizingMethod=\"scale\")";
var _ie6aimage = "\",sizingMethod=\"image\")";



function tooltip(what,head,text) {
  if (!what) {
    startTooltipTimeout();
  } else {
    var tt = document.getElementById("tooltip");
    if (tt) {
      if (!text) {
        startTooltipTimeout();
      } else {
        clearTooltipTimeout();
        var l = (getposOffset(what, "left")-1)+"px";
        var t = (getposOffset(what, "top")-13)+"px";
        var ttm = document.getElementById("tooltip-main");
        if (ttm) {ttm.innerHTML = text;}
        var tth = document.getElementById("tooltip-head");
        if (tth) {tth.innerHTML = head;}      
        tt.style.top = t;
        tt.style.left = l;
      }
    }
  }
}

var tooltipTimer = 0;
var tooltipDelay = 1500; // 1500 ms

function sTT() {
  tooltipTimer = window.setTimeout("hideTooltip()",tooltipDelay);
}

function clearTooltipTimeout() {
  window.clearTimeout(tooltipTimer);
}

function hideTooltip() {
  var tt = document.getElementById("tooltip");
  if (tt) {tt.style.top = "-1000px"};
}

function getposOffset(overlay, offsettype){
  var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
  var parentEl=overlay.offsetParent;
  while (parentEl!=null){
    totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
    parentEl=parentEl.offsetParent;
  }
  return totaloffset;
}
var BibilioStat=false;
Event.observe(window, 'load', function() {
	if(document.getElementById("bibliografia")) {
		Event.observe('bibliografia', 'click', function(){
			ToggleBibl();
		})
	}
});
function ToggleBibl() {
	if(document.getElementById("biblSpis")){
		if(BibilioStat)	{
		document.getElementById("biblSpis").style.display="none";
		BibilioStat=false;
		}
		else {
		document.getElementById("biblSpis").style.display="block";
		BibilioStat=true;
		}
	}
	else alert('hmmm')
}
var LektorControl = 0;
function LektorToggle() {
	if(LektorControl==0) {
		document.LektorSWF.GotoFrame(2);
		document.getElementById('LektorLink').innerHTML = "wyłącz lektora";
		LektorControl=1;
	}
	else {
		document.LektorSWF.GotoFrame(1);
		document.getElementById('LektorLink').innerHTML = "włącz lektora";
		LektorControl=0;		
	}
}
