

var siFx = new Class({
	
	initialize: function(effect, options){

		this.options = options;
		this.target = $$('.' + this.options.target);
		
		switch(effect){
		
		case 'zoomOut': this.zoomOut(); break;
case 'fade': this.fade(); break;
		}
		
	},
	
fade: function(){
		
		var duration = this.options.duration;
		var opacity = this.options.opaclevel;

		this.target.each(function(el){

			el.set('tween', { duration: duration });
			el.addEvent('mouseout', function(){ el.fade(opacity) });
			el.addEvent('mouseover', function(){ el.fade(1.0) });
			
		});
		
	},	
	
	zoomOut: function(){
	
		var duration = this.options.duration;
		var enlarge = this.options.enlarge;
		
		this.target.each(function(el){
			
			
			var imgSize = el.getSize();
			var imgPosition = el.getPosition();		

			el.set('morph', { duration: duration, transition: 'elastic:out' });			
			el.addEvent('mouseover', function(){ el.morph({ width: imgSize.x + enlarge + 'px', height: imgSize.y + enlarge + 'px' }) });
			el.addEvent('mouseout', function(){ el.morph({ width: imgSize.x + 'px', height: imgSize.y + 'px' }) });
			
		});

	}
	
});
