// Enlarge image script
// Variables
var rec_browser = "Prosím vyskúšajte iný prehliadač(IE,FireFox alebo Operu )";
var browser_redir = "http://www.mozilla.sk/";


function imGetLayer(sName) {return document.all?document.all[sName]:document.getElementById?document.getElementById(sName) : "";}

function imZIZoom(sImage,iHeight,iWidth,sDescr) {
if (!document.getElementById('imZIBackg')) {alert(rec_browser); document.location = browser_redir;} // Browser testing
var imZIdiv_Backg = imGetLayer("imZIBackg");
var imZIdiv_Image = imGetLayer("imZIImage");
var imZIyScroll;
var imZIwindowHeight;
if (window.innerHeight && window.scrollMaxY)
imZIyScroll = window.innerHeight + window.scrollMaxY;
else if (document.body.scrollHeight > document.body.offsetHeight)
imZIyScroll = document.body.scrollHeight;
else
imZIyScroll = document.body.offsetHeight;
if (self.innerHeight)
imZIwindowHeight = self.innerHeight;
else if (document.documentElement && document.documentElement.clientHeight)
imZIwindowHeight = document.documentElement.clientHeight;
else if (document.body)
imZIwindowHeight = document.body.clientHeight;
imZIpageHeight = imZIyScroll < imZIwindowHeight ? imZIwindowHeight : imZIyScroll;
if (self.pageYOffset)
imZIyScroll = self.pageYOffset;
else if (document.documentElement && document.documentElement.scrollTop)
imZIyScroll = document.documentElement.scrollTop;
else if (document.body)
imZIyScroll = document.body.scrollTop;
imZIdiv_Backg.style.top = '0px';
imZIdiv_Backg.style.height = (imZIpageHeight + 'px');
imZIdiv_Backg.style.zIndex = '2000';
imZIdiv_Backg.style.left = 1;   // Set up Left position of Backgorund
imZIdiv_Backg.style.width = document.body.offsetWidth - 10;  // Set up Background Width
var imZIImageTop = imZIyScroll + ((imZIwindowHeight - 35 - iHeight) / 2);
var div_Descr = "";


if (sDescr!="") div_Descr = "<div id=\"imZICaption\">" + sDescr + "</div>";
imZIdiv_Backg.innerHTML = "<div id=\"imZIImage\" style=\"margin-top:" + ((imZIImageTop < 0) ? "0px" : imZIImageTop) + "px" + "; width: " + (iWidth + 14) + "px\"><img src=\"" + sImage + "\" width=\"" + iWidth + "\" height=\"" + iHeight + "\" />" + div_Descr + "</div>";
imZIdiv_Backg.style.display = "block";
}
function imZIHide(){
imGetLayer("imZIBackg").style.display = "none";
imGetLayer("imZIImage").innerHtml = "";
}

