//jQuery primer

$(document).ready(function(){

  //begin with everything closed except #investment
  $(".acc").hide();
  $(".item-subhead").hide();
  $("#itemhead").text("Investment Advice"); 
  $("#investment").show(); 
  
//button actions  
$("#invBtn").click(function(event) {
if (!$(this).hasClass("down")){
event.preventDefault();
$(".acc").slideUp("slow");
$("#itemhead").text("Investment Advice");
$("#investment").slideDown("slow");
$("ul#subnav li").removeClass("down");
$(this).addClass("down");
}
});

$("#debtBtn").click(function(event) {
if (!$(this).hasClass("down")){
event.preventDefault();
$(".acc").slideUp("slow");
$("#itemhead").text("Debt Portfolio Advice");
$("#debtportfolio").slideDown("slow");
$("ul#subnav li").removeClass("down");
$(this).addClass("down");
}
});

$("#trainBtn").click(function(event) {
if (!$(this).hasClass("down")){
event.preventDefault();
$("#itemhead").text("Training and Workshops");
$(".acc").slideUp("slow");
$("#training").slideDown("slow");
$("ul#subnav li").removeClass("down");
$(this).addClass("down");
}
});

$("#memtrnBtn").click(function(event) {
if (!$(this).hasClass("down")){
event.preventDefault();
$("#itemhead").text("Member Training");
$(".acc").slideUp("slow");
$("#membertraining").slideDown("slow");
$("ul#subnav li").removeClass("down");
$(this).addClass("down");
}
});

$("#techBtn").click(function(event) {
if (!$(this).hasClass("down")){
event.preventDefault();
$(".acc").slideUp("slow");
$("#itemhead").text("Technical Advice");
$("#technicaladvice").slideDown("slow");
$("ul#subnav li").removeClass("down");
$(this).addClass("down");
}
});

$("#ecoBtn").click(function(event) {
if (!$(this).hasClass("down")){
event.preventDefault();
$(".acc").slideUp("slow");
$("#itemhead").text("Economic Overview");
$("#economic").slideDown("slow");
$("ul#subnav li").removeClass("down");
$(this).addClass("down");
}
});

$("#go4Btn").click(function(event) {
if (!$(this).hasClass("down")){
event.preventDefault();
$(".acc").slideUp("slow");
$("#itemhead").text("Go4 Options");
$("#go4").slideDown("slow");
$("ul#subnav li").removeClass("down");
$(this).addClass("down");
}
});

});
