var commonObj = function() {
  var that = {
    showSubWindow: function(e, windowElem) {
                     var parentOffset = $('container').cumulativeOffset();
                     var parentDimensions = $('container').getDimensions();
                     var windowElemDimensions = $(windowElem).getDimensions();
                     var top    = parentOffset.top;
                     var left   = parentOffset.left;
                     var width  = parentDimensions.width;
                     var height = parentDimensions.height;
                     var wWidth = windowElemDimensions.width;
                     var wHeight = windowElemDimensions.height;
                     $('filter').setStyle('top: ' + top + 'px; left: ' + left + 'px;' + 'width: ' + width + 'px; height: ' + height + 'px;');
                     $(windowElem).setStyle('top: ' + (Event.pointerY(e) - wWidth / 2) + 'px; left: ' + (Event.pointerX(e) - wHeight / 2) + 'px;');
                     new Effect.Appear($('filter'), { from: 0.1, to:0.8, duration: 0.1 });
                     new Effect.Appear($(windowElem));
                   },
    hideSubWindow: function(windowElem) {
                     $(windowElem).hide();
                     $('filter').hide();
                   }
  };
  return that;
};

var commonObj = new commonObj();
document.observe('dom:loaded', function() {
});

