// code for navigation
$(document).ready(function() {
	$(".nav").ready(function() {

		$(".sub").parent().mouseover(function(){
			$(this).closest('li').find('ul.sub').show();
		});

		$(".sub").parent().mouseout(function(){
			$(this).closest('li').find('ul.sub').hide();
		});

		$(".sub2").parent().mouseover(function(){
			$(this).closest('li').find('ul.sub2').show();
		});

		$(".sub2").parent().mouseout(function(){
			$(this).closest('li').find('ul.sub2').hide();
		});

	});

	/*$(".issue .issue-nav li").click(function()
	{
		if (!$(this).hasClass("active"))
		{
			var parentclass = $(this).parent().attr("class");
			$(this).parent().find("li.active").removeClass(parentclass);
			$(this).parent().find("li.active").removeClass("active");
			$(this).addClass("active "+parentclass);
			$(this).parent().parent().parent().find(".issue-main.active").removeClass("active");
			$(this).parent().parent().parent().find(".issue-main[ref = '"+$(this).attr("ref")+"']").addClass("active");
		}
	});*/

	$(".citeLink").click(function(){
		$(".doi-example").fadeIn("slow");
	});

	$(".doi-example").click(function(){
		$(this).fadeOut("slow");
	});

	$(".emailalert").click(function(){
		$(".tx-minimail-pi1").fadeIn("slow");
	});

	$(".closeMail").click(function(){
		$(".tx-minimail-pi1").fadeOut("slow");
	});


	$("#redHome").hover(
      function () {
        $(this).addClass("active");
      },
      function () {
        $(this).removeClass("active");
      }
    );

	$("#purpleHome").hover(
      function () {
        $(this).addClass("active");
      },
      function () {
        $(this).removeClass("active");
      }
    );

	$("#blueHome").hover(
      function () {
        $(this).addClass("active");
      },
      function () {
        $(this).removeClass("active");
      }
    );

	$("#pinkHome").hover(
      function () {
        $(this).addClass("active");
      },
      function () {
        $(this).removeClass("active");
      }
    );

	$("#brownHome").hover(
      function () {
        $(this).addClass("active");
      },
      function () {
        $(this).removeClass("active");
      }
    );

	$("#greenHome").hover(
      function () {
        $(this).addClass("active");
      },
      function () {
        $(this).removeClass("active");
      }
    );

});
