// JavaScript Document
$(document).ready(function() {
						   
$("#homeTxt").fadeIn("slow"); //default homeTxt open on load



//$("#middle_container").animate({opacity: "0.4", top: "+=160", height: "20", width: "20"}, "slow")
				   			  						   
$(".btnHome").click(function(){  	
			$("#historyTxt").fadeOut("slow");
			$("#contactTxt").fadeOut("slow");
			$("#homeTxt").fadeIn("slow");
			$("#servicesTxt").fadeOut("slow");
			return false;			
});

$(".btnHistory").click(function(){  	
			$("#homeTxt").fadeOut("slow");
			$("#contactTxt").fadeOut("slow");
			$("#historyTxt").fadeIn("slow");
			$("#servicesTxt").fadeOut("slow");
			$("#history1, #history2, #history3, #history4, #history5, #history6").hide(); //reset history subContent
			varHistoryIndex = 0; //initialize counter for varHistoryIndex subContent
			$("#history"+varHistoryIndex).fadeIn("slow"); //show default history subcontent
			return false;			
});

$(".btnContact").click(function(){  	
			$("#homeTxt").fadeOut("slow");
			$("#contactTxt").fadeIn("slow");
			$("#historyTxt").fadeOut("slow");
			$("#servicesTxt").fadeOut("slow");
			return false;			
});

$(".btnServices").click(function(){  	
			$("#homeTxt").fadeOut("slow");
			$("#contactTxt").fadeOut("slow");
			$("#historyTxt").fadeOut("slow");
			$("#servicesTxt").fadeIn("slow");
			$("#servicesIntro").fadeIn("slow");					  
			$("#Mediation").fadeOut("slow");
			$("#Arbitration").fadeOut("slow");
			$("#Special").fadeOut("slow");
			$("#Litigation").fadeOut("slow");
			return false;			
});

$(".btnMediation").click(function(){  				  
			$("#servicesIntro").fadeOut("slow");					  
			$("#Mediation").fadeIn("slow");
			$("#Arbitration").fadeOut("slow");
			$("Special").fadeOut("slow");
			$("#Litigation").fadeOut("slow");
			return false;			
});

$(".btnArbitration").click(function(){  				  
			$("#servicesIntro").fadeOut("slow");					  
			$("#Mediation").fadeOut("slow");
			$("#Arbitration").fadeIn("slow");
			$("#Special").fadeOut("slow");
			$("#Litigation").fadeOut("slow");
			return false;			
});

$(".btnSpecial").click(function(){  				  
			$("#servicesIntro").fadeOut("slow");					  
			$("#Mediation").fadeOut("slow");
			$("#Arbitration").fadeOut("slow");
			$("#Special").fadeIn("slow");
			$("#Litigation").fadeOut("slow");
			return false;			
});

$(".btnLitigation").click(function(){  				  
			$("#servicesIntro").fadeOut("slow");					  
			$("#Mediation").fadeOut("slow");
			$("#Arbitration").fadeOut("slow");
			$("#Special").fadeOut("slow");
			$("#Litigation").fadeIn("slow");
			return false;			
});

$(".historyLoad").click(function() 
						   {
		
			$("#history"+varHistoryIndex).fadeOut("slow");
			varHistoryIndex = varHistoryIndex + 1;
			$("#history"+varHistoryIndex).fadeIn("slow");
			//alert("#history"+varHistoryIndex);
			
		return false;			
		
		
	});
			
							 
//			//$(".subContentPanel").hide("fast"); //remove any subContentPanel content
////			$("#news").animate({opacity: "1", height: "400"}, 600)
////			$("#news").addClass("panelOpen")
////			$("#about, #events, #contact").animate({opacity: "0.5", height: "51"}, 600)
////			$("#header").animate({opacity: "0.5", height: "125"}, 600)
////			$("#header").removeClass("headerBG"); //hide header BG image
////			$("#about, #events, #contact").removeClass("panelOpen");
////			$(".subNav").hide();
////			$("#news").find(".subNav").fadeIn("slow");
////			$("#news").find(".subContentPanel:first").slideDown("slow"); //default subContentPanel open on load
////			$("li").removeClass("active")
////			$("#news").find("li:first").addClass("active"); //default li active colored
////			
////			$("#renovation1, #renovation2, #renovation3, #renovation4, #renovation5, #renovation6").hide(); //reset renovation subContent
////			varRenovationIndex = 0; //initialize counter for varRenovationIndex subContent
////			$("#renovation"+varRenovationIndex).fadeIn("slow"); //show default renovation subcontent
//
//$("#red").animate({opacity: "0.1"}, 1200)	
//	  .animate({opacity: "0.4", top: "+=160", height: "20", width: "20"}, "slow")
////	  .animate({opacity: "1", left: "0", height: "100", width: "100"}, "slow")
////	  .animate({top: "0"}, "fast")
////	  .slideUp()
////	  .slideDown("slow")
//	.animate({left: "100"}, 1200)
//	.animate({height: "300", width: "300"}, "slow")
//	.animate({opacity: "1", top: "0", left: "300"}, "slow")
//
//
//
//			return false;			
//});

$(function() {
    setInterval( "slideSwitch()", 5000 );
});
	 
  
}); //jQuery END


 
 function slideSwitch() {
    var $active = $('#slideshow IMG.activeSlide');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('activeSlide')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('activeSlide last-active');
        });
}
