$(document).ready(function(){

  var whichFloor = "home";
  
  $("#doorL").css( { left:"-285px" } );
  $("#doorR").css( { right:"-285px" } );

  $("#homelink").click(function() {
  
    if(whichFloor != "home") {
  
      $("#doorL").animate( { left:"0px" }, 1000);
      $("#doorR").animate( { right:"0px" }, 1000);

      $("#doorContent").animate( { top:"0px" }, 4000, "elasinout", function(){
      
        $("#doorL").animate( { left:"-285px" }, 2000);
        $("#doorR").animate( { right:"-285px" }, 2000);

      });
      
      whichFloor = "home";

    }

      return false;

  });


  $("#aboutlink").click(function() {
  
    if(whichFloor != "about") {
  
      $("#doorL").animate( { left:"0px" }, 1000);
      $("#doorR").animate( { right:"0px" }, 1000);

      $("#doorContent").animate( { top:"-530px" }, 4000, "elasinout", function(){
      
         $("#doorL").animate( { left:"-285px" }, 2000);
         $("#doorR").animate( { right:"-285px" }, 2000);
      
      });
      
      whichFloor = "about";
      
    }

      return false;

  });
  
  $("#contactlink").click(function() {
  
    if(whichFloor != "contact") {
  
      $("#doorL").animate( { left:"0px" }, 1000);
      $("#doorR").animate( { right:"0px" }, 1000);

      $("#doorContent").animate( { top:"-1060px" }, 4000, "elasinout", function(){
      
         $("#doorL").animate( { left:"-285px" }, 2000);
         $("#doorR").animate( { right:"-285px" }, 2000);

      });
      
      whichFloor = "contact";
      
    }

      return false;

  });

  $("#followlink").click(function() {
  
    if(whichFloor != "follow") {
  
      $("#doorL").animate( { left:"0px" }, 1000);
      $("#doorR").animate( { right:"0px" }, 1000);

      $("#doorContent").animate( { top:"-1590px" }, 4000, "elasinout", function(){
      
         $("#doorL").animate( { left:"-285px" }, 2000);
        $("#doorR").animate( { right:"-285px" }, 2000);

      });
      
      whichFloor = "follow";
      
    }

      return false;

  });
  
  $("#doorsclose").click(function() {
  
      $("#doorL").animate( { left:"0px" }, 1000);
      $("#doorR").animate( { right:"0px" }, 1000);
      return false;

  });
  
  $("#doorsopen").click(function() {
  
      $("#doorL").animate( { left:"-285px" }, 1000);
      $("#doorR").animate( { right:"-285px" }, 1000);
      return false;

  });



});