$(document).ready(function() {  
    window.addEventListener('resize', Rem, false);
    Rem();
	var flbox = $('.sechan');
    nav = $('.nav');
    box = $('#container');
    flbox.click(function() {
			nav.animate({right:'0px'},'500');
			$('.nav').css("display", "block");
			$('.mainboxbg').css("display", "block");
			 return; 

    });
	$('.mainboxbg').click(function(){
		nav.animate({right:'-40%'},'500');
		$(this).hide();
       return; 
      }	)
  $('.spanfl').click( function(){
    $('.flboxsub').show();
  });
   $('.flcolose').click( function(){
    $('.flboxsub').hide();
  })
   //产品分类
  $('.shosun').click( function(){
    $(this).toggleClass("sundown");
    $(this).next("ul").slideToggle();
   });
   $('.submenushow').click( function(){
      $('.flboxsub').toggle();
   })

  //滑块
  $('.hua_kh li').click(function(){
    var hua_k_h = $('.hua_kh li').index($(this));
    $(this).addClass('active').siblings('.hua_kh li').removeClass('active');
    $('.hua_kh_con').eq(hua_k_h).show().siblings('.hua_kh_con').hide();
  }); 
	
});
function autoh(){
      var ath=$('.autoh').height();
      $('.autohh').css({'height':ath-20+'px'});
    }
function autoimg_list(){
        var wit=$('.imgautolist li img').width(); 
        var cplbinfo_h=$(".imgautolist li .cplbinfo").height();
        var nnh = cplbinfo_h +  wit;
        $('.imgautolist').find("li .imgbox").css({'height':wit+'px'});
        // $('.imgautolist').find("li").css({'height':nnh+20+'px'});      
        // $('.imgautolist').find("li a").css({'height':nnh-1+'px'});
}
function Rem() {
      var docEl = document.documentElement,
        oSize = docEl.clientWidth / 7.5;
      if (oSize > 100) {
        oSize = 100; //  限制rem值   640 / 6.4 =100
      }
      docEl.style.fontSize = oSize + 'px';
}