function init(){
	//получаем все таблицы внутри дива text
	/*var tables = $$('.text table');
	tables.each(function(table){
		var rows = table.getElements('tbody tr');
		rows.each(function(tr,index){
			 tr.className = ((index + 1) % 2 == 0) ? " oddrows" : " evenrows";
		});
	});
	*/
	//
	var myImages = new Asset.images(images, {
		onComplete: function(){
		   $('face_top').setProperty('src', images[0]);
		   $('face_top').setStyle('visibility', 'visible');
		   $('face_bottom').setProperty('src', images[1]);
		  /* var img = new Element('img',{
			'src': images[1],
			'id' : 'face_bottom'
		   });
		   
		  img.inject( $('face_container'),'top');
		   */
		   fade_img.delay(3000);
		}
	});


	
	
	
	
}

var face = 1
var duration = 1200;

var fade_img = function(){
	
	var myFade = new Fx.Tween('face_top', {
			duration: duration, 
			//property: 'opacity',
			link: 'ignore', 
			onComplete: function(){
				
				restore();
			}
		});

	myFade.start('opacity', 1,0.01);

}

var restore = function(){
		face ++;
		if(face >= images.length) face = 0;
		
		$('face_top').setProperty('src', $('face_bottom').getProperty('src'));
		$('face_top').setStyle('opacity', 1);
		moz2delay.delay(500);
}

var moz2delay = function(){
	
		
		$('face_bottom').setStyle('opacity', 0);
		$('face_bottom').setProperty('src', images[face]);
		$('face_bottom').setStyle('opacity', 1);
		
		fade_img.delay(3000);
}
