function toggleLogin() {
  if($('login').style.display == "none"){
    Effect.toggle('client_extranet', 'blind', { duration: 0.5});
    Effect.toggle('login','blind', { delay: 0.5, duration: 0.5})
  }else{
    Effect.toggle('login','blind', { duration: 0.5})
    Effect.toggle('client_extranet', 'blind', { delay: 0.5, duration: 0.5});
  }
}

function scrollWork(id, last){
  the_id = id
  end_id = last
  new PeriodicalExecuter(function(){
    changeBackground(the_id, end_id)
    the_id += 1
    if(the_id == end_id + 1){
      the_id = 1
    }
  }, 3)
}

function changeBackground(id, max_id){
  if(id==1){
    $('image_' + max_id).hide()
    $('list_' + max_id).removeClassName('active')
  }else
  {
    new_id = id - 1
    $('image_' + new_id).hide()
    $('list_' + new_id).removeClassName('active')
  }
  div = 'image_' + id
  $(div).appear()
  $('list_'+ id).addClassName('active')
}