$(function(){
  if(document.getElementById("divStorySwap")){
  
    // SPLASH TABS onCLICK FUNCTION
  	$("#divStoryNav a").click(function(){
  		var s = $(this);
  		if(!s.parent("div").hasClass("selected")){
  			var i = s.attr("id");
  			i = i.charAt(9);
  			$("#divStoryNav div").attr("class","disabled");
  			$(".divStoryContainer").each(function(){
  				if($(this).css("display") == "block"){
  					$(this).fadeOut("normal");
  				}
  			});
  			$("#divStory" + i).fadeIn("normal");
  			s.parent("div").removeClass("disabled");
  			s.parent("div").addClass("selected");
  			return false;
  		}
  	});
  	
  	// SPLASH TABS onMOUSEOVER FUNCTION	
  	$("#divStoryNav a").mouseover(function(){
  		var y = $(this);
  		if(y.parent("div").hasClass("disabled")){
          y.parent("div").removeClass("disabled");
  		}
  	});
  	
  	// SPLASH TABS onMOUSEOUT FUNCTION
  	$("#divStoryNav a").mouseout(function(){
  		var y = $(this);
  		if ((!y.parent("div").hasClass("disabled")) && (!y.parent("div").hasClass("selected"))) {
  		    y.parent("div").addClass("disabled");
  		}
  	});
  	
  }
});
