/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowAdults_default()
{

  this.updateValue = function ( name )
  {
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolna - ' ;
    }
    else
    {
      var val ;
      var tmp ;
      tmp = '' ;      
      val = ExtComponents.getValue( name ) ;
      if ( val == 1 ) tmp = '1 osoba dorosła' ;
      if ( val >  1 ) tmp = val +' osoby dorosłe' ;
      if ( val >  4 ) tmp = val + ' osób dorosłych' ;
      document.getElementById( 'vis_'+name ).value = tmp ;      
    }
    try
    {
      this.itemsUpdateValues ( name ) ;
    }
    catch(err)
    { 
      // alert ( 'noItems' ) ;
    }
  }
  
  //
  // Akcje z interfejsu okna Items
  //
  
  this.itemsUpdateValues = function ( name )
  {
    ExtComponents.setValue ( 'mb_'+name, ExtComponents.getValue ( name ) ) ;
  }
  
  this.itemsCloseWindow = function ( name )
  {
    EditBox.itemsHideWindow( name ) ;
    ExtComponents.setValue ( name, ExtComponents.getValue ( 'mb_'+name ) );
  }
  
  this.itemsClear = function ( name )
  {
    ExtComponents.setValue ( name, '' ) ;
    this.itemsUpdateValues ( name ) ;
  }

}
SearchWindowAdults_default = new classSearchWindowAdults_default ;

