var obj2 = 0;
var interval2 = 30, step2 = -1;

var out2, box1a, box2a;
var width2 = 0, height2 = 0;
var left1a, left2a;

function moveBanner2()
{
	left1a += step2;
	left2a += step2;

	if (left1a >= width2 && step2 > 0)
	{
		left1a = width2 * -1;
	}
	else if (left1a <= -1 * width2 && step2 < 0)
	{
		left1a = width2 * 1;
	}

	if (left2a >= width2 && step2 > 0)
	{
		left2a = width2 * -1;
	}
	else if (left2a <= -1 * width2 && step2 < 0)
	{
		left2a = width2 * 1;
	}

	box1a.style.left = left1a;
	box2a.style.left = left2a;

	obj2 = setTimeout("moveBanner2()", interval2);
}

/*
 * out : 가장 바깥쪽 테두리 레이어
 * box1 : 첫번째 안쪽 레이어
 * box2 : 두번째 안쪽 레이어
 * width : 레이어의 넓이
 * height : 레이어의 높이
 * space : 첫번째 레이어와 두번째 레이어 사이의 넓이
 */

function initBanner2(out, outWidth, outHeight, box1, box2, width, height, space)
{
	if (out == null || box1 == null || box2 == null)
	{
		alert("초기화 실패");
		return;
	}

	if (width < 0)
	{
		width = 0;
	}
	else if (width < outWidth)
	{
		width = outWidth;
	}

	this.out2 = out;
	this.box1a = box1;
	this.box2a = box2;
	this.width2 = width + space;
	this.height2 = height;
	left1a = 0;
	left2a = -this.width2;

	out.style.width = outWidth;
	out.style.height = outHeight;
	out.style.overflow = "hidden";

	box1.style.position = "absolute";
	box1.style.left = left1a;
	box1.style.top = 0;
	box1.style.width = width;

	box2.style.position = "absolute";
	box2.style.left = left2a;
	box2.style.top = 0;
	box2.style.width = width;
	box2.innerHTML = box1.innerHTML;

	startBanner2();
}

function startBanner2()
{
	if (obj2 == 0)
	{
		obj2 = setTimeout("moveBanner2()", interval2);
	}
}

function stopBanner2()
{
	clearTimeout(obj2);
	obj2 = 0;
}
