
$(function(){
    if (__class == 'products'){
        //$('.right_part  .sub_menu').hide();
        $('.right_part  a.link').click(function(){
            var el=$(this);
            if (el.parent().find('ul:first').css('display') == 'none'){
                el.css({'color':'#C50000',
                    'text-decoration':'none'});
                el.parent().find('ul:first').slideDown('200');
            }
            else if (el.parent().find('ul:first').css('display') == 'block'){
                el.css({'color':'#2d436b',
                        'text-decoration':'underline'});
                el.parent().find('ul:first').slideUp('200');
            }
            else return;    
            return false});
        $('.prod_page_ul a').click(function(){
            var el=$(this).parent().find('div.hidden');
            var content = el.html();
            $.fancybox(content,{'autoDimensions': false,'width':850,'height':'auto'});
            return false;
        })
    };
    if (__class == 'celebrity_cat') {
        $('.more').click(function(){
            if ($('.celebrity_ul .text .hidden').css('display') == 'none'){
                $('.celebrity_ul .text .hidden').slideDown('300');
                $(this).html('скрыть');
            }
            else {
                $('.celebrity_ul .text .hidden').slideUp('300');
                $(this).html('подробнее');
            }
            return false;
        
        })
    }
    if (__class == 'project') {
        var height = $('.right_part').height();
        $('.ph_gallery').css('height',(0.5*height));
        $('.ph_gallery').jScrollPane();
        $('.ph_gallery a.link_ph').fancybox({'titlePosition' : 'inside'});
        //$('.ph_gallery a.link_ph').click(function(){
        //    var src = $(this).attr('href');
        //    var str = '<div><img src="'+src+'" /><br /><span class="text">'+$(this).find('span').html()+'</span></div>';
        //    $.fancybox(str,{'autoDimensions': false,'width':850,'height':850});
        //    return false;
        //})
    }
    if (__class == 'gallery') {
        $('.cert a').fancybox({
            'titlePosition': 'inside'});
    }
    if (__class == 'person_cat') {
        $('a.pic').fancybox();
    }
})
