// JavaScript Document
var obj = "";
var numSteps=0;
var currentStep=0;
var timerID=0;
var opacity = 100;
var opacitySteps = 0;
////////////////////////////////////////
// fade timer
////////////////////////////////////////
function startFadeMessage(divObj, nSteps)
{
	obj = divObj;
  	// need to parse, otherwise it thinks it's not a number		
	numSteps=parseInt(nSteps, 10);
	opacitySteps = opacity/numSteps;
	currentStep=0;
	
  	fade(obj);
}
////////////////////////////////////////
// fade timer
////////////////////////////////////////
function startFadeRow(divObj, nSteps)
{
	obj = divObj;
  	// need to parse, otherwise it thinks it's not a number		
	numSteps=parseInt(nSteps, 10);
	opacitySteps = opacity/numSteps;
	currentStep=0;
	
  	fadeRow(obj);
}

  
////////////////////////////////////////
// fade timer
////////////////////////////////////////
function fade(obj)
{
  	
  	currentStep++;
	opacity -= opacitySteps;
	if(opacity <= 5) {
		opacity = "05";
	}
  	// if not done yet, change the backround
  	if (currentStep<=numSteps)
  	{
		// convert to hex	
	  	obj.style.filter = "alpha(opacity="+opacity+")";
		obj.style.opacity = "."+opacity+"";
			
	  	timerID=setTimeout("fade(obj)", 200); // sets timer so that this function will
                  		   		      // be called every 10 miliseconds
   }
   if (currentStep>=numSteps)
   		obj.style.display = "none";
}
  
////////////////////////////////////////
// fade timer
////////////////////////////////////////
function fadeRow(obj)
{
  	
  	currentStep++;
	opacity -= opacitySteps;
	if(opacity <= 5) {
		opacity = "05";
	}
  	// if not done yet, change the backround
  	if (currentStep<=numSteps)
  	{
		// convert to hex
		for (var i=0; i<obj.cells.length; i++) {
			obj.cells[i].style.filter = 'alpha(opacity=' + opacity + ')'; // IE
		}
		obj.style.opacity = "."+opacity+"";
			
	  	timerID=setTimeout("fadeRow(obj)", 200); // sets timer so that this function will
                  		   		      // be called every 10 miliseconds
   }
   if (currentStep>=numSteps) {	   
   		obj.className = obj.className.replace(" updated", "");
		for (var i=0; i<obj.cells.length; i++) {
			obj.cells[i].style.filter = 'alpha(opacity=100)'; // IE
		}
		obj.style.opacity = ".99";
   }
}