function init() {
  if (window.Event) {
    document.captureEvents(Event.MOUSEMOVE);
  }
  document.onmousemove = getXY;
}
//window.onload = init;

function getXY(e) {
  x = (window.Event) ? e.pageX : event.clientX;
  y = (window.Event) ? e.pageY : event.clientY;

  if (navigator.appName == 'Microsoft Internet Explorer')
  {
  if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
  {
      x += document.body.scrollLeft;
      y += document.body.scrollTop;
  } 
  else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
  {
      x += document.documentElement.scrollLeft;
      y += document.documentElement.scrollTop;
  }
  }
  document.formular.sou_x.value = x + 19;
  document.formular.sou_y.value = y + 11;

  document.formular.l_okraj.value = (document.body.scrollWidth - document.getElementById('obrazek').width)/2;
  document.formular.p_okraj.value = (document.body.scrollWidth - document.getElementById('obrazek').width)/2 + document.getElementById('obrazek').width;

/*	if ((document.formular.sou_x.value < document.formular.l_okraj.value) || (document.formular.sou_x.value > document.formular.p_okraj.value))
	{
		document.getElementById('obr_tlacitka').style.display = 'block'
	}
	else
	{
		document.getElementById('obr_tlacitka').style.display = 'none'
	}
*/
}

function getdata(){
if (document.getElementById)
{
return document.getElementById(document.forms['formular'].pole.value).style}
else if (document.all)
return document.all.pole.style
}

function set_obj(obr)
{
document.forms['formular'].pole.value = obr;
getdata().visibility="visible"
//*window.alert(document.getElementsByTagName('pole').value);
}

function show()
{
getdata().left=document.formular.sou_x.value+"px"
getdata().top=document.formular.sou_y.value+"px"
}

function hide()
{
getdata().visibility="hidden"
}

function ukazat_tlacitka()
{
//window.alert(document.getElementById('obrazek').complete)
if (document.getElementById('obrazek').complete)
	{
//	document.getElementById('obr_tlacitka').style.display = 'block'
	document.getElementById('obr_tlacitka').style.visibility = 'visible'
	}
else
	{
//	document.getElementById('obr_tlacitka').style.display = 'none'
	document.getElementById('obr_tlacitka').style.visibility = 'hidden'
	}
}


