  /*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : Search window params class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindow_mini ()
{
  this.hiddenFields = Array() ;
   
  this.activateHiddenFields = function ( obj )
  {
    this.hiddenFields [ obj ] = $.cookie ( obj+'hiddenFields' ) ;
    if ( this.hiddenFields [ obj ] == 'open' )
    {
      document.getElementById ( obj+'hiddenFields' ).style.display = 'block' ;
      this.hiddenFields [ obj ] = 'open' ;
      $.cookie ( obj+'hiddenFields', 'open' ) ;
      document.getElementById ( obj+'_search_text' ).innerHTML = 'Wyszukiwanie proste';
    }
    else
    {
      document.getElementById ( obj+'hiddenFields' ).style.display = 'none' ;
      this.hiddenFields [ obj ] = 'close' ;
      $.cookie ( obj+'hiddenFields', 'close' ) ;
      document.getElementById ( obj+'_search_text' ).innerHTML = 'Więcej opcji wyszukiwania';
    }
  }
  
  this.showHiddenFields = function ( obj )
  {
    if ( this.hiddenFields [ obj ] != 'open' )
    {
      document.getElementById ( obj+'hiddenFields' ).style.display = 'block' ;
      this.hiddenFields [ obj ] = 'open' ;
      $.cookie ( obj+'hiddenFields', 'open' ) ;
      document.getElementById ( obj+'_search_text' ).innerHTML = 'Wyszukiwanie proste';
    }
    else
    {
      document.getElementById ( obj+'hiddenFields' ).style.display = 'none' ;
      this.hiddenFields [ obj ] = 'close' ;
      $.cookie ( obj+'hiddenFields', 'close' ) ;
      document.getElementById ( obj+'_search_text' ).innerHTML = 'Więcej opcji wyszukiwania';
    }
  }
  
  this.btnSearchMouseOver = function ( obj )
  {
    obj.style.background='url(data/images/search_mini/button_over.png)';
  }
  
  this.btnSearchMouseOut = function ( obj )
  {
    obj.style.background='url(data/images/search_mini/button.png)';
  }

  this.go = function ( srchName )
  {
    url = 'index.php?module=bp/offersList&srchForceClearParams=yes' ;
    url = url + SearchWindow.collectData ( srchName ) ;
    location.href = encodeURI(url) ;
  }
}
SearchWindow_mini = new classSearchWindow_mini () ;
