/* Js for , Version=1775351192 */
 
  var _hmt = _hmt || [];
  (function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?0a42a759b29fb28d728bd0d436f251be";
    var s = document.getElementsByTagName("script")[0]; 
    s.parentNode.insertBefore(hm, s);
  })();
  ;v.lang = {"confirmDelete":"\u60a8\u786e\u5b9a\u8981\u6267\u884c\u5220\u9664\u64cd\u4f5c\u5417\uff1f","deleteing":"\u5220\u9664\u4e2d","doing":"\u5904\u7406\u4e2d","loading":"\u52a0\u8f7d\u4e2d","updating":"\u66f4\u65b0\u4e2d...","timeout":"\u7f51\u7edc\u8d85\u65f6,\u8bf7\u91cd\u8bd5","errorThrown":"<h4>\u6267\u884c\u51fa\u9519\uff1a<\/h4>","continueShopping":"\u7ee7\u7eed\u8d2d\u7269","required":"\u5fc5\u586b","back":"\u8fd4\u56de","continue":"\u7ee7\u7eed","bindWechatTip":"\u53d1\u5e16\u529f\u80fd\u8bbe\u7f6e\u4e86\u7ed1\u5b9a\u5fae\u4fe1\u7684\u9650\u5236\uff0c\u8bf7\u5148\u7ed1\u5b9a\u5fae\u4fe1\u4f1a\u5458\u3002","importTip":"\u53ea\u5bfc\u5165\u4e3b\u9898\u7684\u98ce\u683c\u548c\u6837\u5f0f","fullImportTip":"\u5c06\u4f1a\u5bfc\u5165\u6d4b\u8bd5\u6570\u636e\u4ee5\u53ca\u66ff\u6362\u7ad9\u70b9\u6587\u7ae0\u3001\u4ea7\u54c1\u7b49\u6570\u636e"};;
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?0a42a759b29fb28d728bd0d436f251be";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
;
    $().ready(function()
    {
        // 顶部 tabs
        $('#block267').find(".block-tabs").hide();
        $('#block267').find(".block-tabs-nav").find('li').click(function()
        {
            index = $(this).index();
            $('#block267').find(".block-tabs-nav li").removeClass('active');
            $(this).addClass('active');
            $('#block267').find(".block-tabs").hide();
            $('#block267').find(".block-tabs").eq(index).show();

        });
        $('#block267').find(".block-tabs-nav").find('li').first().click();

        // 新闻列表
        var currentBlockID = 267;

        
        if(typeof($('#block' + currentBlockID).parent('.col').data('grid')) === 'undefined' && $('#block' + currentBlockID).parent('.col').data('probability') === 'undefined')
        {
            var grid = $('#block' + currentBlockID).parents('.blocks').data('grid');
            grid = typeof(grid) == 'undefined' ? 12 : grid;

            $('#block' + currentBlockID).parent('.col').attr('data-grid', grid).attr('class', 'col col-' + grid);
        }

        $('.articleTitleA').each(function()
        {
            $(this).css('max-width', $(this).parents('li').width() - $(this).prev('.category').width() - $(this).next('.sticky').width() - $(this).parent().next('.article-date').width() - 10);
        })
        $('.articleTitleB').each(function()
        {
            $(this).css('max-width', $(this).parent('li').width() - $(this).next('.sticky').width() - 10);
        })
        
    });

;$().ready(function(){
    // 顶部 tabs
    $('#block280').find(".block-tabs").hide();
    $('#block280').find(".block-tabs-nav").find('li').click(function()
    {
        index = $(this).index();
        $('#block280').find(".block-tabs-nav li").removeClass('active');
        $(this).addClass('active');
        $('#block280').find(".block-tabs").hide();
        $('#block280').find(".block-tabs").eq(index).show();

    });
    $('#block280').find(".block-tabs-nav").find('li').first().click()
});

;$("#consultantBtn").click(function(){
    /**
     * 获取URL参数
     */ 
    function getUrlParameter(name) {
        name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
        var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
        var results = regex.exec(location.search);
        return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
    }    
    
    var t = $('#consultantForm').serializeArray(); 

    // 来自哪个搜索引擎
    t.push({
        name: "source",
        value: localStorage.getItem("from_search")
    });
    // 跳转自哪个新闻页面   
    t.push({
        name: "from_url",
        value: localStorage.getItem("news_url")
    });
    
    var param = $('#consultantForm').serializeArray()
    var fields = {
        kemu: "备考科目",
        city: "城市",
        mobile: "手机号码"
    };    

    $('#consultantForm select').css("border","1px solid #e5e5e5");
    $('#consultantForm input').css("border","1px solid #e5e5e5"); 
    
    var validate = param.every(({ name, value}) => {
        if (!$.trim(value) && name in fields) {
            let field_name = fields[name];
            $('#consultantWarn').html(field_name + "不能为空！");
            return false;
        }
        if (name == 'mobile' && !value.match(/^1[34578]\d{9}$/)) {
            $('#consultantWarn').html('请输入正确的手机号');
            return false;
        }
        return true;
    });    
    if (!validate) return;
    
   
    $.ajax({
        type:"POST",
        url:"index.php?m=signup&f=index",
        data:t,
        success:function(msg){
            if(msg.code==0){
                $('#consultantTitle').html('恭喜您，提交成功！');
                $('#consultantContent').html('您好！我们的工作人员会24小时内联系您，谢谢您！');
                $('#consultantModal').modal('toggle', 'center');
            } else {
                alert(msg.msg ? msg.msg : '参数填写错误！');
            }
        },
        error:function(){
            alert("提交出错！");
        }
    }); 
    
});;

var currentBlockID = 239;


if(typeof($('#block' + currentBlockID).parent('.col').data('grid')) === 'undefined' && $('#block' + currentBlockID).parent('.col').data('probability') === 'undefined')
{
    var grid = $('#block' + currentBlockID).parents('.blocks').data('grid');
    grid = typeof(grid) == 'undefined' ? 12 : grid;

    $('#block' + currentBlockID).parent('.col').attr('data-grid', grid).attr('class', 'col col-' + grid);
}

$('.articleTitleA').each(function()
{
    $(this).css('max-width', $(this).parents('li').width() - $(this).prev('.category').width() - $(this).next('.sticky').width() - $(this).parent().next('.article-date').width() - 10);
})
$('.articleTitleB').each(function()
{
    $(this).css('max-width', $(this).parent('li').width() - $(this).next('.sticky').width() - 10);
})
;

var currentBlockID = 240;


if(typeof($('#block' + currentBlockID).parent('.col').data('grid')) === 'undefined' && $('#block' + currentBlockID).parent('.col').data('probability') === 'undefined')
{
    var grid = $('#block' + currentBlockID).parents('.blocks').data('grid');
    grid = typeof(grid) == 'undefined' ? 12 : grid;

    $('#block' + currentBlockID).parent('.col').attr('data-grid', grid).attr('class', 'col col-' + grid);
}

$('.articleTitleA').each(function()
{
    $(this).css('max-width', $(this).parents('li').width() - $(this).prev('.category').width() - $(this).next('.sticky').width() - $(this).parent().next('.article-date').width() - 10);
})
$('.articleTitleB').each(function()
{
    $(this).css('max-width', $(this).parent('li').width() - $(this).next('.sticky').width() - 10);
})
;

var currentBlockID = 241;


if(typeof($('#block' + currentBlockID).parent('.col').data('grid')) === 'undefined' && $('#block' + currentBlockID).parent('.col').data('probability') === 'undefined')
{
    var grid = $('#block' + currentBlockID).parents('.blocks').data('grid');
    grid = typeof(grid) == 'undefined' ? 12 : grid;

    $('#block' + currentBlockID).parent('.col').attr('data-grid', grid).attr('class', 'col col-' + grid);
}

$('.articleTitleA').each(function()
{
    $(this).css('max-width', $(this).parents('li').width() - $(this).prev('.category').width() - $(this).next('.sticky').width() - $(this).parent().next('.article-date').width() - 10);
})
$('.articleTitleB').each(function()
{
    $(this).css('max-width', $(this).parent('li').width() - $(this).next('.sticky').width() - 10);
})
;$("#fireOperatorBtn").click(function(){
    
    var t = $('#queryFireOperator').serialize(); 
    var param = $('#queryFireOperator').serializeArray()
    var fields = {
        type: "证书类型",
        level: "证书等级",
        id_number: "身份证号"
    };
    var validate = param.every(({ name, value}) => {
        if (!$.trim(value) && name in fields) {
            let field_name = fields[name];
            alert(field_name + "不能为空！");
            return false;
        }
        return true;
    });
    if (!validate) return;


    $.ajax({
        type:"GET",
        url:"/index.php?m=certificate&f=index",
        data:t,
        success:function(e){
            if(e.result=='success'){
            var o=e.message; 
            $('#name').html(o.name);
            $('#id_nbr').html(o.id_number);
            $('#cert_nbr').html(o.cert_number);
            //$('#fzjg').html(o.company);
            $('#level').html(o.level);
            $('#senddt').html(o.send_date);
            $('#type').html(o.type);
            if(o.practice=="合格"&&o.theory=="合格"){
              $('#result').html("合格");
            }else{
              $('#result').html("不合格");
            }
            $('#fireOperatorResult').modal('toggle', 'center')
            }else{
                alert("填写的信息不对，查询不到！请输入正确信息！");
            }
            
        },
        error:function(){
            alert("提交出错！");
        }
    }); 
    
});;$().ready(function(){
    // 顶部 tabs
    $('#block281').find(".block-tabs").hide();
    $('#block281').find(".block-tabs-nav").find('li').click(function()
    {
        index = $(this).index();
        $('#block281').find(".block-tabs-nav li").removeClass('active');
        $(this).addClass('active');
        $('#block281').find(".block-tabs").hide();
        $('#block281').find(".block-tabs").eq(index).show();

    });
    $('#block281').find(".block-tabs-nav").find('li').first().click()
});

;

var currentBlockID = 236;


if(typeof($('#block' + currentBlockID).parent('.col').data('grid')) === 'undefined' && $('#block' + currentBlockID).parent('.col').data('probability') === 'undefined')
{
    var grid = $('#block' + currentBlockID).parents('.blocks').data('grid');
    grid = typeof(grid) == 'undefined' ? 12 : grid;

    $('#block' + currentBlockID).parent('.col').attr('data-grid', grid).attr('class', 'col col-' + grid);
}

$('.articleTitleA').each(function()
{
    $(this).css('max-width', $(this).parents('li').width() - $(this).prev('.category').width() - $(this).next('.sticky').width() - $(this).parent().next('.article-date').width() - 10);
})
$('.articleTitleB').each(function()
{
    $(this).css('max-width', $(this).parent('li').width() - $(this).next('.sticky').width() - 10);
})
;var o;
$("#signupBt").click(function(){
    /**
     * 获取URL参数
     */ 
    function getUrlParameter(name) {
        name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
        var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
        var results = regex.exec(location.search);
        return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
    }
    
    var t = $('#signupFr').serializeArray(); 
    
    // 来自哪个搜索引擎
    t.push({
        name: "source",
        value: localStorage.getItem("from_search")
    });
    // 跳转自哪个新闻页面   
    t.push({
        name: "from_url",
        value: localStorage.getItem("news_url")
    });
    
    $('#signupFr select').css("border","1px solid #e5e5e5");
    $('#signupFr input').css("border","1px solid #e5e5e5"); 
    
    if($('#kemu').val()==0){
        $('#kemu').css("border","2px solid red").focus();
        $('#warn').html("请选择报名的科目！");
        return false;
    }
    if($('#city').val()==0){
        $('#city').css("border","2px solid red").focus();
        $('#warn').html("请选择城市！");
        return false;
    }
    if($('#username').val().trim()  ===''){
        $('#username').css("border","2px solid red").val("").focus();
        $('#warn').html("请输入您的姓名！");
        return false;
    }
    if(!$('#mobile').val().match(/^1[34578]\d{9}$/)){
        $('#mobile').css("border","2px solid red").val("").focus();
        $('#warn').html("请输入正确的手机号码！");
        return false;
    }
    if($('#company').val().trim()  ===''){
        $('#company').css("border","2px solid red").val("").focus();
        $('#warn').html("请输入您的工作单位！");
        return false;
    }
     
    $.ajax({
        type:"POST",
        url:"index.php?m=signup&f=index",
        data:t,
        success:function(msg){
            if(msg.code==0){
                $('#msgTitle').html('恭喜您，提交成功！');
                $('#msgContent').html(msg.username+'，您好！我们的工作人员会24小时内联系您，谢谢您！');
                $('#myModal').modal('toggle', 'center');
            } else {
                alert(msg.msg ? msg.msg : '参数填写错误！');
            }
        },
        error:function(){
            alert("提交出错！");
        }
    }); 
    
});;
    $().ready(function()
    {
        // 顶部 tabs
        $('#block278').find(".block-tabs").hide();
        $('#block278').find(".block-tabs-nav").find('li').click(function()
        {
            index = $(this).index();
            $('#block278').find(".block-tabs-nav li").removeClass('active');
            $(this).addClass('active');
            $('#block278').find(".block-tabs").hide();
            $('#block278').find(".block-tabs").eq(index).show();

        });
        $('#block278').find(".block-tabs-nav").find('li').first().click();

        // 新闻列表
        var currentBlockID = 278;

        
        if(typeof($('#block' + currentBlockID).parent('.col').data('grid')) === 'undefined' && $('#block' + currentBlockID).parent('.col').data('probability') === 'undefined')
        {
            var grid = $('#block' + currentBlockID).parents('.blocks').data('grid');
            grid = typeof(grid) == 'undefined' ? 12 : grid;

            $('#block' + currentBlockID).parent('.col').attr('data-grid', grid).attr('class', 'col col-' + grid);
        }

        $('.articleTitleA').each(function()
        {
            $(this).css('max-width', $(this).parents('li').width() - $(this).prev('.category').width() - $(this).next('.sticky').width() - $(this).parent().next('.article-date').width() - 10);
        })
        $('.articleTitleB').each(function()
        {
            $(this).css('max-width', $(this).parent('li').width() - $(this).next('.sticky').width() - 10);
        })
        
    });

;$("#quickQueryBtn").click(function(){
    
    var t = $('#quickQueryForm').serialize(); 
    var param = $('#quickQueryForm').serializeArray()

    var fields = {
        project: "查询项目",
        realname: "姓名",
        id_number: "身份证号"
    };
    var projects = ['国考成绩', '国家资格证书'];
    var project = '';
    var validate = param.every(({ name, value}) => {
        if (!$.trim(value) && name in fields) {
            let field_name = fields[name];
            alert(field_name + "不能为空！");
            return false;
        }
        if (name == 'project') {
            if (projects.indexOf(value) === -1) {
                alert('错误的查询项目！');
                return false;
            }
            project = value;
        } 
        return true;
    });

    if (!validate) return;

    var url = '';
    var esc = encodeURIComponent;
    var query = param.filter(({ name, value }) => {
        return ['id_number', 'realname'].indexOf(name) !== -1
    })
    .map(({name, value}) => esc(name) + '=' + esc(value))
    .join('&');
    

    if (project === '国考成绩') {
        url = '/index.php/page/21.html?' + query;
    } 
    
    if (project === '国家资格证书') {
        url = '/index.php/page/national-certificate.html?' + query;
    }
    
    if (url) {
        window.location.href = url;
    }
    console.log(project, url, query)
    return;
    
});;$().ready(function() { $('#execIcon').tooltip({title:$('#execInfoBar').html(), html:true, placement:'right'}); }); ;$(document).ready(function()
{          
    // add "index" class to the body element.
    $('body').addClass('index');

    $('.nav-system-home:first').addClass('active');
})
$(document).ready(function() { 
     // 存储来自搜索引擎的跳转
    var regex = /azxfsite|anzhuoxfpx/;
    var origin = document.referrer;
    if (!regex.test(origin) && origin != "") {
        // 来自搜索引擎
        var url = new URL(origin);
        var host = url.host;
        localStorage.setItem("from_search", host);
    }   
})
;
function loadCartInfo(twinkle)
{
    $('#siteNav').load(createLink('misc', 'printTopBar'),
        function()
        {
            if(twinkle) 
            {
                bootbox.dialog(
                {  
                    message: v.addToCartSuccess,  
                    buttons:
                    {  
                        back:
                        {  
                            label:     v.lang.continueShopping,
                            className: 'btn-primary',  
                            callback:  function(){location.reload();}  
                        },
                        cart:
                        {  
                            label:     v.gotoCart,  
                            className: 'btn-primary',  
                            callback:  function(){location.href = createLink('cart', 'browse');}  
                        }  
                    }  
                });
            }
        }
    );
}
;
        // 图片懒加载
        var lazyLoadInstance = new LazyLoad({ });
    