/*
Package contents:

  Observer
  BGColourTransformer
  
*/

/**
 * @author Miroslaw Milewski
 * version: 0.1
 * last modified: 10.VII.2007
 * 
 * Description:
 * 
 * This class is an extremely crude implementation of the observer pattern.
 * 
 * Changes:
 * Instructions: 
 * Required values:
 * Other values:
 *  
 */

 var Observer = new Class({
	options: {
		onNotify: Class.empty
	},
	
	initialize: function(options) {
		this.setOptions(options);
		this.observers = [];
	},
	
	register: function(elementId) {
		this.observers.push(elementId);
	},

	remove: function(elementId) {

	},

	notify: function(evt) {
		this.fireEvent('onNotify',evt);
	}

});

Observer.implement(new Events, new Options);


/**
 * @author Tim Harwood
 * version: 0.1
 * last modified: 10.VII.2007
 * 
 * Description:
 * 
 * This class extend Miro's observer class, adding some functionality to register to create a colour control from the gallery
 *  
 */

 var BackgroundColourTransformer = Observer.extend({

	register: function(elementId) {
		elementId.$tmp.fx = new Fx.Style(elementId, 'background-color', { 
			wait: true, 
			duration: 750, 
			transition: Fx.Transitions.Quart.easeInOut
		});
		elementId.$tmp.fx.set(currColor);
		this.observers.push(elementId);
	}

});


