/**
 * Example:

 		var cpxEffect = new CpxEffect('someId', {
 			duration: 1000,
 			transition: Fx.Transitions.Sine.easeInOut
 		}, {
 			'height': [10, 100],
 			'width': [900, 300]
 		});

 		cpxEffect.start();


  		// or

  		var myEffects = $(myElement).effects({
 			duration: 1000,
 			transition: Fx.Transitions.Sine.easeInOut
 		});

 		myEffects.start({
 			'height': [10, 100],
 			'width': [900, 300]
 		});

 */

var CpxEffect = new Class({

	id : Class.empty(),
	effectOptions : Class.empty(),
	startOptions : Class.empty(),
	theEffect : Class.empty(),

	initialize : function (id, effectOptions, startOptions) {
		this.id = id;
		this.effectOptions = effectOptions;
		this.startOptions = startOptions;
		window.addEvent('domready', this.domReady.bind(this));
	},

	domReady : function () {
		this.theEffect = $(this.id).effects(this.effectOptions);
		this.theEffect.start(); // makes ie display effect faster
		this.theEffect.stop(); // makes ie display effect faster
	},

	start : function () {
		return this.theEffect.start(this.startOptions);
	}
});