﻿               //讲师
                function mycarousel_itemLoadCallback(carousel, state) {
                    if (carousel.has(carousel.first, carousel.last)) {
                        return;
                    }
                   //debugger; 
                   
                    $.ajax({
                        url: '../webService/WebSite.asmx/GetLector',
                        data: '{first: ' + carousel.first + '}',
                        type: 'post',
                        dataType: 'json',
                        contentType: 'application/json; charset=utf8',
                        success: function(data) {
                            if (data.d) {
                                var json = eval('(' + data.d + ')');
                                carousel.size(json[0].allcount);
                                //循环结果
                                $(json).each(function(i, ite) {
                                    carousel.add(carousel.first+i, mycarousel_getItemHTML(ite.imagepath, ite.lectorid, ite.name));
                                })
                            }
                        },
                        error: function(xhr) {
                            alert("错误信息：" + xhr.responseText);
                        }
                    });
                }
                
                function mycarousel_getItemHTML(url, id, name) {
                    return '<a href="LectorDetail.aspx?LectorID=' + id + '" target="_blank"><img src="../files/LectorImage/' + url + '" alt="' + name + '" /></a><p><a href="lector.aspx?id=' + id + '">' + name + '</a></p>';
                }
                //搜索
                function search_go() {
                    var keystr = encodeURIComponent(document.getElementById('search_txt').value);
                    var searchcate=document.getElementById('search_cate').value;
                    if(searchcate=="course")
                    window.open("SearchCourse.aspx?w=" + keystr);
                   else
                    if(searchcate=="lector")
                     window.open("SearchLector.aspx?w=" + keystr);
                   else
                  if(searchcate=="exam")  
                    window.open("SearchExam.aspx?w=" + keystr);
                  // $.get('AddSearchWord.ashx?k='+keystr); 
                }
                function search_go_enter(event) {
                     if (event.keyCode == 13) {
                        search_go();
                        return false;
                    }
                }
                    //图片加载中
                    function loadingstring() {
                        return '<img src="../Static/Images/loading.gif"  alt="加载中..."/>';
                    }
                    //重新加载
                    function reloadstring(funname) {
                        return '<a href="javascript:;" onclick="' + funname + '">重新加载</a>';
                    }
