$(document).ready(function (event) { initMoreLess(); $('.pgwSlideshow').pgwSlideshow({ displayList: false }); if (typeof MoveGalleryOnTop != 'undefined' && MoveGalleryOnTop != undefined && MoveGalleryOnTop) { setTimeout(MoveGalleryAboveContent(), 300); } }); function initMoreLess() { // The height of the content block when it's not expanded var adjustheight = 350; // The "more" link text var moreText = "+ More"; // The "less" link text var lessText = "- Less"; // Sets the .more-block div to the specified height and hides any content that overflows $(".more-less .more-block").css('height', adjustheight).css('overflow', 'hidden'); // The section added to the bottom of the "more-less" div $(".more-less").each(function () { if ($(this).parents("div[data-role='page']").is(':visible')) { if ($(this).find(".continued").length == 0) { $(this).append('

[…]

'); } } }); // Set the "More" text $("a.adjust").text(moreText); $(".adjust").toggle(function () { $(this).parents("div:first").find(".more-block").css('height', 'auto').css('overflow', 'visible'); // Hide the [...] when expanded $(this).parents("div:first").find("p.continued").css('display', 'none'); $(this).text(lessText); }, function () { $(this).parents("div:first").find(".more-block").css('height', adjustheight).css('overflow', 'hidden'); $(this).parents("div:first").find("p.continued").css('display', 'block'); $(this).text(moreText); }); } function MoveGalleryAboveContent() { var galleryCtn = $('.pgwSlideshow.narrow'); if ($(galleryCtn).length > 0) { $(galleryCtn).addClass('cs-gallery-moved-up'); $(galleryCtn).detach().insertBefore('#MainContent'); } }