﻿function startTime() {
    var today = new Date();
    var h = today.getHours();
    var m = today.getMinutes();
    // add a zero in front of numbers<10
    m = checkTime(m);
    document.getElementById('spanTime').innerHTML = h + ":" + m;
    t = setTimeout('startTime()', 500);

    day = today.getDate();
    month = today.getMonth() + 1;
    year = today.getYear();
    if (day < 10) {
        day = "0" + day;
    }
    if (month < 10) {
        month = "0" + month;
    }

    document.getElementById('spanDate').innerHTML = day + "." + month + "." + year;
}

function checkTime(i) {
    if (i < 10) {
        i = "0" + i;
    }
    return i;
}

step = 570;
function move_right() {
    line = document.getElementById('imageline');
    line.scrollLeft = line.scrollLeft + step;
}
function move_left() {
    line = document.getElementById('imageline');
    line.scrollLeft = line.scrollLeft - step;
}

var cur = '';
function show(id) {
    document.getElementById(id).style.display = "block";
    cur = id;
}
function hide() {
    if (cur != '') document.getElementById(cur).style.display = "none";
}

images = new Array();
images[0] = new Image();
images[0].src = "/images/menu_pas.gif";
images[1] = new Image();
images[1].src = "/images/menu_act.gif";

function openMenu(nam) {
    var b = document.getElementById('lm' + nam);
    if (b != null) {
        if (b.style.display != "none") {
            b.style.display = "none";
        } else {
            b.style.display = "block"
        }
    }
}