/* ½ºÅ©·Ñ ¹è³Ê ½ºÅ©¸³Æ® ½ÃÀÛ */

var arrIdx = -1; 
var MovingDiv = new Array;

function Insert_MovingDiv(name, limit_name, start_top, end_bottom, timecheck){
    arrIdx++; 
    MovingDiv[arrIdx] = new Object;
    MovingDiv[arrIdx].name = name
    MovingDiv[arrIdx].limit_name = limit_name
    MovingDiv[arrIdx].start_top = start_top
    MovingDiv[arrIdx].end_bottom = end_bottom
	MovingDiv[arrIdx].timecheck = timecheck
}

var initflag=false;
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4"); 
var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4"); 

function CheckLocation2(pTarget, pLimit_Target, limit_top, limit_bottom, strat_top, end_bottom, Gap, nextTime){ 
	var Target = document.all(pTarget) 
	var Limit_Target = document.all(pLimit_Target) 
	T_nextTime = nextTime 

	if(limit_bottom<100){ 
		if(Limit_Target.offsetHeight) { 		 
			limit_bottom = Limit_Target.offsetHeight - Target.offsetHeight; 
 
		}else{ 
			limit_bottom = document.body.scrollHeight - Target.offsetHeight + end_bottom; 
		} 
	} 


	mTo = parseInt(Target.style.top) 
	mFrom = document.body.scrollTop + strat_top 

	if ( mFrom != mTo ){ 

		offSet = mTo + ( ( mFrom < mTo ) ? -1 : 1 ) * Math.ceil( Math.abs( mFrom - mTo ) / Gap ); 

		if( offSet > (limit_top) && offSet < limit_bottom){ 
			Target.style.top = offSet; 
		}else{ 
			T_nextTime = 500; 
		} 
	}else{ 
		T_nextTime = 500; 
	} 

	setTimeout ( "CheckLocation2('" + pTarget + "', '" + pLimit_Target + "', " + limit_top + ", " + limit_bottom + ", " + strat_top + ", " + end_bottom + ", " + Gap + ", " + nextTime + ")", T_nextTime); 
} 

function OnLoad(divname, limit_name, start_top, end_bottom, timecheck) 
{   
	var obj = document.all(divname);	
	obj.style.display = "block"; 
 
	var limit_bottom = document.all(limit_name).offsetHeight - obj.offsetHeight; 
	obj.style.top = start_top; //ÀÍ½ºÇÃ·Î·¯¿ë ·Îµù½Ã ½ÃÀÛ ·¹ÀÌ¾î ÁÂÇ¥ °ª  
	 
	CheckLocation2(divname, limit_name, 0, limit_bottom, start_top, end_bottom, 10,timecheck); 
	return true; 
}

function MovingDiv_Check(){   
	if(initflag) {return} 
	initflag=true;
	for (var i=0 ; i<MovingDiv.length; i ++){
		OnLoad( MovingDiv[i].name , MovingDiv[i].limit_name, MovingDiv[i].start_top, MovingDiv[i].end_bottom, MovingDiv[i].timecheck); 
	}
}

function GoTop() {
	window.scrollTo(0,0);
}


/* ½ºÅ©·Ñ ¹è³Ê ½ºÅ©¸³Æ® ³¡ */
