function jsCallMiddlePanel(){

};

jsCallMiddlePanel.LoadPanelUI=function(){
    var arrString=[];
    arrString.push('<div id="tabPanelDiv"></div>');/*<!--通讯簿列表-明细叶签-->*/
    arrString.push('<div id="divServiceList" style="display:none;">');/*<!--服务登记列表叶签-->*/

    arrString.push("</div>");
    arrString.push('<div id="divServiceRecord" style="display:none;">');/*<!--服务登记叶签-->*/

    arrString.push("</div>");
    arrString.push('<div id="divHistoryCall" style="display:none;">');/*<!--历史通话记录-->*/

    arrString.push("</div>");
    arrString.push('<div id="div-ProductInfo" style="display: none;">');/*<!--产品资料-->*/

    arrString.push("</div>");
    document.getElementById("div_Panel").innerHTML=arrString.join("");
    

};

/*通讯簿列表模式标签*/
jsCallMiddlePanel.listNo="";  /*记录当前点击的哪一个明细便签*/
jsCallMiddlePanel.LoadDetailPanel=function(strType){
       $("#tabPanelDiv").html('');
        var tabItems =[   
              { id: "tab-empInfo", text: "联系人信息", closeable: false,onactive:jsAdrBookForCompany.LoadEmployeeInfoListTab,content:$("#ComModelEmployeInfo").html()},   
             { id: "tab-callNote", text: "历史通话记录", closeable: false,onactive:jsHistoryRecord.LoadHistoryCallListTab,content:$("#divHistoryCall").html()},     
            { id: "tab-otherInfo", text: "往来记录", closeable: false,onactive:jsOtherInfo.LoadOtherInfoTab,content:$("#divOtherInfo").html()},    
    //        ,{ id: "tab-serviceList", text: "服务登记列表", closeable: false,onactive:jsServiceList.LoadServiceListTab,content:$("#divServiceList").html()},
    //        { id: "tab-serviceRecord", text: "服务登记", closeable: false,onactive:jsServiceRegister.LoadServiceRegisterTab,content:$("#divServiceRecord").html()},         
    //        { id: "tab-productMet", text: "产品资料", closeable: false,onactive:jsProductInfo.LoadProductInfoTab,content:$("#div-ProductInfo").html()}, 
            { id: "tab-webSearch", text: "网络搜索", closeable: false, url:"frmWebSearch.htm",onactive:jsCallMiddlePanel.LoadWebSearch}
    //        { id: "tab-msgRecord", text: "短信记录", closeable: false, url:""},
    //        { id: "tab-faxRecord", text: "传真记录", closeable: false, url:""}
        ];
       $("#tabPanelDiv").tabpanel({ items: tabItems, width:'auto',height:275});
       $("#tab_li_tab-empInfo").hide();
       
        if(strType=="Com"){
          $("#tabPanelDiv").opentabitem({ id: "tab-empInfo"});
          $("#tab_li_tab-empInfo").show();
        }
        else{
          $("#tabPanelDiv").opentabitem({ id: "tab-callNote"});
        }
//    $("#tab_li_tab-serviceList").hide();
//    $("#tab_li_tab-serviceRecord").hide();
//    $("#tab_li_tab-webSearch").hide();
//    $("#tab_li_tab-productMet").hide();
//    $("#tab_li_tab-msgRecord").hide();
//    $("#tab_li_tab-faxRecord").hide();

    CollectGarbage();
};

jsCallMiddlePanel.LoadWebSearch=function(){
     jsCallMiddlePanel.listNo="webSearch";
     window.setTimeout("jsCallMiddlePanel.ReloadWebSearch()",200);  
}

jsCallMiddlePanel.ReloadWebSearch=function(){
    if(window.parent.jsTitle.CurrentNumber!=""){
        /*通话中*/
         window.frames["tab_item_frame_tab-webSearch"].jsWebSearch.strTelNum=window.parent.jsTitle.CurrentNumber;
         window.frames["tab_item_frame_tab-webSearch"].jsWebSearch.strComName="";
         window.frames["tab_item_frame_tab-webSearch"].jsWebSearch.strPhone="";
         window.frames["tab_item_frame_tab-webSearch"].jsWebSearch.searchInfo();
    }else if(jsCallBookList.GetCurComOrEmpModel()=="Emp"){
        /*联系人模式下*/
        if(jsBookListModle.CurSeletedBookListGridRow!=null){
            window.frames["tab_item_frame_tab-webSearch"].jsWebSearch.strTelNum=jsBookListModle.CurSeletedBookListGridRow.attr("MOBILE");
            window.frames["tab_item_frame_tab-webSearch"].jsWebSearch.strComName=jsBookListModle.CurSeletedBookListGridRow.attr("NAME");
            window.frames["tab_item_frame_tab-webSearch"].document.getElementById("fontPhone").style.display="";
            window.frames["tab_item_frame_tab-webSearch"].jsWebSearch.strPhone=jsBookListModle.CurSeletedBookListGridRow.attr("TEL1");
            window.frames["tab_item_frame_tab-webSearch"].jsWebSearch.searchInfo();
        }
     }else if(jsCallBookList.GetCurComOrEmpModel()=="Com"){
        /*公司模式下*/
        if(jsAdrBookForCompany.CurCompanyGridSelRow!=null){
             if(!window.frames["tab_item_frame_tab-webSearch"].document.getElementById("rdPhone").checked && !window.frames["tab_item_frame_tab-webSearch"].document.getElementById("rdCompanyName").checked){
                  window.frames["tab_item_frame_tab-webSearch"].document.getElementById("rdPhone").checked="checked";
           }
            window.frames["tab_item_frame_tab-webSearch"].jsWebSearch.strPhone=jsAdrBookForCompany.CurCompanyGridSelRow.attr("TEL");
            window.frames["tab_item_frame_tab-webSearch"].jsWebSearch.strComName=jsAdrBookForCompany.CurCompanyGridSelRow.attr("SIMPLE_NAME");
            window.frames["tab_item_frame_tab-webSearch"].document.getElementById("fontPhone").style.display="none";
            window.frames["tab_item_frame_tab-webSearch"].jsWebSearch.strTelNum="";
            window.frames["tab_item_frame_tab-webSearch"].jsWebSearch.searchInfo();       
        }
     }     
};

/*刷新主表时，清空明细表*/
jsCallMiddlePanel.FreashTabDetailInfo=function(){
    switch (jsCallMiddlePanel.listNo) {
       case "EmployeeInfo":
           jsAdrBookForCompany.EmployeeGrid.clearRow();
        break;        
        case "HistoryRecord":
            jsHistoryRecord.HistoryCallGrid.clearRow();/*刷新主列表时清空历史记录*/
            break;
        case "OtherInfo":
            jsOtherInfo.DetailOtherInfoTemplateGrid.clearRow();
            break;
        default:
            break;
    }
}
