/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowPrice_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 ( tmp == '' )
      {
        valArr = val.split ( ';' ) ;      
        if ( valArr[0] != undefined )
        {
          if (( valArr[0] != '' )&&( valArr[0] != 0 ))
          {
            tmp = 'od '+ valArr[0]/100 + 'zł';
          }
        }
        if ( valArr[1] != undefined )
        {
          if ( valArr[1] != '' )
          {
            tmp = tmp + ' do '+ valArr[1]/100 + 'zł' ;
          }
        }
      }
      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 ) ;
  }

}
SearchWindowPrice_default = new classSearchWindowPrice_default ;

