// ---------------------------------------------------------------------------------------------------- //
// gkbox----------------------------------------------------------------------------------------------- //
// ---------------------------------------------------------------------------------------------------- //
var win;
var len;
var isIE=(document.all && !window.opera)?true:false;
var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;
// nastaveni------------------------------------------------------------------------------------------- //
var settings = new Array;
// funkce gk------------------------------------------------------------------------------------------- //
function gkSetIT () {if (settings["windowID"]) {win = document.getElementById(settings["windowID"]);}else {win = document.createElement('DIV');if (settings["class"]){win.className = settings["class"];}else {settings["classDefault"] = "position:absolute; border: 1px solid #bbb; background: #fbfbfb; padding: 5px; font-size: 80%; font-family: sans-serif; min-height: 100px; text-align:center;";if (isOpera){win.style = settings["classDefault"];}else {win.style.cssText = settings["classDefault"];}}win.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(/.gif/g)!=-1||a[i].href.search(/.png/g)!=-1)&&settings["image"]) {if ((settings["elementName"] && settings["elementName"]==a[i].className)||!settings["elementName"]) {if (settings["action"]=="click") {if (isIE) {a[i].onclick=function () {return gkShowIT(this);}}else {a[i].setAttribute("onclick", "gkShowIT(this); return false;");}}else {if (isIE) {a[i].onmousemove=function () {gkShowIT(this);}}else {a[i].setAttribute("onmousemove", "gkShowIT(this)");}if (settings["hide"]) {if (isIE) {a[i].onmouseout=function () {gkHideIT(this);}}else {a[i].setAttribute("onmouseout", "gkHideIT()");}}}}}}if (!settings["template"]||settings["template"].search(/<img/g) == -1) {settings["template"]='<h5>%title%</h5><img src="%href%" alt="%title% na %src% "/>';}if (!settings["windowID"]) {document.getElementsByTagName('BODY')[0].appendChild(win);}}
function gkShowIT (e) {var r = settings["template"].replace(/%title%/g, e.getAttribute("title"));r = r.replace(/%href%/g, e.getAttribute("href"));r = r.replace(/%src%/g, e.getAttribute("href"));win.innerHTML = r;var t = win.getElementsByTagName('IMG');var width = t[0].offsetWidth;if (isIE) {t[0].onload = gkVisiIT;}else {t[0].onload = gkVisiIT();}win.style.width = width+"px";if (settings["autoPosition"]) {win.style.left=e.offsetLeft+200+"px";if (isIE) {win.style.top = e.offsetTop+e.offsetHeight+170+"px";}else {win.style.top=e.offsetTop+e.offsetHeight+150+"px";}}else if (settings["relativePosition"]) {if (isIE) {win.style.left=document.documentElement.scrollLeft+settings["relativePositionX"]+"px";win.style.top = document.documentElement.scrollTop+settings["relativePositionY"]+"px";}else {win.style.left=window.pageXOffset+settings["relativePositionX"]+"px";win.style.top=window.pageYOffset+settings["relativePositionY"]+"px";}}return false;}
function gkHideIT () {win.style.display = 'none';}
function gkVisiIT () {win.style.display = "block";}
// aktivace gk----------------------------------------------------------------------------------------- //
if (isIE) {window.attachEvent('onload',gkSetIT);}else {window.addEventListener('load',gkSetIT, false);}

