function alternate(id){

	 if(document.getElementsByTagName){  
	
		if (typeof(id) == "string") {
			var table = document.getElementById(id);
		}
		else if (typeof(id) == "object") {
			var table = id;
		}
		else {
			return;
		}
		
		var rows = table.getElementsByTagName("tr");  

		for(i = 0; i < rows.length; i++){
			//manipulate rows
			if(i % 2 == 0){
				rows[i].style.backgroundColor='#CACACA';
			}else{
				rows[i].style.backgroundColor='#BBBBDD';
			}
		}		
	}
	return;
}


function getElementsByClassName(strClass, strTag, objContElm) {
/*
usage:
cont = container, element with id name ex:
cont = document.getElementById('container')

objClassArry = getElementsByClassName('one')	//array with all class 'one' objs
getElementsByClassName('one', 'a', cont)		//class 'one' objs inside of <a>
getElementsByClassName('one two', 'a', cont)	//'one' AND 'two' in <a>
getElementsByClassName('one|two', 'span', cont)	//'one' OR 'two' in <a>

for (i = 0; i < objClassArry.length; i++) 
   // Do your thing here.
   //ex: objClassArry[i].id
}
*/

  strTag = strTag || "*";
  objContElm = objContElm || document;
  var objColl = (strTag == '*' && document.all) ? document.all : objContElm.getElementsByTagName(strTag);
  var arr = new Array();
  var delim = strClass.indexOf('|') != -1  ? '|' : ' ';
  var arrClass = strClass.split(delim);
  for (i = 0, j = objColl.length; i < j; i++) {
    var arrObjClass = objColl[i].className.split(' ');
    if (delim == ' ' && arrClass.length > arrObjClass.length) continue;
    var c = 0;
    comparisonLoop:
    for (k = 0, l = arrObjClass.length; k < l; k++) {
      for (m = 0, n = arrClass.length; m < n; m++) {
        if (arrClass[m] == arrObjClass[k]) c++;
        if (( delim == '|' && c == 1) || (delim == ' ' && c == arrClass.length)) {
          arr.push(objColl[i]);
          break comparisonLoop;
        }
      }
    }
  }
  return arr;
}

// To cover IE 5.0's lack of the push method
Array.prototype.push = function(value) {
  this[this.length] = value;
}