﻿
//
// This function will shows error message inside element by specified selector
//
function ShowError(errorElementSelector, message) {
    $(errorElementSelector).show().html(message);
}

//
// This function will clears error message inside element by specified selector
//
function HideError(elementSelector) {
    $(elementSelector).hide().html("");
}




$(document).ready(function() {


    // Тень шрифта в блоке с картинкой

    var xxx = $("a.shadow").attr("href");
    $("a.added").append($("a.shadow").html());
    $("a.added").attr({ href: xxx });

    // /Тень шрифта в блоке с картинкой



    // Галарея машины
    //    $(".imgitem a").click(function() {
    //        var largePath = $(this).attr("href");
    //        $("#largeImg").attr({ src: largePath }); return false;
    //    });
    //    count = $(".verta").size();
    //    if (count < 5) $(".scrvup").hide();
    //    if (count < 5) $(".scrvdwn").hide();
    //    if (count < 5) $(".scrvdwn").hide();
    // /Галарея машины


    //    $("#SelectAll").click(function() {
    //        var checked_status = this.checked;
    //        $("input[@name='OfferId']").each(function() {
    //            this.checked = checked_status;
    //        });
    //    });




    //раскрывающийся список услуг

    $("table.vacancies tr td div a.full").toggle(
          function() {
              $(this).siblings('.full_spisok').slideToggle('fast'); $(this).css('background-position', '0 3px');
          },
          function() {
              $(this).siblings('.full_spisok').slideToggle('fast'); $(this).css('background-position', '0 -38px');
          });
    $(".vip_infor").toggle(
              function() {
                  $(this).siblings('.vip_infor_content').slideToggle('fast');
                  $('strong', this).toggle();
              },
              function() {
                  $(this).siblings('.vip_infor_content').slideToggle('fast');
                  $('strong', this).toggle();
              });
    try {
        $(".topeltree").next("ul").treeview({
            animated: "fast"
        });
    }
    catch (er) { };

    $(".topeltree").click(function() {
        $(this).next("ul").slideToggle("fast");
        $(this).siblings(".topeltree").next("ul").slideUp("fast");
        $(this).siblings(".topeltree").children("span").removeClass("topeltreeexp");
        $("span", this).toggleClass("topeltreeexp");

    });
    $(".topeltree:first").next("ul").toggle();
    $("span", ".topeltree:first").toggleClass("topeltreeexp");
})

