$(window).scroll(function () {
  var scrollPos = $(window).scrollTop();
  if (scrollPos > 0) {
    $("body").addClass("scrolling");
  } else {
    $("body").removeClass("scrolling");
  }
  if (scrollPos > 500) {
    $(".totop").fadeIn();
  } else {
    $(".totop").fadeOut();
  }
});

$(function () {
$("body").on("click", ".sertypes dt", function () {
    $(this).next("dd").stop(false, true).slideToggle();
})
$(document).click(function (event) {
     var con = $('.sertypes dt');
     if (!con.is(event.target) && con.has(event.target).length === 0) {
         $('.sertypes dd').slideUp();
     }
 });
$(".topSearch form").addClass('s_title');
$(".sertypes dd ul li").click(function(){
 var val = $(this).data('val');
 var txt = $(this).text();
 $(this).parent().parent().prev('dt').find('span').text(txt);
 $("#serType").val(val);
 $(".topSearch form").removeClass().addClass('s_'+val)
})
  $("#app").append('<div  class="totop"><svg  class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"  width="16" height="16"><path d="M825.568 555.328l-287.392-289.28C531.808 259.648 523.488 256.576 515.2 256.64 514.08 256.544 513.12 256 512 256c-4.672 0-9.024 1.088-13.024 2.88-4.032 1.536-7.872 3.872-11.136 7.136l-259.328 258.88c-12.512 12.48-12.544 32.736-0.032 45.248 6.24 6.272 14.432 9.408 22.656 9.408 8.192 0 16.352-3.136 22.624-9.344L480 364.288 480 928c0 17.696 14.336 32 32 32s32-14.304 32-32L544 362.72l236.192 237.728c6.24 6.272 14.496 9.44 22.688 9.44s16.32-3.104 22.56-9.312C838.016 588.128 838.048 567.84 825.568 555.328zM864 192 160 192C142.336 192 128 177.664 128 160s14.336-32 32-32l704 0c17.696 0 32 14.336 32 32S881.696 192 864 192z" ></path></svg></div>')
  var scrollPos = $(window).scrollTop();
  if (scrollPos > 0) {
    $("body").addClass("scrolling");
  } else {
    $("body").removeClass("scrolling");
  };
  $(".showSear").click(function () {
    $(".ser-layer").addClass('showdiv');
    //$('body').removeClass('navShow');
  })
  $(".serclose").click(function () {
    $(".ser-layer").removeClass('showdiv');
  });

  
  $(".totop").click(function () {
    $('body,html').animate({ scrollTop: 0 }, 500);
    return false;
  });

  $(".topnav ul li i.plus").click(function () {
    $(this).toggleClass('show').next().slideToggle();
    $(this).parent().siblings('li').find('.plus').removeClass('show').next().slideUp()
  })

$(".left_menus").click(function(e){
$(this).next('.nyleftNav').slideToggle();
$(this).toggleClass('on');
$(document).one("click", function(){
$(".nyleftNav").slideUp();
$(".left_menus").removeClass('on') 
});
e.stopPropagation();
})

$('.navbtnm').click(function () {
  $('body').toggleClass('navShow');
  $('.header .hda .wp').slideToggle();
});
$('.navbtn').click(function () {
  $('body').toggleClass('navShow');
})


  $(".tabNav").each(function () {
    $(this).find('.mores a:eq(0)').show();
    $(this).find('ul li:eq(0)').addClass('on');
  });
  $(".suTab").each(function () {
    var Navs = $(this).find('.mores .more');
    var Lis = $(this).find('.hd ul li');
    Navs.eq(0).show();
    Lis.click(function () {
      var index = $(this).index();
      Navs.eq(index).show().siblings().hide();
    })
  });

  $(".swiTab").each(function () {
    var Navs = $(this).find('.mores .more');
    var Lis = $(this).find('.tabNav ul li');
    Navs.eq(0).show();
    Lis.click(function () {
      var index = $(this).index();
      Navs.eq(index).show().siblings().hide();
    })
  });

  if (!isIE || ieVer == 10 || isIE11) {
     $('.suTab').slide({ trigger: 'click' });
  }

})