$(document).ready(function() { 

  $("#faq div#exp_col").show();

  $("#faq dd").hide();

  $("#faq dt").hover(function() {
    $(this).addClass("hlite");    
  }, function() {
    $(this).removeClass("hlite");
  });

  $("#faq dt").css('cursor', 'pointer');

  $("#faq dt").prepend('<img src="static/images/plus.gif" alt="expand"/>');
  $("#faq dt").click(function() {
    $(this).next("dd").slideToggle("fast");
    img = $(this).find("img");
    plus_minus(img);
  });
  $("#faq a#expand").click(function() {
    $("#faq dd").show();
    $("#faq dt img").attr("src","static/images/minus.gif");
    $("#faq dt").addClass("expanded");
    return false;
  });
  $("#faq a#collapse").click(function() {
    $("#faq dd").hide();
    $("#faq dt img").attr("src","static/images/plus.gif");
    $("#faq dt").removeClass("expanded");
    return false;
  });

  if (document.location.hash) {
    hash = document.location.hash;
    $("dt"+ hash).next().show();
    plus_minus($("dt"+ hash).find("img"));
  }

});

function plus_minus(e) {
  if (e.attr("src") == "static/images/minus.gif") {
    e.attr("src","static/images/plus.gif");
    e.parent().removeClass("expanded");
  } else {
    e.attr("src","static/images/minus.gif");
    e.parent().addClass("expanded");
  }  
}
