//////// DOCUMENT READY FOR MISC JQUERY ///////////////////////////////////////////////////////////////////////////////////////////
$(document).ready(function(){	
////////// HIDE ALL COMMENTS ////////////////////
	$('.comment-container').hide();
/////////////////////////////////////////////////
/////////////////// ADD PRINT BUTTON AND SHOW ALL COMMENTS BUTTON TO PRINTING THE STANDARD SCREEN ///////////////////
	$('.printable-version').prepend('<h2>Print AA1000SES</h2><div class="printing_container"><p>This page has been specially formatted to print in a friendly manner.</p><p><button type="submit" id="print" name="print">Print AA1000SES</button>&nbsp;&nbsp;<button type="submit" id="toggle_comments" name="toggle_comments">Show All Comments</button></p></div>');
	$('#print').click(function() {
		window.print();
		return false;
	});
////////////////////////////////////////////////////////////////////////////////////////
/////// SHOW ALL / HIDE ALL COMMENTS TOGGLE FOR PRINTING THE STANDARD SCREEN ///////////	
	$("#toggle_comments").toggle(
      function() {
		$('#toggle_comments').html("Hide All Comments");
        $('.comment-container').slideDown('normal');
      },
      function() {
		$('#toggle_comments').html("Show All Comments");
		$('.comment-container').slideUp('normal');
      }
    );
////////////////////////////////////////////////////////////////////////////////////
/////////////////// ADD COMMENTS BUTTON TO WIKI ARTICLES PAGE(S) ///////////////////
	$('#article_buttons').append('<a href="#comment_header" id="toggle_article_comments" title="Comments For This Entry">Comments</a>');
	$("#toggle_article_comments").click(function(){
		if ($('.comment-container').is(':hidden')){
        		$('.comment-container').slideDown('normal');
				$('#toggle_article_comments').addClass('wiki_button_selected');
      	}
		else {
				$('.comment-container').slideUp('normal');
				$('#toggle_article_comments').removeClass('wiki_button_selected');
		}
	});
/////////////// CLOSE COMMENTS ON WIKI ARTICLES PAGE(S) /////////////////////////
	$('.comment-container').append('<a href="#" class="close_comments" title="Close Comments">Close Comments</a>');
	$('.close_comments').click(function(event){
		event.preventDefault();
		$(this).parent().fadeOut('normal');
		$('#toggle_article_comments').removeClass('wiki_button_selected');
	});
/////////////////////////////////////////////////////////////////////////////
	$('.toc_div').localScroll();
	$('.rightcol').localScroll();
	  


///////// DOCUMENT READY FOR MISC JQUERY END ///////////////////////////////////////////////////////////////////////////////////////////////////////
}); 

