function textScroll(scroll_el_id) {
    this.objElement = document.getElementById(scroll_el_id);
    this.objElement.style.position = 'relative';
    this.objElement.style.overflow = 'hidden';

    this.objLi = this.objElement.getElementsByTagName('li');
    this.height = this.objElement.offsetHeight; // li ¿¤¸®¸ÕÆ®°¡ ¿òÁ÷ÀÌ´Â ³ôÀÌ(¿ÜºÎ¿¡¼­ º¯°æ°¡´É)
    this.num = this.objLi.length; // li ¿¤¸®¸ÕÆ®ÀÇ ÃÑ °¹¼ö
    this.totalHeight = this.height*this.num; // ÃÑ ³ôÀÌ
    this.scrollspeed = 2; // ½ºÅ©·ÑµÇ´Â px
    this.objTop = new Array(); // °¢ liÀÇ top À§Ä¡¸¦ ÀúÀå
    this.timer = null;
    
    for(var i=0; i<this.num; i++){
        this.objLi[i].style.position = 'absolute';
        this.objTop[i] = this.height*i;
        this.objLi[i].style.top = this.objTop[i]+"px";
    }
}

textScroll.prototype.move = function(){
    for(var i=0; i<this.num; i++) {
        this.objTop[i] = this.objTop[i] - this.scrollspeed;
        this.objLi[i].style.top = this.objTop[i]+"px";
    }
    if(this.objTop[0]%this.height == 0){
        this.jump();
    }else{
        clearTimeout(this.timer);
        this.timer = setTimeout(this.name+".move()",50);
    }
}

textScroll.prototype.jump = function(){
    for(var i=0; i<this.num; i++){
        if(this.objTop[i] == this.height*(-2)){
            this.objTop[i] = this.objTop[i] + this.totalHeight;
            this.objLi[i].style.top = this.objTop[i]+"px";
        }
    }
    clearTimeout(this.timer);
    this.timer = setTimeout(this.name+".move()",3000);
}

textScroll.prototype.start = function() {
    this.timer = setTimeout(this.name+".move()",3000);
}
















var 
    htmlstr_m = "", 
    flag=true, 
    mouse=1, 
    speed=3, 
    wait=2000, 
    temp=0, 
    m_amount=200, 
    m_left=200;

var ctnt=new Array(), i=0, j=0;

function startText_m() {
  for (i=0; i<ctnt.length; i++) insertText_m(i);
  window.setTimeout("scroll_m()",wait);
}

function scroll_m() {
  if (mouse && flag) {
    for (i=0;i<ctnt.length;i++) {
      temp++;
      tmp = document.getElementById('scroll_area'+i).style;
      tmp.left = parseInt(tmp.left) - 1;
      if (parseInt(tmp.left) <= m_left*(-1)) {
        tmp.left = m_left*(ctnt.length-1);
      }
      if (temp>(m_amount-1)*ctnt.length) {
        flag=false;
        temp=0;
        window.setTimeout("flag=true;temp=0;",wait);
      }
    }
  }
  window.setTimeout("scroll_m()",speed);
}

function insertText_m(i) {
  htmlstr_m='<div style="left:'+((m_left)*i)+'px; width:'+(m_amount+0)+'px; position: absolute; top: 0px;padding:0 0 0 0" id="scroll_area'+i+'">\n';
  htmlstr_m+=ctnt[i]+'\n'+'</div>\n';
  document.write(htmlstr_m);
  //alert(i + " " + htmlstr_m);
}









ctnt[0] = "<a href=/front/php/product.php?product_no=4303&main_cate_no=49&display_group=2><img src=/web/upload/lolling/1.jpg width=170 height=230 border=0 ></a>";
ctnt[1] = "<a href=/front/php/product.php?product_no=4227&main_cate_no=1&display_group=3><img src=/web/upload/lolling/2.jpg width=170 height=230  border=0></a>";
ctnt[2] = "<a href=/front/php/product.php?product_no=4339&main_cate_no=50&display_group=1><img src=/web/upload/lolling/3.jpg  width=170 height=230  border=0></a>";
ctnt[3] = "<a href=/front/php/product.php?product_no=4252&main_cate_no=48&display_group=2><img src=/web/upload/lolling/4.jpg width=170 height=230  border=0></a>";
ctnt[4] = "<a href=/front/php/product.php?product_no=4333&main_cate_no=49&display_group=1><img src=/web/upload/lolling/5.jpg  width=170 height=230  border=0></a>";
ctnt[5] = "<a href=/front/php/product.php?product_no=4268&main_cate_no=1&display_group=3><img src=/web/upload/lolling/6.jpg  width=170 height=230  border=0></a>";
ctnt[6] = "<a href=/front/php/product.php?product_no=4330&main_cate_no=49&display_group=2><img src=/web/upload/lolling/7.jpg  width=170 height=230 border=0></a>";
                                                            
