﻿function libCommon_getFlash(swfName,wt,ht,id,xmlUrl)
{
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+wt+'" height="'+ht+'" id="'+id+'">');
  document.write('<param name="movie" value="'+swfName+'?xml_url='+xmlUrl+'">');
  document.write('<param name="quality" value="high">');
  document.write('<param name="wmode" value="transparent">');
  document.write('<param name="allowScriptAccess" value="always">');
  document.write('<embed src="'+swfName+'?xml_url='+xmlUrl+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" width="'+wt+'" height="'+ht+'" allowScriptAccess="sameDomain" id="'+id+'"></embed></object>');
}


//------------------------------------------------------------------------------
// 로그인 레이어 창 보여줌
//------------------------------------------------------------------------------
function libCommon_showLoginBox()
{
  document.getElementById('popLoginWrap_bg').style.display='inline';
  document.getElementById('popLoginWrap_bg').style.height = document.body.scrollHeight + 59;
  document.getElementById('popLoginWrap_bg').style.width = document.body.scrollWidth;
  document.getElementById('popLogInWrap').style.display='inline';
  document.frmLogin.user_id.focus();
}


//------------------------------------------------------------------------------
// 로그인 레이어 창 숨김
//------------------------------------------------------------------------------
function libCommon_hideLoginBox()
{
  document.getElementById('popLoginWrap_bg').style.display='none';
  document.getElementById('popLoginWrap_bg').style.height = 0;
  document.getElementById('popLoginWrap_bg').style.width = 0;
  document.getElementById('popLogInWrap').style.display='none';  
}


//------------------------------------------------------------------------------
// 로그인
//------------------------------------------------------------------------------
function libCommon_fLogin()
{
  // 13 : 엔터쳤을때
  // 0  : 마우스로 로그인버튼 클릭했을때
  if(event.keyCode != 13 && event.keyCode != 0) return;

  var oForm = document.frmLogin;

  if(oForm.user_id.value == "")
  {
    alert("아이디를 입력하여 주십시요");
    oForm.user_id.focus();
    return;
  }

  if(oForm.user_pw.value == "")
  {
    alert("비밀번호를 입력하여 주십시요");
    oForm.user_pw.focus();
    return;
  }

  oForm.submit();
}


//------------------------------------------------------------------------------
// 팝업창을 뛰운다.
//------------------------------------------------------------------------------
function libCommon_gfPopupWin(sUrl, sTitle, iWidth, iHeight, iTop, iLeft, sScrollYN)
{
  var lsWinOption;
  sTitle = sTitle.replace(" ", "_");

  if(sScrollYN == "Y")
     lsWinOption = "width=" + iWidth + ", height=" + iHeight + ", scrollbars=yes";
  else
     lsWinOption = "width=" + iWidth + ", height=" + iHeight;

  lsWinOption += " toolbar=no,directories=no,status=no,menubar=no,location=no,resizable=no,left=" + iLeft + ",top=" + iTop;
  var loNewWin = window.open(sUrl, sTitle, lsWinOption);
  loNewWin.focus();
}
