//判断是否移动设备
var sUserAgent = navigator.userAgent.toLowerCase();
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
var bIsAndroid = sUserAgent.match(/android/i) == "android";
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
$(function() {
// 栏目弹窗
	$(document).ready(function(){
      $(".menu_btn").click(function(){
        $(".menu_nav").slideToggle(300);
      });
      $(".menu_close").click(function(){        
        $(".menu_nav").hide(300);
      });
    });
//栏目导航收起展开
var Accordion = function(el, multiple) {
        this.el = el || {};
        this.multiple = multiple || false;
        // Variables privadas
        var links = this.el.find('.link_zhan');
        // Evento
        links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown)
    }
    Accordion.prototype.dropdown = function(e) {
        var $el = e.data.el;
            $this = $(this),
            $next = $this.next();
        $next.slideToggle();
        $this.parent().toggleClass('open');

        if (!e.data.multiple) {
            $el.find('.submenu').not($next).slideUp().parent().removeClass('open');
        };
    }   
    var accordion = new Accordion($('#accordion'), false);
    
// 展开收起
    var btnElements = $('.tab_sub');	
	    btnElements.on('click', function() {
	        var this1 = $(this);	
	        this1.siblings('.div_a').toggleClass('active')
	        this1.toggleClass('active')
	    });
	
	//点击复制公众号名称
    $('.copy_wechat').click(function(){
      $(".copy_hide").val('fanw89');
      $(".copy_hide").select();
      try {var state = document.execCommand("copy");}
      catch(err){var state = false;}
      if(state){
       alert("复制成功,请打开微信粘贴搜索")        
      }else{
        alert("复制失败,请打开微信搜索:fanw89")
      }
    })
});
