var rules = { 

/*  Use this one for mouseovers - it's a little distracting for the tree: */

'#menu_container li': function(e)
{ e.onmouseover = function()
  { ul = this.getElementsByTagName ('ul');
    if (ul.length > 0) {
      // ul [0].style.display = 'block';
      T (this.innerHTML); // ul.nodeValue);
    }
  };

  e.onmouseout = function()
  { ul = this.getElementsByTagName ('ul');
    if (ul.length > 0) {
      //ul [0].style.display = 'none';
      T();
    }
  }
},

/* nope, still cant click them.
'#menu_container': function(e)
{ e.onmouseout = function()
  { ul = this.getElementsByTagName ('ul');
    if (ul.length > 0) {
      //ul [0].style.display = 'none';
      T();
    }
  }
},
*/

/* I could do it for clicks, but what if it's already a link?  Ideally, use tooltips - delayed hover!
'#menu_container li': function(e)
{ e.onclick = function()
  { ul = this.getElementsByTagName ('ul');
    if (ul.length > 0) {
      if none then:
        ul [0].style.display = 'block';
      else if block then:
        ul [0].style.display = 'none';
    }
  };
},
*/

'.hostimg' : function(e)
{ e.onmouseover = function()
  { if (this.title)
    {  if (this.name)  // put the image url in the anchor name attr..
        s = '<img alt="" src="' + this.name + '">';

      this.tooltip = s;
    }

    T (this.tooltip);
  };

  e.onmouseout = function() { T() }
},

/* nope - swissarmy onmouseover interferes w/my img popups
'#master0 img' : function(e)  // swissarmy fadeshow images
{ e.onclick = function()
  { //if (this.title)
    //{  if (this.name)  // put the image url in the anchor name attr..
        s = 'tooltip test!' //'<img alt="" src="' + this.name + '">';

      this.tooltip = s;
    //}

    T (this.tooltip);
  };

  e.onmouseout = function() { T() }
},
*/

// '#searchtext' : function(e)
'#search_keywords' : function(e)
{ e.onfocus = function()
  { if (this.value == 'Search')
    { this.value = ''; this.style.color = 'black'; }
  };
 e.onblur = function()
  { if (this.value == '')
    { this.value = 'Search'; this.style.color = 'gray'; }
  };
}


}
Behaviour.register (rules);


