// ·ÎÄÉÀÌ¼Ç ÁËÃø ½ºÅ©·Ñ °ü·Ã
function lgmove1(whichlayer){
	lgtlayer = eval(whichlayer);

	if(lgtlayer.top > 0 && lgtlayer.top <= lgnum) {
		lgtlayer.top = 0;
		setTimeout("lgmove1(lgtlayer)", lgscrollspeed);
		setTimeout("lgmove2(document.lgmain.document.lgsecond)", lgscrollspeed);
		return;
	}
	if (lgtlayer.top >= lgtlayer.document.height * -1) {
		lgtlayer.top -= lgnum;
		setTimeout("lgmove1(lgtlayer)", lgwaitingtime);
	} else {
		lgtlayer.top = lgscrollerheight;
		lgtlayer.document.write(lgmessages[lgi]);
		lgtlayer.document.close();

		if(lgi == lgmessages.length - 1) lgi = 0;
		else lgi++;
	}
}

function lgmove2(whichlayer) {
	lgtlayer2 = eval(whichlayer);

	if(lgtlayer2.top > 0 && lgtlayer2.top <= lgnum) {
		lgtlayer2.top = 0;
		setTimeout("lgmove2(lgtlayer2)", lgscrollspeed);
		setTimeout("lgmove1(document.lgmain.document.lgfirst)", lgscrollspeed);
		return;
	}
	if (lgtlayer2.top >= lgtlayer2.document.height * -1) {
		lgtlayer2.top -= lgnum;
		setTimeout("lgmove2(lgtlayer2)", lgwaitingtime);
	} else {
		lgtlayer2.top=lgscrollerheight;
		lgtlayer2.document.write(lgmessages[lgi]);
		lgtlayer2.document.close();

		if(lgi == lgmessages.length - 1) lgi = 0;
		else lgi++;
	}
}

function lgmove3(whichdiv) {
	lgtdiv = eval(whichdiv);

	if(lgtdiv.style.pixelTop > 0 && lgtdiv.style.pixelTop <= lgnum) {
		lgtdiv.style.pixelTop = 0;
		setTimeout("lgmove3(lgtdiv)", lgscrollspeed);
		setTimeout("lgmove4(lgsecond2)", lgscrollspeed);
		return;
	}
	if(lgtdiv.style.pixelTop >= lgtdiv.offsetHeight * -1){
		lgtdiv.style.pixelTop -= lgnum;
		setTimeout("lgmove3(lgtdiv)", lgwaitingtime);
	} else {
		lgtdiv.style.pixelTop = lgscrollerheight;
		lgtdiv.innerHTML = lgmessages[lgi];

		if(lgi == lgmessages.length - 1) lgi = 0;
		else lgi++;
	}
}

function lgmove4(whichdiv) {
	lgtdiv2 = eval(whichdiv);

	if(lgtdiv2.style.pixelTop > 0 && lgtdiv2.style.pixelTop <= lgnum) {
		lgtdiv2.style.pixelTop = 0;
		setTimeout("lgmove4(lgtdiv2)", lgscrollspeed);
		setTimeout("lgmove3(lgfirst2)", lgscrollspeed);
		return;
	}
	if(lgtdiv2.style.pixelTop >= lgtdiv2.offsetHeight * -1) {
		lgtdiv2.style.pixelTop -= lgnum;
		setTimeout("lgmove4(lgsecond2)", lgwaitingtime);
	} else {
		lgtdiv2.style.pixelTop = lgscrollerheight;
		lgtdiv2.innerHTML = lgmessages[lgi];

		if(lgi == lgmessages.length - 1) lgi = 0;
		else lgi++;
	}
}

function lgonmouse_event(){
	lgnum = 0;
}

function lgmouseout_event(){
	lgnum = 1;
}

function lgstartscroll() {
	if(document.all) {
		lgmove3(lgfirst2);
		lgsecond2.style.top = lgscrollerheight;
		lgsecond2.style.visibility = 'visible';
	} else if(document.layers) {
		document.lgmain.visibility = 'show';
		lgmove1(document.lgmain.document.lgfirst);
		document.lgmain.document.lgsecond.top = lgscrollerheight + lgnum;
		document.lgmain.document.lgsecond.visibility = 'show';
	}
}
