$(document).ready(function(){
    clr = 'www.lmkds.ru'.length + 3; //домен
    window.url = location.href.substring(location.href.indexOf("/")+clr);
    if (url != ''){
        active = $(".leftMenu li a[href$='"+url+"']");
        active.addClass("hover").next("ul").show();
        prevActive1 = active.closest('ul').show().prev('a').addClass("prevHover");
        prevActive2 = active.closest('ul').parent().parent().show().prev('a').addClass("prevHover");
//крошки
        str0 = '<a href="/">Главное</a> /';
        str1 = '<a href="' + active.attr('href') + '">' + active.text() + '</a>';
        if (prevActive1.text()){separator = ' / '}else{separator = ''};
        str2 = '<a href="' + prevActive1.attr('href') + '">' + prevActive1.text() + '</a>' + separator;
        if (prevActive2.text()){separator = ' / '}else{separator = ''};
        str3 = '<a href="' + prevActive2.attr('href') + '">' + prevActive2.text() + '</a>' + separator;
        $('.breadcrumbs').html(str0 + ' ' + str3 + ' ' + str2 + ' ' + str1);
    }
    Sale();
});
function Sale(){
  str = $('h1').text();
  if(str.indexOf('перегородки') + 1 || str.indexOf('перегородок') + 1){
    $("<p class='sale'>Стоимость: от <span>2000</span> рублей за кв.м.</p>").insertAfter($("h1"));
  }
}

