/*
  UNU-specific JavaScript
*/

var UNU = {

prepareNavigation:function()
{
  var lis = $('navul').childNodes;
  for(var i=0;i<lis.length;i++)
  {
    // grab just the list items
    if(lis[i].nodeType == 1 && lis[i].tagName.toLowerCase() == 'li')
    {
      // grab the subnav if there is one
      var sub = lis[i].getElementsByTagName("ul");
      if(sub.length > 0)
      {
        // attach a rollup effect and onclick event to the span inside the list item
        // this element must be the first element (ie: no space between the open
        // li and the <span> or <a>
        lis[i].childNodes[0].fx = new fx.Height(sub[0], {duration:300});
        lis[i].childNodes[0].fx.hide();
        lis[i].childNodes[0].onclick = this.fxonclick;
      }
    }
  }

},

fxonclick:function(){
  this.fx.toggle();
  return false;
}

};
