function initDashboard() { $('#intro, #hideIntro').hide(); $('#showIntro').click( function () { $('#showIntro').css("display", "none"); $('#hideIntro').css("display", "block"); $('#gubbins').slideUp("normal", function () { $('#intro').slideDown("normal"); } ); } ); $('#hideIntro').click( function () { $('#hideIntro').css("display", "none"); $('#showIntro').css("display", "block"); $('#intro').slideUp("normal", function () { $('#gubbins').slideDown("normal"); } ); } ); } function swapText(fileIndex) { var textFile = 'homepage_text.php?homepageID=' + fileIndex; $("#hpText").fadeOut('slow', function() { $("#hpText").load(textFile, function() { $("#hpText").fadeIn('slow'); }); }); } $(document).ready(function() { // load flash $('#hpFlash').flash( { src: '/homepage.swf?flush=1283793444', width: 625, height: 240, wmode: 'transparent', allowScriptAccess: 'sameDomain', flashvars: { homepageID: 'smart_energy', transitionDelay: '10' } } ); $("div.navBlock ul ul").hide(); $("div.navBlock ul ul").parent().attr('class', 'more'); $("div.navBlock ul li a").click( function(event) { var $this = $(this).next('ul'); if ($this.css('display') != undefined) { event.preventDefault(); $this.slideToggle('slow', function () { if ($this.parent().attr('class') == 'more') { $this.parent().attr('class', 'less'); } else { $this.parent().attr('class', 'more'); } }); } else { return true; } }); } );