content['siteSearch'] =  Class.create(
{
  isInit: false,
  initialize: function(arrInstVars)
  {
  
    this.THREAD_ID  = arrInstVars.THREAD_ID;
    this.EXEC_UID   = arrInstVars.EXEC_UID;
    
    $('searchForm').observe('reset', this._onReset.bind(this));
    
    this._init();
  },
  
  _init: function()
  {
    $$('input[name="roomOrFlat"]').each(function(el)
    {
        if(!this.isInit) el.observe('change', this._onChange.bind(this));
        if(el.checked) this._initForm(el.id);
    }.bind(this));

    $$('input[name="objectType"]').each(function(el)
    {
        if(!this.isInit) el.observe('change', this._onChange.bind(this));
        if(el.checked) this._initForm(el.id);
    }.bind(this));
    
    this.isInit=true
  },
  
  _onReset: function()
  {
    this._init.bind(this).defer();   
  },
  
  _onChange: function(evt)
  {
    this._initForm(evt.element().id);
  },
  
  _initForm: function(strType)
  {
    [$('quanForRoom')].invoke(strType=='room' ? 'show' : 'hide');
  }
});
arrJsLoaded['content.siteSearch.js']=true;init.jsLoaded("content.siteSearch.js");