// JavaScript Document
$(document).ready(function() 
{
  var flashElement = $('.overlay').length;
	 
	$('.button').hover(
		function()
	{
			var currentBtn = $(this);
			$('.selectedBtn').removeClass('selectedBtn');
			$(currentBtn).addClass('selectedBtn');
			
			$('#navtable div a.fade').each(function(){
				$(this).stop().animate({opacity:0.3}, 500);
			});   
			
		  if(flashElement)
		  {
			$('#navtable div a.overlay').each(function(){
			  $(this).stop().show().animate({opacity:0.7}, 500);
			});
			}
			
			currentBtn.find('a.fade').stop().animate({opacity:1}, 500);
			
			if(flashElement)
			 currentBtn.find('a.overlay').stop().animate({opacity:0}, 500).delay(1,function(){$(this).hide().css({'cursor':'pointer'})});
		},
		function()
	{
			$(this).find('a.fade').stop().animate({opacity:0.3}, 500);  
			
			if(flashElement)
			 $(this).find('a.overlay').stop().animate({opacity:0.7}, 500);
		}
	);
	
	$('#slider').hover(
		function(e){
		
		},
		function(){
			$('#navtable div').each(function(){
				$(this).find('a.fade').stop().animate({opacity:1}, 500);
				
				if(flashElement)
				  $(this).find('a.overlay').animate({opacity:0}, 500);
			});		
		}
	);
 
});
