var PE = { initIntro: function() { // $("#textbar,#nav,#description").hide(); //,#textbar p PE.introStart(); $("#textbar").click(function(){ $(this).stop(); PE.introSkip(); }); }, introStart:function() { $("#textbar").delay(200).fadeIn(950, function(){$(this).children("p").fadeIn(750, PE.introDone)}); }, introDone: function() { $("#textbar p").delay(3200).fadeOut(700);//,opacity:1 $("#textbar").delay(3200).fadeOut(850, function(){ PE.contentNavUp(450); $("#nav").delay(200).fadeIn(800); $("#description").delay(200).fadeIn(800); }); }, introSkip: function() { $("#textbar p").fadeOut(700); $("#textbar").fadeOut(850); PE.contentNavUp(450); $("#nav").delay(200).fadeIn(800); $("#description").delay(200).fadeIn(800); }, introStarta:function() { $("#textbar").delay(200).fadeIn(650, function(){$(this).children("p").fadeIn(450, PE.introDone)}); }, introDonea: function() { //$("#textbar p").delay(3200).animate({width:'60%'});//,opacity:1 $("#textbar").delay(3200).fadeOut(500, function(){ PE.contentNavUp(450); $("#nav").delay(200).fadeIn(800); $("#description").fadeIn(800); }); }, contentNavUp: function(time) { $("#content-nav").animate({ height: '134px'}, (time === null) ? 350: time); }, contentNavDown: function() { $("#content-nav").animate({ height: '14px'}, 350) }, contentNavHover: function() { var closeInt = 0; $("#content-nav").not(".stay-closed").hover(function () { clearTimeout(closeInt); PE.contentNavUp(); },function () { if(!$(this).hasClass(".stay-open")) { closeInt = setTimeout(PE.contentNavDown, 1000); } })//.click(function () { clearTimeout(closeInt); $(this).animate({ height: '14px'}, 350); }); }, fixNavHover: function() { $("#nav ul li").not(".active").hover(function(){ $(this).siblings(".active").children("ul").hide();//css({display:'none'}); },function(){ $(this).siblings(".active").children("ul").show();//fadeIn(300);//css({visibility:'visible'}); }) }, startImagesCarousel: function() { $("#content #images").jCarouselLite({ btnNext: "#content #images .arrows-next a", btnPrev: "#content #images .arrows-previous a", speed: 1100, easing: 'easeOutQuart', visible: 1, scroll: 1, sync: 1, circular: false, mouseWheel: true, beforeStart: function(args) { $("#textbar:visible").fadeOut("fast"); PE.contentNavDown(); PE.stopFlashVideo(args); }, afterEnd: function(args) { // var sec = args.attr('class').substr(0,args.attr('class').length-2); var t = args.children('.caption').html(); if(t) { // t = t.replace("[","").replace("]",""); $("#textbar").html(t+"
").fadeIn(520).children("p").css("margin-top", (180 - $("#textbar p").height()) / 2 ); $("#textbar").click(function(){ $(this).fadeOut("fast") }); } PE.checkForFlash(args); } }); $(document).keyup(function(e){ if (!e) var e = window.event; var code = (e.which) ? e.which : e.keyCode switch (code) { case 37: $("#content #images .arrows-previous a").trigger("click"); break; case 39: $("#content #images .arrows-next a").trigger("click"); break; } }); }, checkForFlash: function(element) { if(element.length) { if($(element).children("object").length) { $("#image-mask").hide(); } else { $("#image-mask").show(); } } }, stopFlashVideo: function(element) { if($(element).children("object").length) { var object_id = $(element).children("object").attr("id").split("-"); if(object_id[1] == "video") $(element).children("object").get(0).pauseMedia();//loadAlbum(0,0); } }, checkForTextbarContent: function() { var t = $("#content #images ul li:first").children('.caption').html(); if(t) { // t = t.replace("[","").replace("]",""); $("#textbar").html(t+"
").fadeIn(520).children("p").css("margin-top", (180 - $("#textbar p").height()) / 2 ); $("#textbar").click(function(evt){ $(this).fadeOut("fast") }); } }, startContentNavCarousel: function(inStart) { $("#content-nav-items").jCarouselLite({ btnNext: "#content-nav .arrows-next a", btnPrev: "#content-nav .arrows-previous a", speed: 1050, easing: 'easeOutCubic', visible: 4, circular: false, start: (inStart === null) ? 0 : inStart, scroll: 4, // circular:false, mouseWheel: true, beforeStart: function(args) {}, afterEnd: function(args) {} }); }, showCarouselElement:function(inNumber) { var page = Math.floor(inNumber / 4)*4; setTimeout(function(){$("#content-nav-items").showCarouselElement(page)}, 110); }, startBackgroundImages: function() { $("#images ul").cycle({ delay: 2000, timeout: 5000, speed: 750 }) }, gridNavHover: function() { // text mouseovers $(".grid-nav a").hover(function(){ $("#grid li a").not("."+$(this).attr("class")).stop().fadeTo(200, .2); },function(){ $("#grid li a").not("."+$(this).attr("class")).stop().fadeTo(150, 1); }); // grid mouseovers $("#grid li a").hover(function(){ $(this).parent().siblings().stop().fadeTo(200, .2); $(".grid-nav a").filter("."+$(this).attr("class").replace(/\s+/g, ',.')).addClass("active"); },function(){ $(this).parent().siblings().stop().fadeTo(150, 1); $(".grid-nav a").filter("."+$(this).attr("class").replace(/\s+/g, ',.')).removeClass("active"); }); } }; google.setOnLoadCallback(function(){ if($("body").hasClass("intro") || $("body").hasClass("home")) { PE.initIntro(); } PE.contentNavHover(); // PE.fixNavHover(); PE.checkForTextbarContent(); PE.checkForFlash($("#content #images ul.images li:first")); // start slideshow if on homepage // if($("body").hasClass("home")) { // PE.startHomeImages(); // } }); /* got replaced by googles setOnLoad $(function() { // code to execute when the DOM is ready PE.contentNavHover(); PE.fixNavHover(); }); */