window.addEvent('domready', function(){
	
	$$('.homeBox').addEvents({
		'mouseenter':function(){
			this.setStyle('opacity', 0.7);
		},
		'mouseleave':function(){
			this.setStyle('opacity', 1);
		}
	});
	
	$$('.listLoc').setStyle('cursor', 'pointer');
	$$('.listLoc').addEvents({
		'mouseenter':function(){
			this.setStyles({'background-color':'#eee', 'color':'#000'});
		},
		'mouseleave':function(){
			this.setStyles({'background-color':'#fff', 'color':'#999'});
		}
	});

	$$('#centri_lista tbody tr').setStyle('cursor', 'pointer');
	$$('#centri_lista tbody tr').addEvents({
		'mouseenter':function(){
			this.setStyles({'background-color':'#eee', 'color':'#000'});
		},
		'mouseleave':function(){
			this.setStyles({'background-color':'#fff', 'color':'#999'});
		}
	});

	/*
	if($defined($('locationGalleryMore'))) {
		$('body').grab($('gallery'));
		$('locationGalleryMore').addEvent('click', function(e){
			e.stop();
			$('body').set('mask', {
				hideOnClick: true,
				onShow: function(el){
					$('gallery').setStyles({
						'display':'block',
						'top':'200px',
						'left':$('body').getSize().x / 2 - 400
					});
				},
				onHide: function(el){
					$('gallery').setStyle('display', 'none');
				}
			});
			$('body').mask();
		});
		
		$('closeGallery').addEvents({
			'click': function(e){
				e.stop();
				$('body').unmask();
			},
			'mouseenter':function(){
				this.addClass('hover');
			},
			'mouseleave':function(){
				this.removeClass('hover');
			}
		});

		initImageZoom({loadImage:'javascript/images/loading.gif', startOpacity:1.0});
	}
	*/
	
	if($defined($('closePopup'))) {
		$('closePopup').addEvents({
			'click': function(e){
				e.stop();
				$('body').unmask();
			},
			'mouseenter':function(){
				this.addClass('hover');
			},
			'mouseleave':function(){
				this.removeClass('hover');
			}
		});
	}
	if($defined($('closePopup2'))) {
		$('closePopup2').addEvents({
			'click': function(e){
				e.stop();
				$('body').unmask();
			},
			'mouseenter':function(){
				this.addClass('hover');
			},
			'mouseleave':function(){
				this.removeClass('hover');
			}
		});
	}
	
/*
	$$('.prevnext').addEvents({
		'mouseenter':function(){
			this.set('tween', {duration: 'short'});
			this.tween('opacity', 0.7);
		},
		'mouseleave':function(){
			this.set('tween', {duration: 'short'});
			this.tween('opacity', 1.0);
		}
	});
*/
	
	if($defined($('videoLink'))) {
		$('videoLink').addEvents({
			'mouseenter':function(){
				this.set('tween', {duration: 'short'});
				this.tween('opacity', 0.7);
			},
			'mouseleave':function(){
				this.set('tween', {duration: 'short'});
				this.tween('opacity', 1.0);
			}
		});
	}
});


function showCentri() {
	if($defined($('centriPopup'))) {
		$('body').grab($('centriPopup'));
		$('body').set('mask', {
			hideOnClick: true,
			onShow: function(el){
				$('centriPopup').setStyles({
					'display':'block',
					'top':200 + $('body').getScroll().y,
					'left':$('body').getSize().x / 2 - 200
				});
			},
			onHide: function(el){
				$('centriPopup').setStyle('display', 'none');
			}
		});
		$('body').mask();
	}		
}
