/**
 * MyCarousel
 *
 * written by M.Tanishima (okinawa ascon Co,.LTD.)
 * Copyright (c) 2011 okinawa ascon Co,.LTD.
 * licensed under the GPL licenses:
 * http://www.gnu.org/licenses/gpl.html
 *
 */


var m=0;
var rvs=0;
var numItem=0;
var numHeight=0;0
function scrollPics() {
	document.getElementById('div1').style.top=m+'px';
	if (rvs) {
		m++;
		if(m>0) {
			rvs=0;
		}
		if (rvs==0) {
			setTimeout('scrollPics()',interval);
		}else{
			setTimeout('scrollPics()',speed);
		}
	} else {
		m--;
		if(m<=-1*(numItem-3.5)*104) {
			rvs=1;
		}
		if (rvs) {
			setTimeout('scrollPics()',interval);
		}else{
			setTimeout('scrollPics()',speed);
		}
	}
} 
window.onload=function() {
	numItem=document.getElementById('div1').getElementsByTagName('img').length;
	numHeight=document.getElementById('div1').getElementsByTagName('div')[0].style.height;
	numHeight+=document.getElementById('div1').getElementsByTagName('img')[0].height;
	setTimeout('scrollPics()',interval);
}

