
$(document).ready(function() {

	 
	 /* offset for publication help */
	 var offset = $(".publication:first").offset();
	 //$("#help").css("top",offset.top).css("left",offset.left);
	 $(".gone").toggle();

	 /* form stuff */
	 $("select").change(function(e) {
		  e.preventDefault();
		  $("form").submit();
	     });
	 $("#showall").click(function(e) {
		  e.preventDefault();
		  $("[name=q]").val("");
		  $("select").val(0);
		  $("form").submit();
	     });
	 $("#helpClose").click(function(e) {
		  e.preventDefault();
		  $("#help").toggle();
	     });
	 $("#helpShow").click(function(e) {
		  e.preventDefault();
		  $("#help").toggle();
	     });

	 /* abstract toggling */
	 var plusImg = new Image();
	 plusImg.src = 'images/plus11.gif';
	 var minusImg = new Image();
	 minusImg.src = 'images/minus11.gif';

	 $(".readMore").html("<a href=\"#\"><img /></a> ");
	 $(".readMore a img").attr("src","images/plus11.gif");
	 $(".abstractTitle").wrapInner("<a href=\"#\"></a>");
	 $(".abstractData").css("display","none");

	 $(".readMore a,.abstractTitle a").toggle(function(e) {
		  e.preventDefault();
		  $(this).blur();
		  $(this).parent().nextAll(".abstractData").css("display","inline");
		  if ($(this).parent().hasClass("readMore")) {
		      $(this).children().attr("src","images/minus11.gif");
		      $(this).parent().next().children().html("Hide Abstract");
		  } else {
		      $(this).parent().prev().children().children().attr("src","images/minus11.gif");
		      $(this).html("Hide Abstract");
		  }
	     }, function(e) {
		  e.preventDefault();
		  $(this).blur();
		  $(this).parent().nextAll(".abstractData").css("display","none");
		  if ($(this).parent().hasClass("readMore")) {
		      $(this).children().attr("src","images/plus11.gif");
		      $(this).parent().next().children().html("Show Abstract");
		  } else {
		      $(this).parent().prev().children().children().attr("src","images/plus11.gif");
		      $(this).html("Show Abstract");
		  }
	     });

    });

				

