$(document) .ready(function () {

        xOffset = 10;
		yOffset = 20;
		var position2 = $('#lists').offset({});
    
    $('#drawer_open') .toggle(function () {
        
        var position = $(this).offset();
    
     $('#page_drawer') .css("top", + position.top-position2.top+40 + "px")
			      .css("left", + position.left-position2.left + "px")
                  .fadeIn('slow');
        
        $('#drawer_open') .html(" Close Menu");
    },
    function () {
       $('#page_drawer') .fadeOut('slow');
        $('#drawer_open') .html(" Open Menu");
    });
});


/** GE Text Loader **/
$(document).ready(function() {

        var next_no1 = $("#page_title").attr('page');
        var prev_no = next_no1 - 2;
        

			
           /*$('#pager_next').text();
           var next_page = $("#pager_next").attr("href");*/
           $("#pager_next").attr('href', next_no1 + '.php');
           $("#pager_next2").attr('href', next_no1 + '.php');
            $("#pager_previous").attr('href', prev_no + '.php');
             $("#pager_previous2").attr('href', prev_no + '.php');

});

/*
$(document) .ready(function () {
    
    $('#draft_open') .toggle(function () {
         $('div.draft_pages') .slideDown();
        $('#draft_open') .html(" Close");
    },
    function () {
       $('div.draft_pages') .slideUp();
        $('#draft_open') .html(" Open");
    });
});



$(document) .ready(function () {
    
    $('#proofs_open') .toggle(function () {
         $('div.proofs_pages') .slideDown();
        $('#proofs_open') .html(" Close");
    },
    function () {
       $('div.proofs_pages') .slideUp();
        $('#proofs_open') .html(" Open");
    });
});


$(document) .ready(function () {
    
    $('#typescript_open') .toggle(function () {
         $('div.typescript_pages') .slideUp();
        $('#typescript_open') .html(" Open");
    },
    function () {
       $('div.typescript_pages') .slideDown();
        $('#typescript_open') .html(" Close");
    });
});
*/

$(document).ready(function () {
      $('LI.drawer UL:not(".open")').hide(); // hide all ULs inside LI.drawer except the first one
      $('H2.drawer-handle').click(function () {
        // hide all the drawer contents
        $('LI.drawer UL:visible').slideUp().prev().removeClass('open');

        // show the associated drawer content to 'this' (this is the current H2 element)
        // since the drawer content is the next element after the clicked H2, we find
        // it and show it using this:
        $(this).addClass('open').next().slideDown();
      });
    });
    
    
    
    
    /** open and load relevant comment **/
$(document) .ready(function () {

var position2 = $('#lists').offset({});

        xOffset = 10;
		yOffset = 20;
    
    $('#page_text a') .click(function () {
    
    var commentno = $(this).text();
    var position = $(this).offset();
    
    $('#popup_note').empty();
    
     $('#bubble') .css("top", + position.top-position2.top+40 + "px")
			      .css("left", + position.left-position2.left + "px")
                  .fadeIn('slow');
      
       $('#popup_note').load('http://www.woolfonline.com/html/comments/comment' +commentno+ '.html');
       
       this.blur();
  return false;


    });
});

/** open and load relevant TS comment **/
$(document) .ready(function () {

var positionTS = $('#lists').offset({});

        xOffset = 10;
		yOffset = 20;
    
    $('#page_textTS a') .click(function () {
    
    var commentnoTS = $(this).text();
    var position2TS = $(this).offset();
    
    $('#popup_noteTS').empty();
    
     $('#bubbleTS') .css("top", + position2TS.top-positionTS.top+40 + "px")
			      .css("left", + position2TS.left-positionTS.left + "px")
                  .fadeIn('slow');
      
       $('#popup_noteTS').load('http://www.woolfonline.com/html/comments/tscomments/comment' +commentnoTS+ '.html');
       
       this.blur();
  return false;


    });
});

/** open and load relevant TS comment **/
$(document) .ready(function () {

var positionKey = $('#lists').offset({});

        xOffset = 10;
		yOffset = 20;
    
    $('#page_textkey a') .click(function () {
    
    var commentnoKey = $(this).text();
    var position2Key = $(this).offset();
    
    $('#popup_notekey').empty();
    
     $('#bubblekey') .css("top", + position2Key.top-positionKey.top+40 + "px")
			      .css("left", + position2Key.left-positionKey.left + "px")
                  .fadeIn('slow');
      
       $('#popup_notekey').load('http://www.woolfonline.com/html/comments/comment' +commentnoKey+ '.html');
       
       this.blur();
  return false;


    });
});

/** open and load relevant TS comment **/
$(document) .ready(function () {

var positionKey = $('#lists').offset({});

        xOffset = 10;
		yOffset = 20;
    
    $('#page_textProofs a') .click(function () {
    
    var commentnoProofsKey = $(this).attr("key");
    var position2Key = $(this).offset();
    
    $('#popup_notekey').empty();
    
     $('#bubblekey') .css("top", + position2Key.top-positionKey.top+40 + "px")
			      .css("left", + position2Key.left-positionKey.left + "px")
                  .fadeIn('slow');
      
       $('#popup_notekey').load('http://www.woolfonline.com/html/comments/comment' +commentnoProofsKey+ '.html');
       
       this.blur();
  return false;


    });
});

/** close comment bubble **/
$(document) .ready(function () {
    
    $('#close') .click(function () {
       $('#bubble') .fadeOut('slow');
    
    });
});

/** close TS comment bubble **/
$(document) .ready(function () {
    
    $('#closeTS') .click(function () {
       $('#bubbleTS') .fadeOut('slow');
    
    });
});

/** close TS comment bubble **/
$(document) .ready(function () {
    
    $('#closekey') .click(function () {
       $('#bubblekey') .fadeOut('slow');
    
    });
});



