 //创建右下脚信息框对像
    function MessageBox(oTitle,oFrame,type,s){
        this.oFrame=oFrame;
        this.height=oFrame.clientHeight;
        this.initMB=initMB;
        this.Expand=Expand;
        this.Shrink=Shrink;
        this.initType=type;                              //0展开，1收缩
        this.ChangeType=ChangeType;
        this.Stop=Stop;
        this.oTitle=oTitle;
        this.s=s;
        this.addEvent=addEvent;
        if(this.initType=="1"){
            this.oFrame.style.height="1";
        }
        this.oFrame.setAttribute("MessageBox",this);
        this.AutoPlayId=null;
        this.addEvent(oTitle,"click",oFrame.id+".MessageBox.initMB()");
     }
    
    //展开与收缩
    function initMB(){
        if(document.getElementById("QQ").addEventListener){
            if(typeof(this.oFrame)=="undefined"){
                if(document.getElementById("QQ").style.display=="none"){
                    document.getElementById("QQ").style.display="";
                    document.getElementById("qq_title").src="_images/web/qq_button.gif";
                }else{
                   document.getElementById("QQ").style.display="none";
                   document.getElementById("qq_title").src="_images/web/qq_button1.gif";
                }
            }
        }else{
            this.Stop()
            var oFrameid=this.oFrame.id
            if(this.initType=="1"){
                this.oFrame.style.display="";
                this.AutoPlayId=setInterval(oFrameid+".MessageBox.Expand()",10);
            }else{
                this.AutoPlayId=setInterval(oFrameid+".MessageBox.Shrink()",10);
            }
        }
        
    }
    
    //展开
    function Expand(){
        if(this.oFrame.clientHeight<this.height && this.initType=="1"){
            var h=this.oFrame.clientHeight; 
            h=h+this.s;
            if(h>this.height)h=this.height;
            this.oFrame.style.height=h;
        }else{
            this.ChangeType("0");
            this.Stop()
        }
    }
    
    //收缩
    function Shrink(){
        if(this.oFrame.clientHeight>1 && this.initType=="0"){
            var h=this.oFrame.clientHeight; 
            h=h-this.s;
            if(h<1)h=1;
            this.oFrame.style.height=h;
        }else{
            
            this.oFrame.style.display="none";
            this.ChangeType("1");
            this.Stop()
        }
    }
    
    //停止过程
    function Stop(){
        if(this.AutoPlayId!=null){
            clearTimeout(this.AutoPlayId);
        }
    }
    
    //改变展开收缩状态
    function ChangeType(val){
        this.initType=val;
        if(this.initType=="0"){
            this.oTitle.src="_images/web/qq_button.gif";
        }else{
            this.oTitle.src="_images/web/qq_button1.gif";
        }
    }
    
  function addEvent(obj,evtype,fn) {
    if (obj.addEventListener) {
        obj.addEventListener(evtype,this.initMB,false);
      } else {
        obj.attachEvent("on"+evtype,new Function(fn));
      } 
 }
 
 
