// ¼¼ÀÌÅ¬·´, ÇÇ¸ÁÀº IE 5.0 ÀÌ»ó¿¡¼­ µ¿ÀÛÇÕ´Ï´Ù.


//---- OBSOLETE CODES (ÀÌÁ¦´Â »ç¿ëÇÏÁö ¾Ê´Â ÄÚµåµé) {{{------------------------

is_mn_wnd = true;
function global_pointer() {}

//---- OBSOLETE CODES (ÀÌÁ¦´Â »ç¿ëÇÏÁö ¾Ê´Â ÄÚµåµé) }}}------------------------


//---- ÆäÀÌÁö ½ÃÀÛ½Ã ½ÇÇàÇØ¾ß ÇÒ ½ºÅ©¸³Æ® {{{----------------------------------

document.writeln ("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html;charset=euc-kr\">");

// ÄíÅ° »ç¿ëºÒ°¡½Ã ¸Þ½ÃÁö Ãâ·Â
// ºÐ·ù : COMMON / CHECK
if('undefined'==typeof(window.dialogArguments) && !navigator.cookieEnabled)
{
  if(confirm("ÄíÅ° ¼³Á¤ÀÌ µÇ¾î ÀÖÁö ¾Ê½À´Ï´Ù.\nÄíÅ° ¼³Á¤ ¾øÀÌ´Â ¼¼ÀÌÅ¬·´ »ç¿ëÀÌ ºÒ°¡´ÉÇÕ´Ï´Ù.\nÄíÅ° ¼³Á¤ µµ¿ò¸»À» º¸½Ã°Ú½À´Ï±î?"))
  {
    idx = (navigator.appVersion.indexOf("MSIE"));
    if (idx > -1)
      IEV = parseInt(navigator.appVersion.substr(idx+4));
    if (IEV<=4)
      document.location.href = 'http://www.sayclub.com/cookie/cookie_ie4.nwz';
    else
      document.location.href = 'http://www.sayclub.com/cookie/cookie_ie5.nwz';
  }
}

// µµ¸ÞÀÎÀ» ¼³Á¤ÇÑ´Ù.
// ºÐ·ù : COMMON / CONFIG
//document.domain = (matched = document.location.hostname.match(/[^.]+\.(?:com|co\.kr)$/)) ? matched[0] : 'sayclub.com';  // IE6 ÀÌ»ó¿¡¼­¸¸ µ¿ÀÛ
//document.domain = document.location.hostname.slice(document.location.hostname.lastIndexOf('.', document.location.hostname.lastIndexOf('.')-1) + 1); // sayclub.com, paran.com °¡Á¤
function setDomainCookie( name, value, expire )
{
  var ExpDate = new Date();
  ExpDate.setDate(ExpDate.getDate() + expire);
  document.cookie = name + "=" + escape(value) + "; path=; domain="+document.domain+"; expires=" + ExpDate.toGMTString() + ";"
}

function getDomainCookie( name )
{
  var nameOfCookie = name + "=";
  var x = 0;
  while ( x <= document.cookie.length )
  {
    var y = (x+nameOfCookie.length);
    if ( document.cookie.substring( x, y ) == nameOfCookie )
    {
      if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
        endOfCookie = document.cookie.length;
      return unescape( document.cookie.substring( y, endOfCookie ) );
    }
    x = document.cookie.indexOf( " ", x ) + 1;
    if ( x == 0 )
      break;
  }
  return "";
}

function setDocuementDomain()
{
  var arrhostname = document.location.hostname.split( "." );
  if( arrhostname[arrhostname.length-1].length>2 ) document.domain = arrhostname[arrhostname.length-2] + "." + arrhostname[arrhostname.length-1];
  else document.domain = arrhostname[arrhostname.length-3] + "." + arrhostname[arrhostname.length-2] + "." + arrhostname[arrhostname.length-1];

  var arrpath = document.location.pathname.split( "/" );
  /* : ÀÏ´Ü ¾Æ·¡ Á¦ÇÑ °ÅÀÇ ÇÊ¿ä¾øÀ» µí ÇÏ¹Ç·Î, ´Ù Ç®¾î¹ö¸².
  if(
    /* µµ¸ÞÀÎ º¯°æ ½Ã, ÃÖÃÊ À¯ÀÔÀ» ±âÁØÀ¸·Î µµ¸ÞÀÎ °¡¿ë ¹üÀ§¸¦ ÇÑÁ¤ÇÔ.
     * ´Ü, »ç¿ëÀÚ È¯°æ »óÀÇ ÀÌÀ¯·Î, ºñ·Î±×ÀÎ ½Ã¿¡µµ µ¹·Áº¸³»¾ßÇÒ °­Á¦ÀûÀÎ ÀÌÀ¯´Â ¾ø±â¿¡, Ã³¸®ÇÏÁö ¾ÊÀ½.
     * /
    false &&
    document.domain != "sayclub.com" &&
    getDomainCookie( '__CHANNEL_DOMAIN' ) != document.domain
  )
  {
    // document.location.href = "http://"+document.location.hostname + "/?" + document.location.pathname.substring(1) + document.location.search;
  }
  else if( // Ã¤³Î¸µ È£½º°¡ Á¢±ÙÇÏ¸é ¾ÈµÇ´Â 1Â÷ directory ¸ñ·Ï ¹× ÆÄÀÏ : °­¼º Á¦ÇÑÀÌ ¾Æ´Ï¸é, ÆÄÅ·ÆäÀÌÁö·Î ÀÌµ¿.
    document.domain != "sayclub.com" &&
    arrpath.length>2 &&
    arrpath[1] != arrhostname[0] && // ÃÖÃÊ À¯ÀÔ °ÔÀÓ°ú ÇöÀç °ÔÀÓÀÌ ´Ù¸¥ °÷¿¡ À§Ä¡ÇÏ¸é µ¹·Áº¸³¿ : ÆÛºí¸®½Ì °ÔÀÓ Á¢±Ù Á¦ÇÑ.
    true
    // °ø¿ë ºÎºÐ Á¢±Ù Á¦ÇÑ ; ÀÏ´Ü ¿¬´Ù
    // arrpath[1] != "gamepub" &&  arrpath[1]!="promotion" && arrpath[1]!="event" && arrpath[2]!="event" &&
    // arrpath[1]!="police" && arrpath[1]!="report" && arrpath[1]!="poll" && arrpath[1]!="poll" && arrpath[1]!="guild" && arrpath[1]!="board" && arrpath[1]!="admin" && arrpath[1]!="global" && arrpath[1]!="channel"
    /* gamepub w3c vipcoupon tpl report promotion police poll otp money lib how gunbang guild gmcall admin board bokpc channel clientmall coupon diffpics event * /
  ) document.location.href = "http://"+ arrpath[1] + "." + document.domain + "/?" + document.location.pathname.substring(1) + document.location.search;
  else
  {
    // setDomainCookie( '__CHANNEL_HOST',  document.location.hostname, 1 );
    setDomainCookie( '__CHANNEL_HISTORY_2',  getDomainCookie( '__CHANNEL_HISTORY' ), 1 );
    setDomainCookie( '__CHANNEL_HISTORY',  document.location, 1 );
  }
  */
  setDomainCookie( '__CHANNEL_HISTORY_2',  getDomainCookie( '__CHANNEL_HISTORY' ), 1 );
  setDomainCookie( '__CHANNEL_HISTORY',  document.location, 1 );
}

function redirectDocumentDomain()
{
  // plaync ¿¡¼­ sayclub.comÀ¸·Î °¬À» °æ¿ì, µµ¸ÞÀÎÀÌ ´Þ¶ó __CHANNEL_HOST °ªÀ» ¸ð¸§
  if( getDomainCookie( 'CHANNEL_SSID' )!="sayclub.com" ) // Ã¤³Î¸µ ¼³Á¤ÀÌ µÇ¾î ÀÖ´Â °æ¿ì ÇØ´ç ¼­ºñ½ºÀÇ ¸ÞÀÎÀ¸·Î º¸³¿.
    document.location.href = "http://"+getDomainCookie( 'CHANNEL_GID' )+"."+getDomainCookie( 'CHANNEL_SSID' );
  else if( document.location.hostname == "pmang.sayclub.com" )
    document.location.href = "http://"+document.location.hostname+"/channel_deny.nwz";
    // document.location.href = "http://"+document.location.hostname + "/logout.nwz?pageurl="+urlencode( "http://"+document.location.hostname + "/" + document.location.pathname.substring(1) );
  else // ³ª¸ÓÁö´Â ¼¼ÀÌÅ¬·´ ¼­ºñ½º µî
    document.location.href = "http://pmang.sayclub.com/channel_deny.nwz";
    // document.location.href = "http://pmang.sayclub.com/logout.nwz?pageurl="+urlencode( "http://"+document.location.hostname );
}
setDocuementDomain();

// ³×ºñ°ÔÀÌÅÍ ¹× ¹öÀüÀ» Ã¼Å©ÇÑ´Ù.
// ºÐ·ù : COMMON / CHECK
IE_Version = new Number(((window.navigator.appVersion.split('; '))[1].split(' '))[1]);

// ---- ÇÔ¼ö Á¤ÀÇ {{{----------------------------------------------------------

// ¹öÀüÀÌ À©µµ¿ìÁî XP ¼­ºñ½ºÆÑ 2 ÀÌ»óÀÎÁö ¿©ºÎ¸¦ ¹ÝÈ¯ÇÑ´Ù.
// ºÐ·ù : COMMON
function OnQuit_SayClub()/*{{{*/
{
  alert("¼­¹ö¿ÍÀÇ Á¢¼ÓÀÌ ²÷¾îÁ³½À´Ï´Ù.");
}/*}}}*/

// ¹öÀüÀÌ À©µµ¿ìÁî XP ¼­ºñ½ºÆÑ 2 ÀÌ»óÀÎÁö ¿©ºÎ¸¦ ¹ÝÈ¯ÇÑ´Ù.
// ºÐ·ù : COMMON
//
// appVersion Example
// 4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
function isOverXPSP2()/*{{{*/
{
  var strVerStr = window.navigator.appVersion;
  var arrVerStr = strVerStr.split('; ');
  if (arrVerStr.length >= 4)
  {
    // arrOsVer Example
    // Windows NT 5.1
    var arrOsVer = arrVerStr[2].split(' ');
    if (arrOsVer.length >= 3 && arrOsVer[0] == "Windows")
    {
      var osVerNum = new Number(arrOsVer[2]);
      // »õ·Î¿î Windows Version ³ª¿Ã¶§ ¼öÁ¤ÇÊ¿ä
      if (osVerNum >= 5.1 && strVerStr.indexOf("SV1") >= 35 )
        return true;
    }
  }
  return false;
}/*}}}*/

// È¨ÇÇ ¼³Ä¡ÇÁ·Î±×·¥ ¼³Ä¡ ¿À·ù Ã¢ ¶ç¿ì±â
// ºÐ·ù : HOMPY / ERROR
function error_hompyax()/*{{{*/
{
  var args = new Array();

  var winTitle = "È¨ÇÇ ÇÁ·Î±×·¥ ¼³Ä¡ ¿À·ù";

  args["winTitle"]  = winTitle;
  HompyInstallDialog = window.showModalDialog("http://www.sayclub.com/global/HompyInstallModalPopup.nwz", args, "dialogWidth:405px; dialogHeight:455px; edge:sunken; center:yes; resizable:no; status:no; help:no; scroll:no;");

  // ¸ð´Þ´ÙÀÌ¾ó·Î±×ÀÇ ¸®ÅÏ¹ë·ù°¡ installÀÌ¸é ¼³Ä¡
  if (HompyInstallDialog == "install")
  {
    // ¾Æ·¡ urlÀº ¹Ù²ð¿¹Á¤
    window.open("http://dl.sayclub.com/sayclub/sayctl/imginst.EXE", "_Top", "width=1, height=1");
  }

  // ÀÌºÎºÐ¿¡¼­´Â ´Ù½Ã ÆäÀÌÁö¸¦ reloadÇÏ´ø°¡ redirectÇÏ´ø°¡ ÇØ¾ßµÊ.
  history.back();
}/*}}}*/

// ·Î±×¾Æ¿ô ÆäÀÌÁö·Î ÀÌµ¿ÇÑ´Ù.
// ºÐ·ù : COMMON / LOGOUT
//
// ÇÇ¸Á ÆäÀÌÁö¿¡¼­´Â ÇÇ¸Á ·Î±×¾Æ¿ô ÆäÀÌÁö·Î ÀÌµ¿ÇÑ´Ù.
function Logout_SayClub()/*{{{*/
{
  if (document.location.hostname == 'pmang.sayclub.com' ||
      document.location.hostname == 'neohelp.sayclub.com')
    window.open("http://pmang.sayclub.com/logout.nwz", "_top");
  else
    window.open("http://www.sayclub.com/logout.nwz", "_top");

  return;
}/*}}}*/

function OnLogout_SayClub()
{

}

function OnLogoutByForce_SayClub()
{
	//openAlert("", "·Î±×¾Æ¿ô", "¼¼ÀÌÅ¬·´ Á¢¼Ó ÁßÀÌ´ø<br/>" + USRID + "°¡ ·Î±×¾Æ¿ô µÇ¾ú½À´Ï´Ù.", 300, 150);
	document.location.reload();
}

String.prototype.URLEncode = function URLEncode()
{
  var SAFECHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.!~*()";
  var HEX = "0123456789ABCDEF";
  var plaintext = this;
  var encoded = "";
  for( var i=0; i<plaintext.length; i++ )
  {
    var ch = plaintext.charAt(i);
    if( ch==" " ){
      encoded += "+";
    } else if( SAFECHARS.indexOf(ch)!=-1 ) {
      encoded += ch;
    } else {
      var charCode = ch.charCodeAt(0);
      if( charCode>255 ){
        // alert("Unicode Character '"+ch+"' cannot be encoded using standard URL encoding... use 1 byte chars");
        encoded += "+";
      } else {
        encoded += "%";
        encoded += HEX.charAt( (charCode>>4) & 0xF );
        encoded += HEX.charAt( charCode & 0xF );
      }
    }
  }
  return encoded;
}

function Logout_Pubgame( url )/*{{{*/
{
  window.open("http://"+document.location.hostname+"/logout.nwz?pageurl="+url.URLEncode(), "_top");
  return;
}/*}}}*/

// ·Î±×¾Æ¿ô ÆäÀÌÁö·Î ÀÌµ¿ÇÑ´Ù. (È¨ÇÇ¿ë)
// ºÐ·ù : HOMPY / LOGOUT
function Logout_Hompy(targetmsrl)/*{{{*/
{
  window.open("http://hompy.sayclub.com/hp_logout.nwz?targetmsrl="+targetmsrl, "_top");
  return;
}/*}}}*/

// ·Î±×¾Æ¿ô ÆäÀÌÁö·Î ÀÌµ¿ÇÑ´Ù. (ÆÛºí¸®½Ì°ÔÀÓ)
// ºÐ·ù : HOMPY / LOGOUT
function Logout_PubGame(ssn)/*{{{*/
{
  window.open("http://pmang.sayclub.com/pub_logout.nwz?ssn="+ssn, "_top");
  return;
}/*}}}*/

// URL À» ÀÎÄÚµùÇÑ´Ù.
// ºÐ·ù : COMMON / URL
//
// don't trust these urlencode/urldecode functions.
// ' ', '/' ¹®ÀÚ¸¦ °¢°¢ '+', '%2F' ·Î º¯È¯ÇÑ´Ù.
function urlencode(url)/*{{{*/
{
  var strurl = escape(url.replace(/ /g, "+"));
  return strurl.replace(/\//g, "%2F");
}/*}}}*/

// URL À» µðÄÚµùÇÑ´Ù.
// ºÐ·ù : COMMON / URL
//
// don't trust these urlencode/urldecode functions.
// '+', '%2F' ¹®ÀÚ¸¦ °¢°¢ ' ', '/' ·Î º¯È¯ÇÑ´Ù.
function urldecode(url)/*{{{*/
{
  var strurl = unescape(url.replace(/\+/g, " "));
  return strurl.replace(/%2F/g, "\/");
}/*}}}*/

// ¾ÆÀÌµð, ºñ¹Ð¹øÈ£ ºÐ½Ç Ã¢À» ¶ç¿î´Ù.
// ºÐ·ù : MEMBERSHIP / WINDOW
function passwd_window()/*{{{*/
{
  var wndNew = window.open(ssl_request_url("https://www.sayclub.com/forget_passwd.nwz"), "passwd_window", "width=400, height=275, toolbar=no, location=no");

  if (wndNew)
    wndNew.focus();
}/*}}}*/

// ÀÇ¹Ì¾ø´Â ÀÎ¼ö¸¦ ¸¸µé¾î¼­ ¹ÝÈ¯ÇÑ´Ù.
// ºÐ·ù : COMMON
//
// URL ÀÌ Ä³½¬µÇÁö ¾Êµµ·Ï °¡Â¥ ÀÎ¼ö¸¦ ¸¸µé¾î³»´Âµ¥ »ç¿ëÇÑ´Ù.
function gura_arg()/*{{{*/
{
  t = new Date();
  return t.getTime();
}/*}}}*/


/*******************************************************************************
 ***** À©µµ¿ì ÀÌº¥Æ® °ü·Ã ÇÔ¼öµé *************************** ´ã´ç : ½ÅÁ¾ÈÆ *****
 ******************************************************************************/

// Onload ÀÌº¥Æ®¿¡ »ç¿ëÇÏ´Â ¹è¿­
// ºÐ·ù : COMMON / EVENT
if ("undefined" == typeof(WINDOW_ONLOAD_HANDLE_LIST))
  var WINDOW_ONLOAD_HANDLE_LIST = new Array();

// OnLoad ÀÌº¥Æ®¸¦ µî·ÏÇÑ´Ù.
// ºÐ·ù : COMMON / EVENT
// INCLUDE : WINDOW_ONLOAD_HANDLE_LIST
//
// priority ´Â 0 ºÎÅÍ 9 ±îÁö »ç¿ë °¡´ÉÇÏ´Ù.
function addOnloadHandle(eval_str, priority)/*{{{*/
{
  if ("undefined" == typeof(priority) || priority < 0)
  {
    if ("undefined" == typeof(WINDOW_ONLOAD_HANDLE_LIST[9]))
      WINDOW_ONLOAD_HANDLE_LIST[9] = new Array();
    //WINDOW_ONLOAD_HANDLE_LIST[9].push(eval_str);
    WINDOW_ONLOAD_HANDLE_LIST[9][WINDOW_ONLOAD_HANDLE_LIST[9].length] = eval_str;
    return;
  }
  if ("undefined" == typeof(WINDOW_ONLOAD_HANDLE_LIST[priority]))
    WINDOW_ONLOAD_HANDLE_LIST[priority] = new Array();
  //WINDOW_ONLOAD_HANDLE_LIST[priority].push(eval_str);
  WINDOW_ONLOAD_HANDLE_LIST[priority][WINDOW_ONLOAD_HANDLE_LIST[priority].length] = eval_str;
}/*}}}*/

// Onload ÀÌº¥Æ®¸¦ ½ÇÇàÇÑ´Ù.
// ºÐ·ù : COMMON / EVENT
// INCLUDE : WINDOW_ONLOAD_HANDLE_LIST
function execOnloadHandle()/*{{{*/
{
  for (var i=0; i<=9; i++)
  {
    if (typeof(WINDOW_ONLOAD_HANDLE_LIST[i]) == "undefined")
      continue;

    for (var j in WINDOW_ONLOAD_HANDLE_LIST[i])
      eval(WINDOW_ONLOAD_HANDLE_LIST[i][j]);
  }
}/*}}}*/


/*******************************************************************************
 ***** ÀÌÀü GNB È£È¯À» À§ÇÑ ÇÔ¼öµé ************************* ´ã´ç : ½ÅÁ¾ÈÆ *****
 ******************************************************************************/

var objectForClipping = new Array();
var oTableForClipping = new Array();

function addIFrameForClipping(frameName, tableName)/*{{{*/
{
  var count = objectForClipping.length;
  objectForClipping[count] = frameName;
  oTableForClipping[count] = tableName;
}/*}}}*/

// Onresize ÀÌº¥Æ®¿¡ »ç¿ëÇÏ´Â ¹è¿­
// ºÐ·ù : COMMON / EVENT
var WINDOW_ONRESIZE_HANDLE_LIST = new Array();

// Onresize ÀÌº¥Æ®¸¦ µî·ÏÇÑ´Ù.
// ºÐ·ù : COMMON / EVENT
// INCLUDE : WINDOW_ONRESIZE_HANDLE_LIST
function addOnresizeHandle(eval_str)/*{{{*/
{
  //WINDOW_ONRESIZE_HANDLE_LIST.push(eval_str);
  WINDOW_ONRESIZE_HANDLE_LIST[WINDOW_ONRESIZE_HANDLE_LIST.length] = eval_str;
}/*}}}*/

// Onresize ÀÌº¥Æ®¸¦ ½ÇÇàÇÑ´Ù.
// ºÐ·ù : COMMON / EVENT
// INCLUDE : WINDOW_ONRESIZE_HANDLE_LIST
function execOnresizeHandle()/*{{{*/
{
  for (var i in WINDOW_ONRESIZE_HANDLE_LIST)
    eval(WINDOW_ONRESIZE_HANDLE_LIST[i]);
}/*}}}*/

function tachy_go_handler(a)/*{{{*/
{
  eval(AppletSession.codec(50,a,''));
}/*}}}*/

function tachy_go(url,target,options)/*{{{*/
{
  if (url.indexOf("http://tachy.sayclub.com/join")>=0)
    AppletSession.executeHTTP(url,'','tachy_go_handler','');
  else
  {
    if(urldecode(url).indexOf("http://hompy.sayclub.com/hompy.nwz?targetid=") >0)
    {
        hompy_win = window.open(url, '_hompy', options);
        try{ hompy_win.focus(); }catch(Exception){}
    }
    else
      window.open(url,target,options);
  }
}/*}}}*/

var error_reported = false;
function error_handle (msg, url, line)/*{{{*/
{
/*
  var query;
  var s;
  query = "msg="+escape(msg);
  query = query+ "&url="+escape(url);
  query = query+ "&line="+line;
  query = query+ "&cookieenabled="+escape(navigator.cookieEnabled.toString());
  query = query+ "&userlanguage="+escape(navigator.userLanguage.toString());
  query = query+ "&appversion="+escape(navigator.appVersion);

  s = "";
  s += ScriptEngine() + " Version ";
  s += ScriptEngineMajorVersion() + ".";
  s += ScriptEngineMinorVersion() + ".";
  s += ScriptEngineBuildVersion();
  query = query+ "&engversion="+escape(s);

  if (typeof(error_handle.caller) == "function")
    query = query+ "&caller="+escape(error_handle.caller.toString().substring(0,512));
  else
    query = query+ "&caller=(global)";
  if (!error_reported)
  {
    result = virtualGET('http://www.sayclub.com/global/js_error_report.nwz?'+query);
    error_reported = true;
  }
*/
  return true;
}/*}}}*/

if ("undefined" == typeof(POST_JS_ERROR))
  window.onerror = error_handle;

function window_name (name1, name2)/*{{{*/
{
  var fname = "";
  var name0 = escape("_say"+"_"+name1+"_"+name2);
  for (i=0; i<name0.length; i++) {
    if (name0.charAt(i)=='%' || name0.charAt(i)=='/')
      fname += "_";
    else
      fname += name0.charAt (i);
  }
  return fname;
}/*}}}*/

function html_my_name (name1, name2)/*{{{*/
{
  if (window.name!="sc_body")
    window.name = window_name(name1,name2);
}/*}}}*/

function open_game_top_win( url , name , w , h , scroll , resize , type )/*{{{*/
{
  var oWnd = window.open(url, name, "scrollbars="+scroll+",resizable="+resize+",width="+w+",height="+h);
  try{ oWnd.focus(); }catch(Exception){}
  return set_game_top_window( oWnd , type );
} /*}}}*/

function pmangModalDialog( url , param , width , height )/*{{{*/
{
  var args = new Array();

  //°ÔÀÓ ½ÇÇàÁßÀÏ¶§ ÀÚ½ÅÀÌ ÀÔÀåÇÒ ¼ö ¾ø´Â ·¹º§ÀÇ ¹æ¿¡¼­ ÃÊ´ë°¡ ¿À´Â °æ¿ì¿¡
  //¸ð´ÞÃ¢ÀÌ ¶ß°ÔµÇ¸é IE À§¿¡ ¶ß°Ô µÇ¾î Ã¢ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ¾ø´Â °æ¿ì°¡ ¹ß»ýÇÏ´Â ºÎºÐ¿¡ ´ëÇÑ Ã³¸®
  clsid= "2729A0B7-23AD-48a9-9FBE-56452FE63D1C";
  if(AppletSession.externalmethod("isrunning", clsid, 0,0,""))
  {
    open_game_top_win( url, '_pmang_pop', width, height, "no","no",0 );
  }
  else
  {
    var ret = window.showModalDialog( url , args , "dialogWidth:"+width+"px; dialogHeight:"+height+"px; edge:sunken; center:yes; resizable:no; status:no; help:no; scroll:no;");

    switch( ret )
    {
      case 1  :  //È®ÀÎ ¹öÆ°
        window.close();
        break;
      default  :
        break;
    }
  }
  return;
}/*}}}*/

function get_screen_center(w, h)/*{{{*/
{
  var sleft = parseInt((screen.width/2) - (w/2)) - 6;
  var stop = parseInt((screen.height/2) - (h/2)) - 30;
  sleft = (sleft < 0 ? 0 : sleft);
  stop = (stop < 0 ? 0 : stop);

  return "top=" + stop + ", left=" + sleft;
}/*}}}*/

function open_win (url, name, w, h)/*{{{*/
{
  var vleft;
  var vtop;
  vleft = (screen.width - w)/2;
  vtop = (screen.height - h)/2-150;
  var oWin = window.open(url, name, "scrollbars=no,resizable=yes,width="+w+",height="+h+", top="+vtop+", left="+vleft );
  try{ oWin.focus(); }catch(Exception){}
}/*}}}*/

function open_win_position (url, name, w, h, x, y)/*{{{*/
{
  var oWin = window.open(url, name, "scrollbars=no,resizable=yes,width="+w+",height="+h+", top="+x+", left="+y );
  try{ oWin.focus(); }catch(Exception){}
}/*}}}*/

function open_win_scroll (url, name, w, h)/*{{{*/
{
  var oWin = window.open(url, name, "scrollbars=yes,resizable=yes,width="+w+",height="+h);
  try{ oWin.focus(); }catch(Exception){}
}/*}}}*/
function open_win_noresizable (url, name, w, h, scenter)/*{{{*/
{
  var strPos = "";
  if (scenter)
    strPos = ", " + get_screen_center(w, h);

  var oWin = window.open(url, name, "scrollbars=no,resizable=no,width="+w+",height="+h+strPos);
  try{ oWin.focus(); }catch(Exception){}
}/*}}}*/
function open_win_ret (url, name, w, h)/*{{{*/
{
  var oWin = window.open(url, name, "scrollbars=no,resizable=yes,width="+w+",height="+h);
  try{ oWin.focus(); }catch(Exception){}
  return oWin;
}/*}}}*/
function open_window (url, name, extra)/*{{{*/
{
  var oWin = window.open(url, name, extra);
  try{ oWin.focus(); }catch(Exception){}
}/*}}}*/

function nrbOpenItemBuyWin()/*{{{*/
{
  open_win('http://saymall.sayclub.com/saymall_buy_product.nwz?&saleinfo_id=362805','coupon',436,480)
}/*}}}*/

function open_nrbchatwin(opentype, rinfo) // NORAEBANG/*{{{*/
{
  var winname = 'nrbwin';
  var chkvarname = 'nrbWinID';
  var chkpage = 'http://saychatting.sayclub.com/noraeting/nrb_chkload.nwz?wintype=C';
  var options = 'width=790,height=600,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0';

  var oldwin = findWindow('nrbwin', options, '', chkvarname);
  if(oldwin != null)
  {
    oldwin.focus();
    return;
  }

  if( opentype == 'makeroom' )
  {
    var options = 'width=590,height=314,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0';
    window.open(chkpage+rinfo+'&gourl='+escape('http://saychatting.sayclub.com/noraeting/nrb_mkroom.nwz'),winname,options);
  }
  else if( opentype == 'joinroom' )
  {
    window.open(chkpage+'&gourl='+escape(rinfo),winname,options);
  }
}/*}}}*/

function open_nrbselfwin(searchstr)/*{{{*/
{
  var winname = 'nrbwin';
  var chkvarname = 'nrbWinID';
  var options = 'width=790,height=398,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0';
  var chkpage = 'http://saychatting.sayclub.com/noraeting/nrb_chkload.nwz?wintype=S';

  var oldwin = findWindow('nrbwin', options, '', chkvarname);
  if(oldwin != null)
  {
          oldwin.focus();
          return;
  }

  window.open(chkpage+searchstr,winname,options);
}/*}}}*/

function open_nrbselfwin_play(searchstr)/*{{{*/
{
  var winname = 'nrbwin';
  var chkvarname = 'nrbWinID';
  var options = 'width=790,height=398,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0';
  var chkpage = 'http://saychatting.sayclub.com/noraeting/nrb_chkload.nwz?wintype=S&play=true';

  var oldwin = findWindow('nrbwin', options, '', chkvarname);
  if(oldwin != null)
  {
          oldwin.focus();
          return;
  }

  if (typeof(searchstr) == 'undefined') searchstr = '';
  var nrbwin =window.open(chkpage+searchstr,winname,options);
}/*}}}*/

function findWindow(wname, options, framename, chkvariable) // frame is ''(no frame) or frame_name/*{{{*/
{
  var chkwin = window.open('',wname, options);
  try
  {
    if( framename == '' || framename == null )
    {
      if( eval("chkwin."+chkvariable) != null )
        return chkwin;
    }
    else
    {
      if( eval("chkwin."+framename) != null)
      {
        if( eval("chkwin."+framename+"."+chkvariable) != null )
          return chkwin;
      }
    }
    return null;
  }catch(Exception){ return null; }
}/*}}}*/

function opener_open(ssn, url) //µî±ÞÆÇ¸Å¿Í ¸®ÇÊ Ã¢À» °ÔÀÓ È¨¿¡¼­¶ç¿ö ÁÖ±â À§ÇØ/*{{{*/
{
  timeover = 500;
  setTimeout("opener_open_time("+ssn+", '"+url+"')", timeover);
}/*}}}*/

function opener_open_time(ssn, url) //µî±ÞÆÇ¸Å¿Í ¸®ÇÊ Ã¢À» °ÔÀÓ È¨¿¡¼­¶ç¿ö ÁÖ±â À§ÇØ ½Ã°£ °É¾î¼­/*{{{*/
{
  open_win('http://pmang.sayclub.com/'+url+'?ssn='+ssn,'_refill',450,150);
}/*}}}*/

function open_talk(target)/*{{{*/
{
  var dt = new Date();
  var talkwin = open_win("http://saychatting.sayclub.com/chat/neotalk.nwz?targetid="+target+"&guraarg="+gura_arg(), 'talk_'+dt.getTime(), 500, 500);
}/*}}}*/

function connect_ting_client(type,msrl,userid,nickname)/*{{{*/
{
  if(type=='c') // Ã¤ÆÃ
  {
    open_talk(userid);
  }
  else if(type=='k') // ÄôÄôÆÃ
  {
    url = "http://saychatting.sayclub.com/kkting/kkting_connect_game.nwz?tmsrl="+msrl+"&tusrid="+userid+"&tnick="+nickname;
    open_win(url,'_go_game',450,300);

  }
  else if(type=='s') // ½ºÄðÆÃ
  {
    url = "http://saychatting.sayclub.com/schoolting/schoolting_connect_game.nwz?tmsrl="+msrl+"&tusrid="+userid+"&tnick="+nickname;
    open_win(url,'_go_game',400,300);
  }
  else if(type=='n') // ³ë·¡ÆÃ
  {
    open_nrbchatwin('makeroom', '&autoinvitemsrl='+msrl);
  }
}/*}}}*/

function findWindow4Frame(wname, options, framename, chkvariable)/*{{{*/
{
  var chkwin = window.open('',wname, options);//'fullscreen=no,resizable=yes,menubar=no,toolbar=no,scrollbars=no,width=222,height=380'
  try
  {
    if( eval("chkwin."+framename) != null)
    {
      if( eval("chkwin."+framename+"."+chkvariable) != null )
        return chkwin;
    }
    return null;
  }catch(Exception){ return null; }
}/*}}}*/

var tmpCapsLock = false;

function checkCapsLock(e)/*{{{*/
{
  var myKeyCode=0;
  var myShiftKey=false;

  if ( document.all )
  {
    myKeyCode=e.keyCode;
    myShiftKey=e.shiftKey;
  }
  if (e.keyCode != 13 && tmpCapsLock == false)
  {
    if ( ( myKeyCode >= 65 && myKeyCode <= 90 ) && !myShiftKey )
    {
      tmpCapsLock = true;
      document.fo_login.iscapslock.value = 'Y';
    }
    else if ( ( myKeyCode >= 97 && myKeyCode <= 122 ) && myShiftKey )
    {
      tmpCapsLock = true;
      document.fo_login.iscapslock.value = 'Y';
    }
    else
    {
      tmpCapsLock = false;
      document.fo_login.iscapslock.value = "N";
    }
  }

    //alert(document.fo_login.iscapslock.value);
}/*}}}*/

function iebody() {
  // Sense the difference between Strict and Quirks mode
  return (document.compatMode != "BackCompat"? document.documentElement : document.body);
}

nWndWidth = 600;
nTop = -1;
function resize_wnd (calltype)/*{{{*/
{
  try {
    myBody = iebody();
    if ('object' != typeof(document.getElementById('blank_img')))
      return;
    if (document.getElementById('blank_img').style.display == 'none')
      document.getElementById('blank_img').style.display = 'block';

    if (nWndWidth == 600) nWndWidth = myBody.offsetWidth + 8;
    if (nTop < 0) {
      window.resizeTo(nWndWidth, 250);
      nTop = 250 - myBody.clientHeight;
    }
    var nHeight = 0;
    if (document.getElementById('blank_img')) nHeight = document.getElementById('blank_img').offsetTop + nTop;
    document.getElementById('blank_img').style.display = 'none';
    var maxHeight = screen.availHeight;

    if (nHeight > maxHeight) {
      nHeight = maxHeight;
      myBody.scroll= 'yes';
    }
    window.resizeTo(nWndWidth + 10, nHeight);
  } catch(e) {
    if (calltype != 'recall')
    {
      if (typeof(addOnloadHandle) == 'function')
        addOnloadHandle("resize_wnd(\"recall\")");
      else
        setTimeout("resize_wnd(\"recall\")", 1500);
    }
  }
}/*}}}*/
function auto_fit_wnd (nNewWidth)/*{{{*/
{
  if (nNewWidth) nWndWidth = nNewWidth;
  //document.writeln("<img name='blank_img' src='http://file.sayclub.co.kr/images/blank.gif' align=top width=1 height=1 onload='resize_wnd();'>\n");
  document.writeln("<iframe width='1' height='1' frameborder=0 marginheight=0 marginwidth=0 scrolling=no id='blank_img' src='about:blank' onload='resize_wnd();'></iframe>\n");
}/*}}}*/
function auto_fit_wnd_ssl (nNewWidth)/*{{{*/
{
  if (nNewWidth) nWndWidth = nNewWidth;

  //document.writeln("<img name=\"blank_img\" src=\""+ssl_request_url('https://www.sayclub.com/images/blank.gif')+"\" align=top width=1 height=1 onload=\"resize_wnd();\">\n");
  document.writeln("<iframe width='100' height='100' frameborder=0 marginheight=0 marginwidth=0 scrolling=no id='blank_img' src='about:blank' onload='resize_wnd();'></iframe>\n");
}/*}}}*/

function getJsLink (strJsCode, innerHTML, strAttribute)/*{{{*/
{
  if ('undefined'==typeof(strAttribute)) strAttribute = "";
  if (0 == strJsCode.indexOf("javascript:"))
    strJsCode = strJsCode.substr(11);

  return "<a href=\"javascript:"+strJsCode+"\" onclick=\"event.returnValue=false;"+strJsCode+"\" "+strAttribute+">"+innerHTML+"</a>";
}/*}}}*/
function writeJsLink (strJsCode, innerHTML, strAttribute)/*{{{*/
{
  document.write(getJsLink(strJsCode, innerHTML, strAttribute));
}/*}}}*/

function channel_url (encoded_channel, encoded_opts, fw)/*{{{*/
{
  var chanPrefix = encoded_channel.substr (0, encoded_channel.indexOf ("/"));
  var returl = '';
  var tempchannel;
  tempchannel=encoded_channel;

  if (tempchannel.substr(3,2)=="cm")
    returl = "http://saycast.sayclub.com/saycast/room/gateway/?channel=" + encoded_channel;
  else if(tempchannel.substr(3,2)=="cb") // NORAEBANG
    returl = "http://saychatting.sayclub.com/noraeting/ch.nwz?channel=" + encoded_channel;
  else if (tempchannel.substr(3,2)=="mm")
    returl = "http://hompy.sayclub.com/hompy.nwz?targetMsrl=" +tempchannel.substr(11);
  else if (tempchannel.substr(3,2)=="cs") // ¼Ò¼³ÆÃ
    returl = "http://saychatting.sayclub.com/misoting/ch.nwz?channel=" + encoded_channel;
  else if (tempchannel.substr(4,1)=="p") // ÇÇÀÚ¸ó
    returl = "http://saychatting.sayclub.com/pizza/ch.nwz?channel=" + encoded_channel;
  else if (tempchannel.substr(4,2)=="gT") // Å¸ÀÚ°ÔÀÓ
    returl = "http://saychatting.sayclub.com/taja/ch.nwz?channel=" + encoded_channel;
  else
    {
      returl = "http://saychatting.sayclub.com/chat/ch.nwz?channel=" + encoded_channel;
      if (fw=="IW")
        returl = returl + "&fw=IW|RECV";
    }

  if (encoded_opts != "")
    returl += "&"+encoded_opts;
  return returl;
}/*}}}*/

  function channel_tulip_url (encoded_channel, encoded_opts, fw)/*{{{*/
  {
  var chanPrefix = encoded_channel.substr (0, encoded_channel.indexOf ("/"));
  var returl = '';
  var tempchannel;
  tempchannel=encoded_channel;

  if (tempchannel.substr(3,2)=="cm")
    returl = "http://saycast.sayclub.com/saycast/room/gateway/?channel=" + encoded_channel;
  else if(tempchannel.substr(3,2)=="cb") // NORAEBANG
    returl = "http://saychatting.sayclub.com/noraeting/ch.nwz?channel=" + encoded_channel;
  else if (tempchannel.substr(3,2)=="mm")
    returl = "http://hompy.sayclub.com/hompy.nwz?targetMsrl=" +tempchannel.substr(11);
  else if (tempchannel.substr(3,2)=="cs") // ¼Ò¼³ÆÃ
    returl = "http://saychatting.sayclub.com/misoting/ch.nwz?channel=" + encoded_channel;
  else if (tempchannel.substr(4,1)=="p") // ÇÇÀÚ¸ó
    returl = "http://saychatting.sayclub.com/pizza/ch.nwz?channel=" + encoded_channel;
  else if (tempchannel.substr(4,2)=="gT") // Å¸ÀÚ°ÔÀÓ
    returl = "http://saychatting.sayclub.com/taja/ch.nwz?channel=" + encoded_channel;
  else
  {
    returl = "http://saychatting.sayclub.com/chat/ch.nwz?room_type=tulip&channel=" + encoded_channel;
    if (fw=="IW")
      returl = returl + "&fw=IW|RECV";
  }

  if (encoded_opts != "")
    returl += "&"+encoded_opts;
  return returl;
}/*}}}*/
function saycast_reg_url(sendermsrl, targetmsrl, domainid, userflag, encoded_opts )/*{{{*/
{
  var returl = "http://saycast.sayclub.com/cast_join_station.nwz";
  returl=returl + "?sendermsrl="+sendermsrl;
  returl=returl + "&targetmsrl="+targetmsrl;
  returl=returl + "&domainid="+domainid;
  returl=returl + "&userflag="+userflag;

  if (encoded_opts != "")
  returl += "&"+encoded_opts;

  return returl;
}/*}}}*/
function studio_url (encoded_channel, encoded_opts)/*{{{*/
{
  var chanPrefix = encoded_channel.substr (0, encoded_channel.indexOf ("/"));
  var returl = '';

  returl = "http://saymall.sayclub.com/saymall_studio.nwz?act=join&channel=" + encoded_channel;

  if (encoded_opts != "")
    returl += "&"+encoded_opts;

  return returl;
}/*}}}*/

function go_webgame(ssn)
{
  var boardgame  = new Array('38', '60', '12', '16', '5');
  var casualgame = new Array('32', '27', '31', '30', '28');
  var gostopgame = new Array('24', '14', '19', '1', '26', '25', '43');
  var pokergame  = new Array('3', '40', '2', '23', '17', '18');
  var mobilegame = new Array('111');

  if (util_in_array(ssn, pokergame) || util_in_array(ssn, gostopgame))
  {
      document.location.href = "http://pmang.sayclub.com/game_top.nwz?ssn="+ssn;
      return;
  }

  if (util_in_array(ssn, boardgame) || util_in_array(ssn, casualgame))
  {
      document.location.href = "http://pmang.sayclub.com/game_casual_top.nwz?ssn="+ssn;
      return;
  }

  if (util_in_array(ssn, mobilegame))
  {
      document.location.href = "http://pmang.sayclub.com/game_mobile_top.nwz?ssn="+ssn;
      return;
  }

  document.location.href = "http://pmang.sayclub.com/game_top.nwz?ssn="+ssn;
}

function go_game(encoded_channel, encoded_opts)/*{{{*/
{
  eval(virtualGET("http://"+ location.hostname+ "/global/virtual/game_virtual.nwz?ch="+ encoded_channel+ "&opt="+ encoded_opts+ "&type=1"));
}/*}}}*/
function go_game2(ssn, chnum)/*{{{*/
{
  eval(virtualGET("http://"+ location.hostname+ "/global/virtual/game_virtual.nwz?ssn="+ ssn+ "&chnum="+ chnum+ "&type=2"));
}/*}}}*/
function go_game_pwd(ssn, chnum) //°³ÀÎ ¾ÏÈ£È­ ·Î±×ÀÎ/*{{{*/
{
  window.open ("http://"+ location.hostname +"/game_pwd_login.nwz?ssn="+ ssn+"&chnum="+ chnum, "game_pwd", "width=442,height=260")
}/*}}}*/
function go_game3(ssn, usrid, nick)/*{{{*/
{
  eval(virtualGET("http://"+ location.hostname+ "/global/virtual/game_virtual.nwz?ssn="+ ssn+ "&chnum=1&type=2&rstr=FI|"+ usrid+ "|"+ nick));
}/*}}}*/
function go_game4(ssn, chnum, usrid, nick)/*{{{*/
{
  eval(virtualGET("http://"+ location.hostname+ "/global/virtual/game_virtual.nwz?ssn="+ssn+"&chnum="+chnum+"&type=2&rstr=FI|"+ usrid+ "|"+ nick));
}/*}}}*/
function go_game5(ssn, chnum, rstr)/*{{{*/
{
  eval(virtualGET("http://"+ location.hostname+ "/global/virtual/game_virtual.nwz?ssn="+ssn+"&chnum="+chnum+"&type=2&rstr=DI|"+rstr));
}/*}}}*/

function go_tournament(ssn)/*{{{*/
{
  val = eval(virtualGET("http://"+ location.hostname+ "/pmang_tm_virtual.nwz?ssn="+ ssn));
  if(val == 21)
    window.open ("http://"+ location.hostname +"/pmang_tmchannel.nwz?ssn="+ ssn, "tmchannel", "width=310,height=260")
  else
    go_game2(ssn, val);
}/*}}}*/

function run_tachy()/*{{{*/
{
  tachy_clsid="92d76507-24cd-42e6-bea9-d84410a44de5";
  if(typeof(AppletSession)=="undefined")return;

  if(AppletSession.externalmethod("isinstalled",tachy_clsid,0,0,"20031223-0"))
    AppletSession.externalmethod("run",tachy_clsid,0,0,"");
  else
    AppletSession.externalmethod("install",tachy_clsid,0,0,"¼¼ÀÌÅ¬·´ Å¸Å° ´Ù¿î·Îµå");
}/*}}}*/
function run_game(arg)/*{{{*/
{
  if (typeof(AppletSession) == "undefined")
    return;
  clsid= "2729A0B7-23AD-48a9-9FBE-56452FE63D1C";
  if (!AppletSession.externalmethod("isrunning", clsid, 0,0,"")) {
    if (!AppletSession.externalmethod("isinstalled", clsid, 0, 0,"PM2009-06-03-0")) {
      AppletSession.externalmethod("install", clsid, 0, 0, "ÇÇ¸Á ´Ù¿î·Îµå");
    }
    if (!AppletSession.externalmethod("run", clsid, 0, 0, arg)) {
      AppletSession.externalmethod("install", clsid, 0, 0, "ÇÇ¸Á ´Ù¿î·Îµå");
      AppletSession.externalmethod("run", clsid, 0, 0, arg);
    }
  }
  else {
    AppletSession.externalmethod("send", clsid, 1, 1, arg);
  }
}/*}}}*/
function run_playroom()/*{{{*/
{
  playroom_clsid = "81971ED4-B0E9-4130-A3C6-A29F86FE7AAE"; // old clsid : "9C23D13E-E310-4E25-A8FC-D704B833BB57";
  if(typeof(AppletSession)=="undefined")return;

  if(!AppletSession.externalmethod("isinstalled",playroom_clsid,0,0,"20080226-0"))
    AppletSession.externalmethod("install",playroom_clsid,1,0,"ÇÃ·¹ÀÌ·ë ´Ù¿î·Îµå");
}/*}}}*/

function set_game_top_window( oWnd , itype )/*{{{*/
{
  if (!oWnd || typeof(AppletSession) == "undefined")
    return 0;

  clsid="2729A0B7-23AD-48a9-9FBE-56452FE63D1C";
  if (AppletSession.externalmethod("isrunning", clsid, 0,0,"")) // °ÔÀÓÀÌ ½ÇÇàÁßÀÌ¸é
  {
    var hwnd = AppletSession.gethwnd(oWnd); // gethwnd()¿¡ ÇØ´çµÇ´Â methodÀÌ¸§Àº º¯°æµÉ ¼ö ÀÖ½À´Ï´Ù
    AppletSession.externalmethod("send", clsid, 2, hwnd, itype );
    return 1;
  }

  return 0;
}/*}}}*/

function send_game(itype, arg)/*{{{*/
{
  if (typeof(AppletSession) == "undefined")
    return;

  clsid="2729A0B7-23AD-48a9-9FBE-56452FE63D1C";
  if (AppletSession.externalmethod("isrunning", clsid, 0, 0, ""))
    AppletSession.externalmethod("send", clsid, 3, itype, arg);
}/*}}}*/

//var sitepromotion = false; // by amoogi

function game_menu(itype, arg1, arg2)/*{{{*/
{
  var tmp = 0;
  switch (itype) {
    case 1:
      execSayMenu("gohompy", "?gohompy="+arg1+",off");
      break;
    case 4:
      execSayMenu("smssend", "?smssend="+arg1+",off");
      break;
    case 5:
      execSayMenu("mailnew", "?mailnew="+arg1+",off");
      break;
    case 6:
      execSayMenu("talk", "?talk="+arg1+",true");
      break;
    case 14:
      open_game_top_win( "http://pmang.sayclub.com/view_manual.nwz?ssn="+arg1 , '' , 698 , 543 , 'no' , 'yes' , 14 );
      break;
    case 16:
      //idx1 = arg1.indexOf("#__1__");
      //idx2 = arg1.indexOf("#__2__");
      idx1 = arg1.indexOf("^__1__");
      idx2 = arg1.indexOf("^__2__");
      idx_len = arg1.length;

      if (idx1 == -1 && idx2 == -1) {
        value1 = arg1;   value2 = "";   value3 = "";
      }
      if (idx1 != -1 && idx2 == -1) {
        value1 = arg1.substr(0, idx1);   value2 = arg1.substr(idx1 + 7, idx_len);   value3 = "";
      }
      if (idx1 == -1 && idx2 != -1) {
        value1 = arg1.substr(0, idx2);   value2 = arg1.substr(idx2 + 7, idx_len);   value3 = "";
      }
      if (idx1 != -1 && idx2 != -1) {
        value1 = arg1.substr(0, idx1);   value2 = arg1.substr(idx1 + 6, idx2 - idx1 - 6);  value3 = arg1.substr(idx2 + 6, idx_len);
      }
      //if ( arg2 == 1 )
      //  open_game_top_win( value1, value2, value3, "no", "no", 16 );
      //else
        window.open( value1, value2, value3 );
      break;
    case 17:
      if (arg1 == 4 || arg1 == 60 || arg1 == 7)
        document.location.replace("http://pmang.sayclub.com/game_casual_top.nwz?ssn="+ arg1);
      else
        document.location.replace("http://pmang.sayclub.com/game_top.nwz?ssn="+ arg1);
      break;
    case 18:
      // ÀÌÀü¿¡ golevelÀº À¥ÄÚµå¿¡¼­ Ã³¸®¸¦ ÇÏÁö ¾ÊÀ¸¹Ç·Î chtypeÀ» ¹Þµµ·Ï ÇÔ by jm2y@neowiz.com
      ch = virtualGET("http://" + location.hostname + "/pmang_get_channel_max.nwz?ssn="+arg1+"&chtype="+arg2);
      if(ch == "") break;

      //@2005-01-05 Æ¯Á¤ ÄÄÇ»ÅÍ »ç¾ç¿¡¼­  virtualGET ÇÑÀÚ¸®¼ö ¹Þ±â¿¡ ¿¡·¯°¡ »ý°Ü ¾Õ¿¡ 0ºÙ¿© ³Ñ¾î¿Â °ª¿¡ 0À» Á¦°Å
      if( ch.charAt(0) == "0" )
      {
        ch = ch.replace('0','');
      }

      go_game2(arg1, ch);
      break;
    case 20:
      document.location.replace('http://pmang.sayclub.com');
      break;
    case 22:
      eval(virtualGET("http://"+ location.hostname+ "/global/virtual/game_kill.nwz?lusrid="+ arg1));
      break;
    case 23:
      if (arg1 == 1)
        window.focus();

      if (arg2 == 1)  // °í½ºÅéÀÎ °æ¿ì ¿£µù ÆË¾÷ ¶ç¿öÁÜ
      {
        top.virtual_fr.location = "http://pmang.sayclub.com/pmang_ad_endban.nwz?gametype=G";
        setTimeout("document.location.reload()", 1000);
      }
      else if (arg2 == 9) // ±¸½½ °ÔÀÓÀÎ °æ¿ì
        location.href = 'http://pmang.sayclub.com/mileage_top.nwz?flag=game';
      else
        document.location.reload();

      break;
    case 24:
      tachy_go(arg1, 0, 0);
      break;
    case 25:
      join_channel(arg1, arg2);
      break;
    case 27:
      open_game_top_win( "http://pmang.sayclub.com/pmang_purchase_product.nwz?ssn="+arg2+"&product_id="+arg1+"&cat_id=1000004142", "clientbuy", 430, 400 ); //cat_id´Â ±âÅ¸·ù..
      break;
    case 29:
      url = virtualGET("http://"+ location.hostname+ "/global/virtual/gamepopup_virtual.nwz?ssn="+arg1);
      if (url)
        open_game_top_win(url, "_eventpopup", 400, 650, "no", "no", 29);
      break;
    case 30:
      open_win('http://mm.sayclub.com/pmangdir/promotion/realname/gamelimit.html', 400, 220);
      break;
    case 31:
      go_game2(arg1, arg2);
      document.location.replace("http://pmang.sayclub.com/game_top.nwz?ssn="+ arg1);
      break;
    case 32: // Ä³ÁÖ¾ó°ÔÀÓ ¿£µù¹è³Ê
      if (arg2 != 'D') // ´ÙÀ½Ã¤³Î¸µÀÌ ¾Æ´Ñ °æ¿ì¿¡¸¸ ±¤°í¹è³Ê³ëÃâ
      {
        top.virtual_fr.location = "http://pmang.sayclub.com/pmang_ad_endban.nwz?gametype=C";
        setTimeout("document.location.reload()", 1000);
      }
      else
        document.location.reload();
      break;
    case 35 : //¿ÃÀÎ ÈÄ ÆË¾÷ ¸®´º¾ó 2005/01/05 made by mtwan
      //if(IE_Version >= 6.0)
        setTimeout("open_game_top_win('http://pmang.sayclub.com/pmang_refill.nwz?ssn="+arg1+"&isallin=Y', 'allinpop', 434, 443, 'no'/*scroll*/, 'yes'/*resize*/, '35');",1500);
      break;
    case 36:
      open_game_top_win(virtualGET("http://"+ location.hostname+ "/global/virtual/gameitem_virtual.nwz?ssn="+arg1+"&srl="+arg2), "_gameitem", 400, 250, "no", "no", 36);
      break;
    case 37:
      window.open('http://pmang.sayclub.com/pmang_faq_goto.nwz?ssn='+arg1);
      break;
    case 38:
      window.open('http://pmang.sayclub.com/pmang_mall_goto.nwz?ssn='+arg1);
      break;
    case 39:
      var isOpen = virtualGET("http://"+ location.hostname+ "/global/virtual/game_extmoney_virtual.nwz?ssn="+arg1);
      if( isOpen == "01") open_game_top_win('http://pmang.sayclub.com/pmang_extmoney_alert.nwz?ssn='+arg1,"clientalram",480,400);
      break;
    case 40:
      open_win('http://pmang.sayclub.com/pmang_purchase_product.nwz?ssn='+arg1+'&codestr='+arg2, 450, 260);
      break;
    case 41:
      open_game_top_win("http://pmang.sayclub.com/pmang_extmoney_pop.nwz?ssn="+arg1, "clientalram", 480, 580 );
      break;
    case 42:
      open_game_top_win( "http://pmang.sayclub.com/pmang_purchase_premium.nwz?ssn="+arg1+"&rsrl="+arg2, "clientbuy", 430, 400 );
      break;
    case 43:
      open_game_top_win("http://file.sayclub.co.kr/images/pmang/nabi/html/fcitem/item_fc"+arg1+"_safe.html", "fciteminfo", 480, 460);
      break;
    case 44:
      var method = arg2.substr (0, arg2.indexOf ("|"));
      var cat_id = arg2.substr (arg2.indexOf ("|")+1, arg2.length);
      document.location.replace("http://pmang.sayclub.com/premium_top.nwz?ssn="+arg1+"&method="+method+"&cat_id="+cat_id);
      break;
    case 46:
      window.focus();
      open_game_top_win( "http://pmang.sayclub.com/promotion/pmang_dormancy_main.nwz", "_dormancy", 437, 370 );
      break;
    case 47:
      idx1 = arg1.indexOf("#__1__");
      if (idx1 != -1) {
        value1 = arg1.substr(0, idx1);
        value2 = arg1.substr(idx1 + 6);
      }

      go_game5(value1,value2, arg2);
      break;
    case 48:
      document.cookie = "POKERFIRST=Y; domain=sayclub.com; path=/";
      break;
    case 50:  // ¹æ¸í·Ï
      open_game_top_win('http://pmang.sayclub.com/pmang_profile_popup.nwz?method=guestbook&targetmsrl='+arg1,'_profile',400,330);
      break;

    case 90: // PC¹æ Á¡ÁÖ&À¯Àú ÇÁ·Î¸ð¼Ç
      window.open("http://pmang.sayclub.com/promotion/pmang_pcbang_fighting.nwz", "_blank");
      break;
    case 91: //Ä«Áö³ë ÀÌº¥Æ®
      open_game_top_win('http://pmang.sayclub.com/promotion/pmang_event_casino_popup.nwz','_procasino',400,330);
      //open_game_top_win('http://pmang.sayclub.com/promotion/pmang_newpoker_event2_cltpopup.nwz','npeclt',450,550);
      break;
    case 92: //°í½ºÅé°ÔÀÓ±º Å¬¶óÀÌ¾ðÆ® Á¾·á½Ã ±¤°í ¶ç¿ì±â -_-+
      //if( tmpGetCookie(arg1+"_"+arg2+"_clientclose") != "viewingbanner_"+arg1+"_"+arg2 )
        //open_game_top_win('http://pmang.sayclub.com/pmang_clientclose.nwz?ssn='+arg1,'_clientendingbanner',600,350);
        //top.virtual_fr.location = "http://pmang.sayclub.com/pmang_ad_endban.nwz?gametype=G";
        // µô·¯½ºÃÊÀÌ½º ÇÁ·Î¸ð¼Ç Æ®·¡Å· ÈÄ °ÔÀÓ°£ ÀÌµ¿
      var dealcho = virtualGET("http://"+location.hostname+"/promotion/pmang_dealcho_click_client.nwz?ssn="+arg1);
      ch = virtualGET("http://" + location.hostname + "/pmang_get_channel_max.nwz?ssn="+arg1+"&golevel="+arg2);
      if(ch == "") break;

      //@2005-01-05 Æ¯Á¤ ÄÄÇ»ÅÍ »ç¾ç¿¡¼­  virtualGET ÇÑÀÚ¸®¼ö ¹Þ±â¿¡ ¿¡·¯°¡ »ý°Ü ¾Õ¿¡ 0ºÙ¿© ³Ñ¾î¿Â °ª¿¡ 0À» Á¦°Å
      if( ch.charAt(0) == "0" )
      {
        ch = ch.replace('0','');
      }

      go_game2(arg1, ch);
      break;
    case 93: //Áß»óÀ§ ¹Ì¼Ç ÀÌº¥Æ® ÆË¾÷
      if (!tmpGetCookie('powermission_tue') && !tmpGetCookie('powermission'))
      {
        var powerParam = virtualGET("http://"+location.hostname+"/promotion/pmang_powermission_getinfo.nwz?ssn="+arg1);
        if (powerParam.indexOf("#__Y__") != -1 && !tmpGetCookie('powermission'))
        {
          open_game_top_win('http://pmang.sayclub.com/promotion/pmang_powermission_popup_join.nwz?ssn='+arg1,'_powermission',400,330);
        }
      }
      break;
    case 101:  // ¹ÙµÏ Å¬¶óÀÌ¾ðÆ® À¥ÄÝ (itype=101, arg1=url, arg2=width|height)
      size = new Array("","");
      if (arg2 != "")
        size = arg2.sprit("|");
      open_win(arg1, size[0], size[1]);
      break;
  }
}/*}}}*/

//Å¬¶óÀÌ¾ðÆ® Á¾·á½Ã ±¤°íÃ¢À» ¶ç¿ì´Â ÀÛ¾÷¿¡¼­ »ç¿ëÇÏ±â À§ÇØ ÀÓ½Ã·Î ¸¸µç func./*{{{*/
function tmpGetCookie(Name)
{
  var search = Name + "="
  if (document.cookie.length > 0) { // ÄíÅ°°¡ ¼³Á¤µÇ¾î ÀÖ´Ù¸é
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // ÄíÅ°°¡ Á¸ÀçÇÏ¸é
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset)
      // ÄíÅ° °ªÀÇ ¸¶Áö¸· À§Ä¡ ÀÎµ¦½º ¹øÈ£ ¼³Á¤
      if (end == -1)
        end = document.cookie.length
      return unescape(document.cookie.substring(offset, end))
    }
  }

  return false;
}/*}}}*/

var new_win;

function url_to_new_win(url)/*{{{*/
{
  if ('object' == typeof(new_win)) {
    try {
      new_win.sayNavigate(url);
      return;
    } catch (e) {
    }
  }
  new_win = window.open(url, "_blank", "height=500,width=800");
}/*}}}*/

function say_open_url(url)/*{{{*/
{
  var windowToOpen;
  if (parent && parent != self) {
    var c = parent;
    var t;
    var cnt = 0;
    while (cnt++ < 20 && (c.parent && c != c.parent))
    {
      if (c.opener) c = c.opener;
      else c = c.parent;
    }
    cnt = 0;
    if ('undefined' == typeof(c.sumMenus_club) &&
    (1 || !AppletSession) &&
    'object' == typeof(c.opener) &&
    c.opener != c)
    {
      c = c.opener;
      if ('object' == typeof(c.top))
  c = c.top
    }
    windowToOpen = c;
  }
  else
    windowToOpen = self;

  if ('undefined' != typeof(windowToOpen.sayNavigate)) {
    try {
      windowToOpen.sayNavigate(url);
    } catch (e) {
      url_to_new_win(url);
    }
  }
  else {
    try {
      windowToOpen.document.location.assign(url);
    } catch (e) {
      url_to_new_win(url);
    }
  }
}/*}}}*/

function join_channel (encoded_channel, encoded_opts)/*{{{*/
{
  if (encoded_channel.substring(2,4)== 'GG') {
    go_game(escape(encoded_channel), encoded_opts);
  }
  else if ( encoded_channel.substring(2,3) == 'b' ) {
    var url = channel_url(escape(encoded_channel), encoded_opts );
    open_nrbchatwin('joinroom', url);
  }
  else if (encoded_channel.substring(2,4) == 'SS') {
    var typecheck = typeof( parent.opener );
    if ((typecheck != "undefined") && (typecheck != "unknown"))
      open_win(studio_url(escape(encoded_channel), encoded_opts),'_new', 510, 800);
    else
      open_win(studio_url(escape(encoded_channel), encoded_opts),'_new', 510, 800);
  }
  else {
    var url = channel_url(escape(encoded_channel), encoded_opts );
    say_open_url(url);
  }
}/*}}}*/

function join_channel2 (encoded_channel, encoded_opts)/*{{{*/
  {
    if (encoded_channel.substring(2,4)== 'GG') {
    go_game(escape(encoded_channel), encoded_opts);
  }
  else if ( encoded_channel.substring(2,3) == 'b' ) {
    var url = channel_tulip_url(escape(encoded_channel), encoded_opts );
    open_nrbchatwin('joinroom', url);
  }
  else if (encoded_channel.substring(2,4) == 'SS') {
    var typecheck = typeof( parent.opener );
    if ((typecheck != "undefined") && (typecheck != "unknown"))
      open_win(studio_url(escape(encoded_channel), encoded_opts),'_new', 510, 800);
    else
      open_win(studio_url(escape(encoded_channel), encoded_opts),'_new', 510, 800);
    }
  else {
    var url = channel_tulip_url(escape(encoded_channel), encoded_opts );
    say_open_url(url);
  }
}/*}}}*/
  

function checkSkyScraper ()/*{{{*/
{
  if (screen.width < 1024 || screen.height < 768 || document.body.clientWidth <= 934)
    return false;
  else
    return true;
}/*}}}*/

is_ready_gp = false;
function bring_top_game (title)/*{{{*/
{
  if (!is_ready_gp)
  {
    setTimeout("bring_top_game()", 200);
    return;
  }

  if (typeof(sc_game) == "object" && typeof(sc_game.bring_top)== "object")
  {
    sc_game.bring_top(title);
    return;
  }
}/*}}}*/

var lastscrollHeight = 0;
var scrollObjt = false;
function do_scroll ()/*{{{*/
{
  if ('object' == typeof(scrollObjt.scroll))
    scrollObjt.scroll(0,1000000);
  else if ("object" == typeof(scrollObjt.scrollIntoView) && "object" == typeof(curDiv))
    curDiv.scrollIntoView(false);
}/*}}}*/
function scroll_or_not ()/*{{{*/
{
  if (!scrollObjt)
    scrollObjt = document.body;
  if (typeof(curDiv) == "object" && scrollObjt.scrollTop + scrollObjt.offsetHeight + 100>= lastscrollHeight) {
    setTimeout("do_scroll();", 0);
    //curDiv.insertAdjacentHTML ("beforeEnd", "scrollObjt.scrollTop:"+scrollObjt.scrollTop+", scrollObjt.offsetHeight:"+scrollObjt.offsetHeight+
    //                                        ", curDiv.offsetTop:"+curDiv.offsetTop+", curDiv.offsetHeightght:"+curDiv.offsetHeight+";");

    // curDiv.offsetHeightÀÇ º¯°æ°ªÀÌ crollObjt.scrollTopÀÇ º¯°æ°ªº¸´Ù Ä¿¼­
    // ½ºÅ©·ÑÀÌ ºñÁ¤»óÀûÀÎ °æ¿ì°¡ ÀÖ¾î¼­ ¼öÁ¤ ( 2007.07.18 by À¯È¿Áø)
    // ´Ù½Ã¼öÁ¤ 09.08.13 -swj  div 10 °³ ¼ÒÁø½Ã ¿À·ù 
    //lastscrollHeight = scrollObjt.scrollTop + scrollObjt.offsetHeight;
    lastscrollHeight = curDiv.offsetHeight + curDiv.offsetTop;
  }
  else if (typeof(scrollObjt) != "object" || scrollObjt.scrollTop + scrollObjt.offsetHeight >= lastscrollHeight) {
    do_scroll();
    lastscrollHeight = scrollObjt.scrollHeight;
  }
}/*}}}*/

function skyScraperHandler(wideWidth, narrowWidth)/*{{{*/
{
  if (screen.width < 1024 || screen.height < 768 || document.body.clientWidth <= 934) {
    document.all.idGlobalHeader.style.pixelWidth=narrowWidth;
    document.all.idSkyScraperTD1.style.display="none";
    document.all.idSkyScraperTD1.style.pixelWidth=0;
    document.all.idMainContent.style.pixelWidth=narrowWidth;
    document.all.idSkyScraperTD2.style.display="none";
    document.all.idSkyScraperTD2.style.pixelWidth=0;
  }
  else
  {
    try {
      if (document.all.idSkyScraperTD1.style.display == 'none' ||
    document.all.idSkyScraperTD2.style.display == 'none')
      {
  document.all.idGlobalHeader.style.pixelWidth=wideWidth;
  document.all.idSkyScraperTD1.style.display="";
  document.all.idMainContent.style.pixelWidth=wideWidth;
  document.all.idSkyScraperTD2.style.display="";
      }
    } catch (e) {}
  }
}/*}}}*/

function sayNavigate(url)/*{{{*/
{
  var oBaseColl = document.all.tags('BASE');
  if (oBaseColl && oBaseColl.length && oBaseColl[0].target.length)
    window.open(url, oBaseColl[0].target);
  else
    document.location.assign(url);
  if (event)
    event.returnValue = false;
}/*}}}*/

function ts_unload_handler()/*{{{*/
{
  if (!g_ts_service) g_ts_service = "www";
  if (!g_tsparam1) g_tsparam1 = 0;
  if (!g_tsparam2) g_tsparam2 = "Unknown";
  try {
    var ret = virtualGET('http://'+g_ts_service+'.sayclub.com/global/virtual/gather_ts_virtual.nwz?param1='+g_tsparam1+'&param2='+g_tsparam2);
  } catch (e) { }
}/*}}}*/

function open_gnb_fromhompy(url)/*{{{*/
{
  if(top.opener)
    top.opener.location.href = url;
  else
    window.open(url);
}/*}}}*/
function open_club_fromhompy(lclubid, clubsrl, aseq)/*{{{*/
{
   window.open('http://club.sayclub.com/cb_rout.nwz?lclubid='+lclubid+'&clubsrl='+clubsrl+'&aseq='+aseq, 'open_club');
}/*}}}*/
function open_hompy(lusrid,str)/*{{{*/
{
  open_hompy2(lusrid,str);
}/*}}}*/
function open_hompy_srl(srl,str)/*{{{*/
{
  open_hompy2_srl(srl,str);
}/*}}}*/
function open_user_info(msrl,usrid)/*{{{*/
{
  //open_win('http://hompy.sayclub.com/profile/profile_popup.nwz?targetmsrl=' + msrl + '&targetid=' + usrid + '', '_whoone',468,513);
  window.open("http://me.sayclub.com/profile/home/view/"+usrid);
}/*}}}*/
function open_memo_send(usrid)/*{{{*/
{
  open_win('http://memo.sayclub.com/memosend.nwz?toid=' + usrid ,'_memosend',360,272);
}/*}}}*/
function open_hompy2(lusrid,str)/*{{{*/
{
  if(lusrid == '-1' || lusrid == '')
    return;
  var url='http://hompy.sayclub.com/hompy.nwz?targetid='+lusrid+'&pop=pop';
  if(str)
    url = url + '&' + str;
  hompy_win = window.open(url, '_hompy', 'scrollbars=no,resizable=no,width=995,height=585');
  try{ hompy_win.focus(); }catch(Exception){}
}/*}}}*/
function open_hompy2_srl(srl,str)/*{{{*/
{
  if(srl == '-1' || srl == '')
      return;
  var url='http://hompy.sayclub.com/hompy.nwz?targetmsrl='+srl+'&pop=pop';
  if(str)
    url = url + '&' + str;
  hompy_win = window.open(url, '_hompy', 'scrollbars=no,resizable=no,width=995,height=585');
  try{ hompy_win.focus(); }catch(Exception){}
}/*}}}*/
function open_hompy2_fromhompy(msrl,str)/*{{{*/
{
  if(msrl == '-1' || msrl == '')
    return;
  var url='http://hompy.sayclub.com/hompy.nwz?targetmsrl='+msrl+'&pop=frompop';
  if(str)
    url = url + '&' + str;
  hompy_win_fromhompy = window.open(url, '_fromhompy', 'scrollbars=no,resizable=no,width=995,height=585');
  try{ hompy_win_fromhompy.focus(); }catch(Exception){}
}/*}}}*/

// ¼¼ÀÌÅ¬·´¿¡¼­ ÁêÅ©¿Â2.0À¸·Î ÀÌµ¿ÇÒ¶§ ·Î±×ÀÎ À¯Áö½ÃÅ°±â À§ÇÑ ÇÔ¼ö
function go_jukeon(url, usrid)/*{{{*/
{
  // ÁêÅ©¿Â ºÐ¸®¿¡ µû¸¥ SSO ÇØÁ¦
  window.open("http://www.jukeon.com/");
}/*}}}*/
// ¼¼ÀÌÅ¬·´¿¡¼­ ÁêÅ©¿Â FM À¥ÇÃ·¹ÀÌ¾î¸¦ ·Î±×ÀÎ À¯ÁöÇÏ¸é¼­ ¶ç¿ì±â À§ÇÑ ÇÔ¼ö
function go_jukeon_fm(usrid)/*{{{*/
{
  // FM PlayerÀÇ URL
  var url = "http://www.jukeon.com/global/common/player/jukeon_fm_player.nwz?auto_play=1";

  if(typeof(usrid)=='undefined'||!usrid) {
    var win = window.open(url, "JukeonPlayer","width=355,height=340,resizable=no,toolbars=no,scrollbars=no");
    win.focus();
  } else {

    // sayaxÀÇ clasid
    var clsid="EACD6BE5-C0EE-4909-9B71-B2807C8A245C";

    // jukeonax load
    var span = document.frames["span_jukeonax"];
    if(typeof(span)=="undefined") {
      document.body.insertAdjacentHTML("afterBegin",'<span id="span_jukeonax" style="display:none"></span>');
    }
    span = document.frames["span_jukeonax"];
    span.innerHTML='';
    var text="<object id=JukeonAX name=JukeonAX classid='clsid:EACD6BE5-C0EE-4909-9B71-B2807C8A245C' onError='window.open(\""+url+"\",\"JukeonPlayer\",\"width=355,height=440,resizable=no,toolbars=no,scrollbars=no\")'></object>";
    span.innerHTML=text;
    try{
      var r = JukeonAX.externalmethod("go_jukeon",clsid,0,0,usrid+",window.open('"+url+"','JukeonPlayer','width=355,height=440,resizable=no,toolbars=no,scrollbars=no');");
      if(!r) {
        var win = window.open("http://www.jukeon.com/global/common/login/sayclub_gateway.nwz?usrid="+usrid+"&pageurl="+escape(url), "JukeonPlayer","width=355,height=440,resizable=no,toolbars=no,scrollbars=no");
        win.focus();
      }
    } catch(e) {
    }
  }
}   /*}}}*/
function go_jukeon_check(url, usrid)/*{{{*/
{
  if('undefined' != typeof(usrid) && usrid)
    go_jukeon(url, usrid);
  else
    window.open(url);
}/*}}}*/

function go_login(module, ispopup)/*{{{*/
{
  if (ispopup)
  {
    opener.document.location.href = "http://www.sayclub.com/global/loginform.nwz?module="+module+"&pageurl="+opener.document.location;
    self.close();
  }
  else
    document.location.href = "http://www.sayclub.com/global/loginform.nwz?module="+module+"&pageurl="+document.location;
}/*}}}*/

/**
* @brief ½ÇÁ¦ ·»´õ¸µµÇ¾úÀ»¶§ maxwidth ÀÌÇÏÀÇ ÆøÀ» °®´Â ¹®ÀÚ¿­(¾ÕºÎºÐ)À» ¸®ÅÏÇÔ
* @param string str È­¸é¿¡ »Ñ¸®°íÀÚ ÇÏ´Â ¹®ÀÚ¿­
* @param int maxwidth ¹®ÀÚ¿­À» ¸ÂÃß°íÀÚ ÇÏ´Â ÃÖ´ë Æø
* @param string style ¹®ÀÚ¿­¿¡ Àû¿ëÇÏ°íÀÚ ÇÏ´Â ½ºÅ¸ÀÏ
* @param string tail ¹®ÀÚ¿­ÀÌ ÃÖ´ëÆøº¸´Ù ±æ¾úÀ»¶§ Àß¸° ¹®ÀÚ¿­ µÚ¿¡ ºÙ¿©ÁÙ ¹®ÀÚ¿­
* @return string ÃÖ´ëÆø¿¡ ¸ÂÃá ¹®ÀÚ¿­
*/
function fitString(str,maxwidth,style,tail)/*{{{*/
{
  uid = 'what_a_beautiful_day..';
  o = document.createElement('SPAN');
  o.id = uid;
  o.innerHTML = str;
  document.body.appendChild(o);
  o.style.cssText = "top:-1000px; overflow:hidden;white-space:nowrap;visibility:hidden;"+style;
  var strTail;
  if(o.offsetWidth > maxwidth)
    strTail = tail;
  else
    strTail = '';
  maxiteration = 100;
  while(o.offsetWidth > maxwidth)
  {
    o.innerText = o.innerText.substr(0,o.innerText.length-1);
    if(maxiteration == 0) break;
    maxiteration--;
  }
  s = o.innerHTML + strTail;
  document.body.removeChild(o);
  return s;
}/*}}}*/
/**
* @brief ½ÇÁ¦ ·»´õ¸µµÇ¾úÀ»¶§ÀÇ ÆøÀ» ¸®ÅÏÇÔ
* @param string str È­¸é¿¡ »Ñ¸®°íÀÚ ÇÏ´Â ¹®ÀÚ¿­
* @param string style ¹®ÀÚ¿­¿¡ Àû¿ëÇÏ°íÀÚ ÇÏ´Â ½ºÅ¸ÀÏ
* @return int ½ÇÁ¦ Æø
*/
function widthString(str,style)/*{{{*/
{
  uid = 'what_a_beautiful_day..haha';
  o = document.createElement('SPAN');
  o.id = uid;
  o.innerHTML = str;
  document.body.appendChild(o);
  o.style.cssText = "top:-1000px; overflow:hidden;white-space:nowrap;visibility:hidden;"+style;
  var realWidth = o.offsetWidth;
  document.body.removeChild(o);
  return realWidth;
}/*}}}*/

var cntFail =  0 ;
var smsrllist = new Array;

function checkInArray(obj, val) {
  for (var i=0; i < obj.length; i++) {
    if (obj[i]==val) return true;
  }
  return false;
}


// Å¥ÇÇÅä Ã¤ÆÃ ÃÊ´ëÀå
function SayAlertMeetInvite(sendmsrl, method) {
  windowHandle = open_win("http://saychatting.sayclub.com/meeting/pop_memo_list.nwz?yourmsrl="+sendmsrl, '',416,156);
}

function SayAlertMeetPropose(srl, text) { // Å¥ÇÇÅä ÇÁ·ÎÆ÷Áî ¹ÞÀ½ ¾Ë¸² {{{
  windowHandle = open_win('http://saychatting.sayclub.com/meeting/pop_meet_view_propose.nwz?notified=yes&srl='+srl,'',445,284);
} //}}}

function SayAlertMeetProposeInfo(total, unread) {
  /*  ´õ ÀÌ»ó »ç¿ë ¾ÈÇÔ
  text = "<br/><br/><b class=orange01>"+total+"</b>°³ÀÇ ÇÁ·ÎÆ÷Áî¿Í<br/><b class=orange01>"+unread+"</b>°³ÀÇ ´äÀåÀÌ<br/>µµÂøÇÏ¿´½À´Ï´Ù.";
  linkstr = "http://saychatting.sayclub.com/meeting/meet_propose.nwz";
  SayAlert('o_background', 'http://file.sayclub.co.kr/images/incredible/chatting/propose/skin_pop_basic.gif', 'o_lifetime', 10000, 'o_caption', '<a href="'+linkstr+'">'+text+'</a>', 'o_width', 125, 'o_height', 150);
  */
}


function openerGoUrl(url)/*{{{*/
{
  var framechk = typeof(opener.parent);
  if((framechk != 'unknown' ) && (framechk != 'undefined'))
    opener.parent.document.location.href = url;
  else if((chk != 'unknown' ) && (chk != 'undefined'))
  {
    var chk = typeof(opener);
    opener.document.location.href = url;
  }
  self.close();
}/*}}}*/

function charge_saycash_check (strURL)/*{{{*/
{
  var bFromMainWindow = true;
  if (bFromMainWindow)
      window.open(strURL, '_rds', 'width=460,height=161,scrollbars=no,scrolling=auto');
  else
      document.location.replace(strURL);
  return;
}/*}}}*/
function goCafeItem(csrl, usetype, target)/*{{{*/
{
  var index_url = "http://cafe.sayclub.com/mycafe_index.nwz?csrl="+csrl+"&spage_url=";
  var spage_url = window.location.href;
  var url = index_url+escape(spage_url);

  if("new" == target)
    window.open(url, "_top");
  else if("current" == target)
    document.location.href = url;
  else if("parent" == target)
    parent.location.href = url;
}/*}}}*/

// 2006³â 2¿ù 15ÀÏ Windows Updater°ü·Ã ÇÃ·¹½¬ object »ý¼ºÀ» À§ÇÑ Æã¼Ç
function printFlashObject(flash_src,name,width,height,option_param_tag)/*{{{*/
{
  obj_html = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,12,36' width='"+width+"' height='"+height+"' id='"+name+"' align='middle'>\
  <param name='allowScriptAccess' value='always' />\
  <param name='movie' value='"+flash_src+"' />\
  <param name='quality' value='high' />\
  <param name='bgcolor' value='#ffffff' />\
  <param name='wmode' value='transparent'>\
  <param name='menu' value='false'>";

  obj_html = obj_html + option_param_tag;

  obj_html = obj_html + "<embed src='"+flash_src+"' quality='high' bgcolor='#ffffff' width='"+width+"' height='"+height+"' name='"+name+"' align='middle' allowscriptaccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
  </object>";

  document.write(obj_html);
}/*}}}*/

function printFlashObject2(obj,flash_src,name,width,height,option_param_tag)/*{{{*/
{
  obj_html = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,12,36' width='"+width+"' height='"+height+"' id='"+name+"' align='middle'>\
  <param name='allowScriptAccess' value='always' />\
  <param name='movie' value='"+flash_src+"' />\
  <param name='quality' value='high' />\
  <param name='bgcolor' value='#ffffff' />\
  <param name='wmode' value='transparent'>\
  <param name='menu' value='false'>";

  obj_html = obj_html + option_param_tag;

  obj_html = obj_html + "<embed src='"+flash_src+"' quality='high' bgcolor='#ffffff' width='"+width+"' height='"+height+"' name='"+name+"' align='middle' allowscriptaccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
  </object>";

  obj.innerHTML = obj_html;
}/*}}}*/

function printObject(strVar)/*{{{*/
{
  document.write(strVar);
}/*}}}*/

function openAcessHelper()/*{{{*/
{
  open_win_scroll ('http://mm.sayclub.com/sayclub/home/help_access.html', '_helpAccess', 517, 600);
}/*}}}*/

// URL À» º¸¾È¿¬°á URL ·Î º¯È¯ÇÑ´Ù.
// ºÐ·ù : COMMON / URL
function ssl_request_url(url)/*{{{*/
{
  return "https://secure.sayclub.com/?surl="+urlencode(url);
}/*}}}*/
function isSSLRequest()/*{{{*/
{
  var cururl = window.location + "";
  if (cururl.substr(0, 8) == "https://")
    return true;
  return false;
}/*}}}*/
function getSSLURL(url)/*{{{*/
{
  var sslbase = "https://secure.sayclub.com/?surl=";

  if (isSSLRequest())
  {
    url = url.replace(/:/g, "%3A");
    url = url.replace(/\//g, "%2F");
    url = url.replace(/\?/g, "?&");
    return sslbase+url;
  }
  return url;
}/*}}}*/
function getSSLResourceURL(url)/*{{{*/
{
  var sslbase = "https://secure.sayclub.com/resource.nwz?src=";
  if (isSSLRequest())
    return sslbase+url;
  return url;
}/*}}}*/

function printTagHtmlDivScript(tagid,totalcnt)
{
  var today = new Date();
  index_tag = today.getSeconds() % totalcnt;
  document.all[tagid+"_"+index_tag].style.display = "";
}

function getCookie(name)
{
  var Found = false
  var start, end
  var i = 0
  // cookie ¹®ÀÚ¿­ ÀüÃ¼¸¦ °Ë»ö

  while(i <= document.cookie.length)
  {
    start = i
    end = start + name.length
    // name°ú µ¿ÀÏÇÑ ¹®ÀÚ°¡ ÀÖ´Ù¸é
    if(document.cookie.substring(start, end) == name) {
      Found = true
      break
    }
    i++
  }

  // name ¹®ÀÚ¿­À» cookie¿¡¼­ Ã£¾Ò´Ù¸é
  if(Found == true)
  {
    start = end + 1
    end = document.cookie.indexOf(";", start)

    // ¸¶Áö¸· ºÎºÐÀÌ¶ó´Â °ÍÀ» ÀÇ¹Ì(¸¶Áö¸·¿¡´Â ";"°¡ ¾ø´Ù)
    if(end < start)
      end = document.cookie.length

    // name¿¡ ÇØ´çÇÏ´Â value°ªÀ» ÃßÃâÇÏ¿© ¸®ÅÏÇÑ´Ù.
    return document.cookie.substring(start, end);
  }

  return false;
}

//Àü¿ë¹é½Å by samchuck
function install_hauri() //{{{
{
    var dlgHeight = 465;
    var dlgWidth  = 454;
    s = navigator.userAgent;
    if (s.search('MSIE 7') > 0 ) {
       dlgHeight = dlgHeight - 45;
       dlgWidth  = dlgWidth  -  7;
    }

    url = "http://pmang.sayclub.com/vaccine_popup.nwz";
    if (location.hostname != "pmang.sayclub.com") url = url + "?from=sayclub";
    rtn= window.showModalDialog(url, '', 'dialogHeight:' + dlgHeight + 'px;dialogWidth:' + dlgWidth + 'px;');

    switch(rtn)
    {
        case 1:
            var exp_ck= new Date()
            exp_ck.setTime(exp_ck.getTime()+ 30*1000*60*60*24);
            document.cookie = 'noinst_vaccine=on; expires=' + exp_ck.toGMTString()+ '; path=/; domain=sayclub.com';
            break;
        case 2:
//            SayCtrlHauri.externalmethod("install",
//                '39DFDEC4-4E05-4416-B853-B019AE5E5645', 1, 1, "ÇÇ¸Á ´Ù¿î·Îµå");
    }
}

function check_vaccine()
{
  return 0;

  var temp = getCookie("neowiz_vaccine");
  var temp2 = getCookie("noinst_vaccine");

  if (temp == "on" || temp2 == "on")
  {
    //  alert("°Ë»ç¿Ï·á");
  }
  else
  {
    //  alert("°Ë»ç½ÃÀÛ");
    document.write("<OBJECT id=Popinstall classid='clsid:A60276A5-4069-4E9B-926E-EF54A269A4C0' style='width:0; height:0;' onerror='javascript:install_hauri()'><OBJECT>");
    document.cookie = 'neowiz_vaccine=on;domain=sayclub.com; path=/;';
  }
} //}}}

 function gamble_wheel()//{{{
 {
   var temp = getCookie("disneypromo");

   if (temp == "on")
   {
     //  alert("check¿Ï·á");
   }
   else
   {
     var dlgHeight = 438;
     var dlgWidth  = 300;
     s = navigator.userAgent;
     url = "http://saymall.sayclub.com/event/happybag/disney.nwz";
     open_win (url, "_gamblewheel", dlgWidth, dlgHeight);
     //rtn= window.showModalDialog(url, '', 'dialogHeight:' + dlgHeight + 'px;dialogWidth:' + dlgWidth + 'px;');
   }
 } //}}}

 function pop_realname()//{{{
 {
   var temp = getCookie("poprealnameask");

   if (temp == "on")
   {
     //  alert("check¿Ï·á");
   }
   else
   {
     var dlgHeight = 438;
     var dlgWidth  = 300;
     s = navigator.userAgent;
     url = "http://me.sayclub.com/admin/realname/verifynoti";
     open_win (url, "_realname", dlgWidth, dlgHeight);
     //rtn= window.showModalDialog(url, '', 'dialogHeight:' + dlgHeight + 'px;dialogWidth:' + dlgWidth + 'px;');
   }
 } //}}}

function openPlayer(pDomainid)
{
    if (pDomainid)
    {
      url = "http://www.saycast.com/sayradio/sayradio.nwz?type=station&domainid="+pDomainid;
      window.open(url,"_sayradio","width=485,height=220");
    }
}
function openPlayerPrivate(pCjId,pChannel)
{
  var pChannelStr = "";
  if (pChannel)
  {
    pChannel = pChannel.replace("#","%23");
    pChannel = pChannel.replace("/","%2F");
    pChannelStr = "&channel=" + pChannel;
  }
  if (pCjId)
  {
    url = "http://www.saycast.com/sayradio/sayradio.nwz?type=private&cjid="+ pCjId + pChannelStr;
    window.open(url,"_sayradio","width=485,height=220");
  }
}

//ÀÌ¹ÌÁöÆÄÀÏ °æ·Î º¯°æ ( item_real2 => µî·Ï³¯Â¥º° ¼¼ºÎÆú´õ )
function image_root_converter(imgfile,prefix)/*{{{*/
{
  var str_prefix = '';
  if (prefix) str_prefix = prefix+"_";
  var reg_str = /^([0-9]{4}-[0-9]{2})/;
  if (!(imgfile.match(reg_str))) return "http://file.sayclub.co.kr/charimg/item_real2/"+str_prefix+imgfile;
  else return "http://file.sayclub.co.kr/charimg/item_real2/"+imgfile.substr(0,4)+"/"+imgfile.substr(5,2)+"/"+str_prefix+imgfile;
}/*}}}*/

// Ä·ÆäÀÎ trackingÀ» À§ÇÑ ÇÔ¼ö ¹× ÄÚµå, by amoogi@neowiz.com
//{{{
function pmangGetCookie(name, subname) { // {{{
  var prefix = name + "=";
  var cookieStartIndex = document.cookie.indexOf(prefix);
  if (cookieStartIndex == -1)
    return null;
  var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
  if (cookieEndIndex == -1)
    cookieEndIndex = document.cookie.length;

  if(subname == null || subname == "" || subname == 'undefined')
    return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex)); // cookie row
  else
    return pmangGetSubCookie(subname, unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))); // cookie field in cookie row
}
//}}}

function pmangGetSubCookie(name, ckstring){ // {{{
  var prefix = name + "=";
  var cookieStartIndex = ckstring.indexOf(prefix);
  if (cookieStartIndex == -1)
    return null;
  var cookieEndIndex = ckstring.indexOf("&", cookieStartIndex + prefix.length);
  if (cookieEndIndex == -1)
    cookieEndIndex = ckstring.length;
  return ckstring.substring(cookieStartIndex + prefix.length, cookieEndIndex);
} // }}}

function campaignTrace() // {{{
{
  // trace
  var usersrl = pmangGetCookie("pmang_cpgn_trace", "usersrl");
  var navi    = pmangGetCookie("pmang_cpgn_trace", "navi");
  if(usersrl > 0 && navi == 'y') // usersrlÀÌ Á¸ÀçÇÑ´Ù¸é 0º¸´Ù Ç×»ó Å©´Ù
  {
    usersrl = usersrl;
    var usn = pmangGetCookie("pmang_cpgn_trace", "usn");
    var cdate = pmangGetCookie("pmang_cpgn_trace", "cdate");
    var url = escape(location.href);

    if(this.virtualGET instanceof Function) // virtualGET Á¸Àç ¿©ºÎ È®ÀÎ
      virtualGET("http://"+ location.hostname+ "/pmang_set_campaign_log.nwz?usersrl="+usersrl+"&usn="+usn+"&cdate="+cdate+"&url="+url);
  }
} // }}}
//}}}

// Àå¹Ì²É ¼±¹°µµÂøÆË¾÷ ¶ç¿ì±â
function SayRecvRose(pMsrl,roseCnt,hideNickFlag,message,starhistoryId)/*{{{*/
{
  var url = "http://saycast.sayclub.com/saycast/rosegift/recv/?msrl="+pMsrl+"&roseCnt="+roseCnt+"&hideNickFlag="+hideNickFlag+"&starhistoryId="+starhistoryId+"&message="+message;
  window.open(url,"_blank","resizable=no,width=420,height=620");
}/*}}}*/
// Àå¹Ì²É ¼±¹°µµÂøÆË¾÷ ´äÀå ¶ç¿ì±â
function SayRecvRoseReply(pMsrl,replyMsg,starhistoryId)/*{{{*/
{
  var url = "http://saycast.sayclub.com/saycast/rosegift/reply/?msrl="+pMsrl+"&starhistoryId="+starhistoryId+"&replyMsg="+replyMsg;
  window.open(url,"_blank","resizable=no,width=420,height=470");
}/*}}}*/

// ·Î±×ÀÎ½Ã ½×¿©ÀÖ´Â Àå¹Ì²É¼±¹°ÆË¾÷ ¶ç¿ì±â ( ´äÀåµµ ÇÔ²² ±¸ÇÑ´Ù )
function openRecvRosePop()/*{{{*/
{
return false;
  var result = virtualGET("http://"+document.location.hostname+"/global/virtual/saycast_get_recvrose.vr.nwz");
  var arr = result.split("<split>");

  var arrResult = "";
  var arrTemp = "";
  for (var j=0;j<arr.length;j++)
  {
    if (typeof(arr[j]) != "undefined" && arr[j] != "fail")
    {
      arrResult = arr[j].split("||");
      if (arrResult[0] == "recv")
      {
        for (var i=1;i<arrResult.length;i++)
        {
          arrTemp = arrResult[i].split(":",5);
          SayRecvRose(arrTemp[0],arrTemp[1],arrTemp[2],arrTemp[4],arrTemp[3]);
        }
      }
      else if (arrResult[0] == "reply")
      {
        for (var i=1;i<arrResult.length;i++)
        {
          arrTemp = arrResult[i].split(":",3);
          if (arrTemp[0] && arrTemp[1] && arrTemp[2])
            SayRecvRoseReply(arrTemp[0],arrTemp[2],arrTemp[1]);
        }
      }
    }
  }
}/*}}}*/

// ·Î±×ÀÎ ½Ã ¿À´ÃÀÇ Àå¹Ì¸¦ Áö±Þ¹ÞÁö ¾ÊÀº ·ÎÁîÇÃ·¯½º ÀÌ¿ëÀÚ¿¡°Ô ¾È³» ÆË¾÷ ¶ç¿î´Ù
function openAutopayDailyRosePop()/*{{{*/
{
  var result = virtualGET("http://"+document.location.hostname+"/global/virtual/roseplus_get_chance.vr.nwz");
  if(result == 1)window.open('http://me.sayclub.com/event/rosePlus/popupDailyRose', 'dailyRose','width=400,height=320');
}/*}}}*/


// ¾ÆÀÌÅÛ °ü·Ã ÇÔ¼ö
if("undefined" == typeof ItemHandler)
{
  ItemHandler = {
    imageRootConverter : function (imgfile,prefix) { //ÀÌ¹ÌÁöÆÄÀÏ °æ·Î º¯°æ ( item_real2 => µî·Ï³¯Â¥º° ¼¼ºÎÆú´õ )
      var str_prefix = '';
      if (prefix) str_prefix = prefix+"_";
      var reg_str = /^([0-9]{4}-[0-9]{2})/;
      if (!(imgfile.match(reg_str)))
        return "http://filei.sayclub.kr/charimg/item_real2/"+str_prefix+imgfile;
      else
        return "http://filei.sayclub.kr/charimg/item_real2/"+imgfile.substr(0,4)+"/"+imgfile.substr(5,2)+"/"+str_prefix+imgfile;
    },
    getAvatarZindex : function ()
    {
      var z_index = new Array;
      z_index[1]=  8;
      z_index[2]=  7;
      z_index[3]=  6;
      z_index[4]=  9;
      z_index[5]=  5;
      z_index[6]=  14;
      z_index[7]=  15;
      z_index[8]=  22;
      z_index[9]=  0;
      z_index[10]= 1;
      z_index[11]= 2;
      z_index[12]= 3;
      z_index[13]= 4;
      z_index[14]= 13;
      z_index[15]= 10;
      z_index[16]= 11;
      z_index[17]= 12;
      z_index[18]= 16;
      z_index[19]= 17;
      z_index[20]= 18;
      z_index[21]= 19;
      z_index[22]= 20;
      z_index[23]= 21;
      return z_index;
    },
    getAvatarFromFilestr : function (filestr,mood,width,height)
    {
      if (jQuery.inArray(mood,[2,3,4,5]) == -1) mood = 1;
      var z_index = ItemHandler.getAvatarZindex();
      var leftPosition = - (100-width) / 2;
      var charimg = "<!-- CHARACTER START --><div>";
      charimg += "<div id=\"character\" style=\"position:relative; top:0; left:0; width:"+width+"px; height:"+height+"px; overflow:hidden\">";

      var arrChar = filestr.split("!");
      if (arrChar.length > 1)
      {
        var arrTemp = "";
        if (typeof(arrChar[4]) != "undefined" && arrChar[4] != "*")
        {
          arrTemp = arrChar[4].split(",");
          arrChar[4] = arrTemp[0];
        }
        if (typeof(arrChar[17]) != "undefined" && arrChar[17] != "*")
        {
          arrTemp = arrChar[17].split(",");
          arrChar[17] = arrTemp[0];
        }
        for (var j=0; j<23; j++)
        {
          if (typeof(arrChar[j]) == "undefined" || arrChar[j] == "" || arrChar[j] == "*")
            arrChar[j] = "img_blank.gif";
        }

        var layer = 0;
        var tempStr = "";
        for (var i=0;i<arrChar.length;i++)
        {
          layer = i+1;
          if (i==0 || i==4 || i==12 || i==17 || i==18)
          {
            if (mood >= 2 && mood <= 5 && arrChar[i] != "img_blank.gif" && arrChar[i].search("default") == -1)
            {
              arrChar[i] = arrChar[i].replace("01.gif","0"+mood+".gif");
            }
          }
          charimg += "<div id=\"Layer"+layer+"\" style=\"position:absolute; left:"+leftPosition+"px; top:0px; z-index:"+z_index[layer]+"\">";
          charimg += "<img id=\"ImgChar"+layer+"\" src=\""+ItemHandler.imageRootConverter(arrChar[i])+"\" border=\"0\"></div>";
        }
      }
      else
      {
        charimg += "<div id=\"Layer0\" style=\"position:absolute; left:"+leftPosition+"px; top:0px; z-index:1\">";
        charimg += "<img src=\""+ItemHandler.imageRootConverter(filestr)+"\" border=\"0\"></div>";
      }
      charimg += "</div></div><!-- CHARACTER END -->";

      return charimg;
    }
  }
}

function bannerOpenByNw(url)
{
  window.open(url, "_blank");
}

function bannerOpenByPw(url)
{
  if(typeof(window.opener) != 'undefined')
  {
    window.opener.parent.location.replace(url);
    self.close();
  }
  else
  {
    var newwin = window.open(url);
  }
}

function formatNumber(src, separator_pos)
{
  var x = [];
  src = new String(src);
  for(var i=1;i<=src.length;i++)
  {
    if (i % separator_pos)
      x[src.length-i] = src.charAt(src.length-i);
    else
      x[src.length-i] = ','+src.charAt(src.length-i);
  }
  return x.join('').replace(/^,/,'');
}

/**
 * Vista ÀÎÁö È®ÀÎ
 */
function isVista()
{
   if(navigator.appVersion)
   {
    ver = navigator.userAgent.toLowerCase();
    if(ver.indexOf('nt 6.0') > -1)
    {
      return true;
    }
   }

   return false;
}
// ---- ÇÔ¼ö Á¤ÀÇ }}}----------------------------------------------------------

  // {{{-- Moving Font
  function movingFont(content,interval)
  {
		setInterval("movingFontAni(content)", interval);
  }
  function isMovingFont(fontfamily)
  {
    if (fontfamily.substr(0,4) =='GF0M')
    {
     return true;
    }
    else 
    {
     return false;
    }
  }  
  function movingAll()
  {
    $("font[@id^=moving]").trigger('activate');
    $("font[@id^=moving]").trigger('keyup');
    $("input[@id^=moving]").trigger('activate');
    $("input[@id^=moving]").trigger('keyup');
    $("div[@id^=moving]").trigger('activate');
    $("div[@id^=moving]").trigger('keyup');
    $("span[@id^=moving]").trigger('activate');
    $("span[@id^=moving]").trigger('keyup');

  }
  function movingSome(id)
  {
    $("font[@id="+id+"]").trigger('activate');
  }  
  function getMovingID(str)
  {
    if (typeof(str)=='undefined'|| str=='')
      return "moving_"+(new Date()).getTime(); 
    else return "moving_"+str;
  }
  function movingFontAni(obj)
  {
    if (obj === null) return;
    if (obj =='undefined' || typeof(obj.style)!='object') return;
    if (!isMovingFont(obj.style.fontFamily)) return;

    var arr = obj.style.fontFamily.split(/_/);
    if (arr.length < 2) return;
    
    var idx = 1;
    if (arr.length == 3) idx = arr[2];
    
    var nextidx=1;
    if (idx < 4) nextidx = parseInt(idx) + 1;
    
    obj.style.fontFamily = arr[0] + '_' + arr[1] + '_' + nextidx;
  }
  //}}}

  function getNewMemoCount() //{{{
  {
    if('object'== typeof(AppletSession))
    {
      var cnt = AppletSession.getvalue('memo_cnt_new');
      if(cnt == '')
        return 0;
      return cnt;
    }
    return 0;
  } //}}}


