jQuery(document).ready(

	/*
	This function gets loaded when all the HTML, not including the portlets, is
	loaded.
	*/

	function() {
	}
);

Liferay.Portlet.ready(

	/*
	This function gets loaded after each and every portlet on the page.

	portletId: the current portlet's id
	jQueryObj: the jQuery wrapped object of the current portlet
	*/

	function(portletId, jQueryObj) {
			if (!themeDisplay.isStateMaximized()) {
				jQueryObj.find(".show-btn:first").click(function() {
						jQueryObj.find('.portlet-topper:first').show("slide", 500);
						jQueryObj.find(".n5actions:first").show();
						jQueryObj.find(".show-btn:first").hide();
						return false;
				});

				jQueryObj.find(".portlet-topper > .portlet-icons > .hide-btn:first").click(function() {
						jQueryObj.find('.portlet-topper:first').hide("slide", 500);
						jQueryObj.find(".n5actions:first").hide();
						setTimeout(function(){
								jQueryObj.find(".show-btn:first").show();
						}, 1000);
						return false;
				});


				jQueryObj.mouseover(function(){
						jQueryObj.find(".show-btn:first").addClass("visible");
				}).mouseout(function(){
						jQueryObj.find(".show-btn:first").removeClass("visible");
				});

				jQueryObj.find('.portlet-topper').hide();
			}
			
	}
);

jQuery(document).last(

	/*
	This function gets loaded when everything, including the portlets, is on
	the page.
	*/
			function() {}

);
