// JavaScript Document

$(document).ready(function() {
	
	//SETUP FIRST STATES	
	  if ($.browser.msie) {
		$('.rightBar ul li').stop().animate({ textIndent: 5}, 300);
	  }else{ 
		 $('.rightBar ul li').stop().animate({ opacity: 0.6, textIndent: 5}, 300); 
	  }
	  
	
	//ADD FUNCTIONS TO ELEMENTS
		$('.rightBar ul li').hover(overCity, outCity);
		$('.homeBox').hover(overHomeBox, outHomeBox);
		$('a.arrow').hover(overHBa, outHBa);
		$('.nav li a').hover(overNav, outNav);
		$('.footerImgLink-Right a').hover(linkOver, linkUp);
		$('.footerImgLink-Left a').hover(linkOver, linkUp);
		$('a.BigRed').hover(readOver, readUp);
		$('a.pdfLink').hover(pdfOver, pdfUp);
		$('a.wordLink').hover(pdfOver, pdfUp);
		$('.teamFixRight a').hover(fixOver, fixUp);
		$('.teamFixLeft a').hover(fixOver, fixUp);
		
	//FUNCTIONS	
		function overCity(event) {
			if ($.browser.msie) {
	   			$(this).stop().animate({ textIndent: 20}, 300);
			}else{
				$(this).stop().animate({ opacity: 1.0, textIndent: 20}, 300);
			}
		}		
		function outCity(event) {
			if ($.browser.msie) {
				$(this).stop().animate({textIndent: 5 }, 300);
			}else{
				$(this).stop().animate({ opacity: 0.6, textIndent: 5 }, 300);
			}
		}
		
		
		function overHomeBox(event) {
	   		$(this).find('img.blackandwhite').stop().animate({ opacity: 0.0}, 300);
			$(this).find('h3').stop().animate({color: '#f53038'},300); //Red

		}		
		function outHomeBox(event) {
			$(this).find('img.blackandwhite').stop().animate({opacity: 1.0}, 300);
			$(this).find('h3').stop().animate({color: '#343434'},300);
		}
		
		
		function overHBa(event) {
	   		$(this).find('img.up').stop().animate({ opacity: 0.0}, 300);
			$(this).stop().animate( { color: '#2b2b29'}, 300);

		}		
		function outHBa(event) {
			$(this).find('img.up').stop().animate({opacity: 1.0}, 300);
			$(this).stop().animate( { color: '#9f9f9f'}, 300);
		}
		
		
		
		
		function overNav(event){
			$(this).stop().animate({backgroundColor: '#e80504'},400);
		}
		
			function outNav(event){
			$(this).stop().animate({backgroundColor: '#0b0808'},400);
		}
		
		
		
		function linkOver(event) {
	   		$(this).find('img.blackandwhite').stop().animate({ opacity: 0.0}, 300);

		}		
		function linkUp(event) {
			$(this).find('img.blackandwhite').stop().animate({opacity: 1.0}, 300);
		}	
		
		
		//THIS BG RED TO DARK GREY OVER
		function readOver(event) {
			$(this).stop().animate( { backgroundColor: '#d90403'}, 300);
		}
		function readUp(event) {
			$(this).stop().animate( { backgroundColor: '#2b2b29'}, 300);
		}
		
		
		
		//PDF LINK OVERS
		function pdfOver(event){
			$(this).stop().animate({color: '#f53038'},300);			
		}
		function pdfUp(event){
			$(this).stop().animate({color: '#555555'},300);	
		}
		
		
		//FIXTURES LIVE OVERS
		function fixOver(event){
			$(this).find('img.fix-up').stop().animate({ opacity: 0.0}, 300);
			$(this).find('span').stop().animate({backgroundColor: '#D90E16'},300);
		}
		function fixUp(event){
			$(this).find('img.fix-up').stop().animate({ opacity: 1.0}, 300);
			$(this).find('span').stop().animate({backgroundColor: '#565656'},300);
		}

				
});
