var numBeforeThat = -1;
var lastNum = -1;
var num = -1;
var selector = "";
function swapPics() {

	while(num == lastNum) {
		num = Math.floor(Math.random()*3);
	}
	lastNum = num;
	switch(num) {
		case 0:
			selector = "massagePics";
			break;
		case 1:
			selector = "yogaPics";
			break;
		case 2:
			selector = "spaPics";
			break;
	}
		var currentPic = $("#"+selector+" .active");
		var nextPic = currentPic.next();
		if(nextPic.length == 0) {
			nextPic = $("#"+selector+" img:first-child");
		}
		currentPic.fadeOut(4000);
		nextPic.fadeIn(4000);
		currentPic.removeClass('active');
		nextPic.addClass('active');
}
$(document).ready(function () {
	$("#massagePics .active").fadeIn(3000);
	$("#yogaPics .active").fadeIn(3000);
	$("#spaPics .active").fadeIn(3000);
	setInterval("swapPics()",4000)
});
