/*_________________________________________________________________________________
  Border Image Hack
  
  Author: Keith Campbell (campkei@iit.edu)
  
  Applies border images to DOM elements in certain classes.  This is accomplished
  by inserting div elements for each of the four partitions of the border image.
  
  If browsers have advanced to the point where they provide this functionality in
  css in a way similar to this draft spec
  http://www.w3.org/TR/2002/WD-css3-border-20021107/ then by all means remove this
  hack and replace with a pure css solution.
  _________________________________________________________________________________*/

function append_div (element, style)
{
  var div = document.createElement("div")
  div.className = style
  element.appendChild(div)
}

function render_border_images ()
{
  everything = document.getElementsByTagName("*")
  for (index = 0; index != everything.length; index++)
    {
      var item = everything[index]
      if (item.className == "textbox")
        {
          append_div(item, "tl")
          append_div(item, "tr")
          append_div(item, "bl")
          append_div(item, "br")
        }
      else if (item.className == "warninghead")
        {
          append_div(item, "tl")
          append_div(item, "tr")
        }
      else if (item.className == "warningbody")
        {
          append_div(item, "bl")
          append_div(item, "br")
        }
      else if (item.className == "glass")
        {
          append_div(item, "tl")
          append_div(item, "tc")
          append_div(item, "tr")
          append_div(item, "ml")
          append_div(item, "mc")
          append_div(item, "mr")
          append_div(item, "bl")
          append_div(item, "bc")
          append_div(item, "br")
        }
    }
}
