﻿$(document).ready(function() {

  var showMore = true;
  var showMoreSubnav = true;

  $("#PressArchive").hide();
  $('#side_sub_menu li ul li.archive').hide();

  // Show or hide the archived news or press releases
  $('#show_hide_news_press_archive').click(function() {

    if (showMore) {
      $('#show_hide_news_press_archive').text("Show most recent...");
      $("#PressArchive").toggle("slow");
      showMore = false;
    }
    else {
      $('#show_hide_news_press_archive').text("Show all...");
      $("#PressArchive").toggle("slow");
      showMore = true;
    }

    return false;

  });

  // Show or hide the archived press releases on the subnavigation bar
  $('#show_hide_news_press_archive_subnav').click(function() {

    if (showMoreSubnav) {
      $('#show_hide_news_press_archive_subnav').text("Show most recent...");
      $("#side_sub_menu li ul li.archive").toggle("slow");
      showMoreSubnav = false;
    }
    else {
      $('#show_hide_news_press_archive_subnav').text("Show all...");
      $("#side_sub_menu li ul li.archive").toggle("slow");
      showMoreSubnav = true;
    }
    return false;

  });


  $(".PDF-papers-block-wrapper .PDF-papers-block-title a").click(function() {
    var tagName = $(this).parent().parent().attr("id");
    $("#" + tagName + " .PDF-papers-block-title a span").toggleClass("plus-minus");
    if ($.browser.msie) {
      $("#" + tagName + " .PDF-papers-block-links").toggle();
    }
    else {
      $("#" + tagName + " .PDF-papers-block-links").toggle("slow");
    }
    return false;
  });


  /*$(".datasheet-block-wrapper .datasheet-block-title a").click(function() {
    var tagName = $(this).parent().parent().attr("id");
    $("#" + tagName + " .datasheet-block-title a span").toggleClass("plus-minus");
    if ($.browser.msie) {
      $("#" + tagName + " .datasheet-block-links").toggle();
    }
    else {
      $("#" + tagName + " .datasheet-block-links").toggle("slow");
    }
    return false;
  });


  $(".user-guides-block-wrapper .user-guides-block-title a").click(function() {
    var tagName = $(this).parent().parent().attr("id");
    $("#" + tagName + " .user-guides-block-title a span").toggleClass("plus-minus");
    if ($.browser.msie) {
      $("#" + tagName + " .user-guides-block-links").toggle();
    }
    else {
      $("#" + tagName + " .user-guides-block-links").toggle("slow");
    }
    return false;
  });*/
  
});
