window.addEvent('domready',function() {
	var ExpertTips = {
		init:function() {
			this.triggers = $$('#expert_tips_triggers li');
			this.container = $('expert_tips_content');
			this.bottom_fill = $('expert_tips_bottom_fill');
			this.tips = $$('.expert_tips_tip');
			if (this.triggers.length) {
				this.getCurrent();
				this.bindHover();
			}
			this.swapContent(0);
		},
		bindHover:function() {
			var me = this;
			this.triggers.each(function(el,index) {
				el.addEvent('mouseenter',function() {
					me.current.removeClass('selected');
					me.current = this.addClass('selected');
					me.swapContent(index);
				});
			});
		},
		getCurrent:function() {
			var me = this;
			this.triggers.each(function(el) {
				if (el.hasClass('selected')) {
					me.current = el;
				}
			});
		},
		swapContent:function(index) {
			var content = this.tips[index].get('html');
			this.container.set('html',content);			
		}		
	};
	ExpertTips.init();
});