(function (c) {
    var a = {hospitalId: window.Fx.getUrlParam('HospitalId')};
    // hzAPI.getData(window.apiUrl + 'queryDoctor.php?callback=jsonp',a,'#tongxunlu');

    //请求通讯录医生
    c.ajax({
        type: "get",
        url: window.apiUrl+"queryDoctor.php?callback=jsonp",
        dataType: "jsonp",
        data: c.extend(window.hzAPI.getToken(), a),
        jsonp: "callback",
        async: false,
        crossDomain: true,
        complete: window.hzAPI.dialog(false,window.hzAPI.options.timeout,'数据请求中，请稍后'),
        success:function (data) {
            c('#tongxunlu').html('');
            c('.wordbox ul').html('');
            var wordarray = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S','T','U','V','W','X','Y','Z'];
            var liStr = '' ;
            for(var i = 0; i<26 ;i++ ){
                var wordli = '' ;
                for(var j = 0;j<data.data.length;j++){
                    if(data.data[j].ch == wordarray[i]){
                        wordli += '<li><a href="../doctorWhoAnother.html?hospitalId=1000&deptId='+ data.data[j].deptId +'&doctorId='+data.data[j].id+'">'+data.data[j].doctor_name+'</a></li>';
                    }
                }
                c('#tongxunlu').append('<li>' +
                    '<div class="wordtitle">' +
                    '<p id="'+wordarray[i]+'">'+wordarray[i]+'</p>' +
                    '</div>'+
                    '<ul class="doctorul">'+wordli+'</ul>' +
                    '</li>');
                c('.wordbox ul').append('<li><a href="#'+wordarray[i]+'">'+wordarray[i]+'</a></li>');
            }
        },
        error: function (error) {
            window.hzAPI.dialog(false, window.hzAPI.options.timeout, "网络链接失败");
        },
        timeout: 30000
    });
})(Zepto);
