/*** ½ºÅ©·Ñ¹è³Ê °´Ã¼ ***/
var scrollBanner = (function(){function _class(id)
{	
	var obj;	// ½ºÅ©·ÑµÇ´Â °´Ã¼
	var area;	// ½ºÅ©·ÑµÇ´Â ¿µ¿ª
	var marginTop;	// area pixelTop
	var bodyHeight;	// marginTop + area.clientHeight

	var _self = this;

	this.init = function()
	{
		obj = document.getElementById(id);
		
		area = obj.parentNode;
		marginTop = 170;
		if (area!=(document.body.scrollTop)?document.body:document.documentElement) bodyHeight = marginTop + area.clientHeight;
		objHeight = obj.clientHeight;

		obj.style.top = 5;
		this.move();
	}

	this.move = function()
	{
		var posFrom, posTo, gap, timedelay;
		
		timedelay = 500;
		
		posFrom	= obj.style.pixelTop;

		var t = (document.body.scrollTop) ? document.body.scrollTop : document.documentElement.scrollTop;

		posTo = (t<marginTop) ? 5 : t - marginTop + 10;

		if (posFrom != posTo){
			gap = Math.ceil(Math.abs(posTo - posFrom) / 10);
			if (posTo < posFrom) gap = -gap;
			obj.style.top = obj.style.pixelTop + gap;
			timedelay = 10;
		}
		//if (obj.style.pixelTop > bodyHeight-objHeight) obj.style.top = bodyHeight - objHeight;
		//document.title = t + " " + posTo + " " + posFrom;
		
		setTimeout (_self.move, timedelay);
	}

};
return _class;
})();