/////////////////////////////////////////////////////////
//
// FISHEYE MENU CLASS
//
var fish = new Class({
	minZoom : 80,
	maxZoom : 150,
	zoomQty : 5,
	testVar : 'test',
	initialize: function(handle) {
		this.handle = $(handle);
		this.items = this.handle.getElements('img');
		/*this.handle.setStyle('margin-left', '-' + (this.handle.offsetWidth/2) + 'px');*/
		this.effects = [] //meh
		this.items.each(
			function(el) {
				el.addEvent('mouseover', function() { this.magnify(el); }.bind(this));
				el.addEvent('mouseout', function() { this.shrink(el); }.bind(this));
				this.effects[el.src] = $(el.parentNode).effects({wait: false, duration: 200});
			},
			this
		);
	},
	magnify: function(el) {
		this.effects[el.src].custom({
			'height': this.maxZoom + 'px',
			'width': this.maxZoom + 'px',
			'margin-top': '-' + (this.maxZoom - el.getStyle('height').toInt()) + 'px',
			'margin-left': '-' + ((this.maxZoom - el.getStyle('width').toInt())/2) + 'px'
		})
	},
	shrink: function(el) {
		this.effects[el.src].custom({
			'height': this.minZoom + 'px',
			'width': this.minZoom + 'px',
			'margin-top': '0px',
			'margin-left': '0px'
		})
	}
});
	
Window.onDomReady(
	function(){
		var fisheye = new fish($('dock'));
		var fisheye2 = new fish($('dock2'));
	}
);

