COGTREE.homepage.handle_mouseover = function() {
  				var el = jQuery(this);
  				var btn = el.parent().parent();
  				if (btn.hasClass("active")) {
  					return;
  				}
  				el.attr("src", COGTREE.homepage.BUTTONBAR_ON);		
};
		
COGTREE.homepage.handle_mouseout = function() {
				var el = jQuery(this);
  				var btn = el.parent().parent();
  				if (btn.hasClass("active")) {
  					return;
  				}
  				el.attr("src", COGTREE.homepage.BUTTONBAR_OFF);
};


// when the DOM is ready:
jQuery(document).ready(function () {
    jQuery('div.fade img').hover(
        COGTREE.homepage.handle_mouseover, 
        COGTREE.homepage.handle_mouseout);
    
    jQuery('div.fade img').click(function() {
        var clicked = this;
        var el = jQuery(this);
        var imgs = jQuery('div.fade img');
        imgs.each(function() {
            var img = jQuery(this);
            if (this === clicked) {
                img.attr("src", COGTREE.homepage.BUTTONBAR_ON);
            }
            img.attr("src", COGTREE.homepage.BUTTONBAR_OFF);
        });
    });
});
