﻿// JavaScript Dokument  - vypne centrovani pri malem okne prohlizece

window.onresize = zmenClass;
window.onload = zmenClass;


function zmenClass() {
    sir = winW();
    vys = winH();
    if (sir<1004 & vys < 758) { document.getElementById("Panel1").className = "screenTop";}
    else if (sir>=1004 & vys <758) { document.getElementById("Panel1").className = "screenCenterX";}
    else if (sir >= 1004 & vys >= 758) { document.getElementById("Panel1").className = "screenCenter"; }
    else { document.getElementById("Panel1").className = "screenTop"; }

}

function winH() {
    if (window.innerHeight)
    /* NN4 a kompatibilní prohlížeče */
        return window.innerHeight;
    else if
   (document.documentElement &&
   document.documentElement.clientHeight)
    /* MSIE6 v std. režimu - Opera a Mozilla
    již uspěly s window.innerHeight */
        return document.documentElement.clientHeight;
    else if
   (document.body && document.body.clientHeight)
    /* starší MSIE + MSIE6 v quirk režimu */
        return document.body.clientHeight;
    else
        return null;
}

function winW() {
    if (window.innerWidth)
    /* NN4 a kompatibilní prohlížeče */
        return window.innerWidth;
    else if
   (document.documentElement &&
   document.documentElement.clientWidth)
    /* MSIE6 v std. režimu - Opera a Mozilla
    již uspěly s window.innerHeight */
        return document.documentElement.clientWidth;
    else if
   (document.body && document.body.clientWidth)
    /* starší MSIE + MSIE6 v quirk režimu */
        return document.body.clientWidth;
    else
        return null;
}

/*function layer(id) {
    var res
    if (document.getElementById) res = document.getElementById(id)
    if (document.all) res = document.all[id]
    if (res) return res.style
    return null
}*/

/*function preformatuj() {
    var sir, vys, res, nvys;

    sir = winW();
    vys = winH();
    res = layer('Telo');

    nvys = vys - 137 - 60;
     alert(nvys);
    res.height = nvys + 'px';
    return null;
}*/

