/*全局自适应高度*/
function autoFlashHeight(){
    var cHeader = $(".c-header").height();
    var sBar = $(".sjs-bar").height();
    var sBart = $(".sjs-bart").height();
    var sBarz = $(".side-bar").height();
    var pBarz = $(".toolsbar-f").height();
    var bdtopc = $(".body-height-top").height();
    $(".sjs-height-1").height($(window).height()-cHeader-160);
    $(".sjs-height-2").height($(window).height()-cHeader-sBarz-160);
    $(".sjs-height-3").height($(window).height()-cHeader-sBar-560);
    $(".sjs-height-4").height($(window).height()-cHeader-pBarz-160);
    $(".sjs-height-5").height($(window).height()-cHeader-sBart-605);
    $(".sjs-height-6").height($(window).height()-cHeader-bdtopc-204);
};
$(window).resize(autoFlashHeight);
/*全局自适应高度结束*/
$(function(){
/*侧滑*/
$(".open-sidebar").click(function(){
    $(".slide-sidebar").animate({width:"800"}).addClass("open");
});
$("body").click(function(event){
        var e = event || window.event; //浏览器兼容性
        if(!$(event.target).is('a')) {
            var elem = event.target || e.srcElement;
            while (elem) { //循环判断至跟节点，防止点击的是div子元素
                if (elem.className == "open-sidebar" || elem.className == 'slide-sidebar open') {
                    return false;
                }
                elem = elem.parentNode;
            }
            $(".slide-sidebar").animate({width:"0"}).removeClass("open")// 关闭处理
        }

    });
/*侧滑*/
/*工具提示*/
$(function () {
  $('[data-toggle="tooltip"]').tooltip()
});
/*侧栏菜单*/
$(".bg-nav > li > a").click(function() {
      var self = $(this);
      var subMenu = $(this).siblings('ul.sub-menu');
      if(subMenu.length > 0) {
          if(subMenu.is(":visible")) {
              self.find('.menu-arrow').removeClass('fa-angle-up').addClass('fa-angle-down');
              subMenu.slideUp('fast');
              self.parent().removeClass('active');
          }else{
              self.parent().addClass('active');
              self.find('.menu-arrow').removeClass('fa-angle-down').addClass('fa-angle-up');
              subMenu.slideDown('fast');
          }
      }
  });


});
