window.addEvent('domready', function(){
	document.addEvent('keydown', function(e){
		if (e.control && e.code==37) {
			if ($('prevNeighbour')!=null) {
				window.location.href = $('prevNeighbour').get('href');
			}
		}
		if (e.control && e.code==39) {
			if ($('nextNeighbour')!=null) {
				window.location.href = $('nextNeighbour').get('href');
			}
		}
	});

	if ($('prevNeighbour') != null) {
		$('prevNeighbour').addEvent('mouseover', function(e){
			position = $('prevNeighbour').getPosition();
			$('prevThumb').setStyles({left:(position.x-66)+'px',top:(position.y-43)+'px'});
		});
		$('prevNeighbour').addEvent('mouseout', function(e){
			position = $('prevNeighbour').getPosition();
			$('prevThumb').setStyles({left:'-5000px'});
		});
	}
	if ($('nextNeighbour') != null) {
		$('nextNeighbour').addEvent('mouseover', function(e){
			position = $('nextNeighbour').getPosition();
			$('nextThumb').setStyles({left:(position.x+12)+'px',top:(position.y-43)+'px'});
		});
		$('nextNeighbour').addEvent('mouseout', function(e){
			position = $('nextNeighbour').getPosition();
			$('nextThumb').setStyles({left:'-5000px'});
		});
	}

});

