var searchType="";

var todo="show";
var bodyclick=true;
var t_id=null;
var h_id=null;
//显示学校列表
function showpan(_d,_e){
    todo = 'show';
    bodyclick=false;
    t_id=$('#'+_d);
    h_id=$('#'+_e);
    if(typeof(selectElList) != "undefined"){
        var i=0;
        for(i=0;i<selectElList.length;i++){
            if(typeof (selectElList[i])!="undefined"){
                selectElList[i].style.display="none";
            }
        }
    }
    if(todo!="show"){
        return false;
    }
    var x,y;
    //x=findPosX($("#univcontent")[0]);
    //y=findPosY($('#'+_d)[0]);
    window.client={
        width: document.body.clientWidth,
        height: Math.min(document.documentElement.clientHeight, document.body.clientHeight)
    };
    var _top  = parseInt((window.client.height - $('#univlist').height()) / 2);
    var _left = parseInt((window.client.width - $('#univlist').width()) / 2);
    if ($.browser.msie && parseFloat($.browser.version) < 7) {
        _top = (parseInt($(document).scrollTop())) + (parseInt(_top));
    }

    //$("#univlist").css({'left':_left,'top':_top}).show();
    $("#univlist").css({'left':350,'top':45}).show();

    return false;
}
//隐藏学校列表
function hidepan(){
    if(todo!="hide"){
        return false;
    }
    if(typeof (selectElList)!="undefined"){
        var i=0;
        for(i=0;i<selectElList.length;i++){
            if(typeof (selectElList[i])!="undefined"){
                selectElList[i].style.display="";
            }
        }
    }
    //$("univlist").style.display="none";
    $("#univlist").css('display','none');
    return false;
}
function clsearch(e){
    if(!e){
        var e=window.event;
    }
    if(e.target){
        targ=e.target;
    }else{
        if(e.srcElement){
            targ=e.srcElement;
        }
    }
    if(targ.nodeType==3){
        targ=targ.parentNode;
    }
    var _18=targ.innerHTML;
    var _19=targ.href;
    var _1a=_19.indexOf("id=");
    if(_1a==-1){
        alert("\u94fe\u63a5\u9519\u8bef");
        return false;
    }else{
        _1a+=3;
        var _1b=_19.substring(_1a);
    }
    if(h_id!=null){
        t_id.val(_18);
        if(h_id!=null){
            h_id.val(_1b);
        }
    }
    t_id=null;
    h_id=null;
    todo="hide";
    showClearBtn();
    hidepan();
    return false;
}

function showClearBtn(){
    if(getEl("clearUniv")){
        getEl("clearUniv").style.display="inline";
    }
    if(searchType=="advanced"){
        getEl("department").disabled="false";
        getEl("dorm").disabled="false";
    }
}
function hideClearBtn(){
    if(getEl("clearUniv")){
        getEl("clearUniv").style.display="none";
    }
    if(searchType=="advanced"){
        getEl("department").disabled="true";
        getEl("dorm").disabled="true";
    }
}
