/************************************************************************ Powermenu Version 1.1 (981206) by Yongsuk Lee If you include this comments, you can use and modify this code. spacekan@chollian.net http://user.chollian.net/~spacekan/ *************************************************************************/ function linkSonBlur() { linkOpen = false for(var i=0; i < menuInfo.length; i++) { if(n4) eval(menuInfo[i][0]+'.visibility = "hidden"') else document.all[menuInfo[i][0]].style.visibility = "hidden"; } if(n4) linkSonOld.bgColor = "lightgreen" else linkSonOld.style.backgroundColor = "lightgreen" } function linkSonPos(X) { if(n4) { if(X.son.W + X.pageX > window.innerWidth-16) X.son.left = window.innerWidth - X.son.W -16 else X.son.left = X.pageX X.son.top = X.pageY + X.document.height } else { if(X.son.W + X.offsetLeft > document.body.clientWidth) X.son.style.pixelLeft = document.body.clientWidth - X.son.W else X.son.style.pixelLeft = X.offsetLeft X.son.style.pixelTop = X.offsetTop + X.offsetHeight } } function linkOut() { linkSonOld = this } function linkFocus() { linkSonPos(this); if(n4) { this.bgColor = "white" this.son.visibility = "visible" } else { this.style.backgroundColor = "white" this.son.style.visibility = "visible" } linkOpen = true } linkOpen = false linkSonOld = null //¾ÕÀÇ ¸µÅ© ·¹À̾ ÀúÀå function linkOver() { if(e4) this.style.cursor = "hand" if( !linkOpen ) return if(linkSonOld) { linkSonOld.son.blockClear() // °¢ ¸µÅ©°¡ ¿­Àº ÀÚ½ÅÀÇ son ·¹À̾ Áö¿î´Ù. if(n4) { linkSonOld.bgColor = "lightgreen" linkSonOld.son.visibility = "hidden" if(this.son.oldSonColor) this.son.oldSonColor.bgColor = this.son.oldSonColor.nnBackColor; //blockClear()´Â sonÀÇ son ÀÌÇϸ¦ Áö¿î´Ù. ±×·¡¼­ ÀÚ½ÅÀÇ ¹ÙÅÁ»öÀ» Áö¿öÁØ´Ù. } else { linkSonOld.style.backgroundColor = "lightgreen" linkSonOld.son.style.visibility = "hidden" if(this.son.oldSonColor) { this.son.oldSonColor.style.backgroundColor = this.son.oldSonColor.ieBackColor this.son.oldSonColor.style.color = this.son.oldSonColor.fontBackColor } } } linkSonPos(this); if(n4) { this.bgColor = "white" this.son.visibility = "visible" } else { this.style.backgroundColor = "white" this.son.style.visibility = "visible" } } function n4linkInfo() { for(var i=0; i" + linkContent + ""+ linkContent) else document.write("" + linkContent + "") if(n4) { linkInfo[linkInfoIndex] = new Array() linkInfo[linkInfoIndex][0] = N linkInfo[linkInfoIndex][1] = son linkInfoIndex++ } else { document.all[N].son = document.all[son] document.all[N].onfocus = linkFocus document.all[N].onblur = linkSonBlur document.all[N].onmouseover = linkOver document.all[N].onmouseout = linkOut } } function sonWidthPos(posSize, posL) { if(n4) { var posElementL = posL var posElementR = posL + posSize var screenL = window.pageXOffset var screenR = window.pageXOffset + window.innerWidth var posX = 0; if(self != top) { posX += 4 if( document.height > window.innerHeight+4 ) posX += -16 ; screenR += posX } else if( document.height > window.innerHeight ) { posX += -16 screenR += posX } if(posElementL > screenL && posElementR < screenR) posLeft = posElementL; else if( posElementR > screenR ) { while( posElementR > screenR && posElementL > screenL ) { posElementR-- posElementL-- } if(posElementR > screenR && document.width > screenR) posElementL = document.width - posSize; } else if(posElementL < screenL && posElementR < screenR) { while( posElementR < document.width && posElementL < screenL) { posElementR++; posElementL++ } } else if(posElementL > screenL && posElementR > screenR && posElementR < document.width ) { while( posElementR > screenR && posElementL > 0) { posElementR--; posElementL-- } } else if(posElementL < screenL && posElementR > screenR ) { while( posElementR < document.width && posElementL < screenL) { posElementR++; posElementL++ } } if(posElementL < 0) posElementL = 0; if( posElementL+posSize > document.width && document.width > screenR) posElementL = document.width - posSize } else { var posElementL = posL var posElementR = posL + posSize var screenL = document.body.scrollLeft var screenR = document.body.scrollLeft + document.body.clientWidth if(posElementL > screenL && posElementR < screenR) posLeft = posElementL; else if(posElementL < screenL && posElementR < screenR) { while(posElementL < screenL) { posElementR++; posElementL++ } } else if(posElementL > screenL && posElementR > screenR) { while( posElementR > screenR && posElementL > screenL ) { posElementR--; posElementL-- } } else if(posElementL < screenL && posElementR > screenR ) { while( posElementL < screenL) { posElementR++; posElementL++ } } if( posElementL < 0 ) posElementL = 0; } return posElementL } function sonHeightPos(posSize, posT) { if(n4) { var posElementUp = posT var posElementDown = posT + posSize var screenUp = window.pageYOffset var screenDown = window.pageYOffset + window.innerHeight var posY = 0; if(self != top) { posY += 4 if( document.width > window.innerWidth+4 ) posY += -16 ; screenDown += posY } else if(document.width > window.innerWidth) { posY += -16 screenDown += posY } if(posElementUp > screenUp && posElementDown < screenDown) posTop = posElementUp; else if( posElementDown > document.height ) { while( (posElementDown > screenDown) && (posElementUp > screenUp) ) { posElementDown-- posElementUp-- } if(posElementDown > document.height && document.height > screenDown) posElementUp = document.height - posSize; } else if(posElementUp < screenUp && posElementDown < screenDown) { while( posElementDown < document.height && posElementUp < screenUp) { posElementDown++; posElementUp++ } } else if(posElementUp > screenUp && posElementDown > screenDown && posElementDown < document.height ) { while( posElementDown > screenDown && posElementUp > screenUp) { posElementDown--; posElementUp-- } } else if(posElementUp < screenUp && posElementDown > screenDown ) { while( posElementDown < document.height && posElementUp < screenUp) { posElementDown++; posElementUp++ } } if(posElementUp < 0) posElementUp=0; if( posElementUp+posSize > document.height && document.height > screenDown) { //¹ö±× ¿¹¹æ ÄÚµåÀÓ. posElementUp = document.height - posSize } } else { var posElementUp = posT var posElementDown = posT + posSize var screenUp = document.body.scrollTop var screenDown = document.body.scrollTop + document.body.clientHeight if(posElementUp > screenUp && posElementDown < screenDown) posTop = posElementUp; else if(posElementUp < screenUp && posElementDown < screenDown) { while(posElementUp < screenUp) { posElementDown++; posElementUp++ } } else if(posElementUp > screenUp && posElementDown > screenDown) { while( posElementDown > screenDown && posElementUp > screenUp) { posElementDown--; posElementUp-- } } else if(posElementUp < screenUp && posElementDown > screenDown ) { while( posElementUp < screenUp) { posElementDown++; posElementUp++ } } if( posElementUp < 0 ) posElementUp = 0; } return posElementUp } function pageSize(leftOrTop) { if(n4) { var leftBar=topBar=0; var returnValue = null; if(self != parent) { leftBar = 4; topBar = 4; if(document.width > window.innerWidth+4) topBar += -16; if(document.height > window.innerHeight+4) leftBar += -16; } else { if(document.width > window.innerWidth) topBar += -16; if(document.height > window.innerHeight) leftBar += -16; } if(leftOrTop == "LS") returnValue = window.innerWidth + leftBar if(leftOrTop == "TS") returnValue = window.innerHeight + topBar } else { if(leftOrTop == "LS") returnValue = document.body.clientWidth if(leftOrTop == "TS") returnValue = document.body.clientHeight } return returnValue } function sonPos() { var pageW = pageSize("LS") var pageH = pageSize("TS") var realLeftPos = (n4) ? this.parent.left-window.pageXOffset : this.parent.style.pixelLeft-document.body.scrollLeft var realTopPos = (n4) ? this.parent.top-window.pageYOffset : this.parent.style.pixelTop-document.body.scrollTop if( pageW - (realLeftPos + this.parent.W) > realLeftPos) { if(n4) this.son.left = sonWidthPos( this.son.W, this.parent.left + this.parent.W -10 ) else this.son.style.pixelLeft = sonWidthPos( this.son.W, this.parent.style.pixelLeft + this.parent.W -8 ) } else { if(n4) this.son.left = sonWidthPos( this.son.W, this.parent.left - this.son.W +10 ) else this.son.style.pixelLeft = sonWidthPos( this.son.W, this.parent.style.pixelLeft - this.son.W +8 ) } if( pageH - realTopPos > realTopPos ) { if(n4) this.son.top = sonHeightPos(this.son.H, this.parent.top+this.top+9) else this.son.style.pixelTop = sonHeightPos(this.son.H, this.parent.style.pixelTop+this.style.pixelTop+10) } else { if(n4) this.son.top = sonHeightPos(this.son.H, this.parent.top + this.top - this.son.H +9) else this.son.style.pixelTop = sonHeightPos(this.son.H, this.parent.style.pixelTop + this.style.pixelTop - this.son.H + 10) } } function stayColor() { if(this.parent) { if(n4) this.parent.bgColor = this.parent.nnOnColor else { this.parent.style.backgroundColor = this.parent.ieOnColor this.parent.style.color = this.parent.fontChangeColor } this.parent.parent.stayColor() } } function blockClear() { if(this.block) { if( this.block.parent.mOn) { if(n4) this.block.visibility = "hidden" else this.block.style.visibility = "hidden" } if(this.block.oldSonColor) { if(n4) this.block.oldSonColor.bgColor=this.block.oldSonColor.nnBackColor else { this.block.oldSonColor.style.backgroundColor=this.block.oldSonColor.ieBackColor this.block.oldSonColor.style.color=this.block.oldSonColor.fontBackColor } } this.block.blockClear() } } var sonTime=null var blockTime=null var ieBlock = ""; function blockOver() { if(n4) { if( this.block_ID ) clearTimeout(this.block_ID) if(this.oldSonColor) this.oldSonColor.bgColor = this.oldSonColor.nnBackColor } else { if(this.oldSonColor) { this.oldSonColor.style.backgroundColor = this.oldSonColor.ieBackColor this.oldSonColor.style.color = this.oldSonColor.fontBackColor } } if(this.parent) this.stayColor(); blockTime = this setTimeout("blockTime.blockClear();", 111) } function blockOut() { this.block_ID = setTimeout("blockTime.blockInterval()", 222) } function blockInterval() { if(this.block) this.block.visibility = "hidden" } function sonOver() { if(e4) { if( ieBlock != this.parent.id ) { this.parent.blockOver(); } ieBlock = this.parent.id this.style.backgroundColor = this.ieOnColor this.style.color = this.fontChangeColor if(this.href) this.style.cursor = "hand" if(self.sonOut_ID) clearTimeout(sonOut_ID); if(this.son) this.son.style.zIndex = this.parent.style.zIndex + 1 } else { this.bgColor = this.nnOnColor if(this.son) this.son.zIndex = this.parent.zIndex + 1 } this.mOn = false sonTime = this this.son_ID = setTimeout("sonTime.sonInterval()", 222) } function sonOut() { clearTimeout(this.son_ID); this.mOn = true if(e4) { this.style.backgroundColor = this.ieBackColor this.style.color = this.fontBackColor if(sonTime.parent.block) sonOut_ID = setTimeout("sonTime.parent.block.style.visibility = 'hidden'", 111) } else this.bgColor = this.nnBackColor } function sonInterval() { if(this.parent.block) { if(n4) this.parent.block.visibility = "hidden" else this.parent.block.style.visibility = "hidden" } this.parent.oldSonColor = this this.parent.block = this.son if(this.son) { this.sonPos() if(n4) this.son.visibility = "visible" else this.son.style.visibility = "visible" } } function sonFocus() { if(this.href) self.location.href = this.href; } function n4SetEvent() { var subLen=blockHeight=hr=0 var block=sub=null for(var i=0,y=2; i" if(menuInfo[i][y+1]) print += "" if(!menuInfo[i][y+2]) print += " " else print += menuInfo[i][y+2] + "" } } with( eval(menuInfo[i][0]+".document") ) { write(print) close() } print="" } } function e4SetEvent() { var subLen=blockHeight=hr=0 var block=sub=null for(var i=0,y=2; i
" for(y=2; y" if(menuInfo[i][y+1]) print += "" if(!menuInfo[i][y+2]) print += " " else print += menuInfo[i][y+2] + "" } } print += "
" document.write(print) print = "" } } var menuInfo = new Array() var menuInfoIndex = 0; function setMenu() { var arg = setMenu.arguments if(n4) eval( arg[0] + "= new Layer(" + arg[1] + ")" ) menuInfo[menuInfoIndex] = new Array() for(var i=0; i