/* swithbar code */

function expandFrame(){
	var topFrame = parent.document.getElementById("FrameSet");
	var curntFrame = document.getElementById("switchBar");
	var crtStu = document.getElementById("crtStu");
	if (crtStu.display == "block"){
		topFrame.cols="115,23,*";
		crtStu.display="none";
		curntFrame.innerHTML='<img src="icon_shrink.gif" border="0">';
	}
	else if(crtStu.display="none"){
		topFrame.cols="0,23,*";
		crtStu.display="block";
		curntFrame.innerHTML='<img src="icon_expand.gif" border="0">';
	}
}


function Next(obj){
    if(event.keyCode!=13){//回车
    	return;
    }
    nextInput(obj);
}
function nextInput(curobj){
    try{
        obj=curobj;
        if(matchInput(curobj)){
            //跳转到下一个input对象
            if(obj.next==null){
                return;
            }else{
                var nextObj=document.all(obj.next);
                while(nextObj!=null){
                    if(nextObj.type!='hidden'&& nextObj.readOnly==false && nextObj.disabled==false){
                        nextObj.focus();
                        break;
                    }else{
                        if(nextObj.next!=null){
                            nextObj=document.all(nextObj.next);
                        }else{
                            return;
                        }
                    }
                }
            }
        }
    }catch(e){
    }
}

function matchInput(curobj){
    obj=curobj;
    var matchbl = false;
    if(obj.value==""||obj.value==null){//if
       obj.code = "";
        obj.value = "";
        matchbl=true;
    }else{
        if(obj.dict_num==null||obj.dict_num==''){
            matchbl = true;
        }else{
         
        }
    }
    if(matchbl == false){
        curobj.value="";
        curobj.focus();
        return false;
    }else{
        return true;
    }
}
function checkMutilSelect(sel){
	if (sel==null){
		return false;
	}
	var size = sel.length;
	if (size==null){
		if (sel.checked){
			return true;
		}else{
			return false;
		}
	}else {
		for(var i=0;i<size;i++){
			if (sel[i].checked){
				return true;
			}
		}
	}
	return false;
}
function windowOper1(){
window.parent.mainFrame.location.href="controlor.do?event=REGISTER_DETAIL_MOD";
}
function windowOper2(){
window.parent.mainFrame.location.href="controlor.do?event=MODIFY_PASSWORD";
}
function windowOper3(){
window.parent.mainFrame.location.href="../friend/controlor.do?event=FRIEND_MANAGE";
}
function windowOper4(){
window.parent.mainFrame.location.href="../friendmessage/controlor.do?event=FRIEND_MSG_MANAGE";
}
function windowOper5(id){
window.parent.mainFrame.location.href="../user/xx.do?event=AUTHORARTICLE&userid="+id;
}