//
// ÔÎÐÌÀ ÏÎÈÑÊÀ
//

var FindSel=new Array();
FindSel['all']=1;

str_search_path = 'http://www.bishelp.ru/search/?date_from_DAYS_TO_BACK=&date_from=&date_to=';
str_search_send = '&mttype[F]=on&mttype[1]=on&mttype[2]=on&mttype[3]=on&mttype[4]=on&mttype[236]=on&mttype[237]=on';
str_search_send_query = '&go=yes&q=';
mtype_array = new Array(7);

mtype_array[0] = 'F';
mtype_array[1] = '1';
mtype_array[2] = '2';
mtype_array[3] = '3';
mtype_array[4] = '4';
mtype_array[5] = '236';
mtype_array[6] = '237';

function tla(a){

  df=document.getElementById('f'+a);

  if (FindSel[a]) {
    df.className="";
    FindSel[a]=0;
  } else {
    df.className="sel";
    FindSel[a]=1;
    if (a != 'all' && FindSel['all']) {
      tla('all');
    } else if (a=='all') {
      for (i = 0; i < mtype_array.length; i++){
        if (FindSel[mtype_array[i]]) tla(mtype_array[i]);
      }
    }
  }
  return false;
}

function FindSubmit() {
  S = document.FindForm;
  q_value = S.q.value;
  if (q_value=="ïîèñê") {q_value = "";}
  if (FindSel['all'] != 1)   { 
      str_search_send ='';
      for (i = 0; i < mtype_array.length; i++){
        if (FindSel[mtype_array[i]])  {
          str_search_send = str_search_send + '&mttype[' + mtype_array[i] + ']=on';
        }
      }
  }
     str_search_send_query = str_search_send_query + q_value;
     str_search_path = str_search_path + str_search_send_query + str_search_send;
     location.href = str_search_path;
     return false;

}

//
// ÇÀÊËÀÄÊÈ
//

ZakladkiSel=2;

function zak(a){

  if (ZakladkiSel != a) {
    document.getElementById('z'+ZakladkiSel).className='Nosel';
    document.getElementById('z'+a).className="Zsel";
    
    document.getElementById('sp'+ZakladkiSel).style.display='none';
    document.getElementById('sp'+a).style.display='block';
    ZakladkiSel=a;

  }
  return false;
}

//
// ÊÀËÅÍÄÀÐÜ
//
function ShowCalendById(id_show,id_hide) {
  var  show = document.getElementById(id_show);
  var  hide=document.getElementById(id_hide);
  show.style.display="";
  hide.style.display="none";
  return false;
}


function addFav()
   {
   
   title='BisHelp';
   url='http://www.bishelp.ru';

  if (window.sidebar) { // Mozilla Firefox Bookmark
    window.sidebar.addPanel(title, url,"");
  } else if( window.external ) { // IE Favorite
    window.external.AddFavorite( url, title); }
    else if( window.opera && window.print )
    {
      var mbm = document.createElement('a');
      mbm.setAttribute('rel','sidebar');
      mbm.setAttribute('href',url);
      mbm.setAttribute('title',title);
      mbm.click();
    }

  }

 function SetStart(obj) {
  {

  if (document.all)
  {
    obj.style.behavior='url(#default#homepage)';
    obj.setHomePage('http://www.bishelp.ru');
  }
  else
    if(!document.layers)
    {
      netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite");
      navigator.preference("browser.startup.homepage", "http://www.bishelp.ru"); 
    }
} }
