if ( typeof(Animation) != "object" )
{
	var Animation = new function() 
	{
		var _ctr = 0, 	// counter to control image loop
		_id = 0, 	// element id to animate
		_path = "", 	// images path
		_ext = "jpg", 	// images extention
		_lpn = 8	// number of images
		_tmo = null; 	// timeout object

		function startAnimation(id, path, ext) 
		{
			if (_tmo != null) window.clearTimeout(_tmo);
			_id = id;
			_path = path;
			_ctr = 1;
			switchImage();
		}

		function switchImage() 
		{
			if (_tmo != null) window.clearTimeout(_tmo);
			if (_id < 0) return;
			if (++_ctr > _lpn) _ctr = 1;
			var _el = document.getElementById(_id);
			var _n = "00" + _ctr;
			if (_n.length > 3) _n = "0" + _ctr;
			_el.src = _path + "_" + _n + "." + _ext;
			_tmo = window.setTimeout("Animation.switchImage()", 750);
		}

		function stopAnimation() 
		{
			if (_tmo != null) window.clearTimeout(_tmo);
			_id = 0;
		}

		this.startAnimation = startAnimation;
		this.switchImage = switchImage;
		this.stopAnimation = stopAnimation;
	};
}
