﻿
// Init grupa
var InitLightBoxArray = new Array;
var InitLightBoxGroupArray = new Array;
var ieversion, browser, LightBoxState, MaxWidth, MinWidth, MaxHeight, MinHeight, ContentHeight, PreloadImgDisplayStatus, CreateStatus, LastCreate, ImgNum, OldGroup, CurrentGroup, ArrayPageSizes, PageYScroll;
var InitLightBoxId, InitLightBoxOverflowId, InitLightBoxPreloaderImageId, InitLightBoxContainerId, InitLightBoxCloseBtnId, InitLightBoxImageId, InitLightBoxIframeId, InitLightBoxPrevBtnId, InitLightBoxNextBtnId;
var InitLightBoxPadding, InitLightBoxPosition, InitLightBoxIframeScrolling;
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { ieversion = new Number(RegExp.$1); browser = navigator.appName; }

// Init LightBox Configuration - START

InitLightBoxId = 'divInitLightBox';
InitLightBoxOverflowId = 'divInitLightBoxOverflow';
InitLightBoxPreloaderImageId = 'imgInitLightBoxPreloaderImage';
InitLightBoxContainerId = 'divInitLightBoxContainer';
InitLightBoxCloseBtnId = 'divInitLightBoxClosebtn';
InitLightBoxImageId = 'imgInitLightBox';
InitLightBoxIframeId = 'iframeInitLightBox';
InitLightBoxPrevBtnId = "divInitLightBoxPrevBtn"
InitLightBoxNextBtnId = "divInitLightBoxNextBtn"

InitLightBoxPadding = 10;
InitLightBoxPosition = 'fixed'; //absolute,fixed
InitLightBoxIframeScrolling = 'no'; //auto,yes,no

// Init LightBox Configuration - END

function addOnClickEventOnATag() {
    if (!document.getElementsByTagName) { return; }
    var Anchors = document.getElementsByTagName('a');
    var Anchor;
    var RelAttribute;
    for (var i = 0; i < Anchors.length; i++) {
        Anchor = Anchors[i];
        RelAttribute = String(Anchor.getAttribute('rel'));
        if (Anchor.getAttribute('href') && (RelAttribute.toLowerCase().match('image')) || (RelAttribute.toLowerCase().match('iframe')) || (RelAttribute.toLowerCase().match('flashplayer'))) {
            if (RelAttribute.toLowerCase().match('image'))
                InitLightBoxArray.push(Anchor);
                //InitLightBoxArray.push(new Array(Anchor, GroupAttribute));
            Anchor.onclick = function() { initLightBox(this, 'html', '', '', '', ''); return false; };
        }
    }
}

var NextImg, PrevImg = 0;
var ObjTitle;
CreateStatus = (false);
function initLightBox(THIS, caller, objectTag, imgNum, group, title) {
    var ObjectTag;
    var ObjHref;
    if (caller == 'html') {
        CurrentGroup = String(THIS.getAttribute('group'));
        ObjectTag = String(THIS.getAttribute('rel'));
        ObjHref = String(THIS.getAttribute('href'));
        ObjTitle = (THIS.getAttribute('title') ? THIS.getAttribute('title') : null);
        MinWidth = (THIS.getAttribute('minwidth') ? Number(THIS.getAttribute('minwidth')) : 325);
        MinHeight = (THIS.getAttribute('minheight') ? Number(THIS.getAttribute('minheight')) : 250);
    }
    else {
        ImgNum = Number(imgNum);
        CurrentGroup = String(group);
        ObjectTag = objectTag;
        ObjHref = THIS;
        ObjTitle = (title ? title : null);
        MinWidth = 325;
        MinHeight = 250;
    }
    if (!CreateStatus) {
        CreateStatus = (true);
        createInitLightBoxBase();
        createInitLightBoxControlBtns();
    }
    ArrayPageSizes = getPageSize();
    getPageScroll();
    switch (ObjectTag)
    {
        case "iframe":
            LastCreate = InitLightBoxIframeId;
            preloadInitLightBoxIframe(ObjHref);
            break;
        case "image":
            if (InitLightBoxArray.length > 1) {
                setPrevNextCurrentImg(ObjHref);
            }
            else {
                LastCreate = InitLightBoxImageId;
                preloadInitLightBoxImage(ObjHref);
            }
            break;
        case "flashPlayer":
            LastCreate = InitLightBoxFlashPlayerId;
            preloadInitLightBoxFlashPlayer(ObjHref);
            break;
        default:
            alert("Unjeli ste nepostoječi TAG ili ga LightBox ne podržava!");
        break;
    }
    switchLightBoxVisibility(InitLightBoxOverflowId, InitLightBoxId, 1);
}

function setPrevNextCurrentImg(ObjHref) {
    if (LastCreate != null) {
        ObjTitle = (InitLightBoxGroupArray[ImgNum].getAttribute('title') ? InitLightBoxGroupArray[ImgNum].getAttribute('title') : null);
        ArrayPageSizes = getPageSize();
        switchPreloadImgDisplayStatus();
        document.getElementById(InitLightBoxContainerId).removeChild(document.getElementById(LastCreate));
    }
    
    if (OldGroup == null) {
        InitLightBoxGroupArray = [];
        var NumOfImgInGroup = 0;
        for (var i = 0; i < InitLightBoxArray.length; i++) {
            var Obj = (InitLightBoxArray[i]);
            if (String(Obj.getAttribute('group')) == CurrentGroup) {
                InitLightBoxGroupArray.push(Obj);
                if (ImgNum == null && String(Obj.getAttribute('href')) == ObjHref) {
                    ImgNum = Number(NumOfImgInGroup);
                }
                NumOfImgInGroup++;
            }
        }
        OldGroup = CurrentGroup;
    }
    if ((ImgNum + 1) < InitLightBoxGroupArray.length) {
        NextImg = ImgNum + 1;
        setDisplay(InitLightBoxNextBtnId, "block");
    } else { setDisplay(InitLightBoxNextBtnId, "none"); }
    if ((ImgNum - 1) >= 0) {
        PrevImg = ImgNum - 1;
        setDisplay(InitLightBoxPrevBtnId, "block");
    } else { setDisplay(InitLightBoxPrevBtnId, "none"); }
    LastCreate = InitLightBoxImageId;
    preloadInitLightBoxImage(ObjHref);
}

function setInnerHtml(objectId, content) {
    document.getElementById(objectId).innerHTML = content;
}
function setClass(objectId, ClassName) {
    document.getElementById(objectId).className = ClassName;
}
function setVisibility(objectId, status) {
    document.getElementById(objectId).style.visibility = status;
}
function setDisplay(objectId, status) {
    document.getElementById(objectId).style.display = status;
}
function setTop(objectId, top) {
    document.getElementById(objectId).style.top = top;
}
function setWidth(objectId, width) {
    document.getElementById(objectId).style.width = width;
}
function setHeight(objectId, height) {
    document.getElementById(objectId).style.height = height;
}

function getHeight(objectId) {
    return document.getElementById(objectId).offsetHeight;
}

PreloadImgDisplayStatus = (false);
function switchPreloadImgDisplayStatus() {
    var t;
    if (PreloadImgDisplayStatus) {
        PreloadImgDisplayStatus = (false);
        clearTimeout(t);
        setDisplay(InitLightBoxPreloaderImageId, 'none');
        setVisibility(InitLightBoxNextBtnId, '');
        setVisibility(InitLightBoxPrevBtnId, '');
        setVisibility(InitLightBoxId, 'visible');
        setVisibility(InitLightBoxContainerId, 'visible');
        document.getElementById(InitLightBoxOverflowId).onclick = function() { switchLightBoxVisibility(InitLightBoxOverflowId, InitLightBoxId, 1); };
    } else {
        PreloadImgDisplayStatus = (true);
        if (browser == "Microsoft Internet Explorer" && ieversion <= 6)
            setTop(InitLightBoxPreloaderImageId, (PageYScroll + ((ArrayPageSizes[3]) / 2)) + 'px');
        t = setTimeout("if(PreloadImgDisplayStatus){setDisplay(InitLightBoxPreloaderImageId, 'block')}", 500);
        setVisibility(InitLightBoxNextBtnId, 'hidden');
        setVisibility(InitLightBoxPrevBtnId, 'hidden');
        setVisibility(InitLightBoxId, 'hidden');
        document.getElementById(InitLightBoxOverflowId).onclick = function() { };
    }
}

LightBoxState = (false);
var bug_pogledaj = (true);
function switchLightBoxVisibility(InitLightBoxOverflowId, lightBoxId, flashId) {
    if (bug_pogledaj) {
        if (LightBoxState) {
            //callSwitchVisibilityDropDownBoxsIe6Fix('visible', 'selectSortDropDownList');
            setVisibility(InitLightBoxOverflowId, 'hidden');
            setVisibility(InitLightBoxId, 'hidden');
            setVisibility(InitLightBoxContainerId, 'hidden');
            document.getElementById(InitLightBoxContainerId).removeChild(document.getElementById(LastCreate));
            setDisplay(InitLightBoxNextBtnId, 'none');
            setDisplay(InitLightBoxPrevBtnId, 'none');
            //callToActionscript(flashId, videoUrl, "StopVideo");
            LightBoxState = (false);
            LastCreate = null;
            OldGroup = null;
            ImgNum = null;
        } else {
            //callSwitchVisibilityDropDownBoxsIe6Fix('visible', 'selectSortDropDownList');
            setVisibility(InitLightBoxOverflowId, 'visible');
            switchPreloadImgDisplayStatus();
            //setVisibility(InitLightBoxId, 'visible');
            //callToActionscript(flashId, videoUrl, "StopVideo");
            LightBoxState = (true);
        }
    }
    bug_pogledaj = (true);
}

function resizeObjectAndContainer(objectId, width, height) {
    var rez, NewWidth, NewHeight;
    var Obj = document.getElementById(objectId);
    NewWidth = width;
    NewHeight = height;
    if (NewWidth > MaxWidth || NewHeight > MaxHeight) {
        if (NewWidth >= NewHeight) {
            rez = NewWidth / NewHeight;
            NewWidth = MaxWidth;
            NewHeight = MaxWidth / rez;
            if (NewHeight > MaxHeight) {
                rez = NewHeight / NewWidth;
                NewWidth = MaxHeight / rez;
                NewHeight = MaxHeight;
            }
        }
        else if (NewHeight >= NewWidth) {
            rez = NewHeight / NewWidth;
            NewWidth = MaxHeight / rez;
            NewHeight = MaxHeight;
            if (NewWidth > MaxWidth) {
                rez = NewWidth / NewHeight;
                NewHeight = MaxWidth / rez;
                NewWidth = MaxWidth;
            }
        }
    }
    if (objectId == InitLightBoxFlashPlayerId)
        NewHeight += 25;
    Obj.style.width = NewWidth + 'px';
    objInitLightBoxContainer.style.width = (NewWidth) + 'px';
    Obj.style.height = NewHeight + 'px';
    ContentHeight = NewHeight;
    if (objectId == InitLightBoxImageId && ObjTitle != null || ImgNum != null) {
        ContentHeight = NewHeight + getHeight('divInitLightBoxControlInfo');
        setDisplay('divInitLightBoxControlInfo', 'block');
    } else { setDisplay('divInitLightBoxControlInfo', 'none'); }
    objInitLightBoxContainer.style.height = (ContentHeight) + 'px';
    setTop(InitLightBoxId, (PageYScroll + ((ArrayPageSizes[3] - (ContentHeight + (InitLightBoxPadding * 2))) / 2)) + 'px');
    setHeight(InitLightBoxPrevBtnId, (ContentHeight + (InitLightBoxPadding * 2)) + 'px');
    setHeight(InitLightBoxNextBtnId, (ContentHeight + (InitLightBoxPadding * 2)) + 'px');
    setWidth(InitLightBoxPrevBtnId, (NewWidth / 2) + 'px');
    setWidth(InitLightBoxNextBtnId, (NewWidth / 2) + 'px');
}

var objInitLightBoxContainer;
function createInitLightBoxBase() {
    var objBody = document.getElementsByTagName("body").item(0);
    var objOverflow = document.createElement("div");
    objOverflow.setAttribute('id', InitLightBoxOverflowId);
    objOverflow.onclick = function() { /*switchLightBoxVisibility(InitLightBoxOverflowId, InitLightBoxId, 1); */ };
    objBody.appendChild(objOverflow);
    var objInitLightBox = document.createElement('div');
    objInitLightBox.onclick = function() { switchLightBoxVisibility(InitLightBoxOverflowId, InitLightBoxId, 1); };
    objInitLightBox.setAttribute('id', InitLightBoxId);
    objInitLightBox.style.position = InitLightBoxPosition;
    objBody.appendChild(objInitLightBox);
    
    objInitLightBoxContainer = document.createElement('div');
    objInitLightBoxContainer.setAttribute('id', InitLightBoxContainerId);
    objInitLightBoxContainer.style.padding = InitLightBoxPadding+'px';
    objInitLightBoxContainer.onclick = function() { bug_pogledaj = (false); };
    objInitLightBox.appendChild(objInitLightBoxContainer);
    var objInitLightBoxPreloaderImage = document.createElement('div');
    objInitLightBoxPreloaderImage.setAttribute('id', InitLightBoxPreloaderImageId);
    objBody.appendChild(objInitLightBoxPreloaderImage);
}

function createInitLightBoxControlBtns() {
    var objInitLightBoxNextBtn = document.createElement('a');
    objInitLightBoxNextBtn.setAttribute('id', InitLightBoxNextBtnId);
    objInitLightBoxNextBtn.setAttribute('href', 'javascript:void(0);');
    objInitLightBoxNextBtn.onclick = function() { ImgNum = NextImg; setPrevNextCurrentImg(String((InitLightBoxGroupArray[NextImg]).getAttribute('href'))); return false; };
    //objInitLightBoxNextBtn.onmouseover = function() { this.style.background = 'url(../images/img/InitLightBoxNextHover.png) repeat-y right'; };
    //objInitLightBoxNextBtn.onmouseout = function() { setClass(InitLightBoxNextBtnId, 'divInitLightBoxNextBtn'); return false; };
    objInitLightBoxContainer.appendChild(objInitLightBoxNextBtn);
    var objInitLightBoxPrevBtn = document.createElement('a');
    objInitLightBoxPrevBtn.setAttribute('id', InitLightBoxPrevBtnId);
    objInitLightBoxPrevBtn.setAttribute('href', 'javascript:void(0);');
    objInitLightBoxPrevBtn.onclick = function() { ImgNum = PrevImg; setPrevNextCurrentImg(String((InitLightBoxGroupArray[PrevImg]).getAttribute('href'))); return false; };
    //objInitLightBoxPrevBtn.onMouseOver = function() { setClass(InitLightBoxPrevBtnId, 'divInitLightBoxPrevBtnHover'); return false; };
    //objInitLightBoxPrevBtn.onmouseout = function() { setClass(InitLightBoxPrevBtnId, 'divInitLightBoxPrevBtn'); return false; };
    objInitLightBoxContainer.appendChild(objInitLightBoxPrevBtn);
    var objInitLightBoxNextOpacity = document.createElement('div');
    objInitLightBoxNextOpacity.setAttribute('id', 'divInitLightBoxNextOpacity');
    objInitLightBoxNextBtn.appendChild(objInitLightBoxNextOpacity);
    var objInitLightBoxPrevOpacity = document.createElement('div');
    objInitLightBoxPrevOpacity.setAttribute('id', 'divInitLightBoxPrevOpacity');
    objInitLightBoxPrevBtn.appendChild(objInitLightBoxPrevOpacity);
    var objInitLightBoxCloseBtn = document.createElement('a');
    objInitLightBoxCloseBtn.setAttribute('id', InitLightBoxCloseBtnId);
    objInitLightBoxCloseBtn.setAttribute('href', 'javascript:void(0);');
    objInitLightBoxCloseBtn.onclick = function() { switchLightBoxVisibility(InitLightBoxOverflowId, InitLightBoxId, 1); };
    objInitLightBoxContainer.appendChild(objInitLightBoxCloseBtn);
    var objInitLightBoxControlInfo = document.createElement('a');
    objInitLightBoxControlInfo.setAttribute('id', 'divInitLightBoxControlInfo');
    objInitLightBoxControlInfo.setAttribute('href', 'javascript:void(0);');
    objInitLightBoxContainer.appendChild(objInitLightBoxControlInfo);
    var objInitLightBoxInfoTitle = document.createElement('span');
    objInitLightBoxInfoTitle.setAttribute('id', 'spanInitLightBoxInfoTitle');
    objInitLightBoxControlInfo.appendChild(objInitLightBoxInfoTitle);
    var objInitLightBoxInfoNumOfImgs = document.createElement('span');
    objInitLightBoxInfoNumOfImgs.setAttribute('id', 'spanInitLightBoxInfoNumOfImgs');
    objInitLightBoxControlInfo.appendChild(objInitLightBoxInfoNumOfImgs);
}

function createInitLightBoxImage(url) {
    var objInitLightBoxImage = document.createElement('IMG');
    objInitLightBoxImage.setAttribute('id', InitLightBoxImageId);
    objInitLightBoxImage.src = url;
    objInitLightBoxContainer.appendChild(objInitLightBoxImage);
}

function preloadInitLightBoxImage(url){
    var InitLightBoxImgPreloader = new Image();
    InitLightBoxImgPreloader.onload = function() {
        createInitLightBoxImage(url);
        resizeObjectAndContainer(InitLightBoxImageId, InitLightBoxImgPreloader.width, InitLightBoxImgPreloader.height);
        setInnerHtml('spanInitLightBoxInfoTitle', "");
        if (ObjTitle != null && ObjTitle != 'undefined' && ObjTitle != '') {
            setInnerHtml('spanInitLightBoxInfoTitle', "Slika: " + ObjTitle);
        }
        if (ImgNum != null)
            setInnerHtml('spanInitLightBoxInfoNumOfImgs', "Slika " + (ImgNum + 1) + " od " + InitLightBoxGroupArray.length);
        switchPreloadImgDisplayStatus();
    }
    InitLightBoxImgPreloader.src = url;
}

function preloadInitLightBoxIframe(url) {
    var IframeFirstLoadStatus = (false);
    var objInitLightBoxIframe = document.createElement('iframe');
    objInitLightBoxIframe.setAttribute('id', InitLightBoxIframeId);
    objInitLightBoxIframe.setAttribute('src', url);
    objInitLightBoxIframe.setAttribute('scrolling', InitLightBoxIframeScrolling);
    objInitLightBoxIframe.setAttribute('width', MinWidth);
    objInitLightBoxIframe.setAttribute('frameBorder', '0');
    objInitLightBoxIframe.setAttribute('vspace', '0');
    objInitLightBoxIframe.setAttribute('hspace', '0');
    objInitLightBoxIframe.setAttribute('marginwidth', '0');
    objInitLightBoxIframe.setAttribute('marginheight', '0');
    if (objInitLightBoxIframe.attachEvent) {
        objInitLightBoxIframe.attachEvent("onload", function() {
            resizeObjectAndContainer(InitLightBoxIframeId, (objInitLightBoxIframe.contentWindow.document.body.scrollWidth), objInitLightBoxIframe.contentWindow.document.body.scrollHeight);
            if (!IframeFirstLoadStatus) {
                switchPreloadImgDisplayStatus();
                IframeFirstLoadStatus = (true);
            }
            setVisibility(InitLightBoxContainerId, 'visible');
        });
    } else {
        objInitLightBoxIframe.onload = function() {
            resizeObjectAndContainer(InitLightBoxIframeId, objInitLightBoxIframe.contentWindow.document.body.scrollWidth, objInitLightBoxIframe.contentWindow.document.body.scrollHeight);
            if (!IframeFirstLoadStatus) {
                switchPreloadImgDisplayStatus();
                IframeFirstLoadStatus = (true);
            }
            setVisibility(InitLightBoxContainerId, 'visible');
        };
    }
    objInitLightBoxContainer.appendChild(objInitLightBoxIframe);
}

//----------------------------------------------------------------------------------------------------------------------//++//

var InitLightBoxFlashPlayerId = "objectInitLightBoxFlashPlayer";
var InitLightBoxFlashPlayerUrl = "./flash/flvPlaybackAS3.swf";

function createInitLightBoxFlashPlayer(url) {
    var so = new SWFObject(InitLightBoxFlashPlayerUrl, InitLightBoxFlashPlayerId, "1", "1", "10", "#fff");
    so.addParam("wmode", "null");
    so.addParam("flashvars", "varId=" + InitLightBoxFlashPlayerId + "&varUrl=" + url + "&varMaxWidth=" + MaxWidth + "&varMaxHeight=" + (MaxHeight-25) + "&varMinWidth=" + MinWidth + "&varMinHeight=" + MinHeight + "");
    so.addParam("allowFullScreen", "true");
    so.addParam("allowscale", "true");
    so.write(InitLightBoxContainerId);
}

var FlashPlayerPreloadStatus = (false);
function preloadInitLightBoxFlashPlayer(url) {
    if (!FlashPlayerPreloadStatus) {
        //alert("flash cr");
        FlashPlayerPreloadStatus = (true);
        createInitLightBoxFlashPlayer(url);
    }
    else {
        //alert("flash up");
        FlashPlayerPreloadStatus = (false);
        switchPreloadImgDisplayStatus();
    }
}

function getFlashMovie(FlashId) {
    var isIE = navigator.appName.indexOf("Microsoft") != -1;
    return (isIE) ? window[FlashId] : document[FlashId];
}

function sendToActionscript(FlashId, str, event, maxWidth, maxHeight, minWidth, minHeight) {
    if (imUp == "ImUP") {
        getFlashMovie(FlashId).sendToActionscript(str, event, maxWidth, maxHeight, minWidth, minHeight);
    }
}

var imUp = "";
function sendToJavaScript(str) {
    alert(str);
    //document.getElementById('FlashLightBoxHolder').style.visibility = "hidden";
    /*if (imUp != "ImUP") {
        imUp = str;
        sendToActionscript(InitLightBoxFlashPlayerId, videoUrl, "StartPlayer", maxWidth, maxHeight, minWidth, minHeight);
    }*/
}

//----------------------------------------------------------------------------------------------------------------------


function getPageSize() {
    var xScroll, yScroll;
    if (window.innerHeight && window.scrollMaxY) {
        xScroll = document.body.scrollWidth;
        yScroll = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
        xScroll = document.body.scrollWidth;
        yScroll = document.body.scrollHeight;
    } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
        xScroll = document.body.offsetWidth;
        yScroll = document.body.offsetHeight;
    }
    var windowWidth, windowHeight;
    if (self.innerHeight) {	// all except Explorer
        windowWidth = self.innerWidth;
        windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
        windowWidth = document.documentElement.clientWidth;
        windowHeight = document.documentElement.clientHeight;
    } else if (document.body) { // other Explorers
        windowWidth = document.body.clientWidth;
        windowHeight = document.body.clientHeight;
    }
    // for small pages with total height less then height of the viewport
    if (yScroll < windowHeight) {
        pageHeight = windowHeight;
    } else {
        pageHeight = yScroll;
    }
    // for small pages with total width less then width of the viewport
    if (xScroll < windowWidth) {
        pageWidth = windowWidth;
    } else {
        pageWidth = xScroll;
    }
    var SpacerW = 220;
    var SpacerH = 60;
    MaxWidth = windowWidth - SpacerW;
    MaxHeight = windowHeight - SpacerH;
    if (MaxWidth < MinWidth || MaxHeight < MinHeight) {
        MaxWidth = MinWidth;
        MaxHeight = MinHeight;
    }
    ArrayPageSizes = new Array(pageWidth, pageHeight, windowWidth, windowHeight)
    return ArrayPageSizes;
}

function getPageScroll() {
    var yScroll;
    if (self.pageYOffset) {
        yScroll = self.pageYOffset;
    } else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
        yScroll = document.documentElement.scrollTop;
    } else if (document.body) {
        yScroll = document.body.scrollTop;
    }
    // Ako je lightbox position fixed nije potrebno znati poziciju scrollera, osim ako se radi o IE6 kada mora biti absolute
    var lightBoxPosition = document.getElementById(InitLightBoxId).style.position;
    if (lightBoxPosition == "fixed") {
        PageYScroll = 0;
        if (browser == "Microsoft Internet Explorer" && ieversion <= 6) {
            PageYScroll = yScroll;
            document.getElementById(InitLightBoxId).style.position = 'absolute';
        }
    } else if (lightBoxPosition == "absolute") {
        PageYScroll = yScroll;
    }
    else {
        alert("Error: style position LightBoxa nije određen!");
    }  
}

/*
function switchVisibilityDropDownBoxsIe6Fix(VisibilitySwitch, ObjectId) {
if (browser == "Microsoft Internet Explorer" && ieversion <= 6) {
var TagNameSelect = document.getElementsByTagName("select");
for (var e = 0; e < TagNameSelect.length; e++) {
if (TagNameSelect[e].id != ObjectId) {
TagNameSelect[e].style.visibility = VisibilitySwitch;
}
}
}
}
*/

if (browser == "Microsoft Internet Explorer" && window.attachEvent) {
    window.attachEvent("onload", addOnClickEventOnATag);
}
else {
    document.addEventListener("DOMContentLoaded", addOnClickEventOnATag, false);
}

function alertFlash(e) {
    alert(e);
}
