﻿function Resize(image,size) {
       if (image.width > image.height) {
         var tmp;
         tmp = image.width/image.height;
         image.width = size;
         image.height = size/tmp;
       }
       else if (image.width < image.height){
           var tmp;
           tmp = image.height/image.width;
           image.width = size/tmp;
           image.height = size;
       }
       else if (image.width == image.height) {
           image.width = size;
           image.height = size;
       };
}

function DrawDate(){
var today = new Date();
var date = today.getDate();
var month = today.getMonth(); 
var year = today.getFullYear();

var day = today.getDay();
var str_day;

switch(day)
{
    case 1:
        str_day = "Понедельник";
        break;
    case 2:
        str_day = "Вторник";
        break;
    case 3:
        str_day = "Среда";
        break;
    case 4:
        str_day = "Четверг";
        break;
    case 5:
        str_day = "Пятница";
        break;
    case 6:
        str_day = "Суббота";
        break;
    case 0:
        str_day = "Воскресенье";
        break;
}

var str_month;

switch(month)
{
    case 0:
        str_month = "января";
        break;
    case 1:
        str_month = "февраля";
        break;
    case 2:
        str_month = "марта";
        break;
    case 3:
        str_month = "апреля";
        break;
    case 4:
        str_month = "мая";
        break;
    case 5:
        str_month = "июня";
        break;
    case 6:
        str_month = "июля";
        break;
    case 7:
        str_month = "августа";
        break;
    case 8:
        str_month = "сентября";
        break;
    case 9:
        str_month = "октября";
        break;
    case 10:
        str_month = "ноября";
        break;
    case 11:
        str_month = "декабря";
        break;                                            
}

var str_minute;

var hour = today.getHours();
var minute = today.getMinutes();

switch(minute)
{
    case 0:
        str_minute = "00";
        break;
    case 1:
        str_minute = "01";
        break;
    case 2:
        str_minute = "02";
        break;
    case 3:
        str_minute = "03";
        break;
    case 4:
        str_minute = "04";
        break;
    case 5:
        str_minute = "05";
        break;
    case 6:
        str_minute = "06";
        break;
    case 7:
        str_minute = "07";
        break;
    case 8:
        str_minute = "08";
        break;
    case 9:
        str_minute = "09";
        break;                                
    default:
        str_minute = minute;
        break;
}



document.writeln(str_day + " - " + date + " " + str_month + " " + year + " г. - " + hour + ":" + str_minute);
}













