window.addEvent('domready', function() {	
	new CatListPicZoomGroup("CatListPicZoomGroup");
});		//END: Window.AddEvent

var CatListPicZoomGroup = new Class({
	options: {
	},

	//Create class instance
	//container = the first argument in "new CatListPicZoomGroup" call in "window.addEvent("domready"..."
	initialize: function(container, options) {
		this.setOptions(options);
		this.container = $(container);
		//Adds events to all image elements with the class name 'CatListPic'.
		this.imgElements = $(document.body).getElements('img.CatListPic');
		for(var i = 0; i < this.imgElements.length; i++){
			nextImg = this.imgElements[i];
			
			var tmpStr = nextImg.alt;
			nextImg.addEvents({
			    'mouseenter': function(){
					var patt = /width\=[0-9]{2,3}/;
					var widthStr = patt.exec(this.alt);
	//				document.write("Returned value: " + result);
					var patt = /[0-9]{2,3}/;
					var picWidth = patt.exec(widthStr);
					
					//Create morph for photo zoom
					CatListPicZoom = new Fx.Morph(this, {duration: 800, transition: Fx.Transitions.Bounce.easeInOut});
					
					CatListPicZoom.start({		//Zoom large
					    'height':[225],
					    'width': [picWidth]
					});
					
	//		        this.height = '225';
	//		        this.width = '300';
			    },
			    'mouseleave': function(){
					//Create morph for photo zoom
					CatListPicZoom = new Fx.Morph(this, {duration: 800, transition: Fx.Transitions.Bounce.easeInOut});
					
					CatListPicZoom.start({		//Zoom small
					    'height':[48],
					    'width': [48]
					});
	//		        this.height = '48';
	//		        this.width = '48';
			    }
			});
		}	//END: for(var i = 0; i < this.imgElements.length; i++)

		//********************************************************************************
	}	//END: initialize
});

CatListPicZoomGroup.implement(new Events); // Implements addEvent(type, fn), fireEvent(type, [args], delay) and removeEvent(type, fn)
CatListPicZoomGroup.implement(new Options);// Implements setOptions(defaults, options)
