(function($) {
	$(document).ready(function() {	
	
		$('.nx-page, .pv-page, .post-edit-link').css('opacity', 0.7);
		
		$('.nx-page, .pv-page, .post-edit-link').hover(function() {
			$(this).stop().animate({ opacity : 1 }, 300);
		}, function() {
			$(this).stop().animate({ opacity : 0.7 }, 300);
		});
		
		$('.testimonial').filter(':even').addClass('even');
		
		/* homepage */
		$('.home-module-overlay').css('display', 'block');
		$('.home-module-overlay, .home-img-overlay').css({ opacity : 0 });
		
		$('#home-module-home').hover(function() {	
			if($('.home-module-wrap').is('animated') == false) {
				var $title = $('.home-title h2 a', this);
				var $img = $('.home-img-overlay', this);
				var $overlay = $('.home-module-overlay', this);
				$title.css('color', '#000000');
				$img.stop().animate({ opacity : 1 }, 300);
				$overlay.stop().animate({ opacity : 0.9, height: 540 }, {queue: false, duration:300});
				$('#home-module-gallery').stop().animate({ opacity : 0 });
			}				
		}, function() {
			if($('.home-module-wrap').is('animated') == false) {
				var $title = $('.home-title h2 a', this);
				var $img = $('.home-img-overlay', this);
				var $overlay = $('.home-module-overlay', this);
				$title.css('color', '#666666');
				$img.stop().animate({ opacity : 0 }, 300);
				$overlay.animate({ opacity : 0, height: 245 }, {queue: false, duration:300});
				$('#home-module-gallery').stop().animate({ opacity : 1 });
			}
		}).click(function(){
			window.location='home';
		});

		$('#home-module-about-us').hover(function() {	
			if($('.home-module-wrap').is('animated') == false) {
				var $title = $('.home-title h2 a', this);
				var $img = $('.home-img-overlay', this);
				var $overlay = $('.home-module-overlay', this);
				$title.css('color', '#000000');
				$img.stop().animate({ opacity : 1 }, 300);
				$overlay.stop().animate({ opacity : 0.9, height: 540 }, {queue: false, duration:300});
				$('#home-module-testimonials').stop().animate({ opacity : 0 });
			}
		}, function() {
			if($('.home-module-wrap').is('animated') == false) {
				var $title = $('.home-title h2 a', this);
				var $img = $('.home-img-overlay', this);
				var $overlay = $('.home-module-overlay', this);
				$title.css('color', '#666666');
				$img.stop().animate({ opacity : 0 }, 300);
				$overlay.animate({ opacity : 0, height: 245 }, {queue: false, duration:300});
				$('#home-module-testimonials').stop().animate({ opacity : 1 });
			}
		}).click(function(){
			window.location='about-us';
		});
	
		$('#home-module-services').hover(function() {	
			if($('.home-module-wrap').is('animated') == false) {
				var $title = $('.home-title h2 a', this);
				var $img = $('.home-img-overlay', this);
				var $overlay = $('.home-module-overlay', this);
				$title.css('color', '#000000');
				$img.stop().animate({ opacity : 1 }, 300);
				$overlay.stop().animate({ opacity : 0.9, height: 540 }, {queue: false, duration:300});
				$('#home-module-contact-us').stop().animate({ opacity : 0 });
			}
		}, function() {
			if($('.home-module-wrap').is('animated') == false) {
				var $title = $('.home-title h2 a', this);
				var $img = $('.home-img-overlay', this);
				var $overlay = $('.home-module-overlay', this);
				$title.css('color', '#666666');
				$img.stop().animate({ opacity : 0 }, 300);
				$overlay.animate({ opacity : 0, height: 245 }, {queue: false, duration:300});
				$('#home-module-contact-us').stop().animate({ opacity : 1 });
			}
		}).click(function(){
			window.location='services';
		});
		
		$('#home-module-gallery').hover(function() {
			if($('.home-module-wrap').is('animated') == false) {
				var $title = $('.home-title h2 a', this);
				var $img = $('.home-img-overlay', this);
				var $overlay = $('.home-module-overlay', this);
				$(this).stop().animate({ top : -295 }, 300);
				$title.css('color', '#000000');
				$img.stop().animate({ opacity : 1 }, 300);
				$overlay.stop().animate({ opacity : 0.9, height: 540 }, {queue: false, duration:300});
				$('#home-module-home').stop().animate({ opacity : 0 });
			}
		}, function() {
			if($('.home-module-wrap').is('animated') == false) {
				var $title = $('.home-title h2 a', this);
				var $img = $('.home-img-overlay', this);
				var $overlay = $('.home-module-overlay', this);
				$(this).stop().animate({ top : 0 }, 300);
				$title.css('color', '#666666');
				$img.stop().animate({ opacity : 0 }, 300);
				$overlay.animate({ opacity : 0, height: 245 }, {queue: false, duration:300});
				$('#home-module-home').stop().animate({ opacity : 1 });
			}
		}).click(function(){
			window.location='gallery';
		});

		$('#home-module-testimonials').hover(function() {	
			if($('.home-module-wrap').is('animated') == false) {
				var $title = $('.home-title h2 a', this);
				var $img = $('.home-img-overlay', this);
				var $overlay = $('.home-module-overlay', this);
				$(this).stop().animate({ top : -295 }, 300);
				$title.css('color', '#000000');
				$img.stop().animate({ opacity : 1 }, 300);
				$overlay.stop().animate({ opacity : 0.9, height: 540 }, {queue: false, duration:300});
				$('#home-module-about-us').stop().animate({ opacity : 0 });
			}
		}, function() {
			if($('.home-module-wrap').is('animated') == false) {
				var $title = $('.home-title h2 a', this);
				var $img = $('.home-img-overlay', this);
				var $overlay = $('.home-module-overlay', this);
				$(this).stop().animate({ top : 0 }, 300);
				$title.css('color', '#666666');
				$img.stop().animate({ opacity : 0 }, 300);
				$overlay.animate({ opacity : 0, height: 245 }, {queue: false, duration:300});
				$('#home-module-about-us').stop().animate({ opacity : 1 });
			}
		}).click(function(){
			window.location='testimonials';
		});

		$('#home-module-contact-us').hover(function() {	
			if($('.home-module-wrap').is('animated') == false) {
				var $title = $('.home-title h2 a', this);
				var $img = $('.home-img-overlay', this);
				var $overlay = $('.home-module-overlay', this);
				$(this).stop().animate({ top : -295 }, 300);
				$title.css('color', '#000000');
				$img.stop().animate({ opacity : 1 }, 300);
				$overlay.stop().animate({ opacity : 0.9, height: 540 }, {queue: false, duration:300});
				$('#home-module-services').stop().animate({ opacity : 0 });
			}
		}, function() {
			if($('.home-module-wrap').is('animated') == false) {
				var $title = $('.home-title h2 a', this);
				var $img = $('.home-img-overlay', this);
				var $overlay = $('.home-module-overlay', this);
				$(this).stop().animate({ top : 0 }, 300);
				$title.css('color', '#666666');
				$img.stop().animate({ opacity : 0 }, 300);
				$overlay.animate({ opacity : 0, height: 245 }, {queue: false, duration:300});
				$('#home-module-services').stop().animate({ opacity : 1 });
			}
		}).click(function(){
			window.location='contact-us';
		});
		
		
	});
})(jQuery);
