function Dialog()
{ 
  this.open = function( strTitle, strContent, blnCanClose, intAutoClose )
  {
    $( '#loader' ).hide();
    $( '#loader_small' ).hide();
    $( '#window' ).show();

    $( '#window_content' ).html( strContent );
    
    if( blnCanClose == false )
    {
      $( '#window_close' ).hide();
    }
    else
    {
      $( '#window_close' ).show();
    }
      /*
    if(strTitle == '') {
        $("#window_close").hide(); 
    } else {
        $("#window_close").show();    
        $("#window_title").html( strTitle );
    }*/    

    if( intAutoClose > 0 )
    {
      setTimeout( this.close, intAutoClose * 1000 );
    }
    
    if(strTitle == 'Uwaga'){
        $("#overlay").css('background', 'none');
    }
    $( '#overlay' ).fadeIn( 'slow' );

    $( '#window' ).css( 'margin-left', '-' + ( $( '#window' ).width() / 2 ) + 'px' );
    $( '#window' ).css( 'margin-top', '-' + ( $( '#window' ).height() / 2 ) + 'px' );
    
    //uniform(); 
  };

  this.close = function()
  {
    $( '#overlay' ).fadeOut( 'fast' );

    //$.validationEngine.closePrompt( '.formError', true );
  }

  this.loading = function()
  {
    //$.validationEngine.closePrompt( '.formError', true );
    $( '#window' ).hide();
    $( '#loader_small' ).hide();
    $( '#loader' ).show();

    $( '#overlay' ).fadeIn( 'slow' );

    $( '#loader' ).css( 'margin-left', '-' + ( $( '#loader' ).width() / 2 ) + 'px' );
    $( '#loader' ).css( 'margin-top', '-' + ( $( '#loader' ).height() / 2 ) + 'px' );
  }

  this.loading_small = function()
  {
    //$.validationEngine.closePrompt( '.formError', true );
    $( '#window' ).hide();
    $( '#loader' ).hide();
    $( '#loader_small' ).show();

    $( '#overlay' ).fadeIn( 'fast' );

    $( '#loader_small' ).css( 'margin-left', '-' + ( $( '#loader_small' ).width() / 2 ) + 'px' );
    $( '#loader_small' ).css( 'margin-top', '-' + ( $( '#loader_small' ).height() / 2 ) + 'px' );
  }

  this.message = function( strContent, strType )
  {
    strContent = '<img src="' + strBaseUrl + 'assets/img/' + strType + '.png" style="vertical-align: middle; margin-right: 10px;" alt=""><p style="vertical-align: middle; display: inline; width: 300px; font-size: 13px; font-weight: bold; color: #990000; line-height: 20px;">' + strContent + '</p><br style="clear: both;">';
    $( '#loader_small' ).hide();

    this.open( '', strContent, true, 3 );
  }
}
