// Слайдер верхнего меню
jQuery(function(){  
    var animGo = null;
    jQuery("ul.topnav li").hover(
        function() {
            var id = jQuery(this).attr('id');
            //alert(id);
                        
            if(id!='undefined' && animGo == null) {
                animGo = 1;
                $("#"+id+" ul.subnav").slideDown(100, function(){
                    animGo=null;
                }).show();
            }
        }, 
        function() {
            animGo=null;
            var id = jQuery(this).attr('id');
            if(id!='undefined') {
                $("#"+id+" ul.subnav").slideUp(200,function(){
                    animGo=null;
                });
            }
        }
        );
});

// Фон на .topnav
jQuery(function() {
    $('#topnav_1').hover(
        function() {
            $('#topnav_1 a').addClass('over');
        },
        function() {
            $('#topnav_1 a').removeClass('over'); 
        });
    $('#topnav_2').hover(
        function() {
            $('#topnav_2 a').addClass('over');
        },
        function() {
            $('#topnav_2 a').removeClass('over'); 
        });
});

/*
jQuery(function() {
	jQuery("ul.topnav li a").hover(function() {
		jQuery(this).addClass('fix-PNG-background');
	});
});
*/
jQuery(function() {
    jQuery("ul.topnav li a").addClass('fix-PNG-background');
});

// Левое меню

jQuery(function() {
    //alert('aaa');
    var accordion = jQuery("#left-menu .sub").accordion({
        collapsible: true, 
        autoHeight:  false,
        clearStyle:  true,
        active: '.activeAcc'
    //header: '> li > :first-child,> :not(li):even'
    });
});


// POSM меню
jQuery(function() {  
    jQuery("#posm .h3").click(				
        function() {
            changePOSMstate();	
        }
        );
});
function changePOSMstate(el) {
    if(!jQuery('#posm .h3').hasClass('show')) {
        $("#posm ul").slideToggle();
        $("#posm ul li a").css('border','none');
        $("#posm .h3").addClass('show');
        $("#posm .h3").css('text-decoration','none');
        $("#posm .h3").css('padding-bottom','5px');
        $("#posm.posm").css('height','auto');
        $("#posm.posm").css('background','url(/template/images/posm-corner-full-green.png) no-repeat 0px 0px');
        //$("#posm h3").css('background','url(/template/images/menu-bullet-v.gif) no-repeat 217px 20px');
        $("#posm ul li:last-child")  .css('border-bottom','none');
        $("#posm ul li:last-child a").css('height','20px');
    } else {
        
        //
        $("#posm ul").slideToggle(500, function() {
            $("#posm ul").hide();
            $("#posm.posm").css('height','50px');
            $("#posm.posm").css('background','url(/template/images/posm-corner.png) no-repeat 0px 0px');
            //$("#posm h3").css('background','url(/template/images/menu-bullet-right.gif) no-repeat 220px 20px');
            $("#posm .h3").css('text-decoration','underline');
            $("#posm .h3").removeClass('show');
        });
        
    }
			
}
jQuery(function() {
    jQuery('#posm  ul li:last-child a').hover(function() {
        $(this).addClass('hover');
    });
    jQuery('#posm  ul li:last-child a').mouseout(function() {
        $(this).removeClass('hover');
    });
});	
	
	
// лайтбокс

$(function() {
    $('#gallery a').lightBox();
});
$(function() {
    $('.lightBosGallery a').lightBox();
});
$(function() {
    $('.lightBosGalleryM a').lightBox();
});
    
// скругления
    /*
    $(document).ready(function(){
    	$("img.corner-img").imgr({radius:"10px 10px 0px 0px"});
    	});
    */
    /*
    $("div.corner-img").corner();
*/

