    function togg_sub1() {$(".sub1").toggle(500);} ; 
	function togg_sub2() {$(".sub2").toggle(500);} ; 
	function togg_sub3() {$(".sub3").toggle(500);} ;
    function togg_sub4() {$(".sub4").toggle(500);} ; 
	function togg_sub5() {$(".sub5").toggle(500);} ;

	
	function getTimeDiff(earlier, later)
{

  var diff;
  var time = last = {years:0, months:0, days:0, hours:0, minutes:0, seconds:0};
  laterYear=later.getFullYear();
  laterMonth=later.getMonth();
  laterDay=later.getDate();
  laterHours= later.getHours();
  laterMinutes= later.getMinutes();
  earlierYear=earlier.getFullYear();
  earlierMonth=earlier.getMonth();
  earlierDay=earlier.getDate();
  laterHours= later.getHours();
  laterMinutes= later.getMinutes();
  DaysInMonth = new Array (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);


  diff = later.valueOf();

if (laterMonth >= earlierMonth)
 {
    if ((earlierYear%4==0 || earlierYear%400==0) && earlierYear%100!=0)
    	DaysInMonth[1]=29;
    time.years = laterYear - earlierYear;
    time.months = laterMonth - earlierMonth;
    if (laterDay >= earlierDay)
    {
    	time.days = laterDay - earlierDay;
    }
    else
    {
    	time.days = DaysInMonth[earlierMonth] - (earlierDay - laterDay);
    	if (time.months==0)
    	{
    		time.months=11;
    		time.years=time.years-1;
    	}
    	time.months=time.months-1;
    }

   }
   else
   {
    time.years = laterYear - earlierYear - 1;
    if ((earlierYear%4==0 || earlierYear%400==0) && earlierYear%100!=0)
	    DaysInMonth[1]=29;

    time.months = 12 - (earlierMonth - laterMonth);
    if (laterDay >= earlierDay)
    {
    	time.days = laterDay - earlierDay;
    }
    else
    {
    	time.days = DaysInMonth[earlierMonth] - (earlierDay - laterDay);
    	if (time.months==0)
    	{
    		time.months=11;
    		time.years=time.years-1;
    	}
    	time.months=time.months-1;
    }
   }
	dt=new Date(laterYear-time.years, laterMonth-time.months, laterDay-time.days, laterHours, laterMinutes);
	diff = dt.valueOf()-earlier.valueOf();

  time.hours = Math.floor(diff/1000/60/60);
  diff -= time.hours*1000*60*60;

  time.minutes = Math.floor(diff/1000/60);
  diff -= time.minutes*1000*60;

  time.seconds = Math.floor(diff/1000);
  diff -= time.seconds*1000;
  if (time.minutes<0 && time.minutes>-60)
  {
  	time.hours=time.hours-1;
  }
  if (time.hours<0 && time.hours>-23)
  {
  	time.hours=24+time.hours;
  	if (time.days==1)
  	{
  		time.days = DaysInMonth[time.months];
  		if (time.months==0)
    	{
    		time.months=11;
    		time.years=time.years-1;
    	}
    	time.months=time.months-1;
  	}
  }
  var s;
  for(var key in time)
  {
    s+=key+"="+time[key]+ " ";
    var len=(String(time[key]).length>2 ? 2 : String(time[key]).length);
    last[key] = String(time[key]).substr( 0, len);
    //alert(last[key]);
  }
  //alert(s);

  var titles = {
    'y': (last.years == 1)   ? 'год'     : ( (last.years >= 2 && last.years <= 4)     ? 'года'    : 'лет' ),
    'f': (last.months == 1)  ? 'месяц'   : ( (last.months >= 2 && last.months <= 4)   ? 'месяца'  : 'месяцев' ),
    'd': (last.days == 1)    ? 'день'    : ( (last.days >= 2 && last.days <= 4)       ? 'дня'     : 'дней' ),
    'h': (last.hours == 1)   ? 'час'     : ( (last.hours >= 2 && last.hours <= 4)     ? 'часа'    : 'часов' ),
    'm': (last.minutes == 1) ? 'минуту'  : ( (last.minutes >= 2 && last.minutes <= 4) ? 'минуты'  : 'минут' ),
    's': (last.seconds == 1) ? 'секунду' : ( (last.seconds >= 2 && last.seconds <= 4) ? 'секунды' : 'секунд' )
  }

  return {
    'y': time.years,
    'f': time.months,
    'd': time.days,
    'h': time.hours,
    'm': time.minutes,
    's': time.seconds
  };
}

function drawDate() {
  var current, past, diff;
  current = new Date();
  past = new Date(2005, 9, 1, 11, 15);

  diff = getTimeDiff(past, current);
  var counter = document.getElementById('counter').getElementsByTagName('span');
  for(var i = 0, size = counter.length; i < size; i++)
    counter[i].innerHTML = diff[counter[i].id];
}

window.onload = function() {
  drawDate();
  setInterval('drawDate()', 5000);
}


