/**
 * absracts.js
 * @author Dusan Jakub 2010
 *
 * Abstracts page: show/hide references, highlight abstract
 */

$(document).ready(function () {
  if (location.hash) {
    var hash = location.hash.substring(1);
    $(".article[itemId="+hash+"]").addClass("selected");
    $(".references[itemId="+hash+"]").attr("show", 1);
    }
    
  if (!$(".references").length) {
    $("#showAll, #hideAll").hide();
    }
  else {
    $(".references[show!=1]").hide();

    $(".toggleRef").click(function () {
      $(".references[itemId="+$(this).attr("itemId")+"]").toggle();
      return false;
      });
    $("#showAll").click(function () {
      $(".references").show();
      return false;
      });
    $("#hideAll").click(function () {
      $(".references").hide();
      return false;
      });
    }
  
  // the page has been changed so scroll back where supposed
  if (hash)
    location.hash = location.hash;
 });

