(function($) {
	$(document).ready(function() {
	
		$('.external').attr('target', '_blank');
		
		if ($.support.opacity) {
			
			$('#image_grid a').css('opacity', 1).hover(function() { 
				$(this).stop().animate({ 'opacity' : 0.6 }, 500);
			}, function() {
				$(this).stop().animate({ 'opacity' : 1 }, 500);
			});			
		}
		
		/* services popups */
		
		$('.popup').click(function() {
			
			var href = $(this).attr('href');
			$.ajax({
				type	: "POST",
				cache	: false,
				url		: href,
				success: function(data) {
					$.fancybox(data);
				}
			});
			return false;
		});
		
		function resizeNav () {
			var ww = $(window).width();
			if ( ww > 1025 ) {		
				$('#nav li a').css({ 'font-size' : '17px' });		
				$('#nav li').css({ 'margin-left' : '5px' });
				$('#home_blurb').css({ 'font-size': '60px' });
			} 
			else {
				$('#nav li a').css({ 'font-size' : '14px' });
				$('#nav li').css({ 'margin-left' : '2px' });
				$('#home_blurb').css({ 'font-size': '45px' });
			}
		}
		
		$('#admin_link').click(function() {
			$('#admin_menu').toggle();
			return false;
		});
		
		$(window).resize(function () {
			resizeNav();
		});
		
		resizeNav();
		
	}); // end $
})(jQuery); // end function($)
