var timeStr, dateStr, ostStr, x; 

function clock() { 
        now= new Date(); 
        ex = new Date(2012,0,1,0,0,0); 

// Laikas  
        hours= now.getHours(); 
        minutes= now.getMinutes(); 
        seconds= now.getSeconds(); 
        timeStr= "" + hours; 
        timeStr+= ((minutes < 11) ? ":0" : ":") + minutes; 
        timeStr+= ((seconds < 11) ? ":0" : ":") + seconds; 
         
// Data  
        date= now.getDate(); 
        month= now.getMonth()+1; 
        year= now.getYear(); 
        dateStr= "" + date; 
        dateStr+= ((month < 11) ? "/0" : "/") + month; 
        dateStr+= "/" + year; 

// Viskas kartu
        ostStr= ""; 
        x = (ex.getTime() - now.getTime())/1000;   
        ostStr = Math.floor(x/60/60) + ':'; 
        ostStr = ostStr + Math.floor((x/60/60 - Math.floor(x/60/60))*60) + ':'; 
        x = (((x/60/60 - Math.floor(x/60/60))*60) - Math.floor((x/60/60 - Math.floor(x/60/60))*60))*60; 
        ostStr = ostStr + Math.floor(x); 
// jei reikes milisekundziu
//        x = (x - Math.floor(x))*10; 
//        ostStr = ostStr + Math.floor(x) + ' ms. '; 
         
        document.getElementById('nm2011').innerHTML = ostStr;

        Timer= setTimeout("clock()",10); 
}     

clock();
