(function($){ var currentPage, currentHash; function resizeUI() { $('#doc3').css('height', (window.innerHeight || document.documentElement.clientHeight) - $('#hd').height() - 12); } function scrollToHash(hash) { if (hash) { $(hash).each(function() { $(this)[0].scrollIntoView(); }); } } function loadURL(url) { var parts, hash; // Trim away everything but the file name url = /([^\/]+)$/.exec(url)[0]; // Parse out parts parts = /^([^#]+)(#.+)?$/.exec(url); hash = parts[2]; // In page link, no need to load anything if (parts[1] == currentPage) { if (hash) scrollToHash(hash); else $('#detailsView')[0].scrollTop = 0; return; } currentPage = parts[1]; $("#classView a.selected").removeClass('selected'); $("#classView a[href='" + currentPage.replace(/^.*\/([^\/]+)$/, '$1') + "']").addClass('selected').focus().parents("li.expandable").each(function() { var li = $(this).removeClass("expandable").addClass("collapsable"); li.find("> div.expandable-hitarea").removeClass("expandable-hitarea").addClass("collapsable-hitarea"); li.find("> ul").show(); }); $('#detailsView').find("div.page").hide(); // Check if the page has been loaded before if ($("#detailsView div[url='" + currentPage + "']").show().length == 0) { $('#detailsView').addClass("loading"); // Load page and cache it in a div $.get(currentPage, "", function(data) { data = /
]*>([\s\S]+)<\/body>/.exec(data); if (data) { $('#detailsView').removeClass("loading").append('