window.addEvent('domready', function() {
	var headerimage = $('headerimage');
		
	function rand(n) {
		return ( Math.floor ( Math.random ( ) * n + 1 ) );
	}

	headerimage.style.backgroundImage = "url('/image/headerimage_" + rand(5) + ".jpg')";
	
	var fx = new Fx.Styles(headerimage, {duration:1000, wait:false, transition: Fx.Transitions.Quint.easeInOut});
	headerimage.addEvent('mouseenter', function(e) {
		fx.start({
			'width': 758
		});
	});
	headerimage.addEvent('mouseleave', function(e) {
		fx.start({
			'width': 508
		});
	});
});
