// JavaScript Document

// set the png fix to load with document
$(document).ready(function(){ 
	$(document).pngFix(); 
	fadeImages();
	slideSocialButtons();
	toggleNews();

}); 




// function to fade buttons
function fadeImages() {
	$('.fadeimg')
		.css({ opacity: 1.0 })
		.mouseover(function() {				
			$(this).stop().animate(
				{ opacity: 0.6 }
			, 200); // this is the duration of the fade on mouseover in milliseconds
		})
		.mouseout(function() {
			$(this).stop().animate(
				{ opacity: 1.0 }
			, 1000); // this is the duration of the fade on mouseout in milliseconds
		});
}



// function to Slide Social buttons
function slideSocialButtons() {
	
  // SLIDE THE TWITTER DIV
  $(".socialbuttons div")
		
		.mouseover(function() {				
			$(this).animate({bottom:15},"fast");
		})
		
		.mouseout(function() {
			$(this).animate({bottom:0},"medium");
		});		
		
}



// function to toggle tabs between the latest news and twitter areas on the homepage
function toggleNews() {
	
   $('#latestnewslink').click(function(){
     $('.newsbox').show();
	 $('.twitterbox').hide();
	 return false;
   });
   
   $('#twitterfeedlink').click(function(){
     $('.newsbox').hide();
	 $('.twitterbox').show();
	 return false;
   });   
		
}



