var SESSIONID_APPLET="20fcb85b-7e3e-4890-ab22-94e3afdef6dd";

var is_current = 0;

function login_error_handler(msg,mascot_file_num)
{
  is_current = 0;
  var args = new Array();
  var winTitle = "Á¢¼Ó¿¡ ½ÇÆÐÇß½À´Ï´Ù.";
  var from = '';

  if ( document.fo_login.from.value == "" || document.fo_login.from.value == "sayclub" ) from = 'sayclub';
  else from = 'pmang';

  msg = msg.replace(/TAGLEFT;/g,"<");

  args["msg"]       = msg;
  args["icon"]      = "<img src='"+getSSLResourceURL("http://file.sayclub.co.kr/images/img_common_error.gif")+"'>";
  args["winTitle"]  = winTitle;
  args["btnTitle"]  = "È®ÀÎ";
  args["btnWidth"]  = "70";
  args["btnLink"]  = "javascript:yessir();";


  if (from == "sayclub")
  {
    if ('shotonline.sayclub.com' == document.location.hostname)
    {
        SayDialog = window.showModalDialog("http://www.sayclub.com/global/SayModalPop.nwz?moduleID=www&title="+winTitle+"&from="+from, args, "dialogWidth:360px; dialogHeight:240px; edge:sunken; center:yes; resizable:no; status:no; help:no; scroll:no;");
    }
    else
      openAlert("common", winTitle, msg);
    if (typeof(loginLayer) == "object" && typeof(loginLayer.handleFail) == "function")
        loginLayer.handleFail();
  }
  else if (from == "pmang")
  {
    SayDialog = window.showModalDialog("http://"+document.location.hostname+"/global/SayModalPop.nwz?moduleID=www&title="+winTitle+"&from="+from, args, "dialogWidth:360px; dialogHeight:240px; edge:sunken; center:yes; resizable:no; status:no; help:no; scroll:no;");
  }
  else
    SayDialog = window.showModalDialog(getSSLURL("http://"+document.location.hostname+"/global/SayModalPop.nwz?")+"moduleID=www&title="+winTitle+"&from="+from, args, "dialogWidth:360px; dialogHeight:240px; edge:sunken; center:yes; resizable:no; status:no; help:no; scroll:no;");

  showloginform();
}

function multilogin_handler(usrid,killmeurl)
{
  is_current = 1;

  if ( document.fo_login.from.value == "" || document.fo_login.from.value == "sayclub" ) from = 'sayclub';
  else from = 'pmang';
  var args = new Array();
  var winTitle = "ÀÌ¹Ì Á¢¼ÓÇØÀÖ½À´Ï´Ù.";

  if( document.fo_login.from.value == "NC" || document.fo_login.from.value == "CY" )
  {
    args["msg"]       = usrid+"´ÔÀº ÀÌ¹Ì Á¦ÈÞ¼­ºñ½º¿¡ Á¢¼ÓÇØÀÖ½À´Ï´Ù.<br>Á¦ÈÞ ¼­ºñ½º´Â µ¿ÀÏ °èÁ¤À¸·Î ¿©·¯ PC¿¡¼­ Á¢¼ÓÇÒ ¼ö ¾ø½À´Ï´Ù.<br><br>±âÁ¸ Á¢¼ÓÀ» Á¾·áÇÏ½Ã°Ú½À´Ï±î?";
    args["icon"]      = "<img src='"+getSSLResourceURL("http://file.sayclub.co.kr/images/img_common_error.gif")+"'>";
    args["winTitle"]  = winTitle;
    args["btnTitle"]  = "±âÁ¸ Á¢¼Ó Á¾·á";
    args["btnWidth"]  = "110";
    args["btnImage"]  = "<img src='"+getSSLResourceURL("http://file.sayclub.co.kr/images/incredible/member/button/btn_disconnect.gif")+"' border=0>";
    args["btnLink"]   = killmeurl + ";javascript:window.returnValue=1;window.close();";
    //args["btnLink"]  = killmeurl;
  }
  else
  {
    args["msg"]       = usrid+"´ÔÀº ÀÌ¹Ì ¼¼ÀÌÅ¬·´¿¡ Á¢¼ÓÇØÀÖ½À´Ï´Ù.";
    args["icon"]      = "<img src='"+getSSLResourceURL("http://file.sayclub.co.kr/images/img_common_error.gif")+"'>";
    args["winTitle"]  = winTitle;
    args["btnTitle"]  = "±âÁ¸ Á¢¼Ó Á¾·á";
    args["btnWidth"]  = "110";
    args["btnImage"]  = "<img src='"+getSSLResourceURL("http://file.sayclub.co.kr/images/incredible/member/button/btn_disconnect.gif")+"' border=0>";
    args["btnLink"]   = killmeurl + ";javascript:window.returnValue=1;window.close();";
    //args["btnLink"]  = killmeurl;
  }

  if (!isSSLRequest()) // !sso
  {
    args["btn2Title"]  = "´Ù½Ã ·Î±×ÀÎ";
    args["btn2Width"]  = "110";
    args["btn2Link"]  = "javascript:window.returnValue=0;window.close();";
    args["btn2Image"] = "<img src='"+getSSLResourceURL("http://file.sayclub.co.kr/images/incredible/member/button/btn_relogin.gif")+"' border=0>";
    args["result"] = "MULTILOGIN";
  }

  if ('shotonline.sayclub.com' == document.location.hostname)
  {
    SayDialog = window.showModalDialog(getSSLURL("http://www.sayclub.com/global/SayModalPop.nwz?")+"moduleID=www&title="+winTitle+"&from="+from, args, "dialogWidth:360px; dialogHeight:255px; edge:sunken; center:yes; resizable:no; status:no; help:no; scroll:no;");
  }
  else
    SayDialog = window.showModalDialog(getSSLURL("http://"+document.location.hostname+"/global/SayModalPop.nwz?")+"moduleID=www&title="+winTitle+"&from="+from, args, "dialogWidth:360px; dialogHeight:255px; edge:sunken; center:yes; resizable:no; status:no; help:no; scroll:no;");

  if (1==SayDialog)
    try_login(usrid);
  else
    showloginform();
}

function login_handler2( result )
{
  result = SayControl.codec( 50, result, "" );
  if (typeof(progressid) != 'undefined' && progressid)
  {
    clearTimeout(progressid);
    progressid = '';
  }
  eval(result);
}

var saycontrol_upgraded=0;

function upgrade_saycontrol()
{
  if(saycontrol_upgraded)return;
  if(typeof(document.SayControlHelper)=="undefined")return;
  if(typeof(document.SayControlHelper.sessionversion)=="undefined")return;

  if(document.SayControlHelper.sessionversion>=sayctl_version)return;

  if(document.SayControlHelper.externalmethod("install",SESSIONID_APPLET,0,0,"Á¢¼Ó ÇÁ·Î±×·¥ ¾÷±×·¹ÀÌµå"))
  {
    saycontrol_upgraded=1;
  }
}

///////////////////
function login_message_handler(msg,mascot_file_num, loginform, result)
{
  if ( document.fo_login.from.value == "" || document.fo_login.from.value == "sayclub" ) from = 'sayclub';
  else from = 'pmang';
  var args = new Array();
  var winTitle = "·Î±×ÀÎ ¾È³»";

  args["msg"]       = msg;
  args["icon"]      = "<img src='"+getSSLResourceURL("http://file.sayclub.co.kr/images/img_common_error.gif")+"'>";
  args["winTitle"]  = winTitle;
  args["btnTitle"]  = "È®ÀÎ";
  args["btnWidth"]  = "70";
  args["btnLink"]  = "javascript:yessir();";

  if (result)
  {
    args["result"] = result;
    _height = 255;
  }
  else
    _height = 240;

  if (from == "sayclub")
  {
    if ('shotonline.sayclub.com' == document.location.hostname)
    {
        SayDialog = window.showModalDialog("http://www.sayclub.com/global/SayModalPop.nwz?moduleID=www&title="+winTitle+"&from="+from, args, "dialogWidth:360px; dialogHeight:240px; edge:sunken; center:yes; resizable:no; status:no; help:no; scroll:no;");
    }
    else
      openAlert("common", winTitle, msg);
    if (typeof(loginLayer) == "object" && typeof(loginLayer.handleFail) == "function")
      loginLayer.handleFail();
  }
  else
    SayDialog = window.showModalDialog(getSSLURL("http://"+document.location.hostname+"/global/SayModalPop.nwz?")+"moduleID=www&title="+winTitle+"&from="+from, args, "dialogWidth:360px; dialogHeight:"+_height+"px; edge:sunken; center:yes; resizable:no; status:no; help:no; scroll:no;");

 if(loginform == 1)showloginform();
}
////////////////////////

function login_handler_sayr(result)
{
  login_handler(result);
}

var progressid = '';
function login_handler(result,key,ip,port,cip,macaddress,uuid,gwmacaddress,mac2)
{
  if(result=="currentalready")
  {
    try {
      if (document.fo_login.from.value == "sayclub")
        login_message_handler("´Ù¸¥ ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯ Ã¢¿¡<br> ÇØ´ç ¾ÆÀÌµð·Î ÀÌ¹Ì ·Î±×ÀÎ ÁßÀÔ´Ï´Ù.","02",1, result);
      else if (document.fo_login.from.value == "NC" || document.fo_login.from.value == "CY")
      {
        login_message_handler("<center>´Ù¸¥ ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯ Ã¢¿¡¼­<br> ÇØ´ç ¾ÆÀÌµð·Î Á¦ÈÞ ¼­ºñ½º¸¦ ÀÌ¿ë ÁßÀÔ´Ï´Ù.</center>","02",1, result);
        switch ( document.fo_login.from.value )
        {
          case "CY" : document.location = 'http://www.cyworld.com'; break;
          default : document.location = 'http://www.plaync.co.kr'; break;
        }
      }
      else
        login_message_handler("<center>´Ù¸¥ ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯ Ã¢¿¡<br> ÇØ´ç ¾ÆÀÌµð·Î ÀÌ¹Ì ·Î±×ÀÎ ÁßÀÔ´Ï´Ù.</center>","02",1, result);

      if (document.fo_login.conntype[2].checked) // if paran sso (partner»ç Ãß°¡½Ã ¼öÁ¤ÇÊ¿ä)
        document.location = 'http://pmang.sayclub.com';
    }catch(e){}

    return;
  }

  if(result=="anotheralready")
  {
    login_message_handler("Á¢¼Ó ¿À·ùÀÔ´Ï´Ù.","05",1);
    return;
  }

  if(result=="dualconnected")
  {
    if(typeof(post_login_script) != 'undefined')
    {
      eval(post_login_script);
    }

    if ('shotonline.sayclub.com' == document.location.hostname)
            pageurl = document.fo_login.pageurl.value;

    if(pageurl.indexOf('istachy=1') < 0 )
    {
      if (pageurl.indexOf("?") < 0)
        pageurl += "?istachy=1";
      else
        pageurl += "&istachy=1";
    }

    window.open(pageurl,"_top");
    return;
  }

  if(result=="abused")
  {
    login_message_handler("ÀÌ PC´Â Æú¸®½º¿¡ ÀÇÇØ ÀÏ½Ã Á¢¼ÓÀÌ Á¦ÇÑµË´Ï´Ù.<br>Àá½Ã ÈÄ(ÃÖÀå 30ºÐ) ´Ù½Ã Á¢¼ÓÀ» ½ÃµµÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.","05",1);
    return;
  }

  if(result=="excessconnect")
  {
    if( document.fo_login.from.value == "NC" || document.fo_login.from.value == "CY")
    {
      login_message_handler("Á¦ÈÞ¼­ºñ½º´Â µ¿ÀÏ PC¿¡¼­ ´Ù¼öÀÇ ¾ÆÀÌµð·Î ÀÌ¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.","05",1, result);
      switch ( document.fo_login.from.value )
      {
        case "CY" : document.location = 'http://www.cyworld.com'; break;
        default : document.location = 'http://www.plaync.co.kr'; break;
      }
    }
    else
      login_message_handler("µ¿ÀÏÇÑ PC¿¡¼­ ´Ù¼öÀÇ ¾ÆÀÌµð·Î µ¿½Ã¿¡ ·Î±×ÀÎ ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.","05",1, result);
    return;
  }

	if(result == "push_login_invalid_handle" || result == "push_login_not_idle" || result == "push_login_fail_irc_connect") {
		login_message_handler("¼¼ÀÌÅ¬·´¿¡ Á¢¼ÓÁßÀÎ ¾ÆÀÌµð¸¦ ·Î±×¾Æ¿ô ÇÏ½Å ÈÄ<br>ÀÌ¿ëÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.", "05", 1);
		return;
	}
	
  if(result!="connected")
  {
    if (result != "notreg")
    {
      login_message_handler("¾Ë¼ö ¾ø´Â ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù.","05",1);
      doGo();
      return;
    }
  }

  var login_host = "www.sayclub.com";
  switch ( document.fo_login.from.value )
  {
    case "pmang" : login_host = "pmang.sayclub.com"; break;
    case "NC" : login_host = "slugger.plaync.co.kr"; break;
    case "CY" : login_host = "debut.game.cyworld.com"; break;
  }
  var login_url = "http://"+login_host+"/global/login.nwz";

  var bSSO = false;
  var bSecureConnect = false;

  if(typeof(document.fo_login.conntype)!="undefined")
  {
    if (typeof(document.fo_login.conntype.length)!="undefined")
    {
      if (document.fo_login.conntype.length >= 3 && document.fo_login.conntype[2].checked && document.fo_login.conntype[2].value == 3)
        bSSO = true;

      if( (document.fo_login.conntype[1].checked && document.fo_login.conntype[1].value == 2) || bSSO )
        bSecureConnect = true;
    }
    else
    {
      if (document.fo_login.conntype.value == 3)
        bSSO = true;

      if( (document.fo_login.conntype.checked && document.fo_login.conntype.value == 2) || bSSO )
        bSecureConnect = true;
    }
  }

  if (bSecureConnect)
    login_url="https://secure.sayclub.com/global/login.nwz";

  if(typeof(loginfromjukeon)=="undefined" || !loginfromjukeon)
    progressid = setTimeout("showloginprogress()", 3500);

  var temp = typeof(document.fo_login.admin_index);
  if (temp == "undefined" || temp == "unknown")
    admin_index = 0;
  else
    admin_index = document.fo_login.admin_index.value;

  postdata
      ="usrid="+SayControl.codec(0,document.fo_login.usrid.value,"")
      +"&passwd="+SayControl.codec(0,document.fo_login.passwd.value,"")
      +"&pageurl="+SayControl.codec(0,document.fo_login.pageurl.value,"")
      +"&from="+SayControl.codec(0,document.fo_login.from.value,"")
      +"&key="+key
      +"&myip="+ip
      +"&myport="+port
      +"&admin_index="+admin_index
      +"&clientip="+cip
      +"&macaddress="+macaddress
      +"&gwmacaddress="+gwmacaddress
      +"&uuid="+uuid
      +"&mac2="+mac2
      +"&page_domain="+document.domain
      +"&is_current="+is_current
      +"&page_gameid="+document.location.hostname.split( "." )[0]
      ;

  if(typeof(document.fo_login.inpath) == "undefined") postdata += "&inpath=";
  else postdata += "&inpath=" + document.fo_login.inpath.value;

  if (typeof(document.fo_login.iscapslock) == "object")
      postdata += "&iscapslock="+SayControl.codec(0,document.fo_login.iscapslock.value,"")
      ;

  if (bSSO)
  {
    postdata += "&sso="+(bSSO ? '1' : '0');
    postdata += "&channel_userid="+SayControl.codec(0,document.fo_login.from_user_id.value,"");
    postdata += "&channel_id="+SayControl.codec(0,document.fo_login.from_site.value,"");
    postdata += "&channel_srl="+SayControl.codec(0,document.fo_login.from_msrl.value,"");
    postdata += "&chkey="+SayControl.codec(0,document.fo_login.chkey.value,"");
    postdata += "&fingerprint="+SayControl.codec(0,document.fo_login.fingerprint.value,"");
    postdata += "&timestamp="+SayControl.codec(0,document.fo_login.timestamp.value,"");
  }

  if( eval("document.fo_login.popupurl") != null ) postdata += "&popupurl="+document.fo_login.popupurl.value;
  if( eval("document.fo_login.popupoption") != null ) postdata += "&popupoption="+document.fo_login.popupoption.value;
  if(typeof(loginfromjukeon)!="undefined"&&loginfromjukeon)
  {
    if(typeof(JukeonAX)!="object" || JukeonAX.readyState!=4)
    {
      login_message_handler("ÁêÅ©¿Â ÄÁÆ®·Ñ¿¡¼­ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù.", 05, 1);
      return;
    }

    var jukecookieinfo=JukeonAX.getaxvalue("JukCInfo_"+document.fo_login.usrid.value);
    postdata += "&JukeonConnectionInfo="+jukecookieinfo;
  }
  SayControl.executeHTTP( login_url, postdata, "login_handler2", "" );
}

function saycontrol_error()
{
    is_current = 0;
    var from;
    if(document.fo_login)
      from = document.fo_login.from.value;
    else
      from = "";

    if(document.fo_login)
      target_url = document.fo_login.pageurl.value;
    else
      target_url = "";

    if( document.location.hostname.indexOf( "pmang.sayclub.com" ) >= 0 && from != "pmang" )
    {
      document.location.href = "http://www.sayclub.com/install_control.nwz?from="+from+"&target_url="+encodeURI(target_url);
    }
    else if( document.location.hostname.indexOf( "pmang.sayclub.com" ) >= 0 || from == "pmang" )
    {
      var origin_url = target_url;
      document.location.href = "http://www.sayclub.com/install_control.nwz?origin="+origin_url+"&from="+from;
    }
    else if( document.location.hostname.indexOf( "sayclub.com" ) >= 0 )
    {
      var origin_url = escape('http://www.sayclub.com');
      document.location.href = "http://www.sayclub.com/install_control.nwz?origin="+origin_url+"&from="+from+"&target_url="+encodeURI(target_url);
    }
    else
    {
      var origin_url = escape('http://'+document.location.hostname);
      document.location.href = "http://www.sayclub.com/install_control.nwz?origin="+origin_url+"&from="+from;
    }
/*
    var args = new Array();
    var winTitle = "Á¢¼Ó ÇÁ·Î±×·¥ ¼³Ä¡ ¿À·ù";
    args["winTitle"]  = winTitle;
    SayDialog = window.showModalDialog("http://www.sayclub.com/global/SayInstallModalPopup.nwz", args, "dialogWidth:405px; dialogHeight:455px; edge:sunken; center:yes; resizable:no; status:no; help:no; scroll:no;");
    showloginform();

    if(SayDialog == "install")
    {
      window.open('http://dl.sayclub.com/sayclub/sayctl/install.EXE','_Top','width=1,height=1');
    }

*/

 return;

///////////////////

  content=
    "<br>"+
    "<table width=100% border=0 cellpadding=0 cellspacing=0>"+
    "<tr>"+
      "<td>"+
        "<table width=100% border=0 cellpadding=0 cellspacing=0>"+
          "<tr>"+
            "<td width=25></td>"+
            "<td valign=top><img src='http://file.sayclub.co.kr/images/img_common_error.gif'></td>"+
            "<td width=25></td>"+
            "<td align=left>"+
            "Á¢¼Ó ÇÁ·Î±×·¥ ¼³Ä¡¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù.<br>"+
            "¾È³»¿¡ µû¶ó Á¢¼Ó ÇÁ·Î±×·¥À» ¼³Ä¡ÇÏ½Ã°í"+
            "´Ù½Ã Á¢¼ÓÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.<br>"+
            "</td>"+
            "<td width=10></td>"+
          "</tr>"+
        "</table>"+
      "</td>"+
    "</tr>"+
    "<tr height=20><td></td></tr>"+
    "<tr>"+
      "<td>"+
        "<table width=100% border=0 cellpadding=0 cellspacing=0>"+
          "<tr>"+
            "<td width=25></td>"+
            "<td align=left>"+
              "¾Æ·¡ ¼³Ä¡ÇÏ±â ´ÜÃß¸¦ ´©¸¥ ÈÄ Ç¥½ÃµÇ´Â ´ëÈ­Ã¢¿¡¼­,<br>"+
              "<font style='text-decoration:underline'>ÇöÀç À§Ä¡¿¡¼­ ÇÁ·Î±×·¥ ½ÇÇà</font>À» ¼±ÅÃÇÏ½Ê½Ã¿À.<br>"+
            "</td>"+
          "</tr>"+
        "</table>"+
      "</td>"+
    "</tr>"+
    "<tr height=20><td></td></tr>"+
    "<tr>"+
      "<td align=center>"+
        "<img src='http://file.sayclub.co.kr/images/tiffany/sayax/howto.gif'>"+
      "</td>"+
    "</tr>"+
    "<tr height=10><td></td></tr>"+
    "</table>";

  SayMessageBox(1,"Á¢¼Ó ÇÁ·Î±×·¥ ¼³Ä¡ ¿À·ù",content,"¼³Ä¡ÇÏ±â",sayctl_download,80,-1,-2,360,355)
}

function doGo()
{
  switch( document.fo_login.from.value )
  {
    case "DAUM" : document.location.href = "http://game.daum.net"; break;
    case "CY" : document.location.href = "http://www.cyworld.com"; break;
    case "NC" : document.location.href = "http://www.plaync.co.kr"; break;
    case "BUGS" : document.location.href = "http://music.bugs.co.kr/chart/saycast/radio"; break
  }
}

var cntRetry = 0;
function try_login(usrid)
{
  if(typeof(SayControl.sessionversion)=="undefined")
    saycontrol_error();

  if (cntRetry > 10)
    saycontrol_error();

  if(SayControl.readyState!=4)
  {
    if ("undefinded" != typeof(usrid) && "unknown" != typeof(usrid))
    {
      var cmd = "try_login('"+usrid+"')";
      setTimeout(cmd,100);
      cntRetry++;
    }
    return 0;
  }


  sessiontype=typeof(SayControl.sessionversion);

  
  if(sessiontype!="undefined")
  {
    if(usrid.search(/[¤¡-¤¾|¤¿-¤Ó|°¡-Èþ]/) != -1)
    {
      login_message_handler("µî·ÏµÇÁö ¾ÊÀº »ç¿ëÀÚ ÀÔ´Ï´Ù. <br>Á¤È®ÇÑ ¿µ¹®¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.","05",1);
      return;
    }

    usrid = usrid.replace(/\s/g, '');
    set_saycontrol(document.SayControl);
    var err = SayControl.login(usrid,usrid);
    if(err == -44 )
    {
      login_message_handler("µ¿ÀÏÇÑ PC¿¡¼­ ´Ù¼öÀÇ ¾ÆÀÌµð·Î µ¿½Ã¿¡ ·Î±×ÀÎ ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.(44)","05",1);
      doGo();
    }
    else if(err <= 0)
    {
      login_message_handler("·Î±×ÀÎ ÄÁÆ®·Ñ¿¡¼­ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù.<br>¿¡·¯ÄÚµå: " + (-err),"05",1);
      doGo();
    }
  }
  else
  {
    saycontrol_error();
  }
}

function enable_saycontrol()
{
  span=document.frames["span_sayctl"];
  if(typeof(span)=="undefined")
  {
    document.body.insertAdjacentHTML("afterBegin",'<span id="span_sayctl" style="display:none"></span>');
  }

  span=document.frames["span_sayctl"];
  span.innerHTML='';
  var text='<object id=SayControl name=SayControl classid="clsid:'+sayctl_classid+'" codebase="'+getSSLResourceURL(sayctl_codebase)+'"></object>';
  span.innerHTML=text;
}

function start_login(usrid)
{
  upgrade_saycontrol();
  enable_saycontrol();
/*
  if ( isOverXPSP2() )
  {
    if ( try_login(usrid) == 0 )
      saycontrol_error();
  }
  else
  */
    try_login(usrid);
}

function fo_finish (IsKbd)
{
  if(IsKbd && event)
    event.returnValue = false;

  if (0 == document.fo_login.usrid.value.length || 0 == document.fo_login.passwd.value.length)
  {
    if (typeof(loginLayer) == "object" && typeof(loginLayer.handleFocus) == "function")
      loginLayer.handleFocus();
    else
      document.fo_login.usrid.focus();

    login_message_handler("¾ÆÀÌµð¿Í ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.","02",0);
    return;
  }

//  showloginprepare();
  document.fo_login.passwd.disabled=true;
  document.fo_login.usrid.disabled=true;

//  setTimeout("start_login()",1000);
  start_login(document.fo_login.usrid.value);
}

function ssl_window()
{
  var wndNew;
  wndNew = window.open ('http://www.sayclub.com/ssl_message.nwz',
      'ssl_window',
      'width=560,height=450,toolbar=no,location=no');
  if (wndNew)
    wndNew.focus();
}

function showloginform()
{
  if(typeof(document.fo_login) != 'undefined' &&
     (typeof(loginfromjukeon) == "undefined" || !loginfromjukeon))
  {
    if( typeof(document.fo_login.usrid) != 'undefined' &&
        document.fo_login.usrid.type != 'hidden')
    {
      if (typeof(GlobalPage) != "undefined")
        GlobalPage.style.display="";
      if (typeof(LoginPage) != "undefined")
        LoginPage.style.display="none";
      if (typeof(idTbl_MainBanner) != "undefined")
        idTbl_MainBanner.style.display = "";

      document.fo_login.passwd.disabled=false;
      document.fo_login.usrid.disabled=false;
      document.fo_login.passwd.value="";
      document.fo_login.usrid.select();
      if (typeof(loginLayer) == "object" && typeof(loginLayer.handleFocus) == "function")
        loginLayer.handleFocus();
      else
        document.fo_login.usrid.focus();
    }
    else if(window.open_login_page) // °³º°È¨ÇÇ¿¡¼­ ·Î±×ÀÎ ÇÏ´Â ºÎºÐÀ» À§ÇØ
    {
      open_login_page();
    }
  }
  else
  {
    if(loginfromjukeon)
      document.location.href = document.fo_login.pageurl.value;
    else
      document.location.href = pageurl;
  }
}

function showloginprepare()
{
  /*
  document.fo_login.passwd.disabled=true;
  document.fo_login.usrid.disabled=true;
  return;
  */
  if (typeof(LoginPage) != "undefined")
  {
    LoginPage.innerHTML=
    '<table border=0 cellpadding=0 cellspacing=0 width=100% height=400 class="bd">'+
    '<tr height=40%><td></td></tr>'+

      '<tr height=17>'+
        '<td align=center colspan=2>'+
          '<font class="ttl">Ready...</font><br>'+
        '</td>'+
      '</tr>'+
      '<tr height=15>'+
        '<td>'+
        '</td>'+
      '</tr>'+
      '<tr height=40><td></td></tr>'+
      '<tr height=80>'+
        '<td></td>'+
      '</tr>'+

    '<tr height=60%><td></td></tr>'+
    '</table>';
  }

  if (typeof(GlobalPage) != "undefined")
    GlobalPage.style.display="none";
  if (typeof(LoginPage) != "undefined")
    LoginPage.style.display="";
  if (typeof(idTbl_MainBanner) != "undefined")
    idTbl_MainBanner.style.display = "none";
}

function showloginprogress()
{
  //return;
  if (typeof(LoginPage) != "undefined")
  {
    LoginPage.innerHTML=
    '<table border=0 cellpadding=0 cellspacing=0 width=100% height=400 class="bd">'+
    '<tr height=40%><td></td></tr>'+

      '<tr height=17>'+
        '<td align=center colspan=2>'+
          '<font class="ttl">Connecting...</font><br>'+
        '</td>'+
      '</tr>'+
      '<tr height=15>'+
        '<td align=center colspan=2>'+
          '<img src="' + getSSLResourceURL('http://file.sayclub.co.kr/images/img_progress.gif') + '" width=220 height=12>'+
        '</td>'+
      '</tr>'+
      '<tr height=40><td></td></tr>'+
      '<tr height=80>'+
        '<td align=right width=44%><img src="' + getSSLResourceURL('http://file.sayclub.co.kr/images/lock.gif') +'"></td>'+
        '<td align=left valign=center width=66%><font color=gray><b>¿À´Ãµµ ºñ¹Ð¹øÈ£ Á¶½É~, ¶Ç Á¶½É!</b></font></td>'+
      '</tr>'+

    '<tr height=60%><td></td></tr>'+
    '</table>';
  }

  if (typeof(GlobalPage) != "undefined")
    GlobalPage.style.display="none";
  if (typeof(LoginPage) != "undefined")
    LoginPage.style.display="";
  if (typeof(idTbl_MainBanner) != "undefined")
    idTbl_MainBanner.style.display = "none";
}


