﻿// 이미지 크게 보기 컨트롤
function viewLargeImg(path, name)
{
   document.getElementById(name).src = path;
}


// 객실 이미지 컨트롤
var sRepeat=null;
function doScrollerIE(dir, src, amount) 
{
    if (amount==null)
    {amount=20;}
    
    if (dir=="right")
    {
        document.getElementById(src).scrollLeft+=amount;        
    }
    else
    {
        document.getElementById(src).scrollLeft -=amount;       
    }
    
    if (sRepeat==null)
    {
        sRepeat = setInterval("doScrollerIE('" + dir + "','" + src + "'," + amount + ")",100);
        return false;
    }
    return false;
}
window.document.onmouseout = new Function("clearInterval(sRepeat);sRepeat=null");
window.document.ondragstart = new Function("return false");

// 메인 국가 리스트 컨트롤(컨베이어 벨트)
var html="";
 
  function startText() { for (i=0; i<ctnt.length; i++) insertText(i); }
  function scroll( param ) {
    if ( flag ) {
      for (i=0;i<ctnt.length;i++) {
        temp++;
        tmp = document.getElementById('scroll_area'+i).style;
        if( param=='left' ) {
          tmp.left = parseInt(tmp.left)+speed;
        } else if( param=='right' ) {
          tmp.left = parseInt(tmp.left )-speed;
        }
        if( parseInt(tmp.left)>1 ) {
          if( i==0 ) tmp2 = document.getElementById('scroll_area1').style;
          else if( i==1 ) tmp2 = document.getElementById('scroll_area0').style;
          if( parseInt(tmp2.left)>0 ) tmp2.left = width*(-1);
        }
        if (parseInt(tmp.left) <= width*(-1)) tmp.left = width*(ctnt.length-1);
        if( temp>=amount ) { flag=false; temp=0; }
      }
      window.setTimeout("scroll('"+param+"')", 1);
    }
  }
  function scroll_left() { if( !flag ) { flag=true; scroll('left'); } }
  function scroll_right() { if( !flag ) { flag=true; scroll('right'); } }
  function insertText(i) {
    htmlstr="<div style='left:"+(width*i-0)+"px; width:"+width+"px; position:absolute;' id='scroll_area"+i+"'>\n";
    htmlstr+=ctnt[i]+'\n'+'</div>\n';
    document.write(htmlstr);
  }
  
function MM_swapimageArrow(id, dir)
{
    if (dir == "left")
    {
        document.getElementById(id).src = "/main/images/google_map_navi_button_left_on.gif";    
    }
    else
    {
        document.getElementById(id).src = "/main/images/google_map_navi_button_right_on.gif";    
    }
}

function MM_swapImgRestoreArrow(id, dir)
{
    if (dir == "left")
    {
        document.getElementById(id).src = "/main/images/google_map_navi_button_left_off.gif";    
    }
    else
    {
        document.getElementById(id).src = "/main/images/google_map_navi_button_right_off.gif";    
    }
}

