function jsCallBookList(){

};

jsCallBookList.LoadCallBookListMUI=function(){

    jsBookListModle.LoadListModleDom();
    
   jsBookCardModle.LoadCardModleDom();/*联系人模式：档案卡*/
     
     var strtType=jsCallBookList.GetCurComOrEmpModel();
    if(strtType=="Com"){
       $("#radCallBookList").attr("checked",true);
       jsCallBookList.ChangeToEmpOrComDivModel(document.getElementById("radCallBookList"));
    }
 //  jsCallMiddlePanel.LoadPanelUI();/*通讯簿便签*/
   jsCallMiddlePanel.LoadDetailPanel(strtType);/*通讯簿列表模式标签*/
   jsServiceRegister.ServiceRecordTypeDrop();    /*服务登记类型下拉选择框*/
    strtType=null;
    CollectGarbage();
};
/*内容高度*/
jsCallBookList.middleContanier = "";
/*联系人及公司模式的转换*/
jsCallBookList.ChangeToEmpOrComDivModel = function(obj) {
   var strSearchType = "quick";
    if (jsCommunicationQueryCondition.SearchWay == "divFamiliar") {
        strSearchType = "familiar";
    }
    if (jsCommunicationQueryCondition.SearchWay == "divStrange") {
        strSearchType = "strange";
    }
    if ($(obj).val().toString() == "Emp") {            
        jsCallBookList.IsListOrCardModle('Card');        
        document.getElementById("divAdrBookForEmployee").style.display = "";
        document.getElementById("divAdrBookForCompany").style.display = "none";
         jsBookListModle.BookListSearchString(strSearchType);
    }
    else if ($(obj).val().toString() == "Com") {
       
       jsAdrBookForCompany.LoadColSetJsFile();/*加载系统设置*/
        jsAdrBookForCompany.LoadCompanyGrid();/*公司列表*/     
            
        jsAdrBookForCompany.IsListOrCardModle("com","card");  
        jsAdrBookForCompany.IsListOrCardModle("emp","card");          
        document.getElementById("divAdrBookForEmployee").style.display = "none";
        document.getElementById("divAdrBookForCompany").style.display = "";
        jsAdrBookForCompany.CompanyListSearchString("",strSearchType);
    }
    jsCallMiddlePanel.LoadDetailPanel($(obj).val().toString());
    jsCallBookList.ShowOrHideTabPanel(0);
    jsCommunicationQueryCondition.HideQuickSearchDiv($(obj).val());
    
   
//    if ($(obj).val().toString() == "Emp") {
//       
//    }
//    else if ($(obj).val().toString() == "Com") {
//       
//    }   
    /*更改高级查询结果数*/    
    if(document.getElementById("divAdvanceSearch").style.display==""){
        if($(obj).val().toString()=="Com"){
             document.getElementById("fontAdvanceCount").innerHTML=jsAdrBookForCompany.CurComGridAllCount;
        }else if($(obj).val().toString()=="Emp"){
             document.getElementById("fontAdvanceCount").innerHTML=jsBookListModle.CurEmpGridAllCount;
        }     
    }
};    

/*返回当前是联系人模式还是公司模式*/
jsCallBookList.GetCurComOrEmpModel=function(){
     return  $("input[name='rdModelSearch'][checked]").val();
}
/*通讯簿联系人模式下列表与档案卡的转换*/
jsCallBookList.IsListOrCardModle = function(strType) {
    var Sys = {};
    var ua = navigator.userAgent.toLowerCase();
    if (window.ActiveXObject) {
        Sys.ie = ua.match(/msie ([\d.]+)/)[1]
    }
    if (strType == "List") {
        $("#callListModle").hide();
        $("#callCardModle").show();
        $("#DataRecordCount").show();
        if (Sys.ie == "6.0") {
            var cardInfo = document.getElementById("tbCardInfo").parentElement;
            if (cardInfo.style.height == "100%") {
                var gh = parseInt($("#callCardModle").height()) - 25;
                $("#callCardModle").height(gh);
                cardInfo.style.height = gh;
            }
        }
    }
    else if (strType == "Card") {
        setTimeout("document.getElementById('callCardModle').style.display = 'none'",100);
        document.getElementById("callListModle").style.display = "";
        document.getElementById("DataRecordCount").style.display = "none";
    }
    App.SetNullHref(0);
}

/*通讯簿显示或隐藏页签*/
jsCallBookList.ShowOrHideTabPanel = function(value) {
    var frameleftshow = document.getElementById("frameMiddleShow");
    var Sys = {};
    var ua = navigator.userAgent.toLowerCase();
    if (window.ActiveXObject) {
        Sys.ie = ua.match(/msie ([\d.]+)/)[1]
    }
    if (jsCallBookList.middleContanier == "") {
        jsCallBookList.middleContanier = $("#middleContanier").height();
    } else {
        $("#middleContanier").height(jsCallBookList.middleContanier);
    }
    var archiveDiv = document.getElementById("divArchive");
    if (parseInt(frameleftshow.value) == parseInt(value)) {
        frameleftshow.style.backgroundImage = "url('../AppFrame/APICss/default/images/gridview/uup.png')";
        document.getElementById("divShowOrHideTabPanel").style.display = "none";
        archiveDiv.style.height = document.body.clientHeight - 5; //-185;
        var w = $("#middleContanier").width();
        var gh = $("#middleContanier").height() - 115;
        if (Sys.ie == "6.0") {
            archiveDiv.style.height = document.body.clientHeight - 400;
            gh = $("#middleContanier").height() - 125;
        }
        if (jsCallBookList.GetCurComOrEmpModel() == "Emp") {
            if (Sys.ie == "6.0") {
                var empCard = $("#callCardModle");
                if (empCard[0].style.display == "none") {
                    jsBookListModle.AddressBookGrid.flexResize(w, gh);
                } else {
                    gh = gh + 57;
                    empCard.width(w);
                    empCard.height(gh);
                    document.getElementById("tbCardInfo").parentElement.style.height = gh;
                }
            } else {
                jsBookListModle.AddressBookGrid.flexResize(w, gh);
            }
        }
        else {
            if (Sys.ie == "6.0") {
                var comCard = $("#ComCardModle");
                if (comCard[0].style.display == "none") {
                    jsAdrBookForCompany.CompanyGrid.flexResize(w, gh);
                } else {
                    gh = gh + 57;
                    comCard.width(w);
                    comCard.height(gh);
                    document.getElementById("divComCardContanier").style.height = gh;
                }
            } else {
                jsAdrBookForCompany.CompanyGrid.flexResize(w, gh);
            }
        }
        frameleftshow.value = 0;
        w = null;
        gh = null;
    }
    else {
        frameleftshow.style.backgroundImage = "url('../AppFrame/APICss/default/images/gridview/ddn.png')";
        document.getElementById("divShowOrHideTabPanel").style.display = "";
        archiveDiv.style.height = document.body.clientHeight - 270;
        var w = $("#middleContanier").width();
        var gh = $("#middleContanier").height() - 380;
        if (Sys.ie == "6.0") {
            archiveDiv.style.height = document.body.clientHeight - 320;
            if ($("#middleContanier").height() > jsCallBookList.middleContanier) {
                gh = jsCallBookList.middleContanier - 355;
            } else {
                $("#middleContanier").height(jsCallBookList.middleContanier);
                gh = $("#middleContanier").height() - 355;
            }
        }
        if (jsCallBookList.GetCurComOrEmpModel() == "Emp") {
            if (Sys.ie == "6.0") {
                var empCard = $("#callCardModle");
                if (empCard[0].style.display == "none") {
                    jsBookListModle.AddressBookGrid.flexResize(w, gh);
                } else {
                    gh = gh + 57;
                    empCard.width(w);
                    empCard.height(gh);
                    document.getElementById("tbCardInfo").parentElement.style.height = gh;
                }
            } else {
                jsBookListModle.AddressBookGrid.flexResize(w, gh);
            }
        }
        else {
            if (Sys.ie == "6.0") {
                var comCard = $("#ComCardModle");
                if (comCard[0].style.display == "none") {
                    jsAdrBookForCompany.CompanyGrid.flexResize(w, gh);
                } else {
                    gh = gh + 55;
                    comCard.width(w);
                    comCard.height(gh);
                    document.getElementById("divComCardContanier").style.height = gh;
                }
            } else {
                jsAdrBookForCompany.CompanyGrid.flexResize(w, gh);
            }
        }
        frameleftshow.value = 1;
        w = null;
        gh = null;
    }
    archiveDiv = null;
    frameleftshow = null;
    CollectGarbage();
};




















