$(document).ready(function() {

	$('.backtotop').click(function(){
		$('html, body').animate({scrollTop:970}, 'slow');
		return false;
	});
	
	var currentDept = "hair";

	function removeActive(){
		$("#staff_nav li a").removeClass("active");
	}

	function hideAll(){
		$("#makeupDept, #massageDept, #nailsDept, #supportDept, #hairDept").hide();
	}
	function changeCap(id) {
		$("#"+id).next().attr("src",'newimages/active_bg_right.png');
	}
	function inactiveCaps(){
		$("#staff_nav img").attr("src",'newimages/inactive_bg_right.png');
	}

	$("#hairBtn").click(function () {
		hideAll();
		removeActive();
		inactiveCaps();
		$(this).addClass("active");
		changeCap($(this).attr("id"));
		$("#hairDept").show();
	});
	$("#massageBtn").click(function () {
		hideAll();
		removeActive();
		inactiveCaps();
		$(this).addClass("active");
		changeCap($(this).attr("id"));
		$("#massageDept").show();
	});
	$("#makeupBtn").click(function () {
		hideAll();
		removeActive();
		inactiveCaps();
		$(this).addClass("active");
		changeCap($(this).attr("id"));
		$("#makeupDept").show();
	});
	$("#nailsBtn").click(function () {
		hideAll();
		removeActive();
		inactiveCaps();
		$(this).addClass("active");
		changeCap($(this).attr("id"));
		$("#nailsDept").show();
	});
	$("#supportBtn").click(function () {
		hideAll();
		removeActive();
		inactiveCaps();
		$(this).addClass("active");
		changeCap($(this).attr("id"));
		$("#supportDept").show();
	});

});
