﻿function setMyHeight() {
    var divType = 0;
    var divProizv = document.getElementById('divProizvodi');

    if (divProizv == null) {
        divProizv = document.getElementById('divKontakt');
        divType = 2;
    }
    if (divProizv == null) {
        divProizv = document.getElementById('divUpute');
        divType = 3;
    }
    if (divProizv == null) {
        divProizv = document.getElementById('divPrijavite');
        divType = 4;
    }
    if (divProizv != null) {
        var myHeight = 0;
        if (typeof (window.innerWidth) == 'number') {
            //Non-IE
            myHeight = window.innerHeight;
        } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
            //IE 6+ in 'standards compliant mode'
            myHeight = document.documentElement.clientHeight;
        } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
            //IE 4 compatible
            myHeight = document.body.clientHeight;
        }
        if (divType == 0) {
            divProizv.style.height = myHeight - 215 + 'px';
            var divSmallWoman = document.getElementById('divSmallWoman');
            if (divSmallWoman != null) {
                if (myHeight - 515 > 0) {
                    divSmallWoman.style.height = myHeight - 515 + 'px';
                }
                else {
                    divSmallWoman.style.height = '0px';
                }
            }
        }
        else if (divType == 1) {
            divProizv.style.height = myHeight - 470 + 'px';
        }
        else if (divType == 2) {
            divProizv.style.height = myHeight - 210 + 'px';
        }
        else if (divType == 3) {
            divProizv.style.height = myHeight - 230 + 'px';
        }
        else if (divType == 4) {
            divProizv.style.height = myHeight - 220 + 'px';
        }
    }
}
window.onload = setMyHeight;
window.onresize = setMyHeight; 