/*function equalHeight(group) {

    tallest = 0;

    group.each(function(){

        thisHeight = $(this).height();

        if(thisHeight > tallest){

            tallest = thisHeight;

        }

    });

    group.height(tallest);

}*/



var urlTekucheiStr = location.pathname;

var urlTekStrBezSl = urlTekucheiStr.slice(urlTekucheiStr.length-1, urlTekucheiStr.length);

if (urlTekStrBezSl == "/"){

	urlTekucheiStr = urlTekucheiStr.substring(0, urlTekucheiStr.length-1)

}

var lTek = urlTekucheiStr.indexOf('/catalog/');





$(function(){





if($('ul').is('.gallery')){

	//equalHeight($('ul.gallery li'));

	$('ul.gallery img').lightBox();

	

}

$('a[href $=.jpg]').lightBox();



$('.blokRazdel>ul ul').css({"display":"none"});

if(lTek == 0){

	$('.blokRazdel').css({"display":"none"});

	var linkActiv = $('.blokRazdel a[href = '+urlTekucheiStr+']');

	linkActiv.addClass('activ')/*.css({"border":"solid 1px red"})*/.parents('ul, .blokRazdel').css({"display":"block"});

	var nextUlElem = linkActiv.parent().next('ul');

	if(nextUlElem.length){

		nextUlElem.css({"display":"block"});

	}



	$('.blokRazdel .name a').click(function(){return false});

}





$('#img_opacity1, #img_opacity2').animate({opacity:0.5}, 150);

$('#img_opacity1, #img_opacity2').hover(

    function(){

        $(this).animate({opacity:1}, 150);

    },function(){

        $(this).animate({opacity:0.5}, 150);

    }

)

$('.content table.catalog-item').css({'cursor':'pointer'}).click(function(){

    return location= $(this).find('a:first').attr('href');

})



});
