//--часы------------------------------------------------------------------------
function lastsun(month, dc)
  {
  tdate=new Date();
  tdate.setMonth(month);
  for (i=dc;i>23;i--)
    {
    tdate.setDate(i);
    if (tdate.getDay()==0) { return i; }
    }//end for;
  }//end function;
//посл. воскресенье октября(9)?  и последнее воскресенье марта (2);

function ClockAndAssign()
  {
  time = new Date ();
  //---;
  tz_correction=7;
  if (
       (time.getMonth()>2 && time.getMonth()<9) ||
       (time.getMonth()==2 && time.getDate()>=lastsun(time.getMonth(),31)) ||
       (time.getMonth()==9 && time.getDate()<lastsun(time.getMonth(),31))
     )
    { tz_correction=8; }
  correction = time.getTimezoneOffset()*60000 +tz_correction*3600000;
  time.setTime( correction + time.getTime() );
  //---;
  secs = time.getSeconds();
  mins = time.getMinutes();
  hr = time.getHours();
  if (hr<10) { hr='0'+hr; }
  if (mins<10) { mins='0'+mins; }
  if (secs<10) { secs='0'+secs; }
  //---;
  if (time.getMonth()*1+1 < 10) {nn = 0;}
  if (time.getMonth()*1+1 >= 10) {nn = '';}
  datk = time.getDate()+'.'+ nn +(time.getMonth()*1+1)+'.'+time.getFullYear()+' г.';
  //---;
  document.getElementById('clock_td').innerHTML=datk+'&nbsp;&nbsp;'+hr+':'+mins+':'+secs;
  setTimeout('ClockAndAssign()',1000);
  }//end function;

//---------------------------------------------

