$(document).ready(function() {

/***********************************************
***  FOUT PREVENTION  **************************
************************************************/

	if(! ($.browser.msie && $.browser.version <= 7)) {
		WebFont.load({
				custom: {
						families: ['RockoUltraFLFRegular'],
						urls : ['/css/default.css']
					}
			});
	}

/***********************************************
***  ADD JS ENABLED CLASS  *********************
************************************************/

	$('html').addClass('jsEnabled');

	
/***********************************************
***  EXTERNAL LINKS  ***************************
************************************************/

	$('a[rel=external]').addClass('external').attr({
			title: 'Open this page in a new window',
			target: '_blank'
		});
	

/***********************************************
***  SERVICES NAV HOVER  ***********************
************************************************/

	$('.services .sidebarLeft ul a').each(function() {
			var $this = $(this);
			$this.data('originalColor', $this.css('color'));
			var $span = $this.find('span');
			$span.data('originalColor', $span.css('color'));
		}).hover(function() {
				var $this = $(this);
				$this.parent().stop().animate({
						backgroundPosition: '(-30px 0)'
					}, 250, 'easeOutQuad');
				$this.add($this.find('span')).stop().animate({
							color: '#ffe71a'
						}, 250, 'easeOutQuad');
			}, function() {
					var $this = $(this);
					$this.parent().stop().animate({
							backgroundPosition: '(-250px 0)'
						}, 150, 'easeOutQuad');
					$this.stop().animate({
								color: $this.data('originalColor')
							}, 150, 'easeOutQuad');
					var $span = $this.find('span');
					$span.stop().animate({
								color: $span.data('originalColor')
							}, 150, 'easeOutQuad');
				});
	
	
/***********************************************
***  ABOUT NAV HOVER  **************************
************************************************/


	$('.about .sidebarLeft ul a').each(function() {
			var $this = $(this);
			$this.data('originalColor', $this.css('color'));
			var $span = $this.find('span');
			$span.data('originalColor', $span.css('color'));
		}).hover(function() {
				var $this = $(this);
				$this.parent().stop().animate({
						backgroundPosition: '(-30px 0)'
					}, 250, 'easeOutQuad');
				$this.add($this.find('span')).stop().animate({
							color: '#ed1b24'
						}, 250, 'easeOutQuad');
			}, function() {
					var $this = $(this);
					$this.parent().stop().animate({
							backgroundPosition: '(-250px 0)'
						}, 150, 'easeOutQuad');
					$this.stop().animate({
								color: $this.data('originalColor')
							}, 150, 'easeOutQuad');
					var $span = $this.find('span');
					$span.stop().animate({
								color: $span.data('originalColor')
							}, 150, 'easeOutQuad');
				});


/***********************************************
***  CONTACT PAGE BUTTONS  *********************
************************************************/

	$('.contactForm .submitContainer input, .directions .submitContainer input').hover(function(){
			$(this).stop().animate({
					paddingLeft: '30px'
				}, 150);
		}, function(){
				$(this).stop().animate({
						paddingLeft: '15px'
					}, 150);
			});
	
/***********************************************
***  CTA BUTTON HOVER  *************************
************************************************/

	$('.ctaBtn').hover(function(){
			$(this).find('div').stop().animate({
					paddingRight: '60px'
				}, 150);
		}, function(){
				$(this).find('div').stop().animate({
						paddingRight: '30px'
					}, 150);
			});
			
	
});


