(function( $ ) {

  var methods = {
      init: function() { 
      
        var maskWidth = $( window ).width();
        var maskHeight = $( document ).height();
        
        $( '#mask-modal' ).css({'width': maskWidth, 'height':maskHeight});
        $( '#mask-modal' ).fadeTo( 'fast', 0.90 );
        
        var winWidth = $( window ).width();
        var winHeight = $( window ).height();
        
        this.css( { 
                  'left': Math.floor( ( winWidth - this.width() ) / 2 ),
                  'top': Math.floor( ( winHeight - this.height() ) / 2 )
                } );
                
        this.fadeIn( 1000 );      
      },
      close: function() { 
        $( '#mask-modal' ).hide( 'fast' );
        
        this.hide( 'fast' );
      }
  }
  $.fn.modalSchin = function( method ) {
  
    if ( methods[ method ] ) 
      return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ) )
    else if ( typeof method == 'object' || ! method )
      methods.init.apply( this, arguments );
              
  };
})( jQuery );
