﻿ /* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 * TERMS OF USE - jQuery Easing Open source under the BSD License. 
 * Copyright © 2008 George McGinley Smith All rights reserved.
t: current time, b: begInnIng value, c: change In value, d: duration
*/
jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	}
});

 jQuery.timer = function (interval, callback)
 {
	var interval = interval || 100;
	if (!callback)
		return false;	
	_timer = function (interval, callback) {
		this.stop = function () {
			clearInterval(self.id);
		};		
		this.internalCallback = function () {
			callback(self);
		};		
		this.reset = function (val) {
			if (self.id)
				clearInterval(self.id);			
			var val = val || 100;
			this.id = setInterval(this.internalCallback, val);
		};		
		this.interval = interval;
		this.id = setInterval(this.internalCallback, this.interval);		
		var self = this;
	};	
	return new _timer(interval, callback);
 };
