/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

var JFadePanel = new Class.create({
    initialize: function(id) {
	this._element = $(id);
	this._list = this._element.select("img");
	for (var i=0, len = this._list.length; i < len; i++) {
	    this._list[i].setOpacity(0.2);
	}
    },

    addOnMouseOverListener: function(lFunction) {
	this._onMouseOver = lFunction;
	for (var i=0, len = this._list.length; i < len; i++) {
	    this._list[i].observe("mouseover",this._onMouseOver.bind(this));
	}
    },
    
    addOnMouseOutListener: function(lFunction) {
	this._onMouseOut = lFunction;	
	for (var i=0, len = this._list.length; i < len; i++) {
	    this._list[i].observe("mouseout",this._onMouseOut.bind(this));
	}
    }
});

document.observe("dom:loaded", function() {
    var t = new JFadePanel("partners");
    t.addOnMouseOverListener(function(event) {
	var el = event.element();
	el.appear({ from: 0.2, to: 1, duration: 0.3 });
	//alert("mouse over");
    });
    t.addOnMouseOutListener(function(event) {
	var el = event.element();
	el.fade({ duration: 0.2, from: 1, to: 0.3 });
	//alert("mouse out");
    });
});

