(function($){

/*
new FullWindow( '#wrap', {
  overflow: 'auto | hidden | visible'
});
*/

var ns = 'FullWindow';

window[ns] = function ( root, options ) {
  this.root = $(root);
  this.options = options || {};
  
  this.initialize();
  this.observe();
};

window[ns].prototype = {
  
  initialize: function () {
    this.root.css('overflow', this.options.overflow || 'hidden');
    this.resizing();
  },
  
  observe: function () {
    $(window).resize( $.proxy( this.resizing, this ) );
    $(window).bind("smartresize", $.proxy( this.endresize, this ) );
  },
  
  resizing: function () {
    var win = $(window);
    this.root.css({
      width:  win.width(),
      height: win.height()
    });
  },
  
  endresize: function () {
    setTimeout( $.proxy( this.resizing, this ), 300 );
  }
  
}

})(jQuery);
