﻿hideEmptyTables();
function hideEmptyTables() {
    var tb = document.getElementsByTagName("tbody");

    for (i = 0; i < tb.length; i++)
        if (tb[i].getElementsByTagName("tr").length == 0)
            tb[i].parentNode.parentNode.className = "hidden";
}

//-------------------------LANGUAGES----------------------------

function setLanguage(old_lang, lang) {
    location.replace(location.href.replace("/" + old_lang + "/", "/" + lang + "/"));
}

//-------------------------DOJMOVI----------------------------

function winWidth() {
    if (typeof (window.innerWidth) == 'number') {
        //Netscape compliant
        return window.innerWidth;
    } else if (document.documentElement && document.documentElement.clientWidth) {
        //IE6 standards compliant mode
        return document.documentElement.clientWidth;
    } else if (document.body && document.body.clientWidth) {
        //DOM compliant
        return document.body.clientWidth;
    }
}
function winHeight() {
    if (typeof (window.innerHeight) == 'number') {
        //Netscape compliant
        return window.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        //IE6 standards compliant mode
        return document.documentElement.clientHeight;
    } else if (document.body && document.body.clientHeight) {
        //DOM compliant
        return document.body.clientHeight;
    }
}

//--------------------MAP---------------------------------

function changeMap(loc) {
    var img = document.getElementById("map");

    img.src = "images/map_" + loc + ".jpg";
    img.alt = "zoom in";
    img.title = "zoom in";
}

function zoomMap(obj) {
    if (obj.src.indexOf("_zoom") < 0) {
        obj.src = obj.src.replace(".jpg", "_zoom.jpg");
        obj.alt = "zoom out";
        obj.title = "zoom out";
    }
    else {
        obj.src = obj.src.replace("_zoom.jpg", ".jpg");
        obj.alt = "zoom in";
        obj.title = "zoom in";
    }
}
