/*
Script: hoverident.js
	HoverIdent - mouse over/leave effect for list of elements

License:
	MIT-style license.

Copyright:
	Copyright (c) 2009 [cime](http://specialec.net/).
*/

(function($){ 
	this.HoverIdent = new Class({
		Implements: [Options, Events],
		
		parent: null,
		
		options: {
			childs: 'li',
			current: '.current_page_item',
			property: 'margin-left',
			duration: 'short',
			value: {
				over: '10px',
				//middle: '2px',
				leave: '0px'
			}
		},
		
		initialize: function(parent, options){
			this.setOptions(options);
			var self = this;
			
			parent.getElements(this.options.childs + ':not(' + this.options.current + ')').each(function(el){
				el.set('tween', {duration: self.options.duration});
				el.addEvents({
					'mouseover': function(){
						this.tween(self.options.property, self.options.value.over);
						/*this.getPrevious().tween(self.options.property, self.options.value.middle);
						this.getNext().tween(self.options.property, self.options.value.middle);*/
					},
					'mouseleave': function(){
						this.tween(self.options.property, self.options.value.leave);
						/*this.getPrevious().tween(self.options.property, self.options.value.leave);
						this.getNext().tween(self.options.property, self.options.value.leave);*/
					}
				});
			});
		}
	});
})(document.id); 
