/*
 * Ext JS Library 2.2
 * Copyright(c) 2006-2008, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */

var win;

function openStory() {

  // create the window on the first click and reuse on subsequent clicks
  if(!win){
    win = new Ext.Window({
      draggable: true,
      title: document.title,
      applyTo: 'x-window',
      layout: 'fit',
      header: true,
      footer: false,
      width:680,
      height:560,
      minWidth:300,
      minHeight:250,
      constrainHeader: true,
      resizeHandles: 'e,s,se,w,sw',
      closeAction: 'hide',
      plain : false
    });
  }
  win.center();
  win.show();
}

Ext.onReady(function(){
  Ext.get("page-map").on('click', openStory, null,{delegate: 'a'});
});
