// iframe 내에서 사이즈 조절 메서드를 호출할 시
// 액서스가 거부되었습니다. 라는 스크립트 오류 발생시 필요
// document.domain="keb.co.kr";

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

// flashWrite(파일경로, 가로, 세로, 아이디, 배경색, 변수, 윈도우모드)
function flashWrite(url,w,h,id,bg,vars,win){
  // 플래시 코드 정의
  var flashStr=
  "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
  "<param name='allowScriptAccess' value='always' />"+
  "<param name='movie' value='"+url+"' />"+
  "<param name='FlashVars' value='"+vars+"' />"+
  "<param name='wmode' value='"+win+"' />"+
  "<param name='menu' value='true' />"+
  "<param name='quality' value='high' />"+
  "<param name='bgcolor' value='"+bg+"' />"+
  "<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' id='embed"+id+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
  "</object>";

  // 플래시 코드 출력
  document.write(flashStr);
  //iframeWrite(w,h,id);
}
function iframeWrite(w,h,id) {
  if(navigator.userAgent.indexOf("MSIE") != -1) {
    var iframeStr = "<div class='"+id+"''><iframe id='"+id+"' title='flash temp iframe' src='about:blank' frameborder='0' style='width:"+w+"px; height:"+h+"px;' style='filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);'></iframe></div>";
    document.write(iframeStr);
  }
}

function handlerLnbFlashWidth(flashwidth) {
  var objFlash = document.getElementById("LNB");
  var objParent = objFlash.parentNode;
  objFlash.style.width = flashwidth + "px";
  objParent.style.width = flashwidth + "px";
  if((navigator.userAgent.indexOf("Firefox") != -1) || (navigator.userAgent.indexOf("Opera") != -1)) {
    var emobjFlash = document.getElementById("embedLNB");
    emobjFlash.style.width = flashwidth + "px";
  }
}

function handlerLnbFlashHeight(flashheight) {
  var objFlash = document.getElementById("LNB");
  var objParent = objFlash.parentNode;
  objFlash.style.height = flashheight + "px";
  objParent.style.height = flashheight + "px";
  if((navigator.userAgent.indexOf("Firefox") != -1) || (navigator.userAgent.indexOf("Opera") != -1)) {
    var emobjFlash = document.getElementById("embedLNB");
    emobjFlash.style.height = flashheight + "px";
  }
}

function handlerLnbFlashSize(flashwidth,flashheight) {
  var objFlash = document.getElementById("LNB");
  var objParent = objFlash.parentNode;
  objFlash.style.width = flashwidth + "px";
  objFlash.style.height = flashheight + "px";
  if((navigator.userAgent.indexOf("Firefox") != -1) || (navigator.userAgent.indexOf("Opera") != -1)) {
    var emobjFlash = document.getElementById("embedLNB");
    emobjFlash.style.width = flashwidth + "px";
    emobjFlash.style.height = flashheight + "px";
  }
}

function handlerGnbFlashHeight(flashheight) {
  var objFlash = document.getElementById("GNB");
  var objParent = objFlash.parentNode;
  objFlash.style.height = flashheight + "px";
  if((navigator.userAgent.indexOf("Firefox") != -1) || (navigator.userAgent.indexOf("Opera") != -1)) {
    var emobjFlash = document.getElementById("embedGNB");
    emobjFlash.style.height = flashheight + "px";
  }
}

function handleGnbFlash(fwidth, fheight, fleft) {
  //if(navigator.userAgent.indexOf("MSIE") != -1) {
    var objiFrame = document.getElementById("iframeGNB");
    objiFrame.parentNode.style.left = (fleft - 2) + "px";
    objiFrame.style.height = 70 + fheight + "px";
    objiFrame.style.width = (fwidth - 2) + "px";
  //}
}

function handleGnbOverFlash(openNum) {
  //alert(openNum);
  var objFlash = document.getElementById("GNB");
  //el.style.display = (el.style.display == "none" ? "block" : "none");
  var flashHeight  = (openNum == 1 ? 400 : 70);
  objFlash.height = flashHeight + "px";
  if((navigator.userAgent.indexOf("Firefox") != -1) || (navigator.userAgent.indexOf("Opera") != -1)) {
    var emobjFlash = document.getElementById("embedGNB");
    emobjFlash.height = flashHeight + "px";
  }
}
function handleLnbFlash(fwidth, fheight, ftop, flashheight) {
  //alert("메뉴 가로크기=" + fwidth + ", 메뉴 세로크기=" + fheight+ ", 메뉴 탑 위치값=" + ftop+ "세로사이즈," + flashheight);
  var objFlash = document.getElementById("LNB");
  objFlash.style.height = flashheight + 10 + "px";
  objFlash.style.width = 160 + fwidth + "px";
  if(navigator.userAgent.indexOf("MSIE") != -1) {
    var objiFrame = document.getElementById("iframeLNB");
    objiFrame.parentNode.style.top = ftop + "px";
    objiFrame.style.height = fheight + 1 + "px";
    objiFrame.style.width = fwidth + "px";
  }
  if((navigator.userAgent.indexOf("Firefox") != -1) || (navigator.userAgent.indexOf("Opera") != -1)) {
    var emobjFlash = document.getElementById("embedLNB");
    emobjFlash.style.height = flashheight + 10 + "px";
    emobjFlash.style.width = 160 + fwidth + "px";
  }
}
//GoldageBanking Use...
function handleLnbFlashGAB(fwidth, fheight, ftop, flashheight) {
  //alert("메뉴 가로크기=" + fwidth + ", 메뉴 세로크기=" + fheight+ ", 메뉴 탑 위치값=" + ftop+ "세로사이즈," + flashheight);
  var objFlash = document.getElementById("LNB");
  objFlash.style.height = flashheight + 10 + "px";
  objFlash.style.width = 180 + fwidth + "px";
  if(navigator.userAgent.indexOf("MSIE") != -1) {
    var objiFrame = document.getElementById("iframeLNB");
    objiFrame.parentNode.style.top = ftop + "px";
    objiFrame.style.height = fheight + 1 + "px";
    objiFrame.style.width = fwidth + "px";
  }
  if((navigator.userAgent.indexOf("Firefox") != -1) || (navigator.userAgent.indexOf("Opera") != -1)) {
    var emobjFlash = document.getElementById("embedLNB");
    emobjFlash.style.height = flashheight + 10 + "px";
    emobjFlash.style.width = 180 + fwidth + "px";
  }
}
function totalMenuSetPosition (pos)
{
  var objFlash = document.getElementById("flashTotalMenu");
  objFlash.style.top = pos + "px";
}
function directServiceHeight(heightNum)
{  //alert(heightNum);
  var obj = document.getElementById("directservice");
  var flashobj = document.getElementById("directFlash");
  obj.style.height = heightNum + "px";
  flashobj.height = heightNum;
}
// Windows MediaPlayer
function wmvWrite(url, w, h, id, bg, vars, win){
  var wmvStr = "<embed width='"+w+"' height='"+h+"' src='"+url+"' border='0' type='application/x-mplayer2'></embed>";
  // wmv 코드 출력
  document.write(wmvStr);
}
// QuickTime Player
function movWrite(url, w, h, id, bg, vars, win){
  var movStr = "<embed width='"+w+"' height='"+h+"' src='"+url+"' controller='true' border='0' pluginspage='http://www.apple.com/quicktime/download/indext.html'></embed>";
  // mov 코드 출력
  document.write(movStr);
}


// Show-Hide Layer
function showLayer(tgtEl) {document.getElementById(tgtEl).style.display = "block"; }
function hideLayer(tgtEl) {document.getElementById(tgtEl).style.display = "none"; }
function showhideLayer(tgtEl) {
  var el = document.getElementById(tgtEl);
  el.style.display = (el.style.display == "none" ? "block" : "none");
}

// Select Links
function onchangeno_url() {
  var v_url = linkstr;
  if(v_url) {
  window.location = v_url;
  }
}
// add calss
function addClass(element,value) {
  if (!element.className) {
    element.className = value;
  } else {
    newClassName = element.className;
    newClassName+= " ";
    newClassName+= value;
    element.className = newClassName;
  }
}

// imgover
function imgOver() {
  var aImages = document.getElementsByTagName('img');
  for(var i=0; i<aImages.length; i++) {
    if (aImages[i].className == 'imgover') {
      aImages[i].onmouseover = function() {
        var img_src =  this.getAttribute('src');
        img_src = img_src.replace("_off", "_on");
        this.setAttribute('src', img_src);
        }
       aImages[i].onmouseout = function() {
          var img_src =  this.getAttribute('src');
          img_src = img_src.replace("_on", "_off");
          this.setAttribute('src', img_src);
       }
    }
  }
  return false;
}

// label checkbox
function labelClick(labelFor) {
  if(navigator.appVersion.indexOf("MSIE") != -1) {
    var check_name = document.getElementById(labelFor);
    check_name.click();
  }
}
// label focus 필요
function labelFocus(labelFor) {
  if(navigator.appVersion.indexOf("MSIE") != -1) {
    var check_name = document.getElementById(labelFor);
    check_name.focus();
  }
}
// popup
function openwindow(url,target,option) {
  window.open(url,target,option);
}

// alert(msg)
function message(msg) {
  alert(msg);
}

//스크롤 영역 생성
function overScroll() {
  if(!document.getElementsByTagName("div")) return false;
  var divsions = document.getElementsByTagName("div");
  for(var i=0; i < divsions.length; i++) {
    if(divsions[i].className.indexOf("scroll_y") == -1) continue;
      var elemH = parseInt(divsions[i].style.height);
      var childObj = myNextSibling(divsions[i]);
      var childH = childObj.offsetHeight;
      if(elemH < childH) {
        divsions[i].style.overflowY = "scroll";
        divsions[i].style.overflowX = "hidden";
        //divsions[i].style.borderBottom = "1px solid #5CA4CC";
      } else {
        //divsions[i].style.borderBottom = "1px solid #5CA4CC";
        divsions[i].style.height = childObj.scrollHeight + "px";
      }
  }
}

function overScrollLayer(objId) {
  if(!document.getElementById(objId)) return false;
  var scrollElem = document.getElementById(objId);
  if(!scrollElem.getElementsByTagName("div")) return false;
  var divsions = scrollElem.getElementsByTagName("div");
  for(var i=0; i < divsions.length; i++) {
    if(divsions[i].className.indexOf("scroll_layer_y") == -1) continue;
      var elemH = parseInt(divsions[i].style.height);
      var childObj = myNextSibling(divsions[i]);
      var childH = childObj.offsetHeight;
      if(elemH < childH) {
        divsions[i].style.overflowY = "scroll";
        divsions[i].style.overflowX = "hidden";
        divsions[i].style.borderBottom = "1px solid #A69A8E";
      } else {
        divsions[i].style.borderBottom = "1px solid #A69A8E";
        divsions[i].style.height = childObj.scrollHeight + "px";
      }
  }
}
// 자식 엘리먼트 선택
function myNextSibling(obj) {
  var childElem = obj.childNodes;
  for(var i=0; i < childElem.length; i++) {
    if(childElem[i].nodeType == 1) {
      var mnsObj = childElem[i];
      return mnsObj;
      break;
    }
  }
}
// IE예외 타브라우져 너비값 조절
function fxTableColWidth() {
  if(navigator.appVersion.indexOf("MSIE") == -1) {
    if(!document.getElementsByTagName("col")) return false;
    var cols = document.getElementsByTagName("col");
    for(var v=0; v < cols.length; v++) {
      if(cols[v].width.indexOf("%") != -1) return false;
      if(cols[v].width) {
          cols[v].width = parseInt(cols[v].width) + 14;
        }
      }
  }
}
//아이프레임 높이 자동조절
function calcHeight() {
  if(!document.getElementsByTagName('iframe')) return false;
  var iframes = document.getElementsByTagName('iframe');
  for(var i=0; i < iframes.length; i++) {
    if(iframes[i].className.indexOf('auto_height') == -1) continue;
    var the_height=iframes[i].contentWindow.document.body.scrollHeight;
    iframes[i].style.height=the_height + "px";
  }
}
//스크롤바를 따라다니는 레이어
function initMoving() {
  var topPosition = 125;
  var topLimit = 125;
  var btmLimit = 400;
  var interval = 0;
  var obj = document.getElementById("wingMenu");
  if(!obj) return false;

  obj.initTop = topPosition;
  obj.topLimit = topLimit;
  obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

  obj.style.position = "absolute";
  obj.top = obj.initTop;
  obj.left = obj.initLeft;
  obj.style.top = obj.top + "px";

  obj.getTop = function() {
    if (document.documentElement.scrollTop) {
      return document.documentElement.scrollTop;
    } else if (window.pageYOffset) {
      return window.pageYOffset;
    } else {
      return 0;
    }
  }
  obj.getHeight = function() {
    if (self.innerHeight) {
      return self.innerHeight;
    } else if(document.documentElement.clientHeight) {
      return document.documentElement.clientHeight;
    } else {
      return 500;
    }
  }
  obj.move = setInterval(function() {
    //pos = obj.getTop() + obj.getHeight() / 2 - 15;
    var pos = obj.getTop() + topPosition;

    if (pos > obj.bottomLimit)
      pos = obj.bottomLimit
    if (pos < obj.topLimit)
      pos = obj.topLimit

    interval = obj.top - pos;
    obj.top = obj.top - interval / 3;
    obj.style.top = obj.top + "px";
  }, 30)

}

var Library ={};
Library.mousePosi = function (e){
  this.x = parseInt(e.clientX);
  this.y = parseInt(e.clientY);
}
Library.elePosi= function(eleid){
  var na = navigator.appName;
  var ie = 'Microsoft Internet Explorer';

  /* 엘리먼트 절대위치 알아내기 */
  if (eleid.getBoundingClientRect()) //ff2
  {
    this.top = eleid.getBoundingClientRect().top;
    this.left = eleid.getBoundingClientRect().left;
  }
  else if(na != ie){ //ff3
    if (document.getBoxObjectFor(eleid))
    {
      this.top = document.getBoxObjectFor(eleid).y;
      this.left = document.getBoxObjectFor(eleid).x;
    }
  }
  else{
    this.top = eleid.offsetTop;
    this.left = eleid.offsetLeft;
  }
}
// 이벤트전이 방지 스크립트
var eventBubble = function(e, id){
  if(!e) e = window.event;
  var obj = e.srcElement||e.target;
  if(!obj) return true;

  if(e.cancelBubble){ e.cancelBubble = true; }
  if(obj.stopPropagation){ e.stopPropagation(); }
  if(obj.nodeType==3/*text*/) obj = obj.parentNode;

  obj = (e.relatedTarget)?e.relatedTarget:e.fromElement;
  if (obj) {
    while (obj.parentNode) {
      if (obj.id == id)
        return false;
      obj = obj.parentNode;
    }
  }
  return true;
};

/* 레이어 팝업 */

var showLayerE = {
  onover : 'over',
  idnum:null,
  ie:navigator.appName,
  show : function(self,LayerId,mCheck,mX,mY,ieX,ieY,scroll, e){
    //e = e || window.event;
    if(self.onmouseover) var overE = "over";

    var brX = null;
    var brY=null;
    var tmpDiv = document.createElement("div");
    var tmpIframe = document.createElement("iframe");
    tmpDiv.setAttribute("id", LayerId+"TmpDiv");
    var removeElem = tmpDiv.getAttribute("id");
    //alert(removeElem);
    //if (showLayerE.ie != 'Microsoft Internet Explorer')
      brX = mX;
      brY = mY;
    /* 레이어가 여러개일경우 삭제 */
    var layer = document.getElementById(LayerId);
    document.getElementsByTagName('body')[0].appendChild(layer);

    if ((showLayerE.idnum) && (showLayerE.idnum != LayerId)) {
      if(document.getElementById(showLayerE.idnum+"TmpDiv")) {
        var tmpDivs = document.getElementById(showLayerE.idnum+"TmpDiv");
        document.body.removeChild(tmpDivs);
      }
    }

    if (document.getElementById(showLayerE.idnum)) {
       document.getElementById(showLayerE.idnum).style.display="none";
    }
    showLayerE.idnum = layer.getAttribute("id");
    layer.style.display ="block";
    showLayerE.onover ="over";

    /* 이벤트 전이 버그 오류해결 */
    //var self = e.srcElement || e.target;
      /* 레이어 움직임 체크 */
    if (mCheck == 'move')
    {
      layer.style.left = new Library.elePosi(self).left + ((new Library.mousePosi(e).x+document.documentElement.scrollLeft) - new Library.elePosi(self).left)+brX+"px";
      layer.style.top = new Library.elePosi(self).top + ((new Library.mousePosi(e).y+document.documentElement.scrollTop) - new Library.elePosi(self).top)+brY+"px";
    }
    else if (mCheck =='stop'){
      layer.style.left =(new Library.elePosi(self).left+document.documentElement.scrollLeft) + self.offsetWidth+brX+"px";
      layer.style.top =(new Library.elePosi(self).top+document.documentElement.scrollTop) + self.offsetHeight+brY+"px";
    }

    /* 레이어 밖에서 클릭시에만 레이어가 사라짐 */
    layer.onclick = function() {
      //if (eventBubble(e,LayerId)) showLayerE.onover = "over";
      showLayerE.onover = "over";
    }
    if (document.getElementById(scroll))
    {
      document.getElementById(scroll).onscroll = function(){
        layer.style.display ="none";
      }
    }

    document.onclick = function(evt){
      if (showLayerE.onover == "out") {
        layer.style.display ="none";
        if(document.getElementById(removeElem)) {
          var ree = document.getElementById(removeElem);
          document.body.removeChild(ree);
        }
      }
      showLayerE.onover = "out";
    }
    if(overE) {
      showLayerE.onover = "out";
    }
    if(scroll) {
      overScrollLayer(LayerId);
    }

    tmpDiv.className = "tmpDiv";
    tmpDiv.style.left = layer.style.left;
    tmpDiv.style.top = layer.style.top;
    tmpDiv.style.width = layer.clientWidth + "px";
    tmpDiv.style.height = layer.clientHeight + "px";
    //tmpIframe.setAttribute("allowTransparency",true);
    tmpIframe.setAttribute("src","about:blank");
    tmpIframe.frameBorder = "0";
    tmpDiv.appendChild(tmpIframe);
    if(!document.getElementById(removeElem)) {
      document.body.appendChild(tmpDiv);
      }
  }
}

function hideLayerE(layerId) {
  hideLayer(layerId);
  var delElem = document.getElementById(layerId+"TmpDiv");
  document.body.removeChild(delElem);
}
//addLoadEvent(onclickFunc)
/*
  최동호 추가
  각종탭,테이블 온오프
  [예제테이블 guide/script_table.html]
  아이디최소한으로생성 배열로 테이블,탭 온 오프
*/
var opentab = {
  sid :'setid',
  n   :null,
  f   :false,
  str : function(objstr){
    this.objnum =objstr.split("_")[objstr.split("_").length-1];
    return this;
  },
  id  : function(id){
    this.obj = document.getElementById(id);
    return this;
  },
  cn  : function(obj,cName){
    if (!obj)
    {
      return false;
    }
    else{
      obj.className=cName;
    }
  },
  tab : function(tobj,on,off,eleid,cid,cOn,cOff){
    var eleobj,cobj,i,c,showevent,eN,strNum=null;
    eleobj = opentab.id(tobj).obj.getElementsByTagName(eleid);
    if (tobj == null || !eleobj)
    {
      return false;
    }
    for (i=0,eN=0;i<eleobj.length;i++)
    {
      if(i%2){
        eleobj[i].className=off;
      }
      else if(i%2==0)
      {
        cobj = eleobj[i].getElementsByTagName(cid);
        for (c=0;c<cobj.length;c++)
        {
          if (cobj[c].className==cOn || cobj[c].className==cOff)
          {
            cobj[c].setAttribute("id",tobj+opentab.sid+"_"+i);
            cobj[c].onclick = function(){
              strNum = new opentab.str(this.getAttribute("id")).objnum;
              opentab.n = Number(strNum)+1;
              showEvent();
            }
          }
        }
      }
    }
    showEvent = function(){
      // 다음대상 클릭했을때 바로 뒤에 클릭되었던 대상 닫힐때 [객체를 가려지게 한다]
      if(opentab.f && opentab.f != opentab.n+1){
        new opentab.cn(eleobj[opentab.f-1],off);
      }
      //처음 클릭했을때 [객체를 보여지게 한다]
      if (eleobj[opentab.n].className==off){
        new opentab.cn(eleobj[opentab.n],on);
      }
      //같은대상 두번 클릭했을때[객체를 가려지게 한다]
      else{
        new opentab.cn(eleobj[opentab.n],off);
      }
      opentab.f = opentab.n+1;
    }

  }
}

/* dialog */
var popup = {
  layerObject : new Array(),
  eventTargtObject : null,
  close : function(layerID) {
    if (popup.layerObject[layerID] != null && popup.layerObject[layerID] != undefined) {
      // 이벤트 제거할 객체 정의
      popup.eventTargetObject = popup.layerObject[layerID];
      // 사용자 정의 함수 실행
      popup.eventTargetObject.hide();
      popup.eventTargetObject.close();
    }
  },
  openDialog : function(layerID, layerWidth, layerHeight, autoHeight, modal, isClose) {
   if(modal == undefined) modal = false;
    if(isClose == undefined) isClose = true;   // isClose 매개변수를 넘기지 않았을경우의 기본값처리..
    if (popup.layerObject[layerID] == undefined || null == popup.layerObject[layerID]) {
      popup.layerObject[layerID] = new Ext.Window({
        el: layerID,
        autoScroll: true,
        shadow: false,
        autoHeight:autoHeight,
        width: layerWidth,
        height: layerHeight,
        closeAction: 'hide',
        closable:isClose,  // isClose 값이 false 일 경우에 버튼값이 보이지 않습니다.
        modal: modal,
        on:function() {
          pop_scroll(layerID, layerHeight, autoHeight);
        }
      });
    }
    popup.layerObject[layerID].show();
  },
  setPosition : function(layerID, left, top) {
   popup.layerObject[layerID].setPosition(left, top);
  }
};

function pop_scroll(layerID, height, autoHeight) {
  var topHeight = 44;
  var bottomHeight = 25;
  var totalHeight = height;
  var contHeight = totalHeight - topHeight - bottomHeight;
  var popElem = document.getElementById(layerID);
  var divsions = popElem.getElementsByTagName("div");
  var h1Elem = popElem.getElementsByTagName("h1");
  for(var i=0; i < divsions.length; i++) {
    if(divsions[i].className != "x-window-body") continue;
    var xWinBody = divsions[i];
    var contElem = myNextSibling(xWinBody);
    if((xWinBody.scrollHeight > contHeight) && (!autoHeight)) {
      contElem.style.width = (parseInt(contElem.style.width) - 32) + "px";
      h1Elem[0].style.margin = "0 15px 0 0"
    } else {
      contElem.style.width = (parseInt(contElem.style.width) - 17) +"px";
    }
  }
}

function wpSetSize(ie6w, ie6h) {
  var ie6h = ie6h;
  var ie6w = ie6w;
  var w = document.body.clientWidth;
  var h = document.body.clientHeight;
  var headerH = 44;
  var bottomH = 25;
  var wpHeader1 = document.getElementById("wpHeader1");
  var wpContent = document.getElementById("wpContent");
  var wpPop = document.getElementById("wpPop");
  var conH = ie6h- headerH - bottomH;
  var tmpDiv = document.createElement("div");

  if(navigator.userAgent.indexOf("MSIE 6") != -1) {
     if(wpPop.scrollHeight > conH) {
        if(!document.getElementById("tempHiehgt")) {
          h = h - (h - ie6h);
        } else {
          h = document.getElementById("tempHiehgt").offsetHeight;
        }
     }
  }
  wpContent.style.width = w - 27 + "px";
  if(wpPop.scrollHeight > conH) {
    wpContent.style.height = conH + "px";
    wpHeader1.style.width = w - 59 + "px";
    wpPop.style.width = w - 59 + "px";
  } else {
    wpContent.style.height = "";
    wpHeader1.style.width = w - 42 + "px";
    wpPop.style.width = w - 42 + "px";
  }

  var resizeH = myNextSibling(document.body).scrollHeight - h;
  var resizeW = myNextSibling(document.body).scrollWidth - w;

  resizeBy(resizeW, resizeH);
  //alert(myNextSibling(document.body).scrollWidth + ", " + resizeW);
  if(navigator.userAgent.indexOf("MSIE 6") != -1) {
    if(!document.getElementById("tempHiehgt")) {
      tmpDiv.setAttribute("id", "tempHiehgt");
      document.body.appendChild(tmpDiv);
      tmpDiv.style.position = "absolute";
      tmpDiv.style.height = "100%";
    } else {
      tmpH = document.getElementById("tempHiehgt").offsetHeight;
    }
  }
}
function openWindow(url, target, w, h) {
  var popOption = "width="+w+"px, height="+h+"px, toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0";
  window.open(url, target, popOption);

}
/* 외환포털-환전(가입현황그래프) */

function graphjoin() {
    var graph = document.getElementById("graph");
    var graphBar = graph.getElementsByTagName("span");
    var graphBarTxt = graph.getElementsByTagName ("p");

    for (i=0;i< graphBar.length ;i++ )
    {
        if (graphBar[i].offsetWidth <= 5)
        {
            graphBar[i].style.display = "none";
            graphBarTxt[i].style.left = "9px"
        }
        else {
            graphBarTxt[i].style.left = graphBar[i].offsetWidth + 4 +"px";
        }
    }
}

/* 외환포털-송금(송금통계그래프) */
function graphsend() {
  var graph = document.getElementById("graph");
  var graphBar = graph.getElementsByTagName("span");

  for (i=0;i< graphBar.length ;i++ )
  {
      if (graphBar[i].offsetWidth <= 5)
      {
          graphBar[i].style.display = "none";
      }
  }
}
/* 외환포털 - 환전(우대서비스 라디오버튼 탭) */
function optiontab() {
    var checkoption = document.getElementById("checkoption");
    var inputcheck = checkoption.getElementsByTagName("input");
    var optionbox = document.getElementById("optionbox");
    var optiontag = optionbox.getElementsByTagName("li");
    for (var l=0;l<optiontag.length ;l++ )
    {
        if (optiontag[l].className == "option3")
        {
            var inputno = document.getElementById("box3").getElementsByTagName("input");
            for (var k=0;k<inputno.length ;k++ )
            {
                inputno[k].setAttribute("disabled","disabled");
            }
        }
    }
    for (var i=0;i<inputcheck.length ;i++ )
    {
        inputcheck.item(i).onclick = function() {
            for (var j=1;j<=inputcheck.length ;j++ )
            {
                document.getElementById("box"+j).className = "option"+j;
            }
            var inputnum = this.id.substring(8);
            var boxnum = document.getElementById("box"+inputnum);
            var divnum = boxnum.getElementsByTagName("div")[0];
            divnum.style.display = "block";
            boxnum.className = boxnum.className.replace(inputnum,inputnum+"_on");
            for (var l=0;l<optiontag.length ;l++ )
            {
                if (optiontag[l].className == "option3")
                {
                    var inputno = document.getElementById("box3").getElementsByTagName("input");
                    for (var k=0;k<inputno.length ;k++ )
                    {
                        inputno[k].setAttribute("disabled","disabled");
                    }
                }
                else if(optiontag[l].className == "option3_on"){
                    var inputno = document.getElementById("box3").getElementsByTagName("input");
                    for (var k=0;k<inputno.length ;k++ )
                    {
                        inputno[k].removeAttribute("disabled","disabled");
                    }
                }
            }
        }
    }
    var optionbox = document.getElementById("optionbox");
    var box1 = document.getElementById("box1").offsetHeight;
    var box2 = document.getElementById("box2").offsetHeight;
    if (document.getElementById == "box3")
    {
        var box3 = document.getElementById("box3").offsetHeight;
    }
    var maxNum = "0";
    if (box1 > maxNum)
    {
        maxNum = box1;
    }
    if (box2 > maxNum)
    {
        maxNum = box2;
    }
    if (box3 > maxNum)
    {
        maxNum = box3;
    }
    optionbox.style.height = maxNum + 80+"px";
}

addLoadEvent(initMoving)
addLoadEvent(fxTableColWidth)
addLoadEvent(imgOver)
addLoadEvent(overScroll)
addLoadEvent(calcHeight)
//addLoadEvent(openWindow)

//faq Q&A
function faqlist(){
  var faqlist = document.getElementById("faqlist");
  var faqtitle = faqlist.getElementsByTagName("dt");
  var faqcont = faqlist.getElementsByTagName("dd");

  for (var i=0;i<faqtitle.length ;i++ ){
    faqtitle[i].num = i;
    faqtitle[i].tmp =  faqcont[i];
    faqtitle[i].onclick = function() {
      if (this.className=="on"){
        this.className="";
      }
      else {
        for (var j=0;j<faqcont.length ;j++ ){
          faqcont[j].className ="";
          faqtitle[j].className ="";
        }
        this.className="on";
      }
      if (this.tmp.className == "on"){
        this.num.className="";
        this.tmp.className="";
      }
      else {
        this.tmp.className="on";
      }
    }
  }
}
/* 약관 toggle */
function agrToggle(obj, targetId) {
    var targetDiv=document.getElementById(targetId);
    targetDiv.style.display=(targetDiv.style.display=='none')? 'block' : 'none';
    obj.innerHTML=(targetDiv.style.display=='none')? '약관상세보기' : '약관닫기';
    obj.parentNode.className=(targetDiv.style.display=='none')? 'close' : 'open';
}

/* 외환포털- 환전(이미지 롤오버) */
function imgonover(idList) {
    for (var j=0;j<idList.length ;j++ ){
        var listid = document.getElementById("cash_list"+(j+1));
        var allimg = listid.getElementsByTagName("img");
        for (var i=0;i<allimg.length ;i++ )
        {
            allimg[i].onmouseover = function(){
                this.src = this.src.replace("_off.gif","_on.gif");
            }
            allimg[i].onmouseout = function(){
                this.src = this.src.replace("_on.gif","_off.gif");
            }
        }
    }
}

/* total Menu */
function moveElement(elementID,final_x,final_y,interval) {
  if (!document.getElementById) return false;
  if (!document.getElementById(elementID)) return false;
  var elem = document.getElementById(elementID);
  if (elem.movement) {
    clearTimeout(elem.movement);
  }
  if (!elem.style.left) {
    elem.style.left = "0px";
  }
  if (!elem.style.top) {
    elem.style.top = "0px";
  }
  var xpos = parseInt(elem.style.left);
  var ypos = parseInt(elem.style.top);
  if (xpos == final_x && ypos == final_y) {
    return true;
  }
  if (xpos < final_x) {
    var dist = Math.ceil((final_x - xpos)/10);
    xpos = xpos + dist;
  }
  if (xpos > final_x) {
    var dist = Math.ceil((xpos - final_x)/10);
    xpos = xpos - dist;
  }
  if (ypos < final_y) {
    var dist = Math.ceil((final_y - ypos)/10);
    ypos = ypos + dist;
  }
  if (ypos > final_y) {
    var dist = Math.ceil((ypos - final_y)/5);
    ypos = ypos - dist;
  }
  elem.style.left = xpos + "px";
  elem.style.top = ypos + "px";
  var repeat = "moveElement('"+elementID+"',"+final_x+","+final_y+","+interval+")";
  elem.movement = setTimeout(repeat,interval);
}
function totalMenuToggle() {
    if(!document.getElementById("totalMenuToggle")) return false;
    var elem = document.getElementById("totalMenuToggle");
    if(elem.firstChild.getAttribute("src").indexOf("open") != -1) {
        moveElement('flashTotalMenu',0, 0,  0);
        var temp_src = elem.firstChild.getAttribute("src").replace("open", "close");
        elem.firstChild.setAttribute("src", temp_src);
        elem.style.top = 296 + "px";
    } else {
        moveElement('flashTotalMenu',0, -300,  0);
        var temp_src = elem.firstChild.getAttribute("src").replace("close", "open");
        elem.firstChild.setAttribute("src", temp_src);
        elem.style.top = 300 + "px";
    }
}

/* 이미지 변환 */
function transImg() {
  var pagePath = location.href;
  var imgs = document.body.getElementsByTagName("img");
  if((pagePath.indexOf("?EN") != -1) || (pagePath.indexOf("?en") != -1)) {
    //alert(imgs[0].getAttribute("src"));
    for(var i = 0; i < imgs.length; i++) {
          imgs[i].setAttribute("src", imgs[i].getAttribute("src").replace(".gif", "_EN.gif"));
        }
    var tmpElem = document.createElement("link");
    tmpElem.setAttribute("rel", "stylesheet");
    tmpElem.setAttribute("type", "text/css");
    tmpElem.setAttribute("href", "../../../css/public_EN.css");
    //<link rel="stylesheet" type="text/css" href="../css/public_EN.css" />
    document.body.appendChild(tmpElem);
  }
}

function footerSelectMenu(course) {
    if(!document.getElementById("FME")) return false;
    var FME = document.getElementById("FME");
    var posX = FME.offsetLeft;

    var tmpObj = FME.childNodes;
    var sub = new Array();
    for(var i=0;i<tmpObj.length;i++) {
        try{
            if(tmpObj[i].tagName.toUpperCase() == "LI") {
                sub.push(tmpObj[i]);
            }
        }catch(e) { }
    }
    if(course) { //left
        if(posX > (parseInt(FME.clientWidth,10)-(96*3))*-1) { //-278
            //FME.style.left = posX - 96 + "px";
            var moveSize = posX - 96;
            moveElement('FME',moveSize,0,0)
        }else {
            var tmp = sub[0].innerHTML;
            for(var i=0;i<sub.length-1;i++) {
                sub[i].innerHTML = sub[i+1].innerHTML;
            }
            sub[sub.length-1].innerHTML = tmp;
            FME.style.left = (parseInt(FME.style.left,10) + 96) + "px";
            footerSelectMenu(1);
        }
    } else {  //right
        if(posX < 10) {
            var moveSize = posX + 96;
            moveElement('FME',moveSize,0,0)
        }else {
            var tmp = sub[sub.length-1].innerHTML;
            for(var i=sub.length-1;i>0;i--) {
                sub[i].innerHTML = sub[i-1].innerHTML;
            }
            sub[0].innerHTML = tmp;
            tmp = parseInt(FME.style.left, 10);
            if(isNaN(tmp) ) {
                tmp = 10;   //원점은 10px.
            }
            FME.style.left = (tmp - 96) + "px";
            footerSelectMenu(0);
        }
    }
}

addLoadEvent(transImg)

/* snb 셀렉트 메뉴 */
function selectLayer(elmID) {
    var elm = document.getElementById(elmID);
    var elmList = elm.getElementsByTagName("li");

    if (elmID == "seltit1")
    {
        document.getElementById("seltit2").getElementsByTagName("li")[0].className = "first_child";
        document.getElementById("seltit2").getElementsByTagName("li")[1].className = "select_list";
    }
    else {
        document.getElementById("seltit1").getElementsByTagName("li")[0].className = "first_child";
        document.getElementById("seltit1").getElementsByTagName("li")[1].className = "select_list";
    }
    if (elmList[1].className == "select_list")
    {
        elmList[1].className = "select_list on";
        elmList[0].className = "first_child on";
    }
    else {
        elmList[1].className = "select_list";
        elmList[0].className = "first_child";
    }
}

/* toggle */
function toggle(obj) {
 var pNode = obj.parentNode.parentNode;
 var ptNode = nextNode(obj.parentNode.parentNode);
 var clsName = obj.className;

 if( 'show' === clsName )
 {
  ptNode.style.height = 'auto';
  ptNode.style.fontSize = '12px';
  ptNode.style.lineHeight = '14px';
  ptNode.style.padding = '15px 0 13px 0';
  ptNode.style.visibility='visible';

  // IE6일때
  if((navigator.userAgent.indexOf('MSIE 6.0') != -1)) {
   pNode.style.lineHeight = '14px';
   pNode.style.fontSize = '12px';
   pNode.style.margin = '0 0 0 0';
  }
  obj.src = obj.src.replace('down', 'up');
  obj.className = 'hidden';
 }
 else
 {
  ptNode.style.height = '0';
  ptNode.style.fontSize = '0';
  ptNode.style.lineHeight = '0';
  ptNode.style.padding = '0 0 0 0';
  ptNode.style.margin = '0 0 0 0';
  // IE6일때
  if((navigator.userAgent.indexOf('MSIE 6.0') != -1)) {
   pNode.style.lineHeight = '14px';
   pNode.style.fontSize = '12px';
   pNode.style.margin = '0 0 0 0';
  }
  ptNode.style.visibility='hidden';
  obj.src = obj.src.replace('up', 'down');
  //obj.src = '../../../img/npm/ico_arrow_down.gif';
  obj.className = 'show';
 }
}

function nextNode(ptNode) {
 var elem = ptNode;
 do
 {
  elem = elem.nextSibling;
 } while ( elem && elem.nodeType != 1 )
 return elem;
}

function lnb()
{
 if( document.getElementById('flash_lnb') )
 {
  var lnbWrap = document.getElementById('flash_lnb');
  var flashLnb = document.getElementById('LNB');
  lnbWrap.style.height = flashLnb.offsetHeight+'px';
 }
}

//방배동에서 추가

function goMenuAction(menuUrl, encryptionYn) {
//팝업은 pop@주소|추가파라메터 형식임. (ex : pop@pib@/PCM0000M.web|width=600,height=300)
//팝업윈도우 이름은 주소에서 알파벳만 추출하여 적용함.
//    alert(menuUrl + " , "+ encryptionYn);

 // 기업뱅킹 > 메인 > 계좌조회의 경우 팝업으로 호출함
 if(menuUrl == "left1"){
  window.open ('/b2c/popup.html','','scrollbars=0,toolbar=no,status=no,menubar=no');
  return;
 }

 if(!menuUrl == '') {
  location.href = menuUrl;
    }
	var arrMenuURL = menuUrl.split("@");
	if (arrMenuURL.length > 0) {

		if(arrMenuURL[0] == "SSO") {
			var channel = arrMenuURL[1];
			var cookie_sso_token = getCookie("sso_token");

	    	if(channel == "MAL1") {
	    		menuUrl = "http://www.keb.co.kr/MAL/FMProductUser?cmd=main&mType=main&mTypePr=1";
	    	} else if(channel == "MAL2") {
	    		menuUrl = "http://www.keb.co.kr/MAL/FMProductUser?cmd=main&mType=main&mTypePr=2";
	    	} else if(channel == "FEX") {
	    		menuUrl = "http://fx.keb.co.kr/sso_pass.jsp?sso_token=" + cookie_sso_token;

					} else if(channel == "CRD1") {
						menuUrl = "http://card.keb.co.kr/CPI0000C.web?schID=crd";
					} else if(channel == "CRD2")  {
						menuUrl = "http://card.keb.co.kr/CCI0000C.web?schID=crd";
					} else if(channel == "CRD3")  {
						menuUrl = "http://card.keb.co.kr/CMI0000C.web?schID=crd";

			}

    		location.href = menuUrl;
		} else {
			var addr = makeMenuUrl(menuUrl);

			if(addr != false) {
				if(encryptionYn == "Y") {
					//XecureNavigate_keb(addr, "_self");
					location.href = "http://bank.keb.co.kr/jsp/mal/xecurePass.jsp?URL=" + menuUrl;
				} else if(encryptionYn == "P") {
					XecureNavigate(addr, "_self");
				} else {
                    location.href = addr;
                }
			}
		}
	}
}

function makeMenuUrl(str) {
//pib, fex, crd, mal, com 은 각 해당하는 도메인 붙임.
//개발서버의 경우에는 pib는 7001, fex는 7002 포트번호 추가됨.
//앞 3자리 코드가 tmp, pop인 경우엔 함수 내에서 처리 후 false리턴함. goMenuAction에서 처리 안함.
	var regex = /([a-z]{3})@(.*)/g;
	var res = regex.exec(str);
	var menuUrl = str;

	if(res != null && res.length == 3) {
		var domainArr = new Object();
		domainArr["pib"] = "http://bank.keb.co.kr";
		domainArr["fex"] = "http://fx.keb.co.kr";
		domainArr["mal"] = "http://www.keb.co.kr";
		domainArr["com"] = "http://cbs.keb.co.kr";
		domainArr["crd"] = "http://card.keb.co.kr";

		if(domainArr[res[1]] != undefined && domainArr[res[1]] != null) {
			menuUrl = domainArr[res[1]];

			//개발서버인 경우 포트 붙여줌.
			if(false) {
				if(res[1] == "pib") {
					menuUrl += ":7001";
				}else if(res[1] == "fex") {
					menuUrl += ":7002";
				}else if(res[1] == "mal") {
					menuUrl += ":8002";
				}
			}

			if(res[2].charAt(0) != "/") res[2] = "/"+res[2];

			menuUrl += res[2];
		}else if(res[1] == "tmp") { //금융자산벤치마킹
			window.open('http://www.keb.co.kr/IBS/FMBenchMarkUser?vcode=08000000000000&scode=08010300000000','_blank','');
			return false;
		}else if(res[1] == "pop") {
			
			var param = "";
            var popAddr = "http://tbank.keb.co.kr/MCF9100D.web";
            var size = "width=780px, height=380px";   //, toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0
            //openWindow('http://tbank.keb.co.kr/MCF9100D.web', 'pop1', 770 ,380);
            window.open('http://tbank.keb.co.kr/MCF9100D.web', 'pop1', size);

            return false;
		}else if(res[1] == "url") {

		}
	}

	return menuUrl;
}
  
function fncOpenPop(){
 var pop = window.open("http://erms.keb.co.kr/tel/exMailQuestion.jsp", 'popup', 'width=650,height=550,menubar=0,resizable=0, scrollbars=0');
 pop.focus();
}

function fncOpenPop1(){
 alert("로그인 후에 이용하시기 바랍니다.");
 window.location.href="http://bank.keb.co.kr/jsp/mal/xecurePass.jsp?URL=http://bank.keb.co.kr/PCS0000C.web?isHP=CP&returnURL=http://www.keb.co.kr/IBS/ncustomer/kor/index_pop.jsp";
}  


var thisLinkTarget = "keb";
var ebankHostName = "http://ebank.keb.co.kr";
function eLink(arg) {
 while ( arg.indexOf("&") > 0 )
  arg = arg.replace("&","%26");
     window.open(ebankHostName+"/IBS/eBank.jsp?returnURL="+arg,thisLinkTarget,"");
}

/****** 전체프레임(keb) 이동할때 사용하는 링크 *******************************************/
function kLink(arg){
 window.open(arg,thisLinkTarget,""); 
}

function Win( sURL, sName, scrollbars, left, top) { 
 var win = window.open(sURL, sName, "status=no,toolbar=no,resizable=no,scrollbars="+scrollbars+",menubar=no, width=1, height=1, left="+left+", top="+top); 

}

function handlepress(e) {
 if (e.keyCode==13){
  document.forms['search'].submit();
 }
}

function goSearch() {
  document.forms['search'].submit();
}


// 이중 ifram으로 되어있는 프로그램에서 전체 페이지 전환을 하려할때 사용
function goParentsPage(url){
 location.href = url; 
}

// iframe resize method
function resizeHeight(){
 w = document.body.scrollWidth +20; 
 h = document.body.scrollHeight +20;
 resizeTo(w,h);
}


function makeMenuno_url() {
//pib, fex, crd, mal, com 은 각 해당하는 도메인 붙임.
//개발서버의 경우에는 pib는 7001, fex는 7002 포트번호 추가됨.
//앞 3자리 코드가 tmp, pop인 경우엔 함수 내에서 처리 후 false리턴함. goMenuAction에서 처리 안함.
    var regex = /([a-z]{3})@(.*)/g;
    var res = regex.exec(str);
    var menuUrl = str;

 

    if(res != null && res.length == 3) {
        var domainArr = new Object();
        domainArr["pib"] = "bank.keb.co.kr";
        domainArr["fex"] = "fx.keb.co.kr";
        domainArr["crd"] = "card.keb.co.kr";
        domainArr["mal"] = "www.keb.co.kr";
        domainArr["com"] = "cbs.keb.co.kr";

        if(domainArr[res[1]] != undefined && domainArr[res[1]] != null) {
            menuUrl = "http://"+domainArr[res[1]];

            //개발서버인 경우 포트 붙여줌.
            if(false) {
                if(res[1] == "pib") {
                    menuUrl += ":7001";
                }else if(res[1] == "fex") {
                    menuUrl += ":7002";
                }
            }

            if(res[2].charAt(0) != "/") res[2] = "/"+res[2];

            menuUrl += res[2];
        }else if(res[1] == "tmp") {
            popup.openDialog("not_ready_popup", 550, 0, true);
            return false;
        }else if(res[1] == "pop") {
        //팝업인 경우에는 한번 더 파싱함.
            var popAddr = makeMenuno_url();
            if(popAddr != false) {
            //tmp가 아닌 경우의 처리.
                var param = res[2].substring(res[2].indexOf("|")+1);    //팝업 파라메터는 원래의 인수에서 받고
                popAddr = popAddr.substring(0, popAddr.indexOf("|"));   //팝업 주소는 makeMenuUrl() 결과에서 받는다.
                window.open(popAddr, popAddr.replace(/[^a-zA-Z]/g, ""), param);
                return false;
            }else {
                return popAddr;
            }
        }else if(res[1] == "win") {
        //새창링크
            menuUrl = res[2];
            window.open(menuUrl,'','');
            return false;
        }
    }

    return menuUrl;
}

addLoadEvent(lnb);

function showNoticeHappen(){
 window.open('http://bank.keb.co.kr/jsp/mal/xecurePass.jsp?URL=http://bank.keb.co.kr/PCS0000C.web','','width=665,height=512,menubar=0,resizable=0, scrollbars=0');
}

function tab(obj)
{
 var list = obj.parentNode.parentNode.getElementsByTagName('img');
 for( var i = 0; i < list.length; i++ )
 {
  list[i].src = list[i].src.replace('on', 'off');
 }
 obj.getElementsByTagName('img')[0].src = obj.getElementsByTagName('img')[0].src.replace('off', 'on');
 
 var list = obj.parentNode.parentNode.parentNode.getElementsByTagName('div');
 if( obj.className.indexOf('tb_wrap') > -1 ) {
  for( var i = 0; i < list.length; i ++){
   list[i].style.display = 'none';
  }
  document.getElementById(obj.className).style.display = 'block';
 }
}

function WindowReset( width,win /* Window Object */ ){ // 새창의 크기와 위치 재설정

 var winBody = win.document.body; 

 // 새창의 사이즈에 더해줄 marginWidth와 marginHeight 
 var marginHeight = parseInt(winBody.topMargin)+parseInt(winBody.bottomMargin); 

 // height 길이 조절
 var totalSizeHeight;
 //alert(winBody.scrollWidth+"전체:"+winBody.scrollHeight);
 
 if(winBody.scrollHeight > 768){
  totalSizeHeight = 330;
 }else{
  totalSizeHeight = winBody.scrollHeight;
 } 

 if(navigator.appVersion.indexOf("MSIE 7.0") >= 0 ){  // 7.0일 때
  var hei = totalSizeHeight + (winBody.offsetHeight - winBody.clientHeight)+71;
 }else{
  var hei = totalSizeHeight + (winBody.offsetHeight - winBody.clientHeight) + marginHeight;
 }

 // 사이즈 재조정
 //
 win.resizeTo(width, hei);
}

// 이미지 깜빡거림 제거
try {document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
 
// gnb 주가정보
function naviStockOpen(){
var stock = document.getElementById('naviStock');
  stock.style.display = 'block';
}
function naviStockClose(){
 var stock = document.getElementById('naviStock');
  stock.style.display = 'none';
}

// mainflashWrite(파일경로, 가로, 세로, 아이디, 배경색, 변수, 윈도우모드)
function mainflashWrite(url,w,h,id,base){
  // 플래시 코드 정의
  var flashStr=
  "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
  "<param name='allowScriptAccess' value='always' />"+
  "<param name='movie' value='"+url+"' />"+
  "<param name='menu' value='true' />"+
  "<param name='quality' value='high' />"+
  "<param name='base' value='"+base+"' />"+
  "<embed src='"+url+"' base='"+base+"' menu='false' quality='high' width='"+w+"' height='"+h+"' id='embed"+id+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
  "</object>";

  // 플래시 코드 출력
  document.write(flashStr);
  //iframeWrite(w,h,id);
}
/*
이호연 추가 분 
*/
function flashSizeFn(num)
{

	if( document.getElementById('introLNB') )
	{
		var lnbWrap = document.getElementById('introLNB');
		var flashLnb = document.getElementById('LNB');
		lnbWrap.style.height = num+'px';
	}
}
