$.couch.app(function(app) {
  $('.date').prettyDate();

  $("#account").evently($.extend(true, 
    app.ddoc.vendor.couchapp.evently.account, 
    app.ddoc.evently.account), app);
  
  var resizeObject = function () {
    var ratio;
    var container = document.getElementById("mySVGObject");
    var width = $("#mySVGObject").parent().parent().width();
    var svgDoc = $(container.contentDocument).find("#broken-dots-image");
    
    ratio = svgDoc.height() / svgDoc.width();
    $(container).width(width).height(width * ratio);
    svgDoc.width(width - 10).height(width * ratio - 10);
  };
    
  if (navigator.userAgent.match(/WebKit/)) {
    var resizeTimer;
    $("#mySVGObject").ready(function () {
      resizeObject();
    });

    $(window).resize(function() {
      clearTimeout(resizeTimer);
      resizeTimer = setTimeout(resizeObject, 100);
    });
  }
});

