/* ======================================================= +
|  This script uses JavaScript and CSS to alternate the    |
|    row colors of a table.                                |
|                                                          |
|   TO USE:                                                |
|      1.  Link this JS file in the <head> section.        |
|      2.  Choose desired row colors below                 |
|      3.  Add the following line _BEFORE_ the </body>     |
|                                                          |
| <script type="text/javascript">tableRows('###');</script>|
|                                                          |
|   SINGLE TABLE:                                          |
|      4a.  Change "###" to any name and add that name as  |
|          an ID to desired <table>.                       |
|      ie:    ->    <table id="alternateRows">             |
|                                                          |
|   MULTI-TABLE:                                           |
|      4b.  Change "###" to any name and add that name as  |
|          an ID to <body> tag.                            |
|      ie:    ->    <body id="alternateRows">              |
|                                                          |
+ ======================================================= */


function tableRows(tableName)	{
	if(document.getElementsByTagName)	{
		var table = document.getElementById(tableName);
		var rows = table.getElementsByTagName('tr');
	
		for( var i = 0; i < rows.length; i++)	{
			if(i % 2 == 0)
				rows[i].style.background = '#ffffff';            /* Color of first row  */
			else
				rows[i].style.background = '#ddeeff';            /* Color of second row */
		}
	}
}
