$(function()
{
  $("#tid").change(function()
  {
    $("#frmTopic").submit();
  });
  $("button.submitButton").hide();
  
  $("table.list div.solution").hide().css("opacity", 0).data("collapsed", true);
  $("table.list td:even").css("cursor", $.browser.msie ? "hand" : "pointer").hover(function()
  {
    $(this).css("color", "#0000ff");
  }, function()
  {
    if ($(this).css("font-size") != "14px") $(this).css("color", "#000");
  }).click(function()
  {
    var solutions = $("div.solution");
    var index = solutions.index($(this).parent().find("div.solution"));
    
    solutions.each(function(i)
    {
      var el = $(this);
      if (i == index)
      {
        el.data("collapsed", false);
        el.parents("tr").find("td:eq(0)").animate({
          fontSize: 14,
          color: "#0000ff"
        });
        
        el.slideDown(500).animate({
          opacity: 1
        }, 500);
      }
      else
      {
        el.data("collapsed", true);
        el.parents("tr").find("td:eq(0)").animate({
          fontSize: 12,
          color: "#464646"
        });
        
        el.slideUp(500).animate({
          opacity: 0
        }, 500);
      }
    });
  });
});
