var intervals = [];

function showLoad(imgName){
   document.getElementById('status').style.filter = "alpha(100)";
   document.getElementById('status').style.opacity = "1";
   document.getElementById('status').innerHTML = "<img src='images/"+imgName+".gif' align='right'>";
         }

function hideLoad(){
    document.getElementById('status').innerHTML = "";
         }         

function fadeOut(id,next,step,end) {
          if(intervals.length!=0){clearInterval(intervals.pop())};
          var speed = 20;				  		
          var theDiv = document.getElementById(id);		  		  
          theDiv.style.filter='alpha(opacity='+next+')';
          theDiv.style.opacity=(next/100);
          next = next + step;
          if (next >= end) {		    
            setTimeout("fadeOut('"+id+"',"+next+","+step+","+end+");",speed);
          }else{	   
           document.getElementById('status').innerHTML = "";
          }	
        }


function showStatus(imgName,errorDetail){
   document.getElementById('status').style.filter = "alpha(100)";
   document.getElementById('status').style.opacity = "1";
   document.getElementById('status').innerHTML = "<img src='images/"+imgName+".gif' align='right'> "+errorDetail;
   intervals.push(setInterval("fadeOut('status',100,-10,0)", 3000));
}

