function highlight(m)
    {
    if(m==1)
        {
        document.getElementById('menu_1').style.background='#FF5D3A';
        }
    else if(m==2)
        {
        document.getElementById('menu_2').style.background='#FF5D3A';
        }
    else if(m==3)
        {
        document.getElementById('menu_3').style.background='#FF5D3A';
        } 
    }
function highlight_off(m)
    {
    if(m==1)
        {
        document.getElementById('menu_1').style.background='#161924';
        }
    else if(m==2)
        {
        document.getElementById('menu_2').style.background='#161924';
        }
    else if(m==3)
        {
        document.getElementById('menu_3').style.background='#161924';
        } 
    }
function highlight_obj(m)
    {
    var m2=m+'_1';
    var obj=document.getElementById(m);
    var obj2=document.getElementById(m2);
    if(obj.className=='date_mn')
        {
        obj.className='date_smn';
        }
    else
        {
        obj.className='date_mn';
        }
    if(obj2.className=='date_yn')
        {
        obj2.className='date_syn';
        }
    else
        {
        obj2.className='date_yn';
        }
    }
function dayparts_img()
    {
    var now = new Date();
    h=now.getHours();
    if(h>=7&&h<20)
        {
        document.getElementById('img_dayparts').src='img/img-day.jpg';
        }
    else
        {
        document.getElementById('img_dayparts').src='img/img-night.jpg';
        }
    }
function checkthis(txt)
    {
    tmp=String.fromCharCode(1088);
    tmp+=String.fromCharCode(1086)
    tmp+=String.fromCharCode(1082) 
    re=new RegExp(tmp,'i');
    if(re.test(txt))
        {
        alert('Агррррххх;)');
        }
    }
function set_height(textarea_name)
    {
    var textarea = document.getElementById(textarea_name);
    var substrings = textarea.value.split("\n");
    var textareaHeight = textarea.offsetHeight;
    var heightDefault = 45; //изначальная высота
    var heightLimit = 350; // максимальная высота
    var addHeight = 18; // примерная высота строчки
    var startOn = Math.round(heightDefault / addHeight);
    var charsOnLine = 43; //сколько символов вмещается на строку
    var add = 0;

    for(i = 0; i < substrings.length; i ++)
        {
        add = add + Math.round(substrings[i].length / charsOnLine) + 1;
        }
    if(add > startOn && textareaHeight <= heightLimit)
        {
        textarea.style.height = add * addHeight;
        }
    else if(add <= startOn) textarea.style.height = heightDefault;
    if(textarea.value == "") textarea.style.height = heightDefault;
    }
    
function valid()
    {
    if (document.feedback_form.f_name.value.length>=3&&document.feedback_form.f_message.value.length>3)
        {
        document.feedback_form.submit();
        }
    else
        {
        alert('Заполнены не все поля');
        }
    }

