/**
 * Core class which all animations are based off of
 */
VZT.Animation = new Class({
	Implements:[VZT.Base,Events],
	
	startMethod: null,
	stopMethod: null,
	revertMethod: null,
	onComplete: null,
	
	fxObject: null,
	
	name: "",

    /**
     * Starts the animation
     * @param object Object to run the animation on
     * @param args  required arguments for the animation
     * @param complete  function to run when complete
     */
	start: function(object, args, complete){
		
		VZT.AppCore.log("Running Animation" + name, 3);
		
		this.startMethod(object, args);
		if(complete != null)
			this.fxObject.addEvent('complete', function(){ complete(); });
		
	},

    /**
     * Stops the animation if mid runn
     * @param object Object animation is being ran upon
     * @param args  stop arguments
     * @param complete  what to do once stopped
     */
	stop: function(object, args, complete){
		VZT.AppCore.log("Stopping Animation" + name, 3);
		this.stopMethod(object, args);
        if(complete != null)
			this.fxObject.addEvent('complete', function(){ complete(); });
	},

    /**
     * Runs the animation backwards
     * @param object Object to run the animation on
     * @param args  Arguments to run
     * @param complete  what to do once complete.
     */
	revert: function(object, args , complete){
		VZT.AppCore.log("Reverting Animation" + name, 3);
		this.revertMethod(object, args);
        if(complete != null)
			this.fxObject.addEvent('complete', function(){ complete(); });
	},


	initialize: function(o)
	{
		this.setProperties(o);
	}
});
