function opendiv (id) {
	var fx = new Fx.Tween('block_'+id, {duration:100, wait:2000});
	fx.start('margin-top', '-15px')
}
function closediv (id) {
	var fx2 = new Fx.Tween('block_'+id, {duration:100, wait:false});

	if ($('block_'+id).getStyle('margin-left') == '0px')
	fx2.start('margin-top', '-95px')
}

window.addEvent('domready', function() {
	if ($$('.block_home')) {
	$$('.block_home').each(function (item) {
		
		var activ = null;
		var fx1 = new Fx.Tween('block_1');
		var fx2 = new Fx.Tween('block_2');
		var fx3 = new Fx.Tween('block_3');
		var fx = new Fx.Tween('block_'+item.get('alt'));
		$('block_'+item.get('alt')).setStyle('margin-top', '-95px');
		//fx.hide();
		
		/*item.addEvent('mouseover', function () {
			
			var id = item.get('alt');
			activ = id;
			//closeDiv(item.get('alt'));
			fx.start('margin-top', '1px').chain(function () {
				if (activ != 1) { 
					fx1.start('margin-top', '-81px');
				}
				if (activ != 2) { 
					fx2.start('margin-top', '-81px');
				}
				if (activ != 3) { 
					fx3.start('margin-top', '-81px');
				}
		
			});
		});*/
	});
	}
	if ($('slideBand')) {
		currentImg = 0;
		nbrImg = $$('#slideBand li').length;
		$('slideBand').setStyle('width', (nbrImg*800)+'px');
		$('back').setStyle('visibility', 'hidden');
		
		$('next').addEvent('click', function () {
			var act = currentImg*(-1);
			
			if (act+1 < nbrImg) {
				currentImg--;
				var fx = new Fx.Tween('slideBand');
				fx.start('margin-left',(681*currentImg)+'px');
			}
			if (act >= 0) {
				$('back').setStyle('visibility', 'visible');
			} 
			if (act+2 >= nbrImg) {
				$('next').setStyle('display', 'none');
			}
			
		});
		
		$('back').addEvent('click', function () {

			var act = currentImg*(-1);
			
			if (act > 0) {
				currentImg++;
				var fx = new Fx.Tween('slideBand');
				fx.start('margin-left',(681*currentImg)+'px');
			}
			
			if (act <= 1) {
				$('back').setStyle('visibility', 'hidden');
			}
			if (act < nbrImg) {
				$('next').setStyle('display', 'block');
			}
			
		});
	}
});
