// coded by Mashhoor Al Dubayan

// GLOBAL VARIABLES - you can change these
var oddClassName = 'odd'; 
var evenClassName = 'even';
// ----------------

function initialize()
{
  alternate('list1');
  alternate('list2');
  // just add more list ID's this way
  // alternate('listIdGoesHere');
}

function alternate(listId)
{
  var list;
  if(document.getElementById(listId))
  {
    list = document.getElementById(listId);
    var children = list.getElementsByTagName('li');
    for(var i=0; i<children.length; i++)
    {
      children[i].className += (i%2==0) ? oddClassName : evenClassName;
    }   
  }
}


window.onload = initialize;
