$(function () {

    //
    // Добавление 1px к последнему пункту верхнего меню. Удалить, если меню статичное
    //
    $("ul.regions li:last").addClass("last");

    //
    // Добавление отступа к абзацам в описании проекта
    //
    $("div.orderDescribeBlock:not(:has(.h1))").each(function () {
        $(this).children("p").not("p:first").addClass("indented");
    });

    //
    // Очистка формы авторизации
    //
    $("div.authForm input[name=login]").focus(function () {
        $(this).val("");
    });
    $("div.authForm input[name=login]").blur(function () {
        if ($(this).val() == "") $(this).val("логин");
    });

    $("div.authForm input[name=pwd]").focus(function () {
        $(this).val("");
    });
    $("div.authForm input[name=pwd]").blur(function () {
        if ($(this).val() == "") $(this).val("пароль");
    });

    //
    // «Палец» на объявлении
    //
    $("div.contentInfo.advert a").mouseover(function () {
        $("div.attention").addClass("attentionHover");
    });

    $("div.contentInfo.advert a").mouseout(function () {
        $("div.attention").removeClass("attentionHover");
    });

    $("div.attention").mouseover(function () {
        $(this).addClass("attentionHover");
    });

    $("div.attention").mouseout(function () {
        $(this).removeClass("attentionHover");
    });

    //
    // Синяя кнопка формы под курсором
    //

    $("input.button").mouseover(function () {
        $(this).addClass("buttonHover");
    });

    $("input.button").mouseout(function () {
        $(this).removeClass("buttonHover");
    });

    //
    // Голубой фон контент-инфо меню под курсором
    //
    $("div.contentInfoMenuItem").mouseover(function () {
        $(this).addClass("contentInfoMenuItemHover");
        //$(this).children("a.rightAligned").show();
    });

    $("div.contentInfoMenuItem").mouseout(function () {
        $(this).removeClass("contentInfoMenuItemHover");
        //$(this).children("a.rightAligned").hide();
    });

    //
    // Жирный бордер после выделенного меню
    //
    //$("div.contentInfoMenu:not(.contentInfoMenuNoBold) .contentInfoMenuItemSel").next("div.sep0").addClass("sepBold0");

    //
    // Скрываем "скачать" в контент-инфо меню и показываем их по наведению мыши
    //
    //$(".contentInfoMenuItem a.rightAligned").hide();

    //////////////////////////////
    //
    // Добавлено 13.02.2011
    //
    //////////////////////////////

    //
    // Добавляем .last к последнему пункту блока новостей
    //  
    $("div.newsBlock li:last").addClass("last");

    //
    // Голубой фон новостей меню под курсором
    //
    $("div.newsBlock li").mouseover(function () {
        $(this).addClass("hover");
    });
    $("div.newsBlock li").mouseout(function () {
        $(this).removeClass("hover");
    });

});

