$toggleCamera=false; $boxNavHidden=false; SCROLL_DELAY=1000; jQuery(document).ready(function(){ jQuery('#box-top-left-camera').click(function() { if (!$toggleCamera) { //jQuery('#background-container').css('position', 'relative'); jQuery('#inner').fadeOut('slow', function() { // Animation complete. }); jQuery('#border-nav-box').fadeOut('slow', function() { // Animation complete. }); jQuery('#main-navigation').fadeOut('slow', function() { // Animation complete. }); jQuery('#footer').fadeOut('slow', function() { // Animation complete. }); jQuery('#header').fadeOut('slow', function() { // Animation complete. }); jQuery('#boxNav').fadeOut('slow', function() { // Animation complete. }); jQuery('#border-left').fadeOut('slow', function() { // Animation complete. }); jQuery('#border-right').fadeOut('slow', function() { // Animation complete. }); jQuery('#border-bottom').fadeOut('slow', function() { // Animation complete. }); jQuery('#footer-widgets').fadeOut('slow', function() { // Animation complete. }); jQuery('#border-nav-box').fadeOut('slow', function() { // Animation complete. }); jQuery('#border-nav-box-inner').fadeOut('slow', function() { // Animation complete. }); jQuery('#border-bottom').fadeOut('slow', function() { // Animation complete. }); jQuery('#box-background-screen').fadeOut('slow', function() { // Animation complete. }); //jQuery('#stSegmentFrame').hide(); //jQuery('#stwrapper').hide(); //jQuery('#stOverlay').hide(); jQuery('#sthoverbuttons').hide(); jQuery('.gspn-area').hide(); $toggleCamera=true; } else { jQuery('#inner').fadeIn('slow', function() { // Animation complete. }); jQuery('#border-nav-box').fadeIn('slow', function() { // Animation complete. }); jQuery('#main-navigation').fadeIn('slow', function() { // Animation complete. }); jQuery('#footer').fadeIn('slow', function() { // Animation complete. }); jQuery('#header').fadeIn('slow', function() { // Animation complete. }); jQuery('#boxNav').fadeIn('slow', function() { // Animation complete. }); jQuery('#border-left').fadeIn('slow', function() { // Animation complete. }); jQuery('#border-right').fadeIn('slow', function() { // Animation complete. }); jQuery('#border-bottom').fadeIn('slow', function() { // Animation complete. }); jQuery('#footer-widgets').fadeIn('slow', function() { // Animation complete. }); jQuery('#border-nav-box').fadeIn('slow', function() { // Animation complete. }); jQuery('#border-nav-box-inner').fadeIn('slow', function() { // Animation complete. }); jQuery('#border-bottom').fadeIn('slow', function() { // Animation complete. }); jQuery('#box-background-screen').fadeIn('slow', function() { // Animation complete. }); jQuery('#box-top-left-camera').fadeIn('slow', function() { // Animation complete. }); //jQuery('#stSegmentFrame').show(); //jQuery('#stwrapper').show(); //jQuery('#stOverlay').show(); //jQuery('#background-container').css('position', 'fixed'); jQuery('#sthoverbuttons').show(); $toggleCamera=false; } }); jQuery('#boxNav').hover(fs_showBoxNav() ); function fs_showBoxNav() { if (window.pageYOffset!=0 && $boxNavHidden) { $boxNavHidden=false; showNavBox(); } } function fs_hideBoxNav() { if (window.pageYOffset>20 && !$boxNavHidden) { $boxNavHidden=true; hideNavBox(); } } jQuery(window).scroll(function() { setTimeout('fs_scroll()', SCROLL_DELAY); }); //window.onscroll=fs_scroll; // End document ready }); function fs_scroll() { if ($toggleCamera) return ''; if (window.pageYOffset>20 && !$boxNavHidden) { hideNavBox(); $boxNavHidden=true; } if (window.pageYOffset<20 && $boxNavHidden) { showNavBox(); $boxNavHidden=false; } //alert("scrolleventdetected! "+window.pageXOffset+" "+window.pageYOffset); //note:youcanusewindow.innerWidthandwindow.innerHeighttoaccessthewidthandheightoftheviewingarea } function hideNavBox() { //jQuery('#boxNav').fadeOut('slow', function() {}); jQuery('#boxNav').hide("slide", { direction: "right" }, 800); jQuery('.btnNav').css('color', '#595959'); jQuery('#boxNav').css('width', '20px'); jQuery('#boxNav').show("slide", { direction: "right" }, 800); } function showNavBox() { jQuery('#boxNav').hide("slide", { direction: "right" }, 800); jQuery('.btnNav').css('color', ''); jQuery('#boxNav').css('width', ''); jQuery('#boxNav').show("slide", { direction: "right" }, 800); } function simpleSlider() { var $active = jQuery('.hero'); if ($active.length == 0) $active = jQuery('.hero:last'); var $next = $active.next('.hero').length ? $active.next() : jQuery('.hero:first'); $next.css({ opacity: 0.0 }).addClass('active').animate({ opacity: 1.0 }, 1000, function() { $active.removeClass('active'); $active.css({ opacity: 0.0 }); }) } //$('.caption').css({ // opacity: 0.0 //}) simpleSlider(); jQuery('#background-image').click(simpleSlider);