/* rollover by majimojo@ownage.com */
var RollOver = new Class({
	Implements: Options,
	options: {
		passive_class: 'rollover_off',
		active_class: 'rollover_on',
		images: []
	},
	loading: function() {
		this.target.addClass(this.options.passive_class);
		this.target.addEvents({
			'mouseenter':function() {
				this.target.removeClass(this.options.passive_class);
				this.target.addClass(this.options.active_class);
			}.bind(this),
			'mouseleave':function() {
				this.target.removeClass(this.options.active_class);
				this.target.addClass(this.options.passive_class);
			}.bind(this)
		});
	},
	initialize: function(options) {
		this.setOptions(options);
		if (!$chk(this.options.target))
			return;
			
		this.target = $(this.options.target);
		//this.target.setStyle('width', this.options.width);
		//this.target.setStyle('height', this.options.height);
		
		if (Browser.Engine.trident)
		{
			this.loading();
		}
		else // preload images
		{
			this.images = new Asset.images(this.options.images, {
				onComplete:function() {
					this.loading();
				}.bind(this)
			});
		}
	}
});