// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function togglepop(a) {
  if( a.hasClassName('active') ) {
    new Effect.BlindUp(a.next());
    a.removeClassName('active');
    return;
  }

  new Effect.BlindDown(a.next());
  a.addClassName('active');
}

g_lock = false;

function scroll_patients(direction) {
  var scrolled = $('headshots').getStyle('left');
  if( scrolled ) scrolled = scrolled.charAt(0) == '-';

  //backwards...don't go backwards if it's not forward
  if( direction < 0 && !scrolled) return false;
  //forwards...only let it go once (hackery)
  if( direction > 0 && scrolled ) return false;
  if( g_lock ) return false;

  g_lock = true;
  setTimeout("g_lock = false",1000);
  new Effect.Move('headshots',{x:direction*170*-1});
}
