﻿// File JScript
//Prove effetto Zoom
var imBrw_op=window.opera;
var prova=window.opera;
var imBrw_ie=document.all && !imBrw_op;
var imBrw_ns=document.getElementById && !imBrw_ie;
var imEffectEnabled = /MSIE [678]/.test(navigator.userAgent) && navigator.platform == "Win32";
var imHoverToEnable = /MSIE (5\.5)|[6]/.test(navigator.userAgent) && navigator.platform == "Win32";
var mbTipOk = false;
function imGetLayer(sName) {return document.all?document.all[sName]:document.getElementById?document.getElementById(sName) : "";}
function imIEBody(){return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}
function imOpenLocation(sNewLocation){
    document.location = sNewLocation;
}


function imZIZoom(sImage,iHeight,iWidth,sDescr) {

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';
                                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 = "";
}







