/*  behaviour_rules.js - Rules for use with the behaviour.js library.
Behaviour lets you use CSS selectors to specify elements to which
JavaScript events should be added. http://bennolan.com/behaviour */

var brules = {
  '.thumbs a' : function(element) {
    element.onmouseover = function() {
		title = document.getElementsByTagName("h3");
		title = title[0];
		title.innerHTML = "Title: <em>" + this.title + "</em>";
    }
	element.onmouseout = function() {
		title = document.getElementsByTagName("h3");
		title = title[0];
		title.innerHTML = "&nbsp;";
    }
  },
  '#home_browse li a' : function(element) {
    element.onmouseover = function() {
		this.parentNode.parentNode.style.backgroundImage=this.style.backgroundImage;
		this.style.backgroundImage='';
    }
	element.onmouseout = function() {
		this.style.backgroundImage=this.parentNode.parentNode.style.backgroundImage;
		this.parentNode.parentNode.style.backgroundImage='';
    }
  }
};

Behaviour.register(brules);


