function bringHerToMe(){$("div#contactButton").unbind("mouseup",bringHerToMe);$("#contactDisplay").css("display","block");$("div#contactButton").bind("mouseup",takeHerAway)}function takeHerAway(){$("div#contactButton").unbind("mouseup",takeHerAway);$("#contactDisplay").css("display","none");$("div#contactButton").bind("mouseup",bringHerToMe)}
$(document).ready(function(){function k(){var a=$(window).scrollTop(),b=$(window).height(),c=b-q,d=r-b,b=a/(s-b)*c,b=b+46,a=a/d*c;$("#bottom").stop().animate({top:b},{duration:70,specialEasing:{top:"linear"}});$("#middle").stop().animate({top:a},{duration:70,specialEasing:{top:"linear"}})}$("div#contactButton").bind("mouseup",bringHerToMe);var g=0;window.switchProject=function(a){a!=g&&($(".projectSection.ps"+g).animate({opacity:"0",filter:"opacity=0"},400,function(){$(".projectSection").css("display",
"none");$(".projectSection.ps"+a).css("display","block");$(".projectSection.ps"+a).animate({opacity:"1",filter:"opacity=100"},400)}),$(".projectHotSpot").css("background-image",""),$(".projectHotSpot .label").css("color",""),$(".projectHotSpot.b"+a).css("background-image","url(images/subseaButtonOn.gif)"),$(".projectHotSpot.b"+a+" .label").css("color","#f04e23"),$("#projectInfo"+a).css("left","1200px"),$("#projectInfo"+a).css("opacity","0"),$("#projectInfo"+a).css("filter","opacity=0"),$("#projectInfo"+
a).animate({left:"0px",opacity:"1",filter:"opacity=100"},800),0!=g&&$("#projectInfo"+g).animate({left:"-1200px"},800),g=a,k())};$(".projectInfoSlide").css({left:"-1200px",opacity:"0",filter:"opacity=0"});$(".projectSection.ps1").css("display","block");$(".projectSection.ps1").animate({opacity:"1",filter:"opacity=100"},1E3);var s,r,q,h,i,l,d,m,e,n,f,j,t,u,o,p;i=$("#section1").offset().top-300;l=$("#whyPinnacle").offset().top;d=$("#section2").offset().top-300;m=$("#services").offset().top;e=$("#section3").offset().top-
300;n=$("#featuredProjects").offset().top;f=$("#section4").offset().top-300;j=$("#aboutUs").offset().top;t=l-i-100;u=m-d-26;o=n-e-40;p=j-f-26;$(window).scroll($.throttle(30,k));$(window).resize($.debounce(1E3,k));$(window).scroll(function(){var a=$(window).scrollTop();if(a>i&&a<d){var b=a-i;if(a>i&&a<l)var c=300*(b/t)+1;a>l-100&&(c=300);$(".area.whyPinnacle").stop().animate({top:c+"px"},100)}a>d&&a<e&&(b=a-d,a>d&&a<m&&(c=300*(b/u)+1),a>m-100&&(c=300),$(".area.services").stop().animate({top:c+"px"},
50));a>e&&a<f&&(b=a-e,c=300*(b/o)+1,a>e&&a<n&&(c=300*(b/o)+1),a>n-100&&(c=300),$(".area.featuredProjects").stop().animate({top:c+"px"},50));a>f&&a<j&&(b=a-f,c=300*(b/p)+1,a>f&&a<j&&(c=300*(b/p)+1),a>j-100&&(c=300),$(".area.aboutUs").stop().animate({top:c+"px"},50))});setConstants=function(){6820==$("#top").height()?(s=document.getElementById("top").clientHeight+182,r=$("#middle").height(),q=$("#bottom").height(),h=100,k()):setTimeout("setConstants()",100)};window.jumpToMe=function(a){var b=0,c=$(window).scrollTop();
0==a?b=0:1==a?b=$("#whyPinnacle").offset().top-h:2==a?b=$("#services").offset().top-h:3==a?b=$("#featuredProjects").offset().top-h:4==a&&(b=$("#aboutUs").offset().top-h);a=1E3*(Math.abs(b-c)/1E3);$("html,body").animate({scrollTop:b},a)};setConstants();switchProject(1)});
