function countdown(target, element, message) {
    var dn = new Date();
    var dt = new Date(target);
    var diff = dt.getTime() - dn.getTime();
    diff /= 1000;
                         
    // done
    if(diff <= 0) {
        document.getElementById(element).innerHTML = message;
        return(0);
    }
                         
    // days
    var tmp = diff;
    var d = Math.floor(tmp / 24 / 3600);
    tmp = tmp % (24 * 3600);
                         
    // hours
    var h = Math.floor(tmp / 3600);
    tmp = tmp % 3600;
                         
    // minutes
    var m = Math.floor(tmp / 60);
    tmp = tmp % 60;
                         
    // seconds
    var s = Math.floor(tmp);
    
    var str ='<div class="odpocitavadlo-dni"><p><b>Dni</b></p><p class="cislo">';
    if (d < 10) str += "0";                     
    str +=  d + '</p></div><div class="odpocitavadlo-hod"><p><b>Hodiny</b></p><p class="cislo">';
    
                         
    if (h < 10) str += "0";
    str += h + '</p></div><div class="odpocitavadlo-min"><p><b>Minúty</b></p><p class="cislo">';
    if (m < 10) str += "0";
    str += m + '</p></div>';//<div class="odpocitavadlo-sek">';
    //if (s < 10) str += "0";
    //str += s + '</div>';  
                     
    document.getElementById(element).innerHTML = str;
                         
    setTimeout("countdown('"+target+"','"+element+"','"+message+"')",999); 
} 

