$(function() {
	$("#about-us .staffList li a").live("click",function() {
		$("#about-us .staffList li").removeClass("current");
		$(this).parent().addClass("current");
		
		loadMember(this.href);
		return false;
	});
})


function loadMember(href) {
	$("#about-us .currentMember").animate({opacity:0},function(){
		$.ajax({
			url: href,
			type: 'GET',
			dataType: 'json',
			data: {
				json : 1,
				selector : '#about-us .currentMember'
			},
			success: function (res) {			
				// LOAD CSS 
				$(res.css).each(function() {
					if ($("head link[href='"+this+"']").size()==0) {
						$("head").append('<link rel="stylesheet" href="'+BASE+"/"+this+'" type="text/css" />');
					}
				})			
					
				$("#about-us .currentMember").html(res.html);
				$("#about-us .currentMember").animate({opacity:1});
				
				fancybox();
			}
		
		})
	});
}


