var month ='';
var year ='';


function showForm(id)
{
  if(document.getElementById(id).style.display == 'none')
  {
    document.getElementById(id).style.display = 'block';
    document.location.href = "#emailForm";
  }
  else
  {
    document.getElementById(id).style.display = 'none';
  }
}

function upForm(id)
{
  if(document.getElementById(id).style.display == 'none')
  {
    document.getElementById(id).style.display = 'block';
  }
}

function downForm(id)
{
  if(document.getElementById(id).style.display == 'block')
  {
    document.getElementById(id).style.display = 'none';
  }
}

function makeActiveMonth(li_id, set_year, set_month)
{
   $$('ul.month_list li.active').invoke('removeClassName', 'active');
   $('li_'+li_id).addClassName('active');
   
   $$('ul.role li.active').invoke('removeClassName', 'active');
   $('t_0').addClassName('active');
   month=set_month;
   year=set_year;
}

function takeTheRefTitleAppointments(ref_id, ref_type_id)
{  
  new Ajax.Updater('box_to_update', 
  '/referees/appointmentTable/ref_id/'+ref_id+'/year/'+year+'/month/'+month+'/referee_title_id/'+ref_type_id, 
  {asynchronous:true, evalScripts:true,
  onLoading: function(){
     $("indicator").show();
  },
  onComplete: function(){
     $("indicator").hide();
  }
  
  });

   $$('ul.role li.active').invoke('removeClassName', 'active');
   $('t_'+ref_type_id).addClassName('active');

}


function hideById(id)
{
  document.getElementById(id).style.display = 'none';
}

function showById(id)
{
  document.getElementById(id).style.display = '';
}