Dojo FadeIn/FadeOut

Showing message status for few milliseconds using Dojo fadeIn and fadeOut.

message
message

	dojo.byId('messageDiv').style.display = 'block';
	dojo.byId('messageDiv').className='message'; /* className='errormessage' for showing error*/
	dojo.byId('messageDiv').innerHTML = "Profile Updated..";
        dojo.fadeOut(
	{
		node:"messageDiv",
		onEnd:function()
		{
			dojo.fadeIn({node:"messageDiv", delay:300}).play();
			dojo.byId('messageDiv').style.display = 'none';
			dojo.byId('messageDiv').className='';
			dojo.byId('messageDiv').innerHTML = '';
		}
	}).play(800);
.message
{ 
    background:#FFFBCC;
    border:1px solid #E6DB55;
    font-size:12px; 
    font-weight:bold;    
    margin:0 auto;
    padding:2px 0px;    
    text-align:center;     
    width:508px;
 }
.errormessage
{
     background:#FFEFEF;
     border:1px solid #EFD1D1;
     color:#FF0000;
     font-size:12px; 
    font-weight:bold;    
    margin:0 auto;
    padding:2px 0px;    
    text-align:center;     
    width:508px;
}