$(function() {
	cssNavigation();
	headHight();//获取左侧菜单栏高度与图片相等
	iSortFun(".n-item-menu",".n-i-m-bottom .i-j-item",".n-item-right-op","curr");
	mobileheaderlogo();//移动端底顶部logo切换

});
//如果是首页移动端左上角则显示logo
function mobileheaderlogo(){
	if(checkIsMobile()){
		var url = window.document.location.pathname;
		var syWidth =$(".container").width()-95;
		var smWidth =$(".container").width()-142;
        $(".mw-nav-icon").css("background","#000");
        $('head').append("<style>.hear-2-top .mw-nav-icon::before, .hear-2-top .mw-nav-icon::after{ background:#000 }</style>");
        $(".headerlogo").show();
		/*if (url!="/") {

		}else {
			$(".mw-nav-icon").css("background","#000");
			$('head').append("<style>.hear-2-top .mw-nav-icon::before, .hear-2-top .mw-nav-icon::after{ background:#000 }</style>");
            $(".headerlogo").show();
		}*/
	}else {
        $(".headerlogo").show();
	}
}
//获取左侧菜单栏高度与图片相等
function headHight(){
	var height=$(".imgload").eq(0).height();
	if(height>1){
		$(".n-i-m-bottom").css("height",$(".imgload").eq(0).height());
		$(".n-item-right").css("height",$(".imgload").eq(0).height()-2);
		
	}else{
		$(".n-i-m-bottom").css("height",350);
		$(".n-item-right").css("height",350-2);
	}
}
function iSortFun(obj,iTem,iCont,curr) {
	var _timer = null;
	$(obj).on({
		mouseover: function(e) {
			var _this = $(this),
				_index = _this.index();
			if($(iCont).children().eq(_index).length>0) {
				e.stopPropagation();
				_this.addClass(curr).siblings().removeClass(curr);
				_timer = setTimeout(function() {
					$(iCont).show().children().eq(_index).show().siblings().hide();
				}, 100);
				$(iCont).unbind().bind('mouseover', function(e) {
					e.stopPropagation();
					clearTimeout(_timer);
				});
				$(document).unbind().bind('mouseover', function(e) {
					e.stopPropagation();
					clearTimeout(_timer);
					_this.removeClass(curr);
					$(iCont).hide().children().eq(_index).hide();
				})
			}
		}
	}, iTem);
}
/**
 * 设置导航选中样式
 */
function cssNavigation() {
	var url = window.document.location.pathname;
	$("a[href$='" + url + "']").parent().addClass("current");

}
