/* init date of site birth */
       /*    format are DD.MM.YYYY */
       start_date = "24.03.2006";
	   sdate = start_date.split(".");

       date0 = new Date();
       date0.setDate(sdate[0]);
       date0.setMonth(sdate[1]-1);
       date0.setYear(sdate[2]);
       date0.setHours("0");
       date0.setMinutes("0");
       date0.setSeconds("0");

       date1 = new Date();

       function is_leap_year(year) {
           return (year % 4 == 0) && (year % 100 != 0) || (year % 100 == 0);
           //return (year % 4 == 0);
       }

       function days_per_month(year, month) {
           days_in_month = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

           if (month == 1 && is_leap_year(year)) {
               return days_in_month[month] + 1;
           }
           return days_in_month[month];
       }

       function days_per_previous_month(year, month) {
           if (month == 0)
               return days_per_month(year-1, 11);
           return days_per_month(year, month-1);
       }

       function number_to_period(n, str0,str1,str2) {
           switch (n) {
               case 1:
               case 21:
               case 31:
                   return str1;
               case 2:
               case 3:
               case 4:
               case 22:
               case 23:
               case 24:
                   return str2;
               default:
                   return str0;
           }
       }

       function result_date(day0, month0, year0, day1, month1, year1) {
           year = year1 - year0;
             month = 0;
             day = 0;

             if (month1 < month0) {
                   month += 12;
                   year -= 1;
             }

             month += month1 - month0;

             if (day1 < day0) {
                 day = days_per_previous_month(year1, month1);
               if (day < day0 || day <= day1) {
                   day = day1-1;
                   day0 = 0;
                   day1 = 0;
               }

               if (month == 0) {
                     year -= 1;
                     month = 11;
               }
               else  {
                     month -= 1;
               }
            }
           day += day1 - day0;

           if (year)
               str_year = year+' '+number_to_period(year, 'лет', 'год', 'года')+' ';
           else
               str_year = '';

           if (month)
               str_month = month+' '+number_to_period(month, 'месяцев', 'месяц', 'месяца')+' ';
           else
               str_month = '';

           str_day = day+' '+number_to_period(day, 'дней', 'день', 'дня');

           return 'Мы работаем для Вас '+str_year+str_month+str_day+' | <a href="https://broom.x5x.ru" style="color:#D8D8D8">Портал клиента</a> | <a href="mailto:abuse@x5x.ru" style="color:#D8D8D8">Abuse Report</a>';
       }

       if (date1-date0<0) {
           datet = new Date();
           datet = date0;
           date0 = date1;
           date1 = datet;
       }

       document.getElementById('top_info').innerHTML = result_date(date0.getDate(), date0.getMonth(), date0.getYear(), date1.getDate(), date1.getMonth(), date1.getYear());
