var timerID = null;
var timerRunning = false;
var day, mon, year,wday;    
var masmon= Array(
"января",
"февраля",
"марта",
"апреля",
"мая",
"июня",
"июля",
"августа",
"сентября",
"октября",
"ноября",
"декабря");
          
var masday= Array(
"воскресенье",
"понедельник",
"вторник",
"среда",
"четверг",
"пятница",
"суббота");


function stopclock ()
{
  if(timerRunning)
  clearTimeout(timerID);
  timerRunning = false; 
 };
function showtime () 
{
  var now = new Date();
  var hours = now.getHours();
  var minutes = now.getMinutes();
  var seconds = now.getSeconds();
  mon = now.getMonth();
  day = now.getDate();  
  year = now.getFullYear(); 
  //year = ((year < 1900) ? 1900+year :year )
  wday= now.getDay();  
  var timeValue = "" + hours;
  timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
  timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
  document.clock.timer.value = timeValue;

var datevalue = ""+day+" "+masmon[mon]+" "+year+" года"; 
document.clock.day.value = datevalue;   
document.clock.wday.value = masday[wday];   
  // В статус бар:
  //window.status = timeValue;
  timerID = setTimeout("showtime()",1000);
  timerRunning = true;
};



