function startclock(elId) {
    showtime(elId);
}

function showtime(elId) {
    var now = new Date();
    var date = now.getDate();
    var month = now.getMonth() + 1;
    var year = now.getFullYear();
    var hours = now.getHours();
    var minutes = now.getMinutes();
    var seconds = now.getSeconds();
    var dow = now.getDay();
    var dows = new Array();
    dows[0] = "Воскресенье, ";
    dows[1] = "Понедельник, ";
    dows[2] = "Вторник, ";
    dows[3] = "Среда, ";
    dows[4] = "Четверг, ";
    dows[5] = "Пятница, ";
    dows[6] = "Суббота, ";
              
    dow = dows[dow];
    if (month < 10) month = "0" + month;
    if (date < 10) date = "0" + date;
    var timeValue = "Сейчас: " + dow;
    timeValue += " " + date + "." + month + "." + year;
    timeValue += " г.  " + hours;
    timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
    timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
    document.getElementById(elId).innerHTML = timeValue;
    setTimeout("showtime('" + elId + "')", 1000);
}

