//=================================================================================================
// 프로젝트 : 10억홈피 WCMS
// 파 일 명 : /common/js/common.js
// 처리내용 : 공통자바스크립트
// 작 성 자 : 2009-07-07 이성준
//=================================================================================================
var getOp7Up,getOp6Dn,getIE4Up,getIE4,getIE5,getIE6,getNN4,getUA=navigator.userAgent.toLowerCase();
if(window.opera)
{
  var i=getUA.indexOf('opera');
  if( i!=-1 )
  {
    var v=parseInt(getUA.charAt(i+6));
    getOp7Up=v>=7;
    getOp6Dn=v<7;
  }
}

//---------------------------------------------------------------------------------------
// 함수명 : getNum
// 기  능 : 숫자형체크
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function getNum()
{
  for ( var loop=0; loop<arguments.length; ++loop )
  {
    if (isNaN(arguments[loop]) || typeof(arguments[loop])!='number') 
    {
      return false;
    }
  }
  return true;
}

//---------------------------------------------------------------------------------------
// 함수명 : getStr
// 기  능 : 문자형체크
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function getStr(pStr)
{
  for ( var loop=0; loop<arguments.length; ++loop )
  {
    if ( typeof(arguments[loop])!='string' ) 
    {
      return false;
    }
  }
  return true;
}

//---------------------------------------------------------------------------------------
// 함수명 : getDef
// 기  능 : 객체생성체크
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function getDef()
{
  for( var loop=0; loop<arguments.length; ++loop )
  {
    if( typeof(arguments[loop])=='undefined' ) 
    {
      return false;
    }
  }
  return true;
}

//---------------------------------------------------------------------------------------
// 함수명 : toGetElementById
// 기  능 : 
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function toGetElementById( pE )
{
  if( typeof(pE) != 'string' ) { return pE; }

  if      (document.getElementById) { pE = document.getElementById(pE); }
  else if (document.all)            { pE = document.all[pE]; }
  else                              { pE = null; }
  return pE;
}

//---------------------------------------------------------------------------------------
// 함수명 : getClientWidth
// 기  능 : 화면폭취득
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function getClientWidth()
{
  var width = 0;
  if ( getOp6Dn ) 
  { 
    width = window.innerWidth; 
  }
  else if ( document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientWidth )
  { 
    width = document.documentElement.clientWidth; 
  }
  else if ( document.body && document.body.clientWidth )
  { 
    width = document.body.clientWidth; 
  }
  else if ( getDef(window.innerWidth,window.innerHeight,document.height) ) 
  {
    width = window.innerWidth;
    if ( document.height>window.innerHeight ) { width -= 16; }
  }
  return width;
}

//---------------------------------------------------------------------------------------
// 함수명 : getClientHeight
// 기  능 : 화면높이취득
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function getClientHeight()
{
  var height = 0;
  if ( getOp6Dn ) 
  { 
    height = window.innerHeight;
  }
  else if ( document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientHeight )
  {
    height = document.documentElement.clientHeight;
  }
  else if ( document.body && document.body.clientHeight )
  {
    height = document.body.clientHeight;
  }
  else if ( getDef(window.innerWidth,window.innerHeight,document.width) ) 
  {
    height = window.innerHeight;
    if ( document.width>window.innerWidth ) { height -= 16; }
  }
  return height;
}

//---------------------------------------------------------------------------------------
// 함수명 : getBodyHeight
// 기  능 : 바디높이
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function getBodyHeight() 
{
  var cw = getClientHeight();
  var sw = window.document.body.scrollHeight;
  return cw>sw ? cw : sw;
}

//---------------------------------------------------------------------------------------
// 함수명 : getScrollTop
// 기  능 : top stroll
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function getScrollTop(pE, pWin)
{
  var offset = 0;
  if ( !getDef(pE) || pWin || pE == document || pE.tagName.toLowerCase() == 'html' || pE.tagName.toLowerCase() == 'body' ) 
  {
    var w = window;
    if (pWin && pE) { w = pE; }
    if      (w.document.documentElement && w.document.documentElement.scrollTop) { offset = w.document.documentElement.scrollTop; }
    else if (w.document.body && getDef(w.document.body.scrollTop)              ) { offset = w.document.body.scrollTop; }
  }
  else 
  {
    pE = toGetElementById(pE);
    if (pE && getNum(pE.scrollTop)) { offset = pE.scrollTop; }
  }
  return offset;
}
//---------------------------------------------------------------------------------------
// 함수명 : getTop
// 기  능 : top이동
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function getTop( pE, pY )
{
  if ( !(pE=toGetElementById(pE)) ) { return 0; }
  var css = getDef(pE.style);

  if ( css && getStr(pE.style.top) ) 
  {
    if ( getNum(pY) ) 
    {
      pE.style.top = pY + 'px';
    }
    else 
    {
      pY = parseInt(pE.style.top);
      if( isNaN(pY) ) { pY = 0; }
    }
  }
  else if (css && getDef(pE.style.pixelTop)) 
  {
    if(getNum(pY)) { pE.style.pixelTop = pY; }
    else           { pY = pE.style.pixelTop; }
  }
  return pY;
}

//---------------------------------------------------------------------------------------
// 함수명 : flashWrite
// 기  능 : flash 출력
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function flashWrite( pUrl, pW, pH, pId, pVars )
{
  // 플래시 코드 정의
  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='"+pW+"' height='"+pH+"' id='"+pId+"' align='middle'>"+
               "<param name='movie' value='"+pUrl+"' />"+
               "<param name='wmode' value='transparent' />"+
               "<param name='menu' value='false' />"+
               "<param name='quality' value='high' />"+
               "<param name='flashVars' value='"+pVars+"' />"+
               "<embed src='"+pUrl+"' wmode='transparent' menu='false' flashVars='"+pVars+"' quality='high' width='"+pW+"' height='"+pH+"' name='"+pId+"' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
               "</object>";

  // 플래시 코드 출력
  document.write(flashStr);
}

//---------------------------------------------------------------------------------------
// 함수명 : go_url
// 기  능 : div onclick 시 URL이동
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function goUrl(pUrl, pTarget) 
{
  if (pTarget == "_blank") { newwin = window.open(pUrl,'newwin',''); } 
  else                     { location.href = pUrl;                   }
}

//---------------------------------------------------------------------------------------
// 함수명 : delThis
// 기  능 : 삭제여부
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function delThis(pNum)
{
  return confirm("정말 삭제하시겠습니까?");
}

//---------------------------------------------------------------------------------------
// 함수명 : activeTab
// 기  능 : div Tab Control
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function activeTab(pObj) 
{
  var tab_id = pObj.id;
  var cObj   = pObj.parentNode.firstChild;

  while(cObj) 
  {
    if(cObj.nodeName == "LI" && cObj.id) 
    {
      var cTabID= cObj.id;
      if(cTabID.indexOf('tab')<0) { continue; }
      var cContentID = cTabID.replace(/^tab/,'idTabBody');
      if(tab_id == cTabID) { cObj.className = "ssTab ssOn"; toGetElementById(cContentID).className = "ssTabBody ssShow"; } 
      else                 { cObj.className = "ssTab";      toGetElementById(cContentID).className = "ssTabBody ssHide"; }
    }
    cObj = cObj.nextSibling;
  }
}

//---------------------------------------------------------------------------------------
// 함수명 : byteCheck
// 기  능 : Textarea의 바이트수 (글자수 제한)
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function byteCheck(pObj, pTarget, pBytesLimit) 
{
  var msgVal      = pObj.value;
  var bytesLen    = 0;
  var curMsgLen   = '';
  var curBytesLen = 0;
  var realVal     = '';
  var realLen     = 0;
  for(var loop = 0; loop < msgVal.length; loop++) 
  {
    var oneChar = msgVal.charAt(loop);
    if ( escape(oneChar).length > 4              ) { bytesLen += 2; }
    else if ( oneChar != '\r' || oneChar != '\n' ) { bytesLen++;    }

    if ( bytesLen <= pBytesLimit ) 
    {
      curMsgLen = loop + 1;
      curBytesLen = bytesLen;
    }
  }

  if ( bytesLen > pBytesLimit )
  {
    alert("더이상 입력하실 수 없습니다. 초과된 글은 삭제합니다.");
    pObj.value = msgVal.substr(0, curMsgLen);    // 초과 입력시 초과된 만큼 잘라줌
    realLen = curBytesLen;
  }
  else
  {
    realLen = bytesLen;
  }

  toGetElementById(pTarget).innerText = realLen;
}

//---------------------------------------------------------------------------------------
// 함수명 : contentReSize
// 기  능 : 
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function contentReSize(pType)
{
  frm = document.getElementById('reply');
  switch(pType)
  {
    case "+" : frm.style.pixelHeight += 50;                                      break;
    case "-" : if( frm.style.pixelHeight > 82 ) { frm.style.pixelHeight -= 50; } break;
  }
}

//---------------------------------------------------------------------------------------
// 함수명 : getCookie
// 기  능 : 쿠키값취득
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function getCookie(pName) 
{
  var flag = document.cookie.indexOf(pName+'=');
  if (flag != -1) 
  {
    flag += pName.length + 1
    end = document.cookie.indexOf(';', flag)

    if (end == -1) { end = document.cookie.length; }
    return unescape(document.cookie.substring(flag, end))
  }
}

//---------------------------------------------------------------------------------------
// 함수명 : setCookie
// 기  능 : 쿠키값저장
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function setCookie(pName, pValue, pExpire) 
{
  var today     = new Date();
  var expireday = new Date(today.getTime() + pExpire);
  document.cookie = pName + "=" + escape(pValue)+ "; path=/; expires=" + expireday.toGMTString() + ";";
}

//---------------------------------------------------------------------------------------
// 함수명 : autoLink
// 기  능 : 페이지내의 오토링크걸기
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function autoLink(pId) 
{
  var container = document.getElementById(pId);
  var doc       = container.innerHTML;
  var regURL    = new RegExp("(http|https|ftp|telnet|news|irc)://([-/.a-zA-Z0-9_~#%$?&=:200-377()]+)","gi");
  var regEmail  = new RegExp("([xA1-xFEa-z0-9_-]+@[xA1-xFEa-z0-9-]+.[a-z0-9-]+)","gi");
  container.innerHTML = doc.replace(regURL,"<a href='$1://$2' target='_blank'>$1://$2</a>").replace(regEmail,"<a href='mailto:$1'>$1</a>");
}

//---------------------------------------------------------------------------------------
// 함수명 : newWindow
// 기  능 : 가운데창
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function newWindow( pPage, pName, pW, pH, pTool, pScroll )
{
  var winl = (screen.width-pW)/2;
  var wint = (screen.height-pH)/2;
  var settings  = 'height='+pH+',';
      settings += 'width='+pW+',';
      settings += 'top='+wint+',';
      settings += 'left='+winl+',';
      settings += 'toolbar='+pTool+',';
      settings += 'scrollbars='+pScroll+',';
      settings += 'resizable=no';
  win = window.open(pPage,pName,settings);
  if ( parseInt(navigator.appVersion) >= 4 )
  {
    win.window.focus(); 
  }
}
//---------------------------------------------------------------------------------------
// 함수명 : newWindow2
// 기  능 : 구석창
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function newWindow2( pPage, pName, pW, pH, pL, pTool, pScroll )
{
  var settings  = 'height='+pH+',';
      settings += 'width='+pW+',';
      settings += 'top=0,';
      settings += 'left='+pL+',';
      settings += 'toolbar='+pTool+',';
      settings += 'scrollbars='+pScroll+',';
      settings += 'resizable=no';
  win = window.open(pPage,pName,settings);
  if( parseInt(navigator.appVersion) >= 4 )
  {
    win.window.focus();
  }
}
//---------------------------------------------------------------------------------------
// 함수명 : newWindow3
// 기  능 : 위치지정창
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function newWindow3( pPage, pName, pWidth, pHeight, pTop, pLeft, pTool, pScroll )
{
  var settings  = 'height='+pHeight+',';
      settings += 'width='+pWidth+',';
      settings += 'top='+pTop+',';
      settings += 'left='+pLeft+',';
      settings += 'toolbar='+pTool+',';
      settings += 'scrollbars='+pScroll+',';
      settings += 'resizable=no';
  win = window.open(pPage,pName,settings);
  if ( parseInt(navigator.appVersion) >= 4 )
  {
    win.window.focus();
  }
}

//---------------------------------------------------------------------------------------
// 함수명 : disableKeys
// 기  능 : 
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function disableKeys()
{
  if( (event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82)) || 
      (event.keyCode >= 112 && event.keyCode <= 123) )
  {
    event.keyCode = 0;
    event.cancelBubble = true;
    event.returnValue  = false;
  }
}

//---------------------------------------------------------------------------------------
// 함수명 : checkKeys
// 기  능 : 숫자만 입력
// 작성일 : 2009-07-07 이성준
// 참  조 : 대,소문자 입력불가
// --------------------------------------------------------------------------------------
function checkKeys() 
{
  if(( event.keyCode >= 97 && event.keyCode <= 122) || (event.keyCode >=65 && event.keyCode <=90))
  {
    event.keyCode=0;
  }
}

//---------------------------------------------------------------------------------------
// 함수명 : listToggle
// 기  능 : 리스트 체크박스 체크
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function listToggle(pForm)
{
  for (var loop=0; loop<pForm.elements.length; loop++)
  {
    var e = pForm.elements[loop];

    if (e.type == "checkbox" & e.disabled == false)
    {
      if(e.checked != true) { e.checked = "checked"; } 
      else                  { e.checked = "";        }
    }
  }
}

//---------------------------------------------------------------------------------------
// 함수명 : listDisabled
// 기  능 : 활성화설정
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function listDisabled(pForm)
{
  for (var loop=0; loop<pForm.elements.length; loop++)
  {
    var e = pForm.elements[loop];

    if (e.type == "checkbox" & e.value != '0')
    {
      if (e.disabled != true) { e.disabled = "disabled"; } 
      else                    { e.disabled = "";         }
    }
  }
}

//---------------------------------------------------------------------------------------
// 함수명 : resetAll
// 기  능 : Form value값 리셋
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function resetAll(pForm)
{
  for(var loop=0; loop<pForm.elements.length; loop++)
  {
    pForm.elements[loop].value ='';
  }
}

//---------------------------------------------------------------------------------------
// 함수명 : checkComma
// 기  능 : 실시간 입력창에 콤마 찍기
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function checkComma(pObj) 
{
  var num = pObj.value;
  if (pObj.value.length >= 3) 
  {
    re  = /^$|,/g;
    num = num.replace(re, "");
    fl  = "";
    if ( isNaN(num) ) { alert("문자는 사용할 수 없습니다."); return 0; }  // 숫자형이 아닌경우
    if ( num == 0 ) { return num; }                                       // 0인경우
    if ( num < 0  ) { num = num * (-1); fl = "-"; } // 음수확인
    else            { num = num * 1;              }

    num = new String(num);

    var temp    = "";
    var co      = 3;
    var num_len = num.length;
    while ( num_len > 0 )
    {
      num_len = num_len - co;
      if ( num_len < 0 ) { co = num_len + co; num_len=0; }
      temp = "," + num.substr(num_len,co) + temp;
    }
    pObj.value = fl + temp.substr(1);
  }
}

//---------------------------------------------------------------------------------------
// 함수명 : OutComma
// 기  능 : 숫자컴마빼기
// 작성일 : 2009-07-07 이성준
// 참  조 : pStr : 문자열
// --------------------------------------------------------------------------------------
function OutComma(pStr)
{
    commStr   = String(pStr);
    uncommStr = '';

    for( loop=0; loop<commStr.length; loop++ )
    {
        substr = commStr.substring(loop,loop+1);
        if( substr != ',' ) { uncommStr += substr; }
    }

    return uncommStr;
}

//---------------------------------------------------------------------------------------
// 함수명 : InComma
// 기  능 : 숫자컴마넣기
// 작성일 : 2009-07-07 이성준
// 참  조 : pStr : 문자열
// --------------------------------------------------------------------------------------
function InComma(pStr)
{
  uncomm_str = String(OutComma(pStr));
  comm_str   = '';
  var minus  = '';    // 마이너스확인

  if ( '-' == uncomm_str.charAt(0) )
  {
    uncomm_str = uncomm_str.substring(1,uncomm_str.length);
    minus = '-';
  }

  loop_j = uncomm_str.length - 3;

  for( loop=loop_j; loop>=1 ; loop=loop-3 )
  {
    comm_str=','+uncomm_str.substring(loop,loop+3)+comm_str;
  }

  comm_str = uncomm_str.substring(0,loop+3)+comm_str;

  return minus+""+comm_str;
}

//---------------------------------------------------------------------------------------
// 함수명 : checkElement
// 기  능 : 체크박스 체크
// 작성일 : 2009-07-07 이성준
// 참  조 : pName : 엘리먼트명
// --------------------------------------------------------------------------------------
function checkElement( pName ) 
{
  var obj = document.getElementById(pName);
  if ( obj.checked == true ) { obj.checked = false; } 
  else                       { obj.checked = true;  }
}
//---------------------------------------------------------------------------------------
// 함수명 : checkRadio
// 기  능 : 라디오버튼 체크
// 작성일 : 2009-07-07 이성준
// 참  조 : pObj : 라벨Obj
//          라벨의 명칭은 __ 로 구분(예:이름__번호)
// --------------------------------------------------------------------------------------
function checkRadio( pObj,pColor) 
{
  var label_id = pObj.id;

  var tmp = label_id.split("__");
  $("label[id^="+tmp[0]+"__]").css({'background':''}); // 그룹라벨 배경을 지움
  
  if ( "nocolor" != pColor )
  {
    $("#"+label_id).css({'background':'#CCFF00'}); // 해당라벨의 배경색변경
  }

  $("#"+label_id+" > input[type:radio]").click();
}

//---------------------------------------------------------------------------------------
// 함수명 : clipCopy
// 기  능 : 클립보드 복사
// 작성일 : 2009-07-07 이성준
// 참  조 : pName : 엘리먼트명
//          pEl   : 
// --------------------------------------------------------------------------------------
function clipCopy(pName, pEl)
{
  var doc = document.body.createTextRange();
  doc.moveToElementText(document.all(pEl));
  doc.select();
  doc.execCommand('copy');
  alert("'"+pName+"'가(이) 복사 되었습니다.\n\n원하는곳에 '붙여넣기' 나 'Ctrl + v' 하세요.");
}

//---------------------------------------------------------------------------------------
// 함수명 : overClass
// 기  능 : 
// 작성일 : 2009-07-07 이성준
// 참  조 : pEl : 
// --------------------------------------------------------------------------------------
function overClass(pEl)
{
  var pattern = /(_on)$/;
  var code    = pEl.className;
  var tag     = "_on";

  if( pattern.test(code) == true )
  {
    code = code.replace(tag, "");
    pEl.className = code;
  } 
  else
  {
    pEl.className = code+"_on";
  }
}

//---------------------------------------------------------------------------------------
// 함수명 : textBoxEnlarge
// 기  능 : Textarea 크기조절
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function textBoxEnlarge( pBox, pWidth, pHeight )
{
  var boxobj = document.getElementById(pBox);
  var bw     = boxobj.style.width  ? parseInt(boxobj.style.width)  : pWidth;
  var bh     = boxobj.style.height ? parseInt(boxobj.style.height) : pHeight;
  boxobj.style.height = bh + 200;

  if( bw >= 800 )
  {
    boxobj.style.width  = pWidth;
    boxobj.style.height = pHeight;
  }
  else if ( bh > 400 ) 
  {
    boxobj.style.width=800;
  }
}

//---------------------------------------------------------------------------------------
// 함수명 : textBoxEnlarge2
// 기  능 : 
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function textBoxEnlarge2( pBox, pHeight )
{
  var boxobj = document.getElementById(pBox);
  var bh     = boxobj.style.height ? parseInt(boxobj.style.height) : pHeight;
  boxobj.style.height = (bh < 200) ? 200 : pHeight;
}

//---------------------------------------------------------------------------------------
// 함수명 : setPng24
// 기  능 : Png이미지 6.0 버전 이하
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function setPng24(pObj) 
{
  pObj.width        = pObj.height = 1;
  pObj.className    = pObj.className.replace(/\bpng24\b/i,'');
  pObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ pObj.src +"',sizingMethod='image');";
  pObj.src='about:blank;';
  return '';
}

//---------------------------------------------------------------------------------------
// 함수명 : insertOrigin
// 기  능 : 카피할때 출처 삽입하기
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function insertOrigin(pTitle, pForm, pUrl) 
{
  if (window.event) 
  {
    window.event.returnValue = true;
    __insert_origin_title__  = pTitle;
    __insert_origin_url__    = pUrl;
    __insert_origin_from__   = pForm;
    window.setTimeout("_procInsertOrigin()", 25);
  }
}

//---------------------------------------------------------------------------------------
// 함수명 : _procInsertOrigin
// 기  능 : 
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function _procInsertOrigin()
{
  if (window.clipboardData) 
  {
    var obj       = document.frames["hdFrame"].document.body;
    var rng       = obj.createTextRange();
    var printFrom = '';
    if ( __insert_origin_from__ != "" ) 
    {
      printFrom = " from " + __insert_origin_from__;
    }
    var footerHTML = "<p style='margin:15px 0 0 0;'>";
    footerHTML    += "<a href='"+ __insert_origin_url__ +"' target='_new' title='제목 부분을 클릭하면\n원 게시물을 볼 수 있습니다.'>[출처] "+ __insert_origin_title__ + printFrom;
    footerHTML    += "</a></p>";
    rng.execCommand("Paste");
    obj.insertAdjacentHTML("BeforeEnd",  footerHTML);
    rng = obj.createTextRange();
    rng.execCommand("SelectAll");
    rng.execCommand("Cut");
  }
}
//---------------------------------------------------------------------------------------
// 함수명 : gf_BodyHelpKbn
// 기  능 : 본문상단의 도움말 내용을 토글해서 표시
// 작성일 : 2009-07-07 이성준
// 참  조 : 
// --------------------------------------------------------------------------------------
function gf_BodyHelpKbn() 
{
  if ( "inline" == document.getElementById('bodyHelp').style.display ) { document.getElementById('bodyHelp').style.display = "none";   }
  else                                                                 { document.getElementById('bodyHelp').style.display = "inline"; }
}
// --------------------------------------------------------------------------------------
// 모달창 오픈
// --------------------------------------------------------------------------------------
function gf_ModelMsg( pUrl, pParam, pW, pH, pScroll ) 
{
  var settings  ='dialogWidth='+pW+'px;';
  settings +='dialogHeight='+pH+'px;';
  settings +='center=yes;';
  settings +='screenTop=yes;';
  settings +='scroll='+pScroll+';';
  settings +='status=no;';
  settings +='help=no;';
  showModalDialog( pUrl, pParam, settings );
}
