﻿// JScript File

/*
    Create alternate row colors
*/

    addOnLoad(alternateRowStyles);
    
    function alternateRowStyles()
    {
        var i, j;
        var table;
        for( i =0; i < document.getElementsByTagName("table").length; i++)
        {
            if( document.getElementsByTagName("table")[i].className == "altRows")
            {
                table = document.getElementsByTagName("table")[i];
                for ( j = 0; j < table.rows.length; j++)
                {
                
                    
                    if (table.rows[j].className == "")
                    { 
                    if (j%2 == 0  )
                    {
                    
                        table.rows[j].className = "oddClass";
                        
                    }
                    else
                    {
                    
                        table.rows[j].className = "evenClass";
                    }
                    }
                }
            }
        }
        }
    
        
    function addOnLoad(newFunction){
    var oldOnload = window.onload;
    if (typeof oldOnload == "function"){
		window.onload = function() {
			if(oldOnload){ oldOnload();
		}
		newFunction();
    }
   }
   else{
	window.onload = newFunction;
   }
  }   
  
//Rollover images
function imgOn(imgControlName)
{
    var img = document.getElementById(imgControlName);
    img.src = img.src.replace('off_', 'on_');
}

//Rollover images
function imgOff(imgControlName)
{
    var img = document.getElementById(imgControlName);
    img.src = img.src.replace('on_', 'off_');
}
