//function animation()
window.onload = function()
{
	var animes = document.getElementsByClassName('animate');
	var cacheT = (new Date).getMilliseconds();
	animes.each(function(node)
	{
		node.style.display = 'none';
		node.tpl = node.src.replace(/bbs01\/([0-9]+)\/([0-9:]+)/, 'bbs01\/$1\/#{2}');
		node.img_target = (RegExp.$2).split(/:/);
		max = node.img_target.max();
		min = node.img_target.min();
		node.onload = function()
		{
			node.style.display = 'inline';
		}
		node.src = new Template(node.tpl).evaluate({2:min});
		setInterval(function()
		{
			if(!node.cnt) node.cnt = 1;
			if( node.cnt > node.img_target.length-1 ) node.cnt = 0;
			var img_path = new Template(node.tpl).evaluate({2:node.img_target[node.cnt]});
			var tmpimg = new Image();
			tmpimg.onload = function(){if(tmpimg.width) node.src = img_path; node.style.display = 'inline';}
			tmpimg.src = img_path + '?' + cacheT;
			node.cnt = node.cnt + 1;
		}, 6000);
	});
}