home *** CD-ROM | disk | FTP | other *** search
/ Mundo do CD-ROM 118 / cdrom118.iso / internet / webaroo / WebarooSetup.exe / Webaroo.msi / _BF73B5A759B04824AEBFA8BA3FD1B733 < prev    next >
Encoding:
Text File  |  2005-12-23  |  1.4 KB  |  37 lines

  1. /***********************************************
  2. * Highlight Table Cells Script- ┬⌐ Dynamic Drive DHTML code library (www.dynamicdrive.com)
  3. * Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
  4. * This notice must stay intact for legal use
  5. ***********************************************/
  6.  
  7. //Specify highlight behavior. "TD" to highlight table cells, "TR" to highlight the entire row:
  8. var highlightbehavior="TR"
  9.  
  10. var ns6=document.getElementById&&!document.all
  11. var ie=document.all
  12.  
  13. function changeto(e,highlightcolor){
  14. source=ie? event.srcElement : e.target
  15. if (source.tagName=="TABLE")
  16. return
  17. while(source.tagName!=highlightbehavior && source.tagName!="HTML")
  18. source=ns6? source.parentNode : source.parentElement
  19. if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
  20. source.style.backgroundColor=highlightcolor
  21. }
  22.  
  23. function contains_ns6(master, slave) { //check if slave is contained by master
  24. while (slave.parentNode)
  25. if ((slave = slave.parentNode) == master)
  26. return true;
  27. return false;
  28. }
  29.  
  30. function changeback(e,originalcolor){
  31. if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TABLE")
  32. return
  33. else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
  34. return
  35. if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
  36. source.style.backgroundColor=originalcolor
  37. }