function initMenus() { $('ul.menu ul').hide(); $('ul.menu ul.parent_'+curPost).show(); $('li.page-item-'+curPost).addClass("selected"); $('ul.menu li a').click( function() { var checkElement = $(this).next(); var parent = this.parentNode.parentNode.id; if((checkElement.is('ul')) && (checkElement.is(':visible'))) { if($('#' + parent).hasClass('collapsible')) { $('#' + parent + ' ul:visible').slideUp('normal'); } return false; } if((checkElement.is('ul')) && (!checkElement.is(':visible'))) { $('#' + parent + ' ul:visible').slideUp('normal'); checkElement.slideDown('normal'); return false; } } ); setTimeout("$('#nav').show('normal',function() { if (!HasText) sizeMe(); } );", 150); } var infoShowing = false; var TextSeen = false; var UseTextBox = false; var shTopHgt = 6; var shBtmHgt = 22; var lineHgt = 1; var titleWth = 256; var titleMgn = 0; var nwWth = 150; var textWth = 600; var minContentHgt = 550; var minContentWth = 600; var minTotalWth = nwWth + minContentWth; var minTotalHgt = minContentHgt + 100;//676; var cHgt,cWth,cTop,cBtm; var curTextHgt; var contentHgtPercent = .75; function sizeMe(loadflash,startup) { var hgt = $(window).height(); var wth = $(window).width(); if (wth < minTotalWth) { wth = minTotalWth; $("html").css("overflow-x","visible"); } else $("html").css("overflow-x","hidden"); if (curPost == 9) contentHgtPercent = .85; else if (curPost == 40) contentHgtPercent = .8; if (hgt < minTotalHgt) cHgt = Math.round(minTotalHgt * contentHgtPercent); else cHgt = Math.round(hgt * contentHgtPercent); var totalHgt = shTopHgt + shBtmHgt + (2 * lineHgt) + cHgt; cTop = Math.round((hgt - totalHgt) / 2) + 12; if (cTop <= 25) cTop = 25; cWth = wth - nwWth; cBtm = shTopHgt + lineHgt + cHgt; var titleLeft = wth - titleWth; var infoBttnLeft = wth - $("#infobuttonwrapper").width(); var infoBttnTop = cHgt - $("#infobuttonwrapper").height(); $("#infobuttonwrapper").css("left",infoBttnLeft); $("#infobuttonwrapper").css("top",infoBttnTop); if (HasText && infoShowing) { $("#infobutton").css("left",20); } else if (HasText && startup) { $("#infobutton").css("left", 100); setTimeout(animateInfoBttn,2000); infoShowing = true; } if (fancyVisible) { $("#fancy_overlay").width(cWth); $("#fancy_overlay").height(cHgt); $("#fancy_outer").css("left",(cWth - $("#fancy_outer").width()) / 2) - 20; $("#fancy_outer").css("top",cTop + (cHgt - $("#fancy_outer").height()) / 2) - 40; } $("#pagewrapper").css("top",cTop); $("#pagewrapper").height(cHgt); $("#navbarwrapper").css("left",cWth); $("#site_title").css("left",titleLeft); $("#navbarwrapper").height(cHgt); $("#contentwrapper").height(cHgt); $("#contentwrapper").width(cWth); $("#line_bottom").css("top",cBtm); $("#shadow_bottom").css("top",cBtm + lineHgt); if (curTemplate == "page-about.php") $("#about_content").css("margin-top",Math.round((cHgt - $("#about_content").height()) / 2) - 20); if (loadflash && sspPath) loadFlash(); } function animateInfoBttn() { $("#infobutton").animate( { left: 20 }, 1600, "easeOutBack", function() { if (HasText && StartWithText && !TextSeen) $('#infobutton a').click(); setTimeout(sizeMe,400); } ); } function setTextCookie() { $.cookie(curTextCookie,'true', { expires: 120 } ); } $(document).ready(function(){ if (HasText) { curTextHgt = $('#textwrapper').height() + 8; //for fancybox height: added offset as the ratio is a bit off UseTextBox = true; } else $('#infobuttonwrapper').hide(); TextSeen = $.cookie(curTextCookie); $("#infobutton a").fancybox({ 'hideOnContentClick': true, 'frameWidth': $('#textwrapper').width(), 'overlayOpacity': 0.8, 'overlayShow': true }); $('#textwrapper').hide(); $('#nav').hide(); $('#site_title').hide(); $("#navbarwrapper").width(nwWth); if (curPost == 40) { $("body").css("background","#111"); $("#contentwrapper").css("background","#272727"); $("#navbarwrapper").css("background","#272727"); } $("#content_flash").show(); sizeMe(true,true); //calls to animate info button (if needed) and load flash after first resize setTimeout(initMenus,150); setTimeout("$('#site_title').show();", 200); $(window).bind("resize", function(){ clearTimeout(document.waiter); document.waiter = setTimeout("sizeMe()",400); }); });