
/************************************************************************************************/
/* timeInterVal : Interval Time                                                                  */
/* imgHeight : Top ¹öÆ° Æø                                                                        */
/* topDir : °è»êµÉ ¹æÇâ Ç¥½Ã true (»ó->ÇÏ)/ false (ÇÏ->»ó)/ default (true)                         */
/* bwrHeight : ºê¶ó¿ìÀú Æø                                                                        */
/* limitBwrHeight - ºê¶ó¿ìÀú°¡ Æ¯Á¤ ÆøÀÌÇÏ·Î ÀÛ¾ÆÁø°æ¿ì Æ¯Á¤ »ó´Ü¿¡ °íÁ¤µÉ ³ôÀÌ                      */
/* baseGap : À§Ä¡ÇÒ Æ¯Á¤À§Ä¡¿Í ºê¶ó¿ìÀú°£ÀÇ °£°Ý                                                    */
/* isNS4 : ³×½ºÄÉÀÌÇÁ4 Ã¼Å©                                                                        */
/* isNS6 : ³×½ºÄÉÀÌÇÁ6ÀÌ»ó Ã¼Å©                                                                    */
/* isMSIE : ÀÍ½ºÇÃ·Î·¯ Ã¼Å©                                                                        */
/************************************************************************************************/
var timeInterVal = 100;
var imgHeight = 16;
var topDir = true;
var bwrHeight = 0;
var limitBwrHeight = 500;
var baseGap = 40;
var isNS4 = false;
var isNS6 = false;
var isMSIE = false;

/************************************************************************************************/
/* Top Button Position Direction Change Function                                                */
/************************************************************************************************/
function setTopDir(dVal){
	topDir = dVal;
}

/************************************************************************************************/
/* Get Browser Function                                                                         */
/************************************************************************************************/
function getBrowser() {
	isNS4 = ((document.layers)==null)?false:true;
	isNS6 = ((!document.all && document.getElementById)==null || (!document.all && document.getElementById) == false)?false:true;
	isMSIE = ((document.all)==null)?false:true;
}

/************************************************************************************************/
/* Call Browser Size Function                                                                   */
/************************************************************************************************/
function chgWinSize() {
	initTopButton();
}

/************************************************************************************************/
/* Initial Top Button Function                                                                  */
/************************************************************************************************/
function initTopButton() {
	if (isNS4 || isNS6) {
		bwrHeight = window.innerHeight; 
	} else if(isMSIE) {
		bwrHeight = document.body.clientHeight;
	}
	if (isNS4) document.goTop.top = limitBwrHeight;
	if (isNS6) document.getElementById('goTop').style.top = limitBwrHeight;
	if (isMSIE) goTop.style.pixelTop = limitBwrHeight;
}

/************************************************************************************************/
/* Move Top Button Function                                                                     */
/************************************************************************************************/
function TopMovec() {
	var topPos = (topDir)?bwrHeight-(baseGap+imgHeight):baseGap;
	if (isNS4) document.goTop.top = topPos+window.pageYOffset;
	if (isNS6) document.getElementById('goTop').style.top = topPos+scrollY;
	
	if (isMSIE)
	{
		try
		{
			goTop.style.pixelTop = topPos+document.body.scrollTop;
		}
		catch(exception)
		{
			goTop.style.pixelTop = 0;
		}
	}

	if(topDir) {
		if (isNS4 && document.goTop.top <= limitBwrHeight) {
			if (document.goTop.top == limitBwrHeight) return;
			document.goTop.top = limitBwrHeight;
			return;
		}
		if (isNS6 && parseInt(document.getElementById('goTop').style.top) <= limitBwrHeight) {
			if (document.getElementById('goTop').style.top == limitBwrHeight) return;
			document.getElementById('goTop').style.top = limitBwrHeight;
			return;
		}
		if (isMSIE && goTop.style.pixelTop <= limitBwrHeight) {
			if (goTop.style.pixelTop == limitBwrHeight) return;
			goTop.style.pixelTop = limitBwrHeight;
			return;
		}
	}
}


function topc() {
	getBrowser();
	initTopButton();
	setInterval("TopMovec()",timeInterVal);
}

document.write("\
<!-- START OF QUICK LINK -->\
<div id=\"goTop\" name=\"goTop\" style=\"position:absolute;left:980px;top:"+limitBwrHeight+"\">\
	<a href=\"#\" onFocus=\"this.blur()\"><img src=/common/img/common/btn_top.gif border=0 height=30></a>\
</div>\
<!--Top Button ³¡-->\
");