/* google api load */
google.setOnLoadCallback(function() {
	/* mootools secure */
	(function($){
		/* dom ready event */
		window.addEvent('domready', function() {
/* ########## */

/**
 * Class categoryHover
 * realized with mootools 1.2.4
 * @author Markus Brunner <markus.brunner(at)netformic(dot)de>
 */
var categoryHover = new Class({
	Implements: [Events,Options],
	images: null,
	descriptions: null,
	options: {
		bigImageWrapperClass: 'category-images',
		bigImageWrapperClassWithPrefix: '',
		bigImageadditionalSelecor: ' > a > img',
		startingImageNumber: 0,
		descriptionClass: 'category-description',
		descriptionClassWithPrefix: ''
	},
	initialize: function(options){
		// set options
		this.setOptions(options);
		
		// set classNames for selection
		this.options.bigImageWrapperClassWithPrefix = '.'+this.options.bigImageWrapperClass;
		this.options.descriptionClassWithPrefix = '.'+this.options.descriptionClass;
		
		// get elements
		this.images = $$(this.options.bigImageWrapperClassWithPrefix+this.options.bigImageadditionalSelecor);
		this.descriptions = $$(this.options.descriptionClassWithPrefix);
		
		// do initial
		this.doRecoverAction();
		this.doHoverAction(this.options.startingImageNumber);
		
		// hoverAction
		this.descriptions.each((function(elem, index){
			elem.addEvent('mouseover',(function(){
				this.obj.doRecoverAction();
				this.obj.doHoverAction(this.index);
			}).bind({
				obj: this,
				index: index
			}));
		}).bind(this));
	},
	doRecoverAction: function() {
		this.images.each((function(elem, index){
			elem.setStyle('display','none');
		}).bind(this));
		this.descriptions.each((function(elem, index){
			elem.removeClass('hover');
		}).bind(this));
	},
	doHoverAction: function(number) {
		this.images[number].setStyle('display','block');
		this.descriptions[number].addClass('hover');
	},
	complete: function(){
		 this.fireEvent('complete');
	}
});

/**
 * initialization of imagePuzzleFader
 */
var myCategoryHover = new categoryHover({});
/* ########## */
		});
	})(document.id);
});
