
/*  Do dynamic coloration in the headings  */
/*  By Brian Reed                          */

function Headings()
{

var found_music = document.location.href.search(/.net\/music\//i);
var found_art = document.location.href.search(/.net\/art\//i);
var found_design = document.location.href.search(/.net\/design\//i);

var el = document.getElementById("heading_music");
  if (found_art>=0 || found_design>=0)
    el.className = el.className.replace('headings_light', 'headings_dark');

var el = document.getElementById("heading_art");
  if (found_music>=0 || found_design>=0)
    el.className = el.className.replace('headings_light', 'headings_dark');

var el = document.getElementById("heading_design");
  if (found_music>=0 || found_art>=0)
    el.className = el.className.replace('headings_light', 'headings_dark');

}




// DOM loaded:
// http://www.cherny.com/webdev/27/domloaded-updated-again
// OHHHH - no flash in IE?  Or do I need to clear cache to see it?
// <Nautilus> lluad: hey, the JS tool file you said you use... jQuery?
// <lluad> jquery or extjs, depending on my needs.
// <lluad> jquery is lighter weight, extjs is heavier and more widgety.





//// OLD NOTES:

//var myAnchors = document.getElementById(id).getElementsByTagName('a');
// Is that suppose to be 'id' or is that just an example!?  It gives me an error
// Ohhhh - suppose to pass that in?

//  for (var i = 0; i < myAnchors.length; i++)
//    myAnchors[i].className = myAnchors[i].className.replace('headings_white', 'statement_dark');
// I HAVE "statement_dark" in the above line for now!




//Find the url of the page, probably using something like:
//currentPage = document.location.href;



//documentation for this script at http://www.shawnolson.net/a/503/
/*
function changecss(theClass,element,value) {
var cssRules;

  if (document.all) {
    cssRules = 'rules';
  }
  else if (document.getElementById) {
    cssRules = 'cssRules';
  }
  for (var S = 0; S < document.styleSheets.length; S++){
    for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
      if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
        document.styleSheets[S][cssRules][R].style[element] = value;
      }
    }
  }
}


USAGE:
<span class="exampleA">Example A</span>
<span class="exampleB">Example B</span>
<span class="exampleA">Example A</span>
<input type="button" value="Change A Red" onclick="changecss('.exampleA','color','red')" />
<input type="button" value="Change A Black" onclick="changecss('.exampleA','color','black')" />
*/



