window.addEvent('domready', function() {
	shImages = $$("img.sh-news");
	shContents = $$("div.sh-content");
	
	shFx = {};
	if (window.ie) shFx = new Fx.Style($('sh-images-wrap'), 'background-position-x',{duration: 400, unit: 'px', transition: Fx.Transitions.backOut});
	else shFx = new Fx.Style($('sh-images-wrap'), 'background-position',{duration: 400, unit: 'px', transition: Fx.Transitions.backOut});
	shFx.index = 0;
	
	for (i=0; i<shImages.length; ++i) {
		shImages[i].index = i;
		shContents[i].index = i;
		if (i) 	shContents[i].setStyle('display','none');
		shImages[i].addEvent('mouseenter', function() {
			if (shFx.timer) shFx.stop();
			if (shFx.index == this.index) return;
			shContents[shFx.index].setStyle('display','none');
			shFx.index = this.index;
			shContents[shFx.index].setStyle('display','block');
			if (window.ie) var current = parseInt($('sh-images-wrap').getStyle('background-position-x'));
			else var current = parseInt($('sh-images-wrap').getStyle('background-position'));
			shFx.start(current, 82*this.index+1);
		})
	}
});

