$(document).ready(function(){
  $("#overlay").css("height", $(document).height()).hide();
  $('#overlay').hide();
  $('#tdihCode').hide();
  $('#quoteCode').hide();
  $('#popupImage').click(function(){
			$('#overlay').fadeOut('fast');
	});
	$('#mainImage').click(function(){
			$('#overlay').fadeIn('slow')
			if ($(window).height() > $('#overlaycontent').height()) {
					$('#overlaycontent').css('margin-top',Math.round(($(window).height()-$('#overlaycontent').height())/2));
			}
	});
});
function showOverlay() {
  $("#overlay").slideToggle(400);
  if ($(window).height() > $('#overlaycontent').height()) {
    $('#overlaycontent').css('margin-top',Math.round(($(window).height()-$('#overlaycontent').height())/2));
  }
}
function closeOverlay() {
  $("#overlay").slideToggle(400);
  $('#tdihCode').hide();
  $('#quoteCode').hide();
}

