
var _scroll_topmargin=0;     // ÀÌµ¿ ¸Þ´ºÀÇ »ó´Ü ÇÑ°è ÇÈ¼¿ 
var _scroll_ing_topmargin=0;    // ¿òÁ÷ÀÌ´Â µµÁßÀÇ »ó´Ü°úÀÇ °£°Ý 
var _scroll_activate_speed=300;     // ÃÊ±â ¿òÁ÷ÀÓÀ» °¨ÁöÇÏ´Â ½Ã°£Â÷ÀÌ (1/1000ÃÊ) 
var _scroll_ing_activate_speed=10;    // ¿òÁ÷ÀÌ±â ½ÃÀÛÇÑ ÀÌÈÄ¿¡ °¨ÁöÇÏ´Â ½Ã°£Â÷ÀÌ (1/1000ÃÊ) 
var _divMenuID = "divMenu"; // ¿À¸¥ÂÊ¿¡ div ·¹ÀÌ¾îÀÇ ID¸í 

// ºê¶ó¿ìÀú ¼ÂÆÃ 
var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false); 
var isNS4 = (document.layers ? true : false); 
var isNS = navigator.appName == "Netscape"; 

function getRef(id) { 
   if (isDOM) return document.getElementById(id); 
   if (isIE4) return document.all[id]; 
   if (isNS4) return document.layers[id]; 
} 

// ¸ÞÀÎÇÔ¼ö 
function moveRightEdge() { 
   var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck; 
   if (isNS4) { 
       yMenuFrom   = divMenu.top; 
       yMenuTo     = windows.pageYOffset+_scroll_ing_topmargin; 
   } else if (isDOM) { 
       yMenuFrom   = parseInt (divMenu.style.top, 10); 
       yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop)+_scroll_ing_topmargin; 
   } 

   if(yMenuTo<_scroll_topmargin) yMenuTo = _scroll_topmargin; 

   timeoutNextCheck = _scroll_activate_speed; 

   if (yMenuFrom != yMenuTo) { 
       yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 10); 
       if (yMenuTo < yMenuFrom) yOffset = -yOffset; 
       if (isNS4) divMenu.top += yOffset; 
       else if (isDOM) divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset; 
       timeoutNextCheck = _scroll_ing_activate_speed; 
   } 
   setTimeout ("moveRightEdge()", timeoutNextCheck); 
} 

// Body ÅÂ±×ÀÇ onLoad ÀÌº¥Æ®¿¡ ³Ö¾îÁÖ¸é µÊ.... 
function moveInit() { 
   if (isNS4) { 
       var divMenu = document[_divMenuID]; 
       divMenu.top = top.pageYOffset + _scroll_topmargin; 
       divMenu.visibility = "visible"; 
       moveRightEdge(); 
   } else if (isDOM) { 
       var divMenu = getRef(_divMenuID); 
       divMenu.style.top = (isNS ? window.pageYOffset : document.body.scrollTop) + _scroll_topmargin; 
       divMenu.style.visibility = "visible"; 
       moveRightEdge(); 
   } 
} 
