﻿var h = 250; // the height of contactContainer - must be hardcoded for Safari

$(document).ready(function() {
  // Slide the whole thing up
  //$("#contact").animate({top:-1*h}, 300);
  //$("#contactContainer").animate({height:0}, 300);

  // Move the whole thing up
  $("#contact").css("top", -1 * h);
  $("#contactContainer").css("height", 0);


  $("#imgContactButton").click(function() {
    //$("#contactContainer").slideToggle(1000); // simple slide

    // Slide the whole thing down/up
    if ($("#contactContainer").css("height").substr(0, 1) == "0") {
      $("#contact").animate({ top: 0 }, 1000);
      $("#contactContainer").animate({ height: h }, 1000);
    }
    else {
      $("#contact").animate({ top: -1 * h }, 1000);
      $("#contactContainer").animate({ height: 0 }, 1000);
    }
  });


  //  var cssObj = {
  //    'height' : $("#centerColumn").height() + "px"
  //  }
  //  
  //  if ($("#rightColumn").height() < $("#centerColumn").height())
  //    $("#rightColumn").css(cssObj);



  /**2010-06-09   
  **/
  $("#goToContact").click(function() {

    var contactContainer = $("#contactContainer");
    if (contactContainer.height() == 0)
      $('html, body').animate({ scrollTop: 0 }, 1000,
      function() {
        $("#imgContactButton").click();
      });
    else
      $('html, body').animate({ scrollTop: 0 }, 1000);
  });

});
