/* <![CDATA[ */
	jQuery(document).ready(function($) {
		$('.nav li a').children('span.swap').hide();
		$('.nav li a').hover(
			function () {
				$(this).children('span.swap').show();
				$(this).children('span.norm').hide();
			},
			function () {
				$(this).children('span.swap').hide();
				$(this).children('span.norm').show();
			}
		);
		//Portfolio
		$('ul#filter a').click(function() {
			$(this).css('outline','none');
			$('ul#filter .current').removeClass('current');
			$(this).parent().addClass('current');
			var filterVal = $(this).text().toLowerCase().replace(' ','-');	
			if(filterVal == 'all') {
			$('ul#portfolio li.hidden').fadeIn('slow').removeClass('hidden');
			} else {	
				$('ul#portfolio li').each(function() {
					if(!$(this).hasClass(filterVal)) {
						$(this).fadeOut('normal').addClass('hidden');
					} else {
						$(this).fadeIn('slow').removeClass('hidden');
					}
				});
			}	
			return false;
		});
		jQuery.fn.modal = function() {
			return this.each(function(){
			var ah = $(this).height();
		        var wh = $(window).height();
				var dh = $(document).height();
		        var nh = (wh - ah)/2;
		 
		        var aw = $(this).width();
		        var ww = $(window).width();
		        var nw = (ww - aw)/2;
		 
		        // Trim body height, append overlay, and disable scrolling (this can be undone with a custom close button)
		        $("body").append('<div class="overlay"><\/div>');
		        $(".overlay").height(dh).css('overflow','hidden').fadeTo("slow", .8);
		        $(this).css({'top':nh, 'left':nw}).fadeIn("slow");
			});
		};
	});
/* ]]> */