/**
 * @author syndicat
 * accordion that works with Prototype and Scriptaculous
 */
var Accordion = Class.create();
Accordion.prototype =  { 
	/**
	 * inintialize(arr, main)
	 * function creates new Accordion
	 * must be supplied with an array that contains div names
	 * 
	 * @param {array} arr
	 * @param {string} main
	 * @param {float} blindspeed
	 */
	initialize: function(arr, main, blindspeed){ 
		this.accord		= arr;
		this.blindSpeed = blindspeed;
		this.main		= main + "Class";
		this.previous	= null;
	},  

	/**
	 * slide(div, toggle)
	 * function determines which of the divs may slide open and
	 * which one should close
	 * 
	 * change divName var to below when you want to use the 'this' referer
	 * var divName = $(div).id;
	 * 
	 * @param {string} div
	 * @param {string} toggle
	 */
	slide: function(divName, toggle){
		new Effect.toggle(divName, 'blind', {duration: this.blindSpeed}); 
		if (this.previous && this.previous != divName){
			new Effect.BlindUp(this.previous, {duration: this.blindSpeed});
		}
		this.previous = divName;
		if (this.main == "workClass"){workClass.change(toggle); }
		if (this.main == "nameClass"){nameClass.change(toggle); }
	}
}