// This little script turns off

// Check for DOM support
if (document.getElementsByTagName) {

  // Collect array of all links in <div id="subnav">
  subnavDiv = document.getElementById("subnav");
  if (subnavDiv) {
    anchorLinks = subnavDiv.getElementsByTagName("a");
    // Find which class is applied to subnav div. For use below in IE Mac workaround
    divClass = document.getElementById("subnav").className;
  
    // Traverse array of links, looking for the page we're on
    for (i=0; i<anchorLinks.length; i++) {
  
      // Store link for convenience
      theLink = anchorLinks[i].href; 
      // Hack to make this work on stage and in workareas
      if (theLink.indexOf("http://") > -1 ) { theLink = theLink.substring( theLink.indexOf("adobe.com")+9, theLink.length ); }
  
      // If the link points to the page we're on, strip the anchor tags.
      if (theLink.length > 4 && document.location.href.indexOf(theLink) > -1) {      
        if (divClass == "consumer") { // workaround for rendering bug in IE Mac
          anchorLinks[i].className="loc";
          anchorLinks[i].setAttribute("href", "#");
          anchorLinks[i].setAttribute("title", "");
        } else { // IE Mac chokes on the following if the link is in an <li> which contains a <ul>
          rg = /<a[^>]+>[^<]+<\/a>/i;
          anchorLinks[i].parentNode.innerHTML = anchorLinks[i].parentNode.innerHTML.replace(rg,anchorLinks[i].innerHTML);
        }
      }
    }
  }
}

