if (typeof Proworx == 'undefined') {
	var Proworx = {};
}
Proworx.Gallery = new Class({
    initialize: function(primary, secondary) {
		this.primary = $$(primary)[0];
		var image = $(this.primary.getElementsByTagName('img')[0]);
		this.original = {
			src:	image.getProperty('src'),
			width:	image.getProperty('width'),
			height:	image.getProperty('height')
		};
		this.secondary = $$(secondary);
		this.secondary.each(function(secondary) {
			secondary.addEvent('mouseover', function() {
				var pImage = $(this.primary.getElementsByTagName('img')[0]);
				var sImage = $(secondary.getElementsByTagName('img')[0]);
				if (sImage.hasClass('width')) {
					pImage.setProperty('width', '293');
					pImage.removeProperty('height');
				} else if (sImage.hasClass('height')) {
					pImage.removeProperty('width');
					pImage.setProperty('height', '220');
				}
				pImage.setProperty('src', sImage.getProperty('src'));
			}.bind(this));
			secondary.addEvent('mouseout', function() {
				var pImage = $(this.primary.getElementsByTagName('img')[0]);
				pImage
					.setProperty('src', this.original.src)
					.setProperty('width', this.original.width)
					.setProperty('height', this.original.height);
			}.bind(this));
		}.bind(this));
    }
});