﻿function FormatAllTables()
{
  var tbls;
  var curr_tbl;    
  tbls = document.getElementsByTagName('table');  
  if(tbls)
  {        
    for(curr_tbl=0;curr_tbl<tbls.length;curr_tbl++)
    {            
      if((tbls[curr_tbl].className == "tbl_left") || 
         (tbls[curr_tbl].className == "tbl_top") || 
         (tbls[curr_tbl].className == "tbl_left_left") || 
         (tbls[curr_tbl].className == "tbl_general"))
        FormatTable(tbls[curr_tbl]);
    }
  }  
};
function FormatTable(obj)
{	
	var curr_row;	
	var rows;	
	if(obj)
	{		
		rows = obj.getElementsByTagName('tr');		
		if(rows)
		{			
			
			for (curr_row = 0; curr_row < rows.length; curr_row++)	
			{
			  if(obj.className == "tbl_top") // don't format first row (header)
			  {
			    if((curr_row)%2!=0)		  
			  	  rows[curr_row].className="tbl_odd";		  	
			  }
			  else
			  {
			    if((curr_row+1)%2!=0)		  
			  	  rows[curr_row].className="tbl_odd";		  	
			  }
			}		  	
		}
	}	
}
/*
function FormatTable(src)
{	
	var tbl = document.all.getElementById(src);	
	var curr_row;	
	var rows;
	if(tbl)
	{		
		rows = tbl.getElementsByTagName('tr');
		window.alert("got: " + rows.length);
		if(rows)
		{
			for (curr_row = 0; curr_row < rows.length; curr_row++)	
			{
			  if((curr_row+1)%2!=0)		  
			  	rows[curr_row].className="tbl_odd";		  	
			}		  	
		}
	}	
}
*/

