(function($){"use strict";var isIE=!!navigator.userAgent.match(/MSIE/i)||!!navigator.userAgent.match(/Trident.*rv:11\./);isIE&&$('body').addClass('ie');var ua=window['navigator']['userAgent']||window['navigator']['vendor']||window['opera'];(/iPhone|iPod|iPad|Silk|Android|BlackBerry|Opera Mini|IEMobile/).test(ua)&&$('body').addClass('smart');})(jQuery);;(function($){"use strict";$(document).on('click','[ui-toggle-class]',function(e){e.preventDefault();var $this=$(e.target);$this.attr('ui-toggle-class')||($this=$this.closest('[ui-toggle-class]'));var classes=$this.attr('ui-toggle-class').split(','),targets=($this.attr('ui-target')&&$this.attr('ui-target').split(','))||($this.attr('target')&&$this.attr('target').split(','))||Array($this),key=0;$.each(classes,function(index,value){var target=$(targets[(targets.length&&key)]),current=target.attr('ui-class'),_class=classes[index];(current!=_class)&&target.removeClass(target.attr('ui-class'));target.toggleClass(classes[index]);target.attr('ui-class',_class);key++;});$this.toggleClass('active');});})(jQuery);;(function($){"use strict";$.extend(jQuery.easing,{def:'easeOutQuad',easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;}});$(document).on('click','[ui-scroll-to]',function(e){e.preventDefault();var target=$('#'+$(this).attr('ui-scroll-to'));$('html,body').animate({scrollTop:target.offset().top},600,'easeInOutExpo');});})(jQuery);;



/*! main.js - v0.1.1
 * http://www.mobanbox.net/
 * Copyright (c) 2015 Yeti Designs;*/
/* Mobanbox theme functions. Required for
 * Settings Pane and misc functions */

// ajax引用站内其它页面
// 清除ajax缓存
Date.now = Date.now || function() { return +new Date; };

+function ($) {
  var w = $(window).width();
  $(function(){
    $(document).on('click', '[data-toggle="ajaxCom"]',
        function(e) {
          $('#ajaxCom').remove();
          e.preventDefault();
          var $this = $(this)
              , $remote = $this.data('remote') || $this.attr('href')
              , $modal = $('<div id="ajaxCom"></div>');
          $this.after($modal);
          $modal.load($remote);
        }
    );
  });

  $(function(){
    $(document).on('click', '[data-toggle="ajaxStar"]',
        function(e) {
          $('#ajaxStar').remove();
          e.preventDefault();
          var $this = $(this)
              , $remote = $this.data('remote') || $this.attr('href')
              , $modal = $('<div class="modal black-overlay fade" id="ajaxStar" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="overflow-y:hidden;"></div>');
          $('body').append($modal);
          $modal.modal();
          $modal.load($remote);
        }
    );
  });

  w > 768 && $(function(){
    $(document).on('click', '[data-toggle="MobanBoxAjax"]',
        function(e) {
          $('#MobanBoxAjax').remove();
          e.preventDefault();
          var $this = $(this)
              , $remote = $this.data('remote') || $this.attr('href')
              , $modal = $('<div id="MobanBoxAjax"></div>');
          $('body').append($modal);
          $modal.load($remote);
        }
    );

    $(document).on('click', '[data-toggle="ajaxModal"]',
        function(e) {
          $('#ajaxModal').remove();
          e.preventDefault();
          var $this = $(this)
              , $remote = $this.data('remote') || $this.attr('data-src')
              , $modal = $('<div class="modal black-overlay fade" id="ajaxModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="overflow-y:hidden;"><div class="modal-body"></div></div>');
          $('body').append($modal);
          $modal.modal();
          $modal.load($remote);
        }
    );

    $(document).on('mouseover', '[data-toggle="ajaxUser"]',
        function(e) {
          $('#ajaxUser').remove();
          e.preventDefault();
          var $this = $(this)
              , $remote = $this.data('remote') || $this.attr('data-src')
              , $modal = $('<div class="dropdown-menu box-shadow-z3 dropdown-menu-scale lt" style="padding:0;" id="ajaxUser"></div>');
          $this.after($modal);
          $modal.load($remote);
        }
    );
  });
}(jQuery);

//jQuery(document).ready(function() {
//  "use strict";
//  Mobanbox.init();
//});

//将其放置于页面尾部

var Mobanbox = function() {
  // Mobanbox FUNCTIONS
  var runMobanboxSettings = function() {
    if ($('#changeskins').length) {
      // 缓存
      var Body = $('body');
      var Sidebar = $('#aside');
      var Header = $('.navbar');
      var Primary = $("#skinStyle");
      var Branding = Header.children('.navbar-branding');
      // 基础皮肤颜色
      var primary = "primary accent blue danger info success warn warning";
      var darkSkins = "dark grey black";
      var bgSkins = "bg_image_1 bg_image_2 bg_image_3 bg_image_4 bg_image_5 bg_image_6 bg_image_7 bg_image_8 bg_image_9";
      // 皮肤设置
      var settingsObj = {
        'sidebarShow': '', /*show*/
        'boxed': '', /*boxed*/
        'bgSkin': '', /*bg_image_1*/
        'darkSkin': '', /*dark*/
        'primary': "primary" /*danger*/
      };
      // Local Storage 缓存值
      var themeKey = 'mobanbox-skin-settings';
      // Local Storage 获取值
      var themeGet = localStorage.getItem(themeKey);
      // 如果值不存在，设置新的密钥
      if (themeGet === null) {
        localStorage.setItem(themeKey, JSON.stringify(settingsObj));
        themeGet = localStorage.getItem(themeKey);
      }
      // 当网页刷新时读取保存的值
      (function() {
        var settingsParse = JSON.parse(themeGet);
        settingsObj = settingsParse;
        $.each(settingsParse, function(i, e) {
          switch (i) {
            case "primary":
              Primary.attr("href", "/mbthemes/assets/styles/skin/sk." + e + ".css");
              $('#skintoolsPrimary input[value="' + e + '"]').prop('checked', 'true');
              break;
            case 'bgSkin':
              Body.removeClass(bgSkins).addClass(e);
              $('#co_bg_images_list a[data-toggle="' + e + '"]').addClass('current');
              $('#co_bg_pattern_list a[data-toggle="' + e + '"]').addClass('current');
              break;
            case 'darkSkin':
              Body.removeClass(darkSkins).addClass(e);
              $('#skinDark a[data-toggle="' + e + '"]  i').addClass('s');
              break;
            case 'sidebarShow':
              if (e === "show") {
                Sidebar.addClass('show');
                $('#sidebar-option').prop('checked', true);
              } else {
                Sidebar.find('.nano-content').attr('style', '');
                Sidebar.removeClass('show');
                $('#sidebar-option').prop('checked', false);
              }
              break;
            case 'boxed':
              if (e === "boxed") {
                Body.addClass('container');
                $('#body-option').prop('checked', true);
              } else {
                Body.removeClass('container');
                $('#body-option').prop('checked', false);
              }
              break;
          }
        });
      })();
      $("#skintoolsPrimary input").on("click", function() {
        var This = $(this);
        var Val = This.val();
        // 更改css皮肤路径
        Primary.attr("href", "/mbthemes/assets/styles/skin/sk." + Val + ".css");
        // 保存皮肤css值
        settingsObj['primary'] = Val;
        localStorage.setItem(themeKey, JSON.stringify(settingsObj));
      });
      $("#skinDark a").on("click", function() {
        var This = $(this);
        var Val = This.attr('data-toggle');
        // 更改黑色颜色class值
        Body.removeClass(darkSkins).addClass(Val);
        $("#skinDark a i").removeClass('s');
        $('#skinDark a[data-toggle="' + Val + '"] i').addClass('s');
        // 保存黑色颜色值
        settingsObj['darkSkin'] = Val;
        localStorage.setItem(themeKey, JSON.stringify(settingsObj));
        return false;
      });
      // 图片背景切换   图案填充（#co_bg_pattern_list）按需要启用，暂弃用
      $('#co_bg_images_list a,#co_bg_pattern_list a').on('click', function() {
        var Val = $(this).attr('data-toggle');
        var Vbl = 'current';
        if (Body.hasClass(Val)) {
        } else {
          // 图片背景切换
          Body.removeClass(bgSkins).addClass(Val);
          $('#co_bg_images_list a,#co_bg_pattern_list a').removeClass(Vbl);
          $(this).addClass(Vbl);
          Body.addClass('container');
          $('#body-option').parent('checkbox-disabled').addClass('.checkbox-custom').end().prop('checked', true).attr('disabled', false);
          // 关联boxed盒子模式，点击图片后自动打开盒子模式
          settingsObj['boxed'] = "boxed";
          localStorage.setItem(themeKey, JSON.stringify(settingsObj));
        }
        // 保存图片背景图片值
        settingsObj['bgSkin'] = Val;
        localStorage.setItem(themeKey, JSON.stringify(settingsObj));
        return false;
      });
      //鼠标滑动到图片上在选中div上显示图片预览
      jQuery('#co_bg_pattern_list a').hover(
          function() {
            "use strict";
            var pattern = jQuery(this).parent().attr('id') == 'co_bg_pattern_list';
            jQuery(this).parent().parent().css({
              'backgroundImage': 'url(' + jQuery(this).find('img').attr('src').replace('_thumb2', '_thumb') + ')',
              'backgroundRepeat': pattern ? 'repeat' : 'no-repeat'
            });
          },
          function() {
            "use strict";
            jQuery(this).parent().parent().css('backgroundImage', 'none');
          }
      );
      //鼠标滑动到图片上后在选中div的同下级显示图片预览
      jQuery('#co_bg_images_list a').hover(
          function() {
            "use strict";
            jQuery(this).parent().next().css({
              'backgroundImage': 'url(' + jQuery(this).find('img').attr('src').replace('_thumb2', '_thumb') + ')',
              'backgroundRepeat': 'no-repeat',
              'min-height': '140px',
              'margin-top': '15px'
            });
          },
          function() {
            "use strict";
            jQuery(this).parent().next().css({
              'backgroundImage': 'none',
              'min-height': '0',
              'margin-top': '0px'
            });
          }
      );
      // 盒子模式及打开侧边栏
      $('#body-option').on('click', function() {
        var boxed = "boxed";
        if (Body.hasClass('container')) {
          Body.removeClass('container');
          boxed = "relative";
          var Val = $(this).attr('data-toggle');
          var Vbl = 'current';
          Body.removeClass(bgSkins).addClass(Val);
          $('#co_bg_images_list a,#co_bg_pattern_list a').removeClass(Vbl);
          $(this).addClass(Vbl);
          settingsObj['bgSkin'] = Val;
          localStorage.setItem(themeKey, JSON.stringify(settingsObj));
        } else {
          Body.addClass('container');
          boxed = "boxed";
          //
          $('#body-option').parent('.checkbox-custom').removeClass('checkbox-disabled').end().attr('disabled', false);
        }
        // 保存盒子模式值
        settingsObj['boxed'] = boxed;
        localStorage.setItem(themeKey, JSON.stringify(settingsObj));
      });
      // 侧边栏
      $('#sidebar-option').on('click', function() {
        var sidebarShow = "";
        if (Sidebar.hasClass('show')) {
          Sidebar.find('.nano-content').attr('style', '');
          Sidebar.removeClass('show');
          sidebarShow = "";
        } else {
          Sidebar.addClass('show');
          sidebarShow = "show";
        }
        $(window).trigger('resize');
        //
        settingsObj['sidebarShow'] = sidebarShow;
        localStorage.setItem(themeKey, JSON.stringify(settingsObj));
      });
      // 无刷新清除本地存储等
      $("#clearLocalStorage").on('click', function() {
        localStorage.clear();
        $('body').removeClass('boxed container bg_image_1 bg_image_2 bg_image_3 bg_image_4 bg_image_5 bg_image_6 bg_image_7 bg_image_8 bg_image_9');
        $('#co_bg_pattern_list a,#co_bg_images_list a').removeClass('current');
        Body.removeClass('grey black dark');
        $("#skinDark a i").removeClass('s');
        $("#skinDark a:first-child i").addClass('s');
        $('#aside').removeClass('show');
        $('#header-option').prop('checked', true);
        $('#body-option,#sidebar-option').prop('checked', false);
        $('#primary1').prop('checked', true);
        var $link = $("#skinStyle", $("head")),
            href = "/mbthemes/assets/styles/skin/sk.primary.css";
        return void(0 === $link.length ? $("head").append('<link id="skinStyle" href="' + href + '" rel="stylesheet" type="text/css"/>') : $link.attr("href", href));
      });
    }
  }
  return {
    init: function() {
      runMobanboxSettings();
    }
  }
}();

jQuery(document).ready(function() {
  "use strict";
  // Init Mobanbox JS
  Mobanbox.init();
});


//导航侧边栏返回顶部个人空间导航颜色个人空间canvas效果控制
//window.mbBase = {
//  headerFix: true,
//  sidebarFix: true,
//  top: true
//};
//上面为在页面控制方法，必须将其放在所在js上面才会生效

+function ($) { "use strict";
  mbBase.headerFix = "undefined" != typeof mbBase.headerFix ? mbBase.headerFix : !1,
      mbBase.sidebarFix = "undefined" != typeof mbBase.sidebarFix ? mbBase.sidebarFix : !1,
      mbBase.top = "undefined" != typeof mbBase.top ? mbBase.top : !1,
      mbBase.userheaderColor = "undefined" != typeof mbBase.userheaderColor ? mbBase.userheaderColor : !1,
      mbBase.canvas = "undefined" != typeof mbBase.canvas ? mbBase.canvas : !1;

//导航侧
  $(function() {
    if (mbBase.headerFix) {
      /*在.main-nav前面加入父级div*/
      /*$(".main-nav").before('<div class="header-nav-wrap wrap-md"><div class="header-nav-wrap-inner"></div></div>'),
       $(".main-nav").appendTo(".header-nav-wrap-inner"), 0 !== $(".sub-nav").length && ($(".header-nav-wrap").addClass("has-sub-nav"));*/
      var e = null,
          r = !!window.ActiveXObject,
          t = r && !window.XMLHttpRequest;
      $(window).bind("scroll", function() {
        clearTimeout(e), e = setTimeout(function() {
          var e = $(window).scrollTop(),
              w = $(window).width(),
          /*a = $(".header-nav-wrap-inner"),*/
              d = $(".app-header"),
              q = $(".navbar-form"),
              n = $(".h-nav");
          e > 600 ? d.hasClass("navbar-sm navbar-fixed") & q.hasClass("h-form") || (d.addClass("navbar-sm navbar-fixed") & d.addClass("b-b") & q.addClass("h-form"), n.hide(), t || d.css("top", "-80px").animate({
            top: "0px"
          }, 600)) : d.hasClass("navbar-sm navbar-fixed") & q.hasClass("h-form") && (d.removeClass("navbar-sm navbar-fixed") & d.removeClass("b-b") & q.removeClass("h-form"), n.show())
        }, 30)
      })
    }
  });
//个人空间导航透明
  $(function() {
    if (mbBase.userheaderColor) {
      var e = null,
          r = !!window.ActiveXObject,
          t = r && !window.XMLHttpRequest;
      $(window).bind("scroll", function() {
        clearTimeout(e), e = setTimeout(function() {
          var e = $(window).scrollTop(),
              w = $(window).width(),
              d = $(".app-header");
          e > 600 ? d.hasClass("") || (d.removeClass("grey dk no-bg"), t) : d.addClass("no-bg") && (d.addClass("grey dk no-bg"))
        }, 30)
      })
    }
  });

//内容页右侧边栏互动固定
  $(function() {
    if (mbBase.sidebarFix) {
      var e = null;
      $(window).bind("scroll", function() {
        clearTimeout(e), e = setTimeout(function() {
          var e = $(window).scrollTop(),
              w = $(window).width(),
              a = $(".right-bar");
          w > 768 & e > 600 ? a.hasClass("fix") || (a.addClass("fix")) : a.hasClass("fix") && (a.removeClass("fix"))
        })
      })
    }
  });


//返回顶部
  $(function() {
    if (mbBase.top) {
      var e = null;
      $(window).bind("scroll", function() {
        clearTimeout(e), e = setTimeout(function() {
          var e = $(window).scrollTop(),
              w = $(window).width(),
              a = $("#top");
          e > 600 ? a.hasClass("show") || (a.addClass("show")) : a.hasClass("show") && (a.removeClass("show"))
        })
      })
    }
  });

//个人空间canvas效果
  $(function() {
    if (mbBase.canvas) {
      var w = $(window).width();
      $(".box-canvas").each(function() {
        //w > 768 & e > 200  为浏览器当宽度大于768时才会触发，否则无效， e > 500为当滚动高度大于500时才会触发
        w > 768 && postars($('.cover')[0]).init();
      });
    }
  });

//导航改为hover显示子菜单
  $(function(){
    //body .on fix ajax返回无效问题
    $(document).on('mouseover' , '.myDrop' ,
        function() {
          $(this).addClass('open');
        }
    );
    $(document).on('mouseout' , '.myDrop' ,
        function() {
          $(this).removeClass('open');
        }
    );
    $('[data-toggle="tooltip"]').tooltip()
  });
}(window.jQuery);