h});
  return Math.max(Math.max(tl_d, tr_d), Math.max(bl_d, br_d));
}


function toggleDialog() {
  var el = document.getElementById('dialog');
  el.classList.toggle("visible");
}

function toggleMenu() {
  var el = document.getElementById('menu');
  el.classList.toggle("visible");
}


// Initialize

function init() {
    setUpPaperByClass( '.paper' );
}

window.addEventListener('DOMContentLoaded', init, false);
</script>

<style type="text/css" media="screen">
  body {
  background-color: #f9f9f9;
    marg