$(document).ready(function(){

	var activeBtn = "";
	var oldBtn = "";

	$(".heroContainer1, .heroContainer2, .heroContainer3, .heroContainer4").attr("style","display: none");
	$(".heroContainer1").attr("style","display: block");
	
	$("#heroNavContainer a").hover(
	  function () {
	  	if ($(this).attr("class") != activeBtn)
		{
			$(this).children("img").attr("src",$(this).children("img").attr("src").replace(/.png/,"Over.png"));
		}
	  }, 
	  function () {
	  	if ($(this).attr("class") != activeBtn)
		{
			$(this).children("img").attr("src",$(this).children("img").attr("src").replace(/Over.png/,".png"));
		}
	  }
	);
	$("#heroNavContainer a").click(
		function () {
		  	if (($(this).attr("class") != activeBtn) && (activeBtn != ""))
			{
				oldBtn = activeBtn;
				activeBtn = "reset";
				$("#heroNavContainer a")
					.each (function(){
						if ($(this).attr("class") == oldBtn)
							$(this).children("img").attr("src",$(this).children("img").attr("src").replace(/Over.png/,".png"));
					});
	
			}
			if ((activeBtn == "reset") || (activeBtn == "" && oldBtn == ""))
			{
				activeBtn = $(this).attr("class");
				$(this).children("img").attr("src",$(this).children("img").attr("src").replace(/Over.png/,"Over.png"));
				
				$(".heroContainer1, .heroContainer2, .heroContainer3, .heroContainer4").attr("style","display: none");
				if($(this).attr("class") == "heroBtn1"){
					$(".heroContainer2").fadeIn("slow");
				}
				else if($(this).attr("class") == "heroBtn2"){
					$(".heroContainer3").fadeIn("slow");
				}
				else if($(this).attr("class") == "heroBtn3"){
					$(".heroContainer4").fadeIn("slow");
				}
				else {
					$(".heroContainer1").fadeIn("slow");
				}
				
				return false;
			}

	});
});






