function CLASS_MSN_MESSAGE(id,width,height,caption,title,message,target,action){  
    this.id     = id;  
    this.title  = title;  
    this.caption= caption;  
    this.message= message;  
    this.target = target;  
    this.action = action;  
    this.width    = width?width:200;  
    this.height = height?height:120;  
    this.timeout= 1000;  
    this.speed    = 20; 
    this.step    = 1; 
    this.right    = screen.width -1;  
    this.bottom = screen.height; 
    this.left    = this.right - this.width; 
    this.top    = this.bottom - this.height; 
    this.timer    = 0; 
    this.pause    = false;
    this.close    = false;
    this.autoHide    = true;
}  
  
/*
*    隐藏消息方法  
*/  
CLASS_MSN_MESSAGE.prototype.hide = function(){  
    if(this.onunload()){  
        var offset  = this.height>this.bottom-this.top?this.height:this.bottom-this.top; 
        var me  = this;  
        if(this.timer>0){   
            window.clearInterval(me.timer);  
        }  
        var fun = function(){  
            if(me.pause==false||me.close){
                var x  = me.left; 
                var y  = 0; 
                var width = me.width; 
                var height = 0; 
                if(me.offset>0){ 
                    height = me.offset; 
                } 
     
                y  = me.bottom - height; 
     
                if(y>=me.bottom){ 
                    window.clearInterval(me.timer);  
                    me.Pop.hide();  
                } else { 
                    me.offset = me.offset - me.step;  
                } 
                me.Pop.show(x,y,width,height);    
            }             
        }  
        this.timer = window.setInterval(fun,this.speed)      
    }  
}  
  
/*  
*    消息卸载事件，可以重写  
*/  
CLASS_MSN_MESSAGE.prototype.onunload = function() {  
    return true;  
}  
/* 
*    消息命令事件，要实现自己的连接，请重写它  
*  
*/  
CLASS_MSN_MESSAGE.prototype.oncommand = function(){  
    //this.close = true;
    this.hide();  
 window.open("http://www.baidu.com");
   
} 
/**//*  
*    消息显示方法  
*/  
CLASS_MSN_MESSAGE.prototype.show = function(){  
    var oPopup = window.createPopup(); //IE5.5+  
    this.Pop = oPopup;  
  
    var w = this.width;  
    var h = this.height;  
        var str = "<DIV>"
        str += '<TABLE height=159 cellSpacing=0 cellPadding=0 width=256 border=0>'
        str += '<TR><TD height=20><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0><TR>'  
        str	+='<TD width=44><IMG src="images/kk1.gif" width=44 height=20 border="0"></TD><TD style="FONT-SIZE:12px;COLOR:#ffffff;" style="PADDING-TOP: 4px" width="193" background=images/kk2.gif><Strong>公告通知</Strong></TD><TD width=19 id="btSysClose"><IMG src="images/kk3.gif" alt="关闭" width="19" height=20 border=0></TD></TR></TABLE>';
        str	+='</TD></TR><TR><TD vAlign=bottom><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0><TR><TD background=images/kk7.gif height=107><TABLE height=107 cellSpacing=0 cellPadding=0 width="100%" border=0><TR><TD width=3 background=images/kk8.gif> </TD><TD vAlign=top width=250>'
        str +='<TABLE height=107 cellSpacing=0 cellPadding=0 width="100%" border=0><TR><TD vAlign=top><TABLE height=22 cellSpacing=0 cellPadding=0 width="100%" border=0>'
        str +='<TR><TD width=13></TD><TD style="PADDING-TOP: 8px;FONT-SIZE:14px;COLOR:#091f84;" vAlign=bottom align=left>'
        str +='<font id="ommand1" style="cursor:hand;" url="'+this.caption+'"><Strong>'+this.title+'</Strong></font></TD><TD width=13> </TD></TR></TABLE></TD></TR><TR><TD valign="top"><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0><TR><TD width=13> </TD><TD><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 valign="top"><TR><TD width=3> </TD><TD>'
        str +='<TABLE height=18 cellSpacing=0 cellPadding=0 width="100%" valign="top" border=0>'
        str +='<TR valign="top"><TD style="FONT-SIZE:12px;COLOR:#0139d8;" width="100%"><FONT color=#091f84></FONT><font id="ommand2" url="'+this.caption+'">'+ this.message+'</font></TD></TR></TABLE></TD></TR></TABLE></TD></TR></TABLE></TD></TR></TABLE></TD><TD width=3 background=images/kk9.gif> </TD></TR></TABLE></TD></TR><TR><TD>'
        str +='<TABLE height=32 cellSpacing=0 cellPadding=0 width="100%" border=0><TR><TD width=7><IMG height=32 src="images/kk5.gif" width=7></TD><TD background=images/kk4.gif>'
        str +='<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0><TR><TD width=22 vlign="right"><IMG height=17 src="images/kk10.gif" width=18></TD><TD align="left" style="FONT-SIZE:12px;COLOR: #091f84;" nowrap width=28><A id="ommand" href="'+this.caption+'" target="_blank">查看</A></TD><TD width=22></TD><TD class=STYLE3></TD><TD class=STYLE3 align=right></TD></TR></TABLE></TD><TD width=7><IMG height=32 src="images/kk6.gif" width=7></TD></TR></TABLE></TD></TR></TABLE></TD></TR></TABLE>'
        str +="</DIV>"
    oPopup.document.body.innerHTML = str;   
    this.offset  = 0; 
    var me  = this;  
    oPopup.document.body.onmouseover = function(){me.pause=true;}
    oPopup.document.body.onmouseout = function(){me.pause=false;}
    var fun = function(){  
        var x  = me.left; 
        var y  = 0; 
        var width    = me.width; 
        var height    = me.height; 
            if(me.offset>me.height){ 
                height = me.height; 
            } else { 
                height = me.offset; 
            } 
        y  = me.bottom - me.offset; 
        if(y<=me.top){ 
        
        //    me.timeout--; 
          //  if(me.timeout==0){ 
            //    window.clearInterval(me.timer);  
              //  if(me.autoHide){
                //    me.hide(); 
               // }
            //} 
        } else { 
            me.offset = me.offset + me.step; 
        } 
        me.Pop.show(x,y,width,height);    
    }  
  
    this.timer = window.setInterval(fun,this.speed)      
    var btClose = oPopup.document.getElementById("btSysClose");  
    btClose.onclick = function(){  
        me.close = true;
        me.hide();  
    }  
  
   var ommand = oPopup.document.getElementById("ommand");  
      ommand.onclick = function(){  
       //this.close = true;
    me.hide();  
 window.open(ommand.href);
    }   
     var ommand1 = oPopup.document.getElementById("ommand1");  
      ommand1.onclick = function(){  
       //this.close = true;
    me.hide();  
 window.open(ommand1.url);
    }   
    
     var ommand2 = oPopup.document.getElementById("ommand2");  
      ommand2.onclick = function(){  
       //this.close = true;
    me.hide();  
 window.open(ommand2.href);
    }   

}  
/**//* 
** 设置速度方法 
**/ 
CLASS_MSN_MESSAGE.prototype.speed = function(s){ 
    var t = 20; 
    try { 
        t = praseInt(s); 
    } catch(e){} 
    this.speed = t; 
} 
/**//* 
** 设置步长方法 
**/ 
CLASS_MSN_MESSAGE.prototype.step = function(s){ 
    var t = 1; 
    try { 
        t = praseInt(s); 
    } catch(e){} 
    this.step = t; 
} 
  
CLASS_MSN_MESSAGE.prototype.rect = function(left,right,top,bottom){ 
    try { 
        this.left        = left    !=null?left:this.right-this.width; 
        this.right        = right    !=null?right:this.left +this.width; 
        this.bottom        = bottom!=null?(bottom>screen.height?screen.height:bottom):screen.height; 
        this.top        = top    !=null?top:this.bottom - this.height; 
    } catch(e){} 
} 
//本来可以同时弹出两个窗口，但两个有闪烁，只能用层代替了，不过层不跨框架 
//var MSG2 = new CLASS_MSN_MESSAGE("aa",200,120,"短消息提示：","您有2封消息","很不错的啊！");  
//   MSG2.rect(100,null,null,screen.height); 
//    MSG2.show();  
//-->  
