document.observe('dom:loaded', function(){

	$$('body')[0].addClassName('jsOn');

	$$('#menuContainer li.topLevel a b').each(function(menuItem){
		
		
		if(!menuItem.ancestors()[0].ancestors()[0].hasClassName('Selected') && !menuItem.ancestors()[0].hasClassName('twitter') && !menuItem.hasClassName('hover') ){
			
			
			jQuery(menuItem).hover(function() {
				//console.log(this.getStyle('backgroundPosition'));
				if(this.getStyle('backgroundPosition') == '-500px 100%' || this.getStyle('backgroundPosition') == '-500px bottom'){
					jQuery(this).animate({backgroundPosition: "0px bottom"}, 1000);
				}
			}, function() {
				jQuery(this).animate({backgroundPosition: "-500px bottom"}, 'fast');
			});
		}

		
		
		
		/*Event.observe(menuItem, 'mouseover', function(event){	
			
			
			if(!menuItem.ancestors()[0].ancestors()[0].hasClassName('Selected') && !menuItem.ancestors()[0].hasClassName('twitter') && !menuItem.hasClassName('hover') ){
				menuItem.addClassName('hover');	
			
				
				new Effect.Morph(menuItem, {
					style: 'background-position: 0 bottom;', // CSS Properties
					duration: 1 // Core Effect properties
				});

				Event.observe(menuItem, 'mouseout', function(event){	
					
					this.removeClassName('hover');	
					this.writeAttribute('style','');

				})
																											
			}
		});*/
	});
})