window.addEvent('domready',function(){

	var centralimg = new Element('img',{'src':'../img/central_hh.jpg','width':'800','height':'350','id':'centralimg','alt':'Happy Hour'});
	var box = $('image');
		
	new Asset.images(['../img/central_hh.jpg','../img/central_hh2.jpg','../img/central_hh3.jpg','../img/central_hh4.jpg','../img/central_hh5.jpg','../img/central_hh6.jpg'],{
		onProgress: function(){
			box.addClass('loading');
		},
		onComplete: function(){
			box.removeClass('loading');
			box.set('styles',{
				'opacity':'0'
			});
			
			$('rotater-demo').set('styles',{
				'display':'block',
				'opacity':'0'
			});
			$('rotater-demo').fade('in');
			//centralimg.inject(box);
			
			box.fade('in');
			
		}//close onComplete
		
	});//close asset
	
	$$('.photo').each(function(el){
		el.addEvent('mouseover',function(e){
			e.stop();
				el.tween('border-color','#ebdbba');			
		});
		el.addEvent('mouseout',function(e){
			e.stop();
				el.tween('border-color','#403c3c');			
		});
		el.addEvent('click',function(e){
			new Event(e).stop();
			
		//	var src = el.getProperty('href');

		//	centralimg.get('tween',{property:'opacity'}).start(0).chain(
		//			function(){centralimg.setProperty('src',src); this.start(1)}
		//	);	
			
		});

	
	});

	$$('.photo img').each(function(el){
		el.set('styles',{	'opacity':'0.5'	});
		el.addEvent('mouseover',function(){
			this.get('tween',{property:'opacity'}).start(1);
		});
		el.addEvent('mouseout',function(){
			this.get('tween',{property:'opacity'}).start(0.5);
		});
	});
});