var count=1;
var first=true;
var duration=5000;
var myFx;
var myFx2;
var myFunction = function(){ 
	var children = $('StripGallery').getChildren();
	myFx = new Fx.Tween(children[count],{duration:duration});
	if(count-1<0)	myFx2 = new Fx.Tween(children[children.length-1],{fps:60,duration:duration});
	else	myFx2 = new Fx.Tween(children[count-1],{fps:60,duration:duration});
	myFx.start('opacity', '0', '1');
	myFx2.start('opacity', '1', '0');
	count++;
	if(count>children.length-1) count=0;
};
function StartGallery(){
	if($defined($('StripGallery'))){
		var images=new Array();
		var slider =0;
		var percento=0;
		$('StripGallery').setStyle('visibility','hidden');
		var fx = new Fx.Morph($('progress'), {wait:false,fps:60,duration:500,unit:'%'});
		
		$$('#StripGallery img').each(function(item){
			var Thumb=item;
			if(first==true) first=false;
			else Thumb.setStyle('opacity',0);
			var src =Thumb.getProperty('src');
			images.push(src);
		});
		var	avanzamento=(100/images.length);
		var myImages = new Asset.images(images, {
			onProgress: function(i) {
				percento=percento+avanzamento;
				if(percento>100)percento=100;
				fx.start({'width': percento});
			},
			onComplete: function() {
				fx.start({'width': percento}).chain( function() {
					$('progress_bar').destroy();
					$('StripGallery').setStyle('visibility','visible');
				});
				myFunction.periodical(duration,images);
			}
		});
	}
	
	
	}
