$(function(){
	//初始化手机端导航
	if($("nav#menu").length > 0) {
		$("nav#menu").mmenu({
			"extensions": ["theme-blue"],
			"slidingSubmenus": true,
			"offCanvas": {
				"position": "right"
			},
			"navbar": {
				"title": "MENU"
			}
		});
	}
});

var is_open=[];
$(document).ready(function(index){
	$(".public_list_156 #nav li").each(function(index){

		is_open[index]={"d1":0,"d2":0};
		if($(this).attr('data-second')!=undefined){
			var li_data_second =$(this).attr('data-second');
			var li_width       =$(window).width()-$(this).offset().left;

			$(".public_list_156 .conten_second .second."+li_data_second).width(li_width);
			var li_height      =$(".public_list_156 .conten_second .second."+li_data_second).outerHeight();
			$(".public_list_156 .conten_second .second."+li_data_second).animate({marginTop:"-"+li_height+"px"});


			//console.log($(".public_list_156 #nav li:eq("+index+"),.public_list_156 .conten_second .second."+li_data_second));

			$(this).hover(function(){
				if(is_open[index].d1==0 && is_open[index].d2==0){
					$(".public_list_156 .conten_second .second."+li_data_second).animate({marginTop:"0px"});
				}
				is_open[index].d1=1;
			},function(){
				is_open[index].d1=0;
				var li_height      =$(".public_list_156 .conten_second .second."+li_data_second).outerHeight();
				setTimeout(function(){
					if(is_open[index].d1==0 && is_open[index].d2==0){
						$(".public_list_156 .conten_second .second."+li_data_second).animate({marginTop:"-"+li_height+"px"});
					}
				},100);

			});

			$(".public_list_156 .conten_second .second."+li_data_second).hover(function(){
				if(is_open[index].d1==0 && is_open[index].d2==0){
					$(".public_list_156 .conten_second .second."+li_data_second).animate({marginTop:"0px"});
				}
				is_open[index].d2=1;
			},function(){
				is_open[index].d2=0;
				var li_height      =$(".public_list_156 .conten_second .second."+li_data_second).outerHeight();
				setTimeout(function(){
					if(is_open[index].d1==0 && is_open[index].d2==0){
						$(".public_list_156 .conten_second .second."+li_data_second).animate({marginTop:"-"+li_height+"px"});
					}
				},100);
			});


		}
	});
});

(function($) {
	$.fn.resizeimgSize = function(options) {
		//默认参数
		var defaults = {
			select_wrapper: "li",
			img_item: "",
			proportion: 842/595
		};

		//覆盖默认参数
		var opts = $.extend(defaults, options);
		var el = this;

		var start = function() {
			el.each(function() {
				var obj = $(this);
				var initwidth = 0;

				obj.find(opts.select_wrapper).each(function(index) {
					if(index == 0) {
						initwidth = $(this).innerWidth();
					}
					if(opts.img_item == '') {
						$(this).find("img").height((Number(initwidth) / opts.proportion));
					} else {
						$(this).find("."+opts.img_item).height(Number(Number(initwidth) / opts.proportion));
					}
				});
			});
		}
		return start();
	}
})(jQuery);

//数字变换   开始
	  $('#target').animateNumber(
	    {
	      number: 1000
	    },
	    1500
	  )
	   $('#target1').animateNumber(
	    {
	      number: 12
	    },
	    1500
	  )

	  var decimal_places = 1.5;
		var decimal_factor = decimal_places === 0 ? 1 : decimal_places * 10;
		$('#target3')
		  .animateNumber(
		    {
		      number: 1.5 * decimal_factor,
		      numberStep: function(now, tween) {
		        var floored_number = Math.floor(now) / decimal_factor,
		            target = $(tween.elem);
		        if (decimal_places > 0) {
		          floored_number = floored_number.toFixed(decimal_places);
		          floored_number = floored_number.toString().replace('.', '.');
		        }
		        target.text(floored_number);
		      }
		    },
		    1500
		  );
// 数字变换   End


//banner 轮播图
	$('.bxslider').bxSlider({
	  auto: true,
	  autoControls: true
	});
//banner End

	$('.m_bxslider').bxSlider({
		  auto: true,
		  autoControls: true
		});


//我们的团队
