jQuery(document).ready(

    /*
	This function gets loaded when all the HTML, not including the portlets, is
	loaded.
 */

    function() {
		if ( jQuery('#banner-ticker .n5list li').length > 0 ) jQuery('#banner-ticker').show();
    }
    );

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() {
        jQuery('#choose-lang').click(function() {
            jQuery('.choose-lang').slideToggle("fast");
        });

        jQuery('#modOwnLinks').click(function() {
            jQuery('#ownLinks').hide();
            jQuery('#editOwnLinks').show();
            return false;
        });

        jQuery('#ownLinkCancel').click(function() {
            jQuery('#ownLinks').show();
            jQuery('#editOwnLinks').hide();
            return false;
        });

        jQuery('#ownLinkSubmit').click( function(){
            jQuery.cookie('ownlink0Name', jQuery('#ownlinkName1').val(), { expires: 1780 });
            jQuery.cookie('ownlink0Url', jQuery('#ownlinkUrl1').val(), { expires: 1780 });
            jQuery.cookie('ownlink1Name', jQuery('#ownlinkName2').val(), { expires: 1780 });
            jQuery.cookie('ownlink1Url', jQuery('#ownlinkUrl2').val(), { expires: 1780 });
            jQuery.cookie('ownlink2Name', jQuery('#ownlinkName3').val(), { expires: 1780 });
            jQuery.cookie('ownlink2Url', jQuery('#ownlinkUrl3').val(), { expires: 1780 });
            jQuery.cookie('ownlink3Name', jQuery('#ownlinkName4').val(), { expires: 1780 });
            jQuery.cookie('ownlink3Url', jQuery('#ownlinkUrl4').val(), { expires: 1780 });
            jQuery.cookie('ownlink4Name', jQuery('#ownlinkName5').val(), { expires: 1780 });
            jQuery.cookie('ownlink4Url', jQuery('#ownlinkUrl5').val(), { expires: 1780 });
            return true;
        });

        jQuery('#layout-column_portlet\\:71_INSTANCE_0001').removeClass('lfr-portlet-column');
        jQuery('#layout-column_portlet\\:73_INSTANCE_0001').removeClass('lfr-portlet-column');
        jQuery('#layout-column_portlet\\:N5ContentEditor_INSTANCE_0001').removeClass('lfr-portlet-column');

    }

    );

        


