function clip() { 
	 moving_control();
     // width of the banner container 
     var contWidth = 560; 
     // height of the banner container 
     var contHeight = 43; 
 
     var id1 = document.getElementById('sponser'); 
     var id2 = document.getElementById('sponser'); 
     var height = id1.offsetHeight; 
      
     id1.style.left = parseInt(id1.style.left)-2 + 'px'; 
      
     document.getElementById('slideCont').style.height = contHeight + "px"; 
     document.getElementById('slideCont').style.clip = 'rect(auto,'+ contWidth +'px,' + contHeight +'px,auto)'; 
     id2.style.display = ''; 
     if(parseFloat(id1.style.left) <= -(1850)) { 
          id1.style.left = contWidth+'px'; 
     } 
     aa=setTimeout(clip,50) 
} 
 
function addLoadEvent(func) { 
  var oldonload = window.onload; 
  if (typeof window.onload != 'function') { 
    window.onload = func; 
  } else { 
    window.onload = function() { 
      if (oldonload) { 
        oldonload(); 
      } 
      func(); 
    } 
  } 
} 
 
addLoadEvent(function() { 
  clip(); 
  moving_control();
  setLangType("ko");
}); 

function slideStop()
{
	 clearTimeout(aa)
}
function slideStart()
{
	clip();
}

var scroll_pixel,div_pixel,gtpos,gbpos,loop,moving_spd;
var top_margin = 1;         /// 창의 맨위와의 여백 내려올때
var top_margin2 =26;      /// 창의 맨위와의 여백 올라올때
var speed = 20;            /// 점차 줄어드는 속도를 위한 설정
var speed2 = 15;           /// setTimeout을 위한 속도 설정
var moving_stat = 0;      /// 메뉴의 스크롤을 로딩시 on/off설정 1=움직임 0은 멈춤

function check_scrollmove()
{
  scroll_pixel = document.all["wrapper"].scrollTop;
        gtpos = document.all["wrapper"].scrollTop+top_margin;
        gbpos = document.all["wrapper"].scrollTop+top_margin2;
  if(div_id.style.pixelTop < gtpos)
  {
	 moving_spd = (gbpos-div_id.style.pixelTop)/speed;
	 div_id.style.pixelTop += moving_spd;
  }
  if(div_id.style.pixelTop > gtpos)
  {
	 moving_spd = (div_id.style.pixelTop-gtpos)/speed;
	 div_id.style.pixelTop -= moving_spd;
  }
  loop = setTimeout("check_scrollmove()",speed2);
}
function moving_control()
{
  if(typeof(div_id)!="object") return;
 
//  if(top_margin!=div_id.style.pixelTop){alert(document.body.style.top);}
  if(!moving_stat)
  { 
	 // if(scroll_pixel%1000==1) alert(scroll_pixel);
	  check_scrollmove(); 
	  moving_stat = 1;
  }
   else
  { 
	   clearTimeout(loop); 
	   moving_stat = 0; 
	   div_id.style.pixelTop = top_margin;
	}
}

