/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Mr. J :: http://www.huntingground.net/
 */

 function colourDivs(){
  // Set the tag name below that you want to use
  el=document.getElementById("containerx").getElementsByTagName("tr")
  numOfDivs=el.length

  for(i=0;i<numOfDivs;i++){
    if((i+1)%2==0) {
      el[i].style.backgroundColor="#dddddd"
      el[i].style.color="#000"
    } else {
      el[i].style.backgroundColor="#b7d2b6"
      el[i].style.color="#000"
    }
  }
  // Set the tag name below that you want to use
  el=document.getElementById("containerxx").getElementsByTagName("tr")
  numOfDivs=el.length

  for(i=0;i<numOfDivs;i++){
    if((i+1)%2==0) {
      el[i].style.backgroundColor="#dddddd"
      el[i].style.color="#000"
    } else {
      el[i].style.backgroundColor="#b7d2b6"
      el[i].style.color="#000"
    }
  }
  // Set the tag name below that you want to use
  el=document.getElementById("containery").getElementsByTagName("tr")
  numOfDivs=el.length

  for(i=0;i<numOfDivs;i++){
    if((i+1)%2==0) {
      el[i].style.backgroundColor="#bbbbbb"
      el[i].style.color="#000"
    } else {
      el[i].style.backgroundColor="#95b094"
      el[i].style.color="#000"
    }
  }
  // Set the tag name below that you want to use
  el=document.getElementById("containeryy").getElementsByTagName("tr")
  numOfDivs=el.length

  for(i=0;i<numOfDivs;i++){
    if((i+1)%2==0) {
      el[i].style.backgroundColor="#bbbbbb"
      el[i].style.color="#000"
    } else {
      el[i].style.backgroundColor="#95b094"
      el[i].style.color="#000"
    }
  }
  // Set the tag name below that you want to use
  el=document.getElementById("containerz").getElementsByTagName("tr")
  numOfDivs=el.length

  for(i=0;i<numOfDivs;i++){
    if((i+1)%2==0) {
      el[i].style.backgroundColor="#999999"
      el[i].style.color="#000"
    } else {
      el[i].style.backgroundColor="#739c72"
      el[i].style.color="#000"
    }
  }
  // Set the tag name below that you want to use
  el=document.getElementById("containerzz").getElementsByTagName("tr")
  numOfDivs=el.length

  for(i=0;i<numOfDivs;i++){
    if((i+1)%2==0) {
      el[i].style.backgroundColor="#999999"
      el[i].style.color="#000"
    } else {
      el[i].style.backgroundColor="#739c72"
      el[i].style.color="#000"
    }
  }
}

// Multiple onload function created by: Simon Willison
// http://simonwillison.net/2004/May/26/addLoadEvent/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function() {
  colourDivs();
});

