// JavaScript Document
// JavaScript Document

$(document).ready(function(){




 /* highlight tabs */
 // if the page contains #welcome, apply active class to the welcome tab <li>, etc.
 if ($("#welcome").length) $("#nav-main-welcome").addClass("active");
 if ($("#community").length) $("#nav-main-community").addClass("active");
 if ($("#business").length) $("#nav-main-business").addClass("active");
 if ($("#members").length) $("#nav-main-members").addClass("active");
 if ($("#chamber").length) $("#nav-main-chamber").addClass("active");

/* hero rollovers */
 // changeHero()
 function changeHero(thisHero,thisButton) {
 $(".hero-shot").not(thisHero).hide(); // hide any visible hero-shots
 if ( $(thisHero).is(":hidden") ) { $(thisHero).show(); } // show new hero-shot

 $(thisButton).addClass("active"); // highlight tab
 $("#nav-main li.active").not(thisButton).removeClass("active"); // clear all other tabs
 }

 
	if($("#welcome").length){
		$("#nav-main-welcome a").mouseover(function(){ changeHero("#welcome-hero","#nav-main-welcome"); });
 		$("#nav-main-business a").mouseover(function(){ changeHero("#business-hero","#nav-main-business"); });
 		$("#nav-main-community a").mouseover(function(){ changeHero("#community-hero","#nav-main-community"); });
 		$("#nav-main-members a").mouseover(function(){ changeHero("#members-hero","#nav-main-members"); });
 		$("#nav-main-chamber a").mouseover(function(){ changeHero("#chamber-hero","#nav-main-chamber"); });
	}
	

 /* dropdown menu */
 /* hover() = rollover(), rollout() */
 $("#nav-top li.dropdown").hover(
 function() {
 $("ul", this).slideDown("fast"); // show dropdown menu
 $(this).addClass("active"); // highlight tab
 $(this).next("li.divider").addClass("long"); // change divider to right of tab
 $(this).prev("li.divider").addClass("long"); // change divider to left of tab
 },
 function() {
 $("ul", this).slideUp("fast", function() { // hide dropdown menu and then...
 $(this).parent().removeClass("active"); // clear tab
 });
 $(this).next("li.divider").removeClass("long"); // change divider to right of tab
 $(this).prev("li.divider").removeClass("long"); // change divider to left of tab
 }
 );


 /* text resize button */
 // toggle() = click(), click(), click(), ...
 $("#text-resize").toggle(
 function () { $(this).text("Shrink Text"); $("body").addClass("largefont"); }, // add .largefont to <body>
 function () { $(this).text("Enlarge Text"); $("body").removeClass("largefont"); } // remove it
 );

});
$(document).ready(function(){


 /* highlight tabs */
 // if the page contains #welcome, apply active class to the welcome tab <li>, etc.
 if ($("#welcome").length) $("#nav-main-welcome").addClass("active");
 if ($("#community").length) $("#nav-main-community").addClass("active");
 if ($("#business").length) $("#nav-main-business").addClass("active");
 if ($("#members").length) $("#nav-main-members").addClass("active");
 if ($("#chamber").length) $("#nav-main-chamber").addClass("active");



 /* dropdown menu */
 /* hover() = rollover(), rollout() */
 $("#nav-top li.dropdown").hover(
 function() {
 $("ul", this).slideDown("fast"); // show dropdown menu
 $(this).addClass("active"); // highlight tab
 $(this).next("li.divider").addClass("long"); // change divider to right of tab
 $(this).prev("li.divider").addClass("long"); // change divider to left of tab
 },
 function() {
 $("ul", this).slideUp("fast", function() { // hide dropdown menu and then...
 $(this).parent().removeClass("active"); // clear tab
 });
 $(this).next("li.divider").removeClass("long"); // change divider to right of tab
 $(this).prev("li.divider").removeClass("long"); // change divider to left of tab
 }
 );

 /* text resize button */
 // toggle() = click(), click(), click(), ...
 $("#text-resize").toggle(
 function () { $(this).text("Shrink Text"); $("body").addClass("largefont"); }, // add .largefont to <body>
 function () { $(this).text("Enlarge Text"); $("body").removeClass("largefont"); } // remove it
 );

});


