
/***********************************************
* Highlight Table Cells Script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/
//Specify highlight behavior. "TD" to highlight table cells, "TR" to highlight the entire row:
var highlightbehavior="TD"
var newFontColor = "black"
var originalFontColor = "lightgrey"

var ns6=document.getElementById&&!document.all
var ie=document.all

function changeto(e,highlightcolor){
 source=ie? event.srcElement : e.target
 if (source.tagName=="TABLE")
  return
 while(source.tagName!=highlightbehavior && source.tagName!="HTML")
  source=ns6? source.parentNode : source.parentElement
 if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore") {
   source.style.backgroundColor=highlightcolor
   source = source.getElementsByTagName("A")[0];
	 source.style.color=newFontColor
   source.style.backgroundColor=highlightcolor
 }
}

function contains_ns6(master, slave) { //check if slave is contained by master
while (slave.parentNode)
if ((slave = slave.parentNode) == master)
return true;
return false;
}

function changeback(e,originalcolor){
 if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TABLE")
  return
 else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
  return
 if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source) {
  source.style.backgroundColor=originalcolor
	  source.style.color=originalFontColor;
	if (source.tagName == "A") {
	   source = source.parentNode;
	} else if (source.tagName == "TD"){ 
   	 source = source.getElementsByTagName("A")[0];
  }
  source.style.color=originalFontColor;
  source.style.backgroundColor=originalcolor;
 }
}

function open_win(url_add){
   window.open(url_add,'welcome','width=760,height=500,menubar=no,status=yes,location=no,toolbar=no,scrollbars=yes');  
}

function toggleDivOnOff(divid){
if (document.getElementById(divid).style.display == 'none')
   document.getElementById(divid).style.display = 'block';
else
   document.getElementById(divid).style.display = 'none';
}

function alternate(id){
 if(document.getElementsByTagName){  
   var table = document.getElementById(id);  
   var rows = table.getElementsByTagName("tr");  
   for(i = 0; i < rows.length; i++){          
 //manipulate rows
     if(i % 2 == 0){
       rows[i].className = "even";
     }else{
       rows[i].className = "odd";
     }      
   }
 }
}

