

  


function sectionInteraction() {
	

	var editorialHeight = $("#Edi").height();	
	var clinicalHeight = $("#Cli").height();	
	var jourHeight = $("#AHA").height();	
	var booksHeight = $("#Fea").height(); 
	var affiliatedHeight = $("#AFF").height();
	var picksHeight = $("#Picks").height();
	

	
	var arrowClosed = new Image();
	arrowClosed.src = "images/home/sections/section_arrow-closed.jpg";
	
	var articlesClosed = new Image();
	articlesClosed.src = "images/home/sections/articles/articles-closed.jpg";
	
	var editorialClosed = new Image();
	editorialClosed.src = "images/home/sections/editorial/editorial-closed.jpg";
	
	var clinicalClosed = new Image();
	clinicalClosed.src = "images/home/sections/clinical/clinical-closed.jpg";	
	
	var journalsClosed = new Image();
	journalsClosed.src = "images/home/sections/journals/journals-closed.jpg";
	
	var booksClosed = new Image();
	booksClosed.src = "images/home/sections/books/books-closed.jpg";
	
	var affClosed = new Image();
	affClosed.src = "images/home/sections/affiliated/aff-closed.jpg";

		
	$("#Edi_arrow").click(function() {toggleSection("Edi",editorialHeight);});
	$("#Cli_arrow").click(function() {toggleSection("Cli",clinicalHeight);});	
	
	$("#Fea_arrow").click(function() {toggleSection("Fea",booksHeight);});
	$("#AHA_arrow").click(function() {toggleSection("AHA",jourHeight);});
	$("#AFF_arrow").click(function() {toggleSection("AFF",affiliatedHeight);});
	$("#journals_arrow").click(function() {toggleSection("Picks",picksHeight);});	
	
	
}




function toggleSection(sectionName,origHeight) 
	{
	   	
		var section = $("#" + sectionName);
		
		if(section.hasClass("closed")) {
		  
			section.animate({height: "" + origHeight + "px"},"slow",function(){section.css('height','');});
			section.removeClass("closed");
			section.addClass("open");
			section.find(".sectionHead").css("background-image","url(/maui/images/home/sections/sectionbg-open.jpg)");
			section.find(".arrow").attr("src","/maui/images/home/sections/section_arrow-open.jpg");
			section.find(".hideOnClose").css("visibility","visible");
		} else {
		    
			section.animate({height: "26px"},"slow");
			section.removeClass("open");
			section.addClass("closed");
			
			section.find(".sectionHead").css("background-image","url(/maui/images/home/sections/sectionbg-closed.jpg)");
			section.find(".arrow").attr("src","/maui/images/home/sections/section_arrow-closed.jpg");
			section.find(".hideOnClose").css("visibility","hidden");
		}
	}