var X = 0;
var Y = 0;
var moving = false;
var tooltip;
var content;

function initTooltip()
{
  document.write('<DIV ID="tooltip" STYLE="position:absolute; top:-1000px; left:-1000px; z-index:1000"><\/DIV>');
}

function moveTooltip(e) 
{
  X = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
  Y = (document.all) ? window.event.y + document.body.scrollTop : e.pageY;
  if (moving == true) showTooltip(null);
  return true;
}

if (document.all?false:true) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = moveTooltip;
		
function showTooltip(text) 
{
  if (text != null) content = text;

  if (document.layers)
  {
    document.tooltip.document.open();
    document.tooltip.document.write("<DIV STYLE=\"border:1px solid black;font-family:verdana,arial,tahoma;font-size:8pt;layer-background-color:#ffcc00;background-color:#ffcc00;padding:2px\">" + content + "</DIV>");
    document.tooltip.document.close();
    document.tooltip.left = X + 15;
    document.tooltip.top = Y + 20;
    document.tooltip.visibility = "show";
  }
  else
  {
    if(document.getElementById)
    {
      tooltip = document.getElementById("tooltip");
      tooltip.innerHTML = "<DIV STYLE=\"border:1px solid black;font-family:verdana,arial,tahoma;font-size:8pt;layer-background-color:#ffcc00;background-color:#ffcc00;padding:2px\">" + content + "</DIV>";
      tooltip.style.left = X + 15;
      tooltip.style.top = Y + 20;
      tooltip.style.visibility = "visible";
    }
  }

  moving = true;
}

function hideTooltip()
{
  moving = false;

  if (document.layers)
  { 
    document.tooltip.visibility = "hide";
  }
  else
  {
    if (document.getElementById)
    {
      tooltip.style.visibility = "hidden";
    }
  } 
}

function showCopyright()
{ 
  document.write('<IMG SRC="images\/layout\/t.gif" WIDTH="175" HEIGHT="1" BORDER="0" ALT=""><B>Copyright<\/B> &copy; <B>2005-2009 Dolina Bobrów</B><IMG SRC="images\/layout\/t.gif" WIDTH="175" HEIGHT="1" BORDER="0" ALT=""><A HREF="mailto:MKurek'+unescape('%40')+'gmail.com"><IMG SRC="images\/website\/m.gif" WIDTH="9" HEIGHT="9" BORDER="0" ALT="Kontakt techniczy" TITLE="Kontakt techniczny"><\/A>'); 
}

function showImage(source, wwidth, wheight, iwidth, iheight, scroll)
{
  var imageWindowContent;

  if (document.layers)
    imageWindowContent = '<HTML><HEAD><TITLE>Gospodarstwo agroturystyczne Dolina Bobrów<\/TITLE><META HTTP-EQUIV="imagetoolbar" CONTENT="no"><\/HEAD><BODY ONLOAD="self.focus();" ONBLUR="self.close();"><LAYER LEFT="0" TOP="0"><IMG SRC="'+source+'" WIDTH="'+iwidth+'" HEIGHT="'+iheight+'" BORDER="0" ALT="" ONCLICK="window.close();"><\/LAYER><\/BODY><\/HTML>';
  else
    imageWindowContent = '<HTML><HEAD><TITLE>Gospodarstwo agroturystyczne Dolina Bobrów<\/TITLE><META HTTP-EQUIV="imagetoolbar" CONTENT="no"><\/HEAD><BODY ONLOAD="self.focus();" ONBLUR="self.close();"><DIV STYLE="position:absolute; left:0px; top:0px;"><IMG SRC="'+source+'" WIDTH="'+iwidth+'" HEIGHT="'+iheight+'" BORDER="0" ALT="" ONCLICK="window.close();"><\/DIV><\/BODY><\/HTML>';

  var imageWindow = window.open('', 'imageviewer', 'left='+Math.floor((screen.width-wwidth)/2)+',top='+Math.floor((screen.height-wheight)/2)+',width='+wwidth+',height='+wheight+',scrollbars='+scroll);

  imageWindow.document.open();
  imageWindow.document.write(imageWindowContent);
  imageWindow.document.close();

  return;
}

