// JavaScript Document





function homePage(){
	var gall = new Gallery.Core('img', {
			url : 'galleries/galleries.xml',
			datatype : 'xml',
			transition : 'fadeOut',
			holdingSlide : false,
			debug: false,
			firstGallery : 1,
			resize : 'crop'
	});
	
	
	var c = new Gallery.Components.CaptionBar( gall, 'text-screen', {
	  useHTML:true, showAlways:true,
	  showCaption: function(el){
		 $('text-screen').set('tween', {link:'cancel', duration:1500});
		   if(el.get('html') != '') el.tween('left', 0);
	  },
	  hideCaption: function(el){
		 el.tween('left', -500);
	  }
	});
	
	var s = new Gallery.Components.Slideshow( gall, 2000, { atEnd:'pause' } );
	
/*	var p = new Gallery.Components.Preloader( gall, {
		onStart: function(gallName, number){
			$('preloader').setStyle('display', 'block');
			$('preloader').set('tween', {link:'cancel'});
		},
		onTick: function(obj){
			$('preloader-bar').tween('width', obj.loaded.percentage);
		},
		onFinish: function(){
			$('preloader').tween('opacity', 0);
		}
	});*/
	gall.addEvent('transitionComplete', function(){
		if( $('text-screen').get('html') == ''){ c.hideCaption(); }
		if( gall.currentIndex  == 2 ){
			h.fx.start({
				'1' : {
					'left' : 0
				}
			});
		}else if( gall.currentIndex == 6 ){
		/*	gall.currentImage.set('tween', {duration:2000});
			gall.currentImage.tween('clip', [ [ 0, 980, 522, 0 ].join(' '), [0, 980, 522, 450].join(' ') ]);*/
		}
	});

								  

}


	