var nahled;
var isIE=(document.all && !window.opera)?true:false;
var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;

// funkce //
function vytvorDiv ()
{
nahled = document.createElement('DIV');
styly = "position:absolute;border:3px solid #00184A;border-bottom:0px;background:#00184A;";
if(isIE)
	{
	styly = styly+"border-bottom:3px solid #00184A;";
	}
if (isOpera)
	{
	nahled.style = styly;
	}
else
	{
	nahled.style.cssText = styly;
	}
nahled.style.display = "none";
var a = document.getElementsByTagName("a");
for (var i=0;i<a.length;i++)
	{
	if ((a[i].href.search(/.jpg/g)!=-1||a[i].href.search(/.JPG/g)!=-1||a[i].href.search(/.gif/g)!=-1||a[i].href.search(/.png/g)!=-1))
		{
		if (isIE)
			{
			a[i].onmousemove=function ()
				{
				kresli(this);
				}
			}
		else
			{
			a[i].setAttribute("onmousemove", "kresli(this)");
			}
		if (isIE)
			{
			a[i].onmouseout=function ()
				{
				schovej(this);
				}
			}
		else
			{
			a[i].setAttribute("onmouseout", "schovej()");
			}
		}
	}
document.getElementsByTagName('BODY')[0].appendChild(nahled);
}

function kresli (x)
{
/*
maluj = '<img src="'+x.getAttribute("href")+'" style="max-width:500px;" />';
nahled.innerHTML = maluj;
var z = nahled.getElementsByTagName('IMG');
var sirka = z[0].offsetWidth;
if (isIE)
	{
	z[0].onload = zobraz;
	}
else
	{
	z[0].onload = zobraz();
	}
nahled.style.width = sirka+"px";
nahled.style.left=x.offsetLeft+"px";
if (isIE)
	{
	var mysx = 170+x.offsetLeft+x.offsetWidth+event.offsetX;
	var mysy = x.offsetTop+x.offsetHeight+event.offsetY;
	nahled.style.top = mysy+"px";
	nahled.style.left = mysx+"px";
	}
else
	{
	nahled.style.top=x.offsetTop+x.offsetHeight+"px";
	}*/
return false;
}

function schovej () {/*nahled.style.display = "none";*/}

function zobraz () {nahled.style.display = "block";}

if (isIE)
	{
	window.attachEvent('onload',vytvorDiv);
	}
else
	{
	window.addEventListener('load',vytvorDiv, false);
	}