function prepareContents() { document.write('
'); document.write('
'); document.write(' '); document.write(' '); document.write(' '); document.write(' '); document.write(' '); document.write(' '); document.write(' '); document.write(' '); document.write('
'); } function FloatObject() { // Constant this.TOP_SPACE = 20; this.SPEED = 20; // Attribute this.objName = ""; this.posX = 0; this.posY = 0; this.scrollHeight = 0; this.objHeight = 0; prepareContents(); } FloatObject.prototype.main = function(objname, posX, posY) { this.initObj(objname, posX, posY); var obj = this.getRef(); obj.style.top = document.body.scrollTop + posY; obj.style.visibility = "visible"; obj.style.left = this.posX; window.setInterval(this.objName +".calXYBanner()", 10); } FloatObject.prototype.getRef = function(name) { var isDOM = (document.getElementById ? true : false); var isIE4 = ((document.all && !isDOM) ? true : false); var isNS4 = (document.layers ? true : false); var isNS = navigator.appName == "Netscape"; var objname = this.objName; if( name != null ) objname = name; if(isDOM) return document.getElementById(objname); if(isIE4) return document.all[objname]; if(isNS4) return document.layers[objname]; } FloatObject.prototype.initObj = function(objname, posX, posY) { this.objName = objname; this.posX = posX; this.posY = posY; this.scrollHeight = document.body.scrollHeight; this.objHeight = this.getRef().offsetHeight; } FloatObject.prototype.calXYBanner = function() { var obj = this.getRef(); obj.style.left = this.posX; var yBannerPos, yScrollTopPos; var yLimitPos; var interval; var yNewPos; var yNewTop; var dHeight = this.posY; yScrollTopPos = parseInt(document.body.scrollTop, 10); yBannerPos = parseInt(obj.style.top, 10); if(document.body.scrollTop < dHeight) { yLimitPos = dHeight; } else { yLimitPos = document.body.scrollTop + this.TOP_SPACE; } if(yBannerPos != yLimitPos) { yNewPos = Math.ceil(Math.abs(yLimitPos - yBannerPos) / this.SPEED); if(yLimitPos < yBannerPos) { yNewPos = -yNewPos; } yNewTop = parseInt(obj.style.top, 10) + yNewPos; if( (yNewTop+this.objHeight) > document.body.scrollHeight - this.getRef("footer").offsetHeight ) { obj.style.top = document.body.scrollHeight - this.getRef("footer").offsetHeight - this.objHeight; } else { obj.style.top = yNewTop; } } } // ÆË¾÷ÀÌ ¾Æ´Ï°í main ÆäÀÌÁö°¡ ¾Æ´Ï¸é Àû¿ë. if ( typeof opener == 'undefined' && location.href.indexOf('/directweb/main.jsp') == -1 ) { now_path = self.location.href; myAdd = now_path.split("/",6); if (myAdd[5].substring(0,4) == "main") { var RightBanner = new FloatObject(); RightBanner.main("RightBanner", 974, 318); } else { var RightBanner = new FloatObject(); RightBanner.main("RightBanner", 974, 318); } }