// Place application-specific JavaScript in here

function getPage(page_id) {
  if(!page_id) return;  // Can't do anything with nothing!
  
  // Fade out the current content area; when it's done, we'll add a loading thing
  new Effect.Fade('content-area', {duration: .3, afterFinish: function () {
      $('content-area').style.display = 'block';
      $('content-area').innerHTML = 'Loading...';
      new Ajax.Request('home/page/' + page_id, {asynchronous: true, onComplete: function (e) {
          new Effect.Fade('content-area', {duration: .3, afterFinish: function() {
            //eval(e.responseText);
            $('content-area').innerHTML = e.responseText;
            //document.title = obj.title;
            new Effect.Appear('content-area', {duration: .3});
          }});
        }});
    }});
}
