// JavaScript Document

window.addEvent('domready', function() {
	var togglers = [$('sz_homeVideosMainSticker'), $('sz_homeVideosSticker1'), $('sz_homeVideosSticker2'), $('sz_homeVideosSticker3')];
	var slides = [
		new Fx.Slide($('sz_homeVideosMainStickerMore')), 
		new Fx.Slide($('sz_homeVideosSticker1More')), 
		new Fx.Slide($('sz_homeVideosSticker2More')),
		new Fx.Slide($('sz_homeVideosSticker3More'))
	];
	
	slides.each(function(item, index) {
		if(index != 0) {
			item.hide();
		}
	});
	
	togglers.each(function(item, index) {
		item.addEvent('click', function(e) {
			// Removes the old current class
			togglers.each(function(item) {
				item.removeClass('sz_current');
			});
			item.addClass('sz_current');
			// Slides out all the other sildes
			slides.each(function(item, index2) {
				if(index2 != index) {
					item.slideOut();
				}
			});
			// Slides in this slide
			slides[index].slideIn();
		});
		
		item.addEvent('mouseover', function(e) {
			// Adds the the new mouseOver class
			if(!item.hasClass('sz_current')) {
				item.addClass('sz_mouseOver');
			}
		});
		item.addEvent('mouseout', function(e) {
			// Removes the the new mouseOver class
			item.removeClass('sz_mouseOver');
		});
	});
});