window.addEvent('domready',function() {
	if ($('banner')) {
		var count = 0;
		var state = 0;
		var tweener = $('banner').set('tween',{ transition: 'linear' });
		var run = function() {
			tweener.tween('background-position','-' + (++count) + 'px 0px');
		};
	
		var fire = $('fire').set('tween',{ duration: 3000, transition: Fx.Transitions.Bounce.easeOut });
		var runfire = function() {
			fire.tween('opacity', state);
			if (state == 1) {state=0;} else {state=1;}
		};
		run(); runfire();
		run.periodical(60);
		runfire.periodical(3000);
	}
	
	$$('#a a').each(function(el) {
	var fx = new Fx.Morph(el,{
		duration: 600,
		link: 'cancel'
	});
	el.setStyles({
			'background-position':'0px 50px',
			'color':'#28408a'
		}).addEvents({
			'mouseenter': function(e) {
				e.stop();
				fx.start({
					'background-position': '0px 400px',
					'color': '#c0c0c0'
				});
			},
			'mouseleave': function(e) {
				e.stop();
				fx.start({
					'background-position': '0px 50px',
					'color': '#28408a'
				});
			}
		});
	});
});
