var x0 = 0;
var y0 = 0;
var limdex = 976;
//limdex = (Í¼Ïñ¿í¶È+2)*Í¼ÏñÊýÁ¿
var dest = 0;
var distance = 0;
var step = 0;
var destination = 0;
var on = true;

function scrollit(destination) {
	step = 2;
	dest = destination;
	if (x0 < dest & x0 < limdex){
		while (x0 < dest) {
			step += (step / 7);
			x0 += step;
			scroll(x0,0);
		}  
		if(dest <= limdex) { scroll(dest,0); }
		x0 = dest;
	}
	if (x0 > dest)  {
		while (x0 > dest) {
			step += (step / 7);
			if(x0 >= (0+step)) { x0 -= step; scroll(x0,0); }
			else break;
		}
		if(dest >= 0) { scroll(dest,0); }
		x0 = dest;
	}
	if (x0 < 1) { scroll(1,0); x0=1 }
	if (x0 > limdex) { scroll(limdex,0); x0 = limdex }
	x0 = dest;
}
function scrollnow() {
	if (on){
		if (x0 < limdex & x0 >= 0 ) {              
			scroll(x0,0);
			x0 = x0 + 1;
			setTimeout('scrollnow()', 50);
        
		} else if (x0 < 0) {
			x0 = limdex;
			scrollnow();
		} else {
			x0 = 0;
			scrollnow();
		}
	}
}
function stopscroll() {
	if (on){
		on = false;
	} else {
		on = true;
		scrollnow();
	}
}
function startscroll() { on = true; scrollnow(); }
function stop_start() { 
	if (on){ on = false;} else { on = true;scrollnow();}
}






