function expand(elem_name)
{
  //new Effect.BlindDown($(elem_name+'expanded'));
  //$(elem_name+'expanded').addClassName('expanded');
  //$(elem_name+'expanded').removeClassName('collapsed');

  //$(elem_name).style.display = "none";
  //$(elem_name + "expanded").style.display = "";
}

function collapse(elem_name)
{
  //$(elem_name + "expanded").style.display = "none";
  //$(elem_name).style.display = "";
}


//TODO: figure out what is actually being used?
//TODO: formal documentation
//TODO: testing?
//
//
//constants?
//var GLOBAL_FPS = 15.0;
//var TYPE_RESOLUTION = 100;
//
//
//function AddressLocator(result_action)
//{
//  this.result_action = result_action;
//  this.ajax = null;
//  
//  //makes an AJAX request to find the requested location
//  this.find = function(location)
//  {
//    this.ajax = new Ajax.Request(JSEnv.ajax_findlocation,
//    {
//      method: 'get'
//    , parameters: { location: encodeURIComponent(location) }
//    , onSuccess: function(transport)
//      {
//        this.ajax = null;
//        
//        //get the JSON response object
//        var json = transport.responseText.evalJSON();
//        if (json != null && json.success)
//        {
//          //perform the result action with the found location
//          this.result_action(json.location);
//        }
//        else
//        {
//          //call the result action without a location
//          this.result_action(null);
//        }
//      }.bind(this)
//    , onFailure: function(transport)
//      {
//        this.ajax = null;
//        
//        //call the result action without a location
//        this.result_action(null);
//      }.bind(this)
//    });
//  };
//  
//  //cancels the location search
//  this.cancel = function()
//  {
//    //stop AJAX request if it is still processing
//    if (this.ajax)
//    {
//      this.ajax.stop();
//    }
//  };
//};
//
//function ResponderBox(textbox, main_action, change_action)
//{
//  this.textbox = $(textbox);
//  this.main_action = main_action;
//  this.change_action = change_action;
//  this.timer = null;
//  this.last_value = null;
//  
//  //perform this action to do the box's intended function
//  this.runAction = function()
//  {
//    this.main_action(this.textbox.value);
//  };
//  
//  //perform this action when you want the box to respond
//  this.respond = function()
//  {
//  	if (this.last_value != this.textbox.value)
//    {
//      //value has changed, so perform the change action 
//      this.change_action(this.textbox.value);
//      
//      //delete timer
//      if (this.timer != null)
//      {
//        clearTimeout(this.timer);
//        this.timer = null
//      }
//      
//      //disable autofilling
//      if (this.textbox._autotext_ref != null
//       && this.textbox._autotext_ref.autofilling == true)
//      {
//        return;
//      }
//      
//      //set new timer
//      this.type_timer = setTimeout(function()
//                                   {
//                                     this.type_timer = null;
//                                     this.runAction();
//                                   }.bind(this), TYPE_RESOLUTION);
//      
//      //set old value
//      this.last_value = this.textbox.value;
//    }
//  }
//};
//
//
//
//function FadeAnimator(container, fade_mode, rate, in_opac, out_opac, ondone_action)
//{
//  this.container = container;
//  this.fade_mode = (fade_mode == "in" ? 1 : 0);
//  this.rate = rate;
//  this.in_opac = (in_opac != null ? in_opac : 1.0);
//  this.out_opac = (out_opac != null ? out_opac : 0.0);
//  this.ondone_action = ondone_action;
//  
//  this.executer = null;
//  this.c_opac = (this.fade_mode == 0 ? this.in_opac : this.out_opac);
//  
//  //starts the fade animation
//  this.startAnimation = function(nfade_mode)
//  {
//    //set opacity to current value
//    this.setOpac(this.c_opac);
//    
//    //if a new fade mode was passed, set it
//    if (nfade_mode != null)
//    {
//      this.fade_mode = (nfade_mode == "in" ? 1 : 0);
//    }
//    
//    //stop fading if it has already started
//    this.stopAnimation();
//    
//    //set a timer to tick and fade to the next level
//    this.executer = setTimeout(this.tick.bind(this), parseInt(1000.0 / GLOBAL_FPS));
//  };
//  
//  //stops the fade animation
//  this.stopAnimation = function()
//  {
//    //check that a timer actually exists
//    if(this.executer != null)
//    {
//      //kill the timer
//      clearTimeout(this.executer);
//      this.executer = null;
//    }
//  };
//  
//  //do this every "tick" - changes opacity slightly
//  this.tick = function()
//  {
//    if (this.fade_mode == 1) //fade in
//    {
//      //calculate the next opacity level
//      var new_opac = this.c_opac + this.rate / GLOBAL_FPS;
//      
//      //check if we have overstepped the maximum opacity
//      if(new_opac > this.in_opac)
//      {
//        new_opac = this.in_opac;
//      }
//      
//      //set the opacity to the new level
//      this.setOpac(new_opac);
//      
//      //check if we have finished fading
//      if(this.c_opac == this.in_opac)
//      {
//        //kill the timer
//        this.executer = null;
//        
//        //perform the action if one exists
//        if (this.ondone_action != null)
//        {
//          this.ondone_action();
//        }
//      }
//      else
//      {
//        //reset timer
//        this.executer = setTimeout(this.tick.bind(this), parseInt(1000.0/GLOBAL_FPS));
//      }
//    }
//    else //fade out
//    {
//      //calculate the next opacity level
//      var new_opac = this.c_opac - this.rate / GLOBAL_FPS;
//      
//      //check if we have understepped the minimum opacity
//      if (new_opac < this.out_opac)
//      {
//        new_opac = this.out_opac;
//      }
//      
//      //set the opacity to the new level
//      this.setOpac(new_opac);
//      
//      //check if we have finished fading
//      if(this.c_opac == this.out_opac)
//      {
//        //kill the timer
//        this.executer = null;
//        
//        //perform the action if one exists
//        if (this.ondone_action != null)
//        {
//          this.ondone_action();
//        }
//      }
//      else
//      {
//        //reset timer
//        this.executer = setTimeout(this.tick.bind(this), parseInt(1000.0/GLOBAL_FPS));
//      }
//    }
//  };
//  
//  //set the container to a new opacity value
//  this.setOpac = function(opac)
//  {
//    //save the original parameter value
//    var save_opac = opac;
//    
//    //check top opacity boundary
//    if (opac > .99)
//    {
//      opac = 1.0;
//      save_opac = 1.0;
//    }
//    
//    //check bottom opacity boundary
//    if (opac < .01)
//    {
//      //stop displaying container at all
//      opac = 1.0;
//      save_opac = 0;
//      this.container.style.display = "none";
//    }
//    else if (this.container.style.display == 'none')
//    {
//      //start displaying container
//      this.container.style.display = '';
//    }	
//    
//    if (opac != 1.0)
//    {
//      //set opacity of the container
//      this.container.style.opacity = opac;
//      this.container.style.MozOpacity = opac;
//      this.container.style.filter = "alpha(opacity=" + parseInt(opac * 100.0) + ")";
//    }
//    else
//    {
//      //if opacity=1.0, remove opacity details
//      this.container.style.opacity = '';
//      this.container.style.MozOpacity = '';
//      this.container.style.filter = '';
//    }
//    
//    //return original opacity
//    this.c_opac = save_opac;
//    return save_opac;
//  };
//};
//
//function TextAnimator(container, noani_message, message, ani_color, rate, startnow)
//{
//  this.container = container;
//  this.noanimessage = noani_message;
//  this.message = message;
//  this.ani_color = ani_color;
//  this.rate = rate;
//  
//  this.cindex = 0;
//  this.executer = null;
//  
//  //starts the animation
//  this.startAnimation = function(newtext)
//  {
//    //stop the animation in case it has been started already
//    this.stopAnimation();
//    
//    //change the text if a parameter was passed
//    if (newtext != null)
//    {
//      this.message = newtext;
//    }
//    
//    //set timer
//    this.cindex = 0;
//    this.executer = setTimeout(this.tick.bind(this), this.rate);    
//  };
//  
//  this.stopAnimation = function()
//  {
//    //check that the animation has been started
//    if (this.executer != null)
//    {
//      //revert to old message and clear the timer
//      this.container.innerHTML = this.noani_message;
//      clearTimeout(this.executer);
//      this.executer = null;
//    }
//  };
//  
//  //do this every "tick" - colors the next letter
//  this.tick = function()
//  {
//    var html = "";
//    
//    //get front portion of string that is uncolored
//    if (this.cindex > 0)
//    {
//      html += this.message.substring(0, this.cindex);
//    }
//    
//    //color the next character
//    html += "<span style=\"color: " + this.ani_color + "\">" + this.message.charAt(this.cindex) + "</span>";
//    
//    //get the rest of the string
//    if (this.cindex < this.message.length - 1)
//    {
//      html += this.message.substring(this.cindex + 1);
//    }
//    
//    //increment index of colored character
//    if (++this.cindex == this.message.length)
//    {
//      //loop if necessary
//      this.cindex = 0;
//    }
//    
//    //set the value of the container
//    this.container.innerHTML = html;
//    
//    //reset timer
//    this.executer = setTimeout(this.tick.bind(this), this.rate);
//  };
//  
//  //start the animation if indicated
//  if (startnow)
//  {
//    this.startAnimation();
//  }
//  else
//  {
//    this.container.innerHTML = this.noanimessage;
//  }
//};
