var CK_MEMBERID =	0;
var CK_PASSWORD =	1;
var CK_NAME =		2;
var CK_SEX =		3;
var CK_AGE =		4;
var CK_VALID =		5;
var CK_AVATARID =	6;
var CK_IDVALID =	7;
var CK_NICKNAME =	8;
var CK_SOCIALID =	9;
var CK_ABSUID =    10;
var CK_ABSSTATUS = 11;
var CK_PLUSLINK  = 12;
var CK_SERVICE   = 13;
var CK_SUBUPDATE = 14;
var CK_REGPATH		= 15;
var CK_ROOMID		= 20;

var MAX_PASSWORD_LEN = 4;
var FIX_DOMAIN = "hangame.co.jp"


Array.prototype.push = function(value){
	this[this.length] = value;
	return this.length;
}

// use: footer menu
var onresizeFunctions = new Array();
var onscrollFunctions = new Array();

// footer menu functions
function setOnresize(func){
	onresizeFunctions.push(func);
}

function setOnscroll(func){
	onscrollFunctions.push(func);
}

function hg_onresize(){
	for(var i = 0; i < onresizeFunctions.length; i++){
		onresizeFunctions[i]();
	}
}

function hg_onscroll(){
	for(var i = 0; i < onscrollFunctions.length; i++){
		onscrollFunctions[i]();
	}
}
// tooter menu functions

// onResize-Event と onScroll-Eventは、hg_onresize, hg_onscrollで管理します
window.onresize = hg_onresize;
window.onscroll = hg_onscroll;



setDomain();


var GMT_KOREA = -540;

// var USERDETAIL_OPTION = "width=301,height=450,maximize=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,screenX=100,screenY=100,left=100,top=100";
var USERDETAIL_OPTION = "width=301,height=512,maximize=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,screenX=100,screenY=100,left=100,top=100";
var BILL_WIDTH = 570;
var BILL_HEIGHT = 690;
var BILL_OPTION = "yes";

//--- アフィリエート判断 ---
var IspHost = new Array("aff","asp1","asp2","asp3","ocn","odn","dion","hi-ho","isao","gpara","tok2","cyberhome","teacup","nifty","b-bob","4gamer","u-netsurf","mediati","dreamag","skipup","joqr","h555","v2k","vaio-gamecenter","msn","lolipop","netcafe","gamingtv","acrossbb","onmix","ejnet", "famille", "nmbbm", "goo", "tigers-net", "ocntest", "odntest", "diontest", "hi-hotest", "isaotest", "gparatest", "tok2test", "cyberhometest", "teacuptest", "niftytest", "u-netsurftest", "mediatitest", "dreamagtest", "b-bobtest", "4gamertest","skipuptest","joqrtest","h555test","v2ktest","vaio-gamecentertest","msntest","lolipoptest","netcafetest","gamingtvtest","acrossbbtest","onmixtest","ejnettest", "familletest", "nmbbmtest", "gootest", "tigers-nettest");
var aspcounter = 0;
var bAspFlg = 0;
var sHost = document.URL.substr(7);
sHost = sHost.substr(0, sHost.indexOf("."));
for( aspcounter= 0; aspcounter < IspHost.length; aspcounter++ ){
	if( sHost == IspHost[aspcounter] ){
		bAspFlg = 1;
	}
}
var sAdHead = "http://ad2.hangame.co.jp/ad?loc=";
var sAdFoot = "&showme=js";
var sAdAsp = "";
if( bAspFlg == 1 ){
	sAdAsp = "_aff";
}

function openWin(sURL, sWindowName, w, h, sScroll)
{
	// 画面中央のPopup - Scrollbarはオプション 
	// ex)
	//			openWin("test.asp", "winTest", 400, 300);			■ Scrollbar無し
	//			openWin("test.asp", "winTest", 400, 300, "yes");	■ Scrollbar有り
	//			openWin("test.asp", "winTest", 400, 300, "auto");	■ Scrollbar自動

	var x = (screen.width - w) / 2;
	var y = (screen.height - h) / 2;

	if (sScroll==null) sScroll = "no";

	var sOption = "";
	sOption = sOption + "toolbar=no, channelmode=no, location=no, directories=no, resizable=yes, menubar=no";
	sOption = sOption + ", scrollbars=" + sScroll + ", left=" + x + ", top=" + y + ", width=" + w + ", height=" + h;

	if( window.name == sWindowName ){
		var win = window.open(sURL, "", sOption);
		win.name = sWindowName;
		window.close();
	}else{
		var win = window.open(sURL, sWindowName, sOption);
	}
	return win;
}

function openWinFreePos(sURL, sWindowName, w, h, x, y, sScroll)
{
	// 画面特定位置のPopup - Scrollbarはオプション
	// ex)
	//			openWin("test.asp", "winTest", 400, 300, 0, 0);			 ■ Scrollbar無し
	//			openWin("test.asp", "winTest", 400, 300, 0, 0 "yes");	 ■ Scrollbar有り
	//			openWin("test.asp", "winTest", 400, 300, 0, 0 "auto"); ■ Scrollbar自動

	if (sScroll==null) sScroll = "no";

	var sOption = "";
	sOption = sOption + "toolbar=no, channelmode=no, location=no, directories=no, resizable=yes, menubar=no";
	sOption = sOption + ", scrollbars=" + sScroll + ", left=" + x + ", top=" + y + ", width=" + w + ", height=" + h;

	var win = window.open(sURL, sWindowName, sOption);
	return win;
}

function outputCopyright()
{
	// 各ページの下にCopyright入れる
	// ex)
	//			outputCopyright();
	/*
	document.write("<table width=\"100%\" bgcolor=\"#37416E\" border=0 cellspacing=0 cellpadding=0>");
	document.write("<tr><td height=1 bgcolor=gray></td></tr>");
	document.write("<tr valign=middle height=44>");
	document.write("	<td align=center height=44>");
	document.write("		<font style=\"color: white; font-face: verdana,helvetica,gulim; font-size: 10pt\">Copyright(C) Since 2000 NHN Japan Corporation  All Rights Reserved.</font>");
	document.write("	</td>");
	document.write("</tr>");
	document.write("</table>");
	*/

	//setFooter("game");
}

function getCookie(n)
{
	// クッキ - ログインの情報読む
	// ex) 
	//			id = getCookie(CK_MEMBERID);		→ ID読む

	var ckLogin = getStrCookie("login");
	if (ckLogin=="" || ckLogin=="undefined" || ckLogin==null) return "";
	var sList = ckLogin.split("%2C");

	if (n < sList.length) {
		if(n == CK_AVATARID) {
			return sList[n].replace("%2D", "-").replace(/%5F/g, "_");   // 簡易デコード
		} else {
			return sList[n];
		}
	}

	return "";
}

function getStrCookie(sName)
{
	// クッキ読む

	var lName, aRec, aData, aValue, n, sCook;
	lName = sName.toLowerCase();
	var aCook = document.cookie.split("; ");
	
	for (var i=0; i<aCook.length; i++) {
		aRec = aCook[i].split("=");
		if(aRec.length==1 && (lName==aRec[0].toLowerCase())){
			return "";
		}else if(aRec.length == 2){ //hangame.co.jpの以外のサイト(Keyがない場合)
			if(lName==aRec[0].toLowerCase()) return aRec[1];
		}else{
			if(aCook[i].indexOf("&")>0){
				aData = aCook[i].split("&");
				for(var j=0; j<aData.length; j++){
					if(j == 0){
						n = aData[0].indexOf("=");
						sCook = aData[0].substring(0, n);
						aData[0] = aData[0].substring(n+1, aData[0].length);
					}
					aValue = aData[j].split("=");
					if((lName==sCook.toLowerCase()) && (getKey()==aValue[0].toLowerCase())) return aValue[1]; 
				}
			}else{
				aValue = aCook[i].split("=");
				if((lName==aValue[0].toLowerCase()) && aValue.length < 3) return "";
				else if((lName==aValue[0].toLowerCase()) && (getKey()==aValue[1].toLowerCase())) return aValue[2];
			}
		}
	}

	return "";
}

function setStrCookie(sName, sValue)
{
	// クッキ書く
	
	//var exDate = new Date;
	//exDate.setMonth(exDate.getMonth() + 6);
	//document.cookie = sName + "=" + sValue + ";expires=" + exDate.toGMTString();
	document.cookie = sName + "=" + sValue + ";domain=" + getFixDomain();
	return "";
}

function setMenuURL(sValue)
{
	setStrCookie("menuurl", sValue);
}

function numberFormat(nVar, nSize)
{
	// 0000000123の形式に返還  nSizeの省略の場合 00 ~ 99
	// ex)
	//			n = 2;
	//			s = numberFormat(n, 5);			→ s = "00002"
	//			s = numberFormat(n);				→ s = "02"

	if (nSize==null) nSize = 2;
	
	var s = "0000000000" + nVar;
	var n = s.length;

	return s.substring(n - nSize, n);
}

function isNum(sVal)
{
	// 数字形式かないか検査
	// ex)
	//			b = isNum("123")					→ b = true
	//			b = isNum("123ｰ｡ｳｪｴﾙ")		→ b = false

	if (sVal=="") return false;
	for (var i=0; i<sVal.length; i++) {
		if (sVal.charAt(i) < "0") return false;
		if (sVal.charAt(i) > "9") return false;
	}
	return true;
}

function isErrorID_Char(sBuf)
{
	// Stringに特殊記号がある場合にtrueを Return

	var sChk = "!@#$%&*()|'[];:\" ^|><~`=+-\\/{}^_,.?";
	for ( var i=0; i<sBuf.length; i++ ) {
		if (sChk.indexOf(sBuf.charAt(i)) >= 0) {
			return true;
		}
	}
	return false;
}

function isErrorAddress(sBuf)
{
	// Stringに特殊記号がある場合にtrueを Return (空白許容)

	var sChk = "!@#$%&*()|'[];:\"^|><~`=+-\\/{}^_,.?";
	for ( var i=0; i<sBuf.length; i++ ) {
		if (sChk.indexOf(sBuf.charAt(i)) >= 0) {
			return true;
		}
	}
	return false;
}

function isErrorID_Word(sBuf)
{
	// Stringに特殊IDがある場合にtrueを Return

	var sChk = "admin,root,doumi,ubnf,qlor,anbf,mouky".split(",");
	for ( var i=0; i<sChk.length; i++ ) {
		if (sBuf.indexOf(sChk[i]) >= 0) {
			return true;
		}
	}
	return false;
}

String.prototype.trim = function()
{
	// Stringの空白除去
	// ex)
	//		s = "       ひひひ     ".trim();	→ s = "ひひひ"

    return this.replace(/(^\s*)|(\s*$)/g, "");
}

String.prototype.replace = function(a, b)
{
	// Stringの変更
	// ex)
	//		s = "abcTTTdef".replace("TTT", "");	→ s = "abcdef"

	var s = this;
	var n1, n2, s1, s2;

	while (true) {
		if ( s=="" || a=="" ) break;
		n1 = s.indexOf(a);
		if ( n1 < 0 ) break;
		n2 = n1 + a.length;
		if ( n1==0 ) {
			s1 = b;
		}
		else {
			s1 = s.substring(0, n1) + b;
		}
		if ( n2 >= s.length ) {
			s2 = "";
		}
		else {
			s2 = s.substring(n2, s.length);
		}
		s = s1 + s2;
	}
	return s;
}

function checkEmail(EmailForm)
{
	//email チェック
	var strEmail = EmailForm.value;
    var i;
    var strCheck1 = false;
    var strCheck2 = false;
	var iEmailLen = strEmail.length
	if (iEmailLen > 0) {
		// strEmail に '.@', '@.' がある場合にエラーメッセージ
		// strEmail の始めにまたは終わりに '@', '.' がある場合にエラーメッセージ
		if ((strEmail.indexOf(".@") != -1) || (strEmail.indexOf("@.") != -1) ||
			(strEmail.substring(0,1) == ".") || (strEmail.substring(0,1) == "@") ||
			(strEmail.substring(iEmailLen-1,iEmailLen) == ".") || (strEmail.substring(iEmailLen-1,iEmailLen) == "@"))
		{	
	        alert("Emailを正しく入力して下さい｡");
	        EmailForm.focus();
			return false;
		}
	    for ( i=0; i<iEmailLen; i++ ) {
	        if ( (strEmail.substring(i,i+1) == ".") || (strEmail.substring(i,i+1) == "-") || (strEmail.substring(i,i+1) == "_") ||
				((strEmail.substring(i,i+1) >= "0") && (strEmail.substring(i,i+1) <= "9")) ||
				((strEmail.substring(i,i+1) >= "@") && (strEmail.substring(i,i+1) <= "Z")) ||
				((strEmail.substring(i,i+1) >= "a") && (strEmail.substring(i,i+1) <= "z")) ) {
	                if (strEmail.substring(i,i+1) == ".")
						strCheck1 = true;
	                if (strEmail.substring(i,i+1) == "@")
						strCheck2 = true;
	        }
	        else {
	            alert("Emailを正しく入力して下さい｡");
	            EmailForm.focus();
				return false;
	        }
	    }
	
	    if ((strCheck1 == false) || (strCheck2 == false)) {
	        alert("\nEmailを正しく入力して下さい｡");
	        EmailForm.focus();
			return false;
	    }
	}
    return true;
}

function getTargetString(sGameid)
{
	var gm, ag, sx;
	
	gm = (sGameid==null) ? getStrCookie("gameid") : sGameid;
	ag = getCookie(CK_AGE);
	sx = getCookie(CK_SEX).toLowerCase();
	
	return "&showme=html&gm=" + gm + "&ag=" + ag + "&sx=" + sx;
}

function getTimezone()
{
	// Client GMT..

	now = new Date();	
	return now.getTimezoneOffset();
}

function isKorean()
{
	// Clientが韓国か検査

	return (getTimezone()==GMT_KOREA);
}

function getAdvurl(sAdcase, sGameid)
{
	// Clientの国に会っている広告Return
	
	var sTarget = getTargetString(sGameid);
	var sKor = "http://hangamead.naver.com/ad?loc=hangame." + sAdcase + sTarget;
	var sEtc = "http://naver128.naver.com:10040/ad?loc=hangame." + sAdcase + sTarget;
	
	if ( !isKorean() ) {
		if ( typeof(fraUsid)=="object" ) {
			// Clientが外国の場合にIDの統計のために
			fraUsid.location.href = "http://www.hangame.net/user/cuser.jsp?t=" + (getTimezone() / 60) + "&uid=" + txtUsid.value;
		}
	}

	return ( isKorean() ) ? sKor : sEtc;
}

function errPassword(sPassword, sBirth)
{
	// パスワード検査
	// ex)
	//		bErr = errPassword("abcd");		パスワードに不可能な文字の場合に bErr ← true

	var ch, i, nLen, sSocialID;
	
	nLen = sPassword.length;
	if (nLen < MAX_PASSWORD_LEN) return true;

	ch = sPassword.substring(0, 1);
	for ( i=0; i<nLen; i++ ) {
		if (ch != sPassword.substring(i, i + 1)) break;
	}
	if (i >= nLen) return true;
	if (sBirth && sBirth.indexOf(sPassword) >= 0) return true;
	if (sPassword=="1234") return true;

	return false;
}

function getFixDomain()
{
	var s = document.domain;

	if ( s.indexOf(FIX_DOMAIN) >= 0 ) {
		return FIX_DOMAIN;
	}
	else {
		var n = s.indexOf(".");
		return s.substring(n + 1, s.length);
	}
}

function getKey()
{
	var s, n, sKey;
	s = document.location.href;
	n = s.indexOf("http://")
	if((getFixDomain()==FIX_DOMAIN) && (n==0)){
		s = s.substring(7, s.length);
		sKey = s.substring(0, s.indexOf("."));
		if(sKey.toLowerCase() != "gamegate") sKey = "hangame";
	}else{
		sKey = "";
	}
	return sKey.toLowerCase();
}

function setTopMenu(s)
{
	if ( typeof(top.frames[0].oclick)=='function' ) {
		top.frames[0].oclick(s);
	}
}

function setDomain()
{
	document.domain = getFixDomain();
	// document.domain = "hangame.co.jp";
	// window.status = document.domain;
}



//AD
function putAdCode( sAdId ){
	document.write("<script language=javascript src=\""+sAdHead+sAdId+sAdAsp+sAdFoot+"\"></script>");
}
LOGINHOST_domain = new Array("ocn","odn","dio","hih","isa","gpr","tok","cyh","tea","nif","bob","hgj","unt","mdt","drm","jqr","h55","abb","vgc","msn","lol","ncf","gtv","omx","ejn","fam","nmb","gof", "tig", "nms");

function putAdCodeNew( sAdSv, sAdId, sAdHost ){
	var sAdAff = "";
	var aff_host = getCookieHost();
	var cnt;
	
	for(cnt = 0; cnt <= LOGINHOST_domain.length; cnt++){
		if(aff_host == LOGINHOST_domain[cnt]){
			sAdAff = "_aff";
		}
	}
	if(sAdHost == "www."){
		sAdAff = "";
	}

	document.write("<script language=javascript src=\"http://"+sAdSv+".hangame.co.jp/ad?loc="+sAdId+sAdAff+sAdFoot+"\"></script>");
}

//PROFILE
function openProfile( url ){
	window.open(__urlProfile + url, "searchid", USERDETAIL_OPTION);
}

var __bTest = (location.hostname.indexOf('test') >= 0) || (location.hostname.indexOf('dev') >= 0);

var __host_suffix = "";
if(location.hostname.indexOf('test') >= 0){
	__host_suffix = "test"
}else if(location.hostname.indexOf('dev') >= 0){
	__host_suffix = "dev"
}

var sSubDomain = 'http://www.hangame.co.jp';


var __urlLogout = 'http://id.hangame.co.jp/logout.asp';
var __urlMinimail = 'http://minimail.hangame.co.jp/minimail/index.asp';
var __urlProfile = 'http://profile.hangame.co.jp';
var __urlchat = 'http://pasteller.hangame.co.jp';
var __urlSiteMap = 'http://www.hangame.co.jp/sitemap/sitemap.asp';

var __urlHangame = 'http://www.hangame.co.jp/';
//var __urlBeginner = 'javascript:void(window.open(\'http://www.hangame.co.jp/guide/index.htm\', \'guide\', \'width=500,height=400\'));';
var __urlBeginner = 'http://www.hangame.co.jp/pamphlet/index.asp';
var __urlHelp = 'http://customer.hangame.co.jp/';

var __headerImgPath = 'http://images.hangame.co.jp/_images/top200506/img_top';
var __footerImgPath = 'http://images.hangame.co.jp/_images/top200503/footer';

/*
var __serviceMenu = new Array('game'
		, 'triathlon'
		, 'uranai'
		, 'chat'
		, 'circle'
		, 'board'
		, 'avatar'
		, 'prishot'
		, 'mirerva'
		, 'mobile'
		, 'kplus');
*/

var __serviceMenu = new Array(
		'game_top'
		, 'community_top'
		, 'avatar_top'
		, 'entame_top'
		, 'super_top');

var __serviceUrl = new Array(
		'http://easygame.hangame.co.jp/'
		, 'http://community.hangame.co.jp/'
		, 'http://avatars.hangame.co.jp/'
		, 'http://community.hangame.co.jp/'
		, 'http://www.hangame.co.jp/');

var __serviceImg = new Array(
		'/btn_h_game_off0711.gif'
		, '/btn_h_com_off.gif'
		, '/btn_h_avat_off.gif'
		, '/btn_h_enter_off0711.gif'
		, '/btn_h_home_off0711.gif');
		
var __serviceImgSelected = new Array(
		'/btn_h_game_on0711.gif'
		, '/btn_h_com_on.gif'
		, '/btn_h_avat_on.gif'
		, '/btn_h_enter_on0711.gif'
		, '/btn_h_home_off0711.gi');


var __loginHost = new Array("ocn","odn","dio","hih","isa","gpr","tok","cyh","tea","nif","bob","hgj","unt","mdt","drm","jqr","h55","abb","vgc","msn","lol","ncf","gtv","omx","ejn","fam","nmb","gof", "tig", "nms");
var __loginHostInfoDefault = new Array('www', 'http://www.hangame.co.jp/', 'インターネットゲームポータルサイト ハンゲーム', '_self', 'http://images.hangame.co.jp/_images/top200506/img_top/logo.gif', 'display:none');
var __loginHostInfo = new Array(
		new Array("ocn", "http://www.ocn.ne.jp/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/ocn.gif", "display:inline")
		, new Array("odn", "http://www.odn.ne.jp/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/odn.gif", "display:inline")
		, new Array("dio", "http://www.dion.ne.jp/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/dio.gif", "display:inline")
		, new Array("hih", "http://home.hi-ho.ne.jp/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/hih.gif", "display:inline")
		, new Array("isa", "http://www.isao.net/games", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/isa.gif", "display:inline")
		, new Array("gpr", "http://www.gpara.com/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/gpr.gif", "display:inline")
		, new Array("tok", "http://tok2.com/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/tok.gif", "display:inline")
		, new Array("cyh", "http://www.cyberhome.ne.jp/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/cyh.gif", "display:inline")
		, new Array("tea", "http://www.teacup.com/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/tea.gif", "display:inline")
		, new Array("nif", "http://www.hangame.co.jp/", "", "_blank", "http://images.hangame.co.jp/_images/top200506/img_top/logo.gif", "display:none")
		, new Array("bob", "http://www.b-bob.net/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/bob.gif", "display:inline")
		, new Array("hgj", "http://www.hangame.co.jp/", "", "_self", "http://images.hangame.co.jp/_images/top200506/img_top/logo.gif", "display:none")
		, new Array("unt", "http://www1.netsurf.ad.jp/withu/index.html", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/unt.gif", "display:inline")
		, new Array("mdt", "http://www.mediatti.com/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/mdt.gif", "display:inline")
		, new Array("drm", "http://www.dreamag.com/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/drm.gif", "display:inline")
		, new Array("jqr", "http://www.joqr.co.jp/ag/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/jqr.gif", "display:inline")
		, new Array("h55", "http://bb.h555.net/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/h55.gif", "display:inline")
		, new Array("abb", "http://www.hangame.co.jp/", "", "_blank", "http://images.hangame.co.jp/_images/top200506/img_top/logo.gif", "display:none")
		, new Array("vgc", "http://www.vaio.sony.co.jp/Enjoy/Game/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/vgc.gif", "display:inline")
		, new Array("msn", "http://game.msn.co.jp/home.armx", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/msn.gif", "display:inline")
		, new Array("lol", "http://hills.lolipop.jp/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/lol.gif", "display:inline")
		, new Array("ncf", "http://netcafe.hangame.co.jp/netcafe.asp", "", "_self", "http://images.hangame.co.jp/_images/top200506/img_top/logo.gif", "display:none")
		, new Array("gtv", "http://www.gamingtv.jp/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/gtv.gif", "display:inline")
		, new Array("omx", "http://onmix.com/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/omx.gif", "display:inline")
		, new Array("ejn", "http://www.ejnet.ne.jp/index.html", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/ejn.gif", "display:inline")
		, new Array("fam", "http://www.famille.ne.jp/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/fam.gif", "display:inline")
		, new Array("nmb", "http://www.nmbbm.jp/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/nmb.gif", "display:inline")
		, new Array("gof", "http://www.goo.ne.jp/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/gof.gif", "display:inline")
		, new Array("tig", "http://www.tigers-net.com/", "", "_blank", "http://images.hangame.co.jp/_images/isp/logo/tig.gif", "display:inline")
		, new Array("nms", "http://www.hangame.co.jp", "", "_self", "http://images.hangame.co.jp/_images/top200506/img_top/logo.gif", "display:none"));

setUrl();

/** If test, replace url */
function setUrl() {
	if (__bTest) {
		sSubDomain = setTestUrl(sSubDomain);

		__urlLogout = setTestUrl(__urlLogout);
		__urlMinimail = setTestUrl(__urlMinimail);
		__urlProfile = setTestUrl(__urlProfile);
		__urlchat = setTestUrl(__urlchat);

		__urlHangame = setTestUrl(__urlHangame);
		__urlBeginner = setTestUrl(__urlBeginner);
		__urlHelp = setTestUrl(__urlHelp);
		
		__urlSiteMap = setTestUrl(__urlSiteMap);

		for (var i=0;i<__serviceUrl.length;i++) {
			__serviceUrl[i] = setTestUrl(__serviceUrl[i]);
		}
		
		__loginHostInfoDefault[1] = setTestUrl(__loginHostInfoDefault[1]);
	}
}

/** Replace url with test url. */
function setTestUrl(url) {
	if (url.indexOf('www.') >= 0) {
		return url.replace('www.', __host_suffix + '.');
	} else {
		if (url.indexOf('.') >= 0) {
			var testUrl = '';
			var sUrl = url.split('.');
			for (var i=0; i < sUrl.length-1; i++) {
				testUrl += sUrl[i] + ((sUrl[i].indexOf('http://') >= 0) ? __host_suffix + '.' : '.');
			}
			testUrl += sUrl[sUrl.length-1];
			return testUrl;
		} else {
			return url;
		}
	}
}

function getCookieHost() {
	return getStrCookie('loginhost');
}

function isAffSite() {
	var value = getCookieHost();
	var index = 0;
	for (var i=0;i<__loginHost.length;i++) {
		if (__loginHost[i] == value) {
			return true;
		}
	}
	
	return false;
}

function equalsAffSite(host) {
	return (host == getCookieHost());
}

/** Get Hangame / Aff. site info */
function getLoginHostInfo() {
	var value = getCookieHost();
	var index = -1;
	for (var i=0;i<__loginHost.length;i++) {
		if (__loginHost[i] == value) {
			index = i;
			break;
		}
	}

	return (index == -1) ? __loginHostInfoDefault : __loginHostInfo[index];
}

/** Find service index from service Id */
function findServiceIndex(serviceId) {
	
	if(serviceId == 'game' || serviceId == 'triathlon'){
		return 0;
	}else if(serviceId == 'chat' || serviceId == 'circle' || serviceId == 'board' || serviceId == 'kplus'){
		return 1;
	}else if(serviceId == 'avatar'){
		return 2;
	}else if(serviceId == 'uranai' || serviceId == 'prishot' || serviceId == 'mirerva' || serviceId == 'mobile'){
		return 3;
	}
	
	for (var i=0;i<__serviceMenu.length;i++) {
		if (serviceId == __serviceMenu[i])
			return i;
	}
	
	return 4; // default
}

/** Replace current service image with activated image */
function setServiceImg(index) {
	__serviceImg[index] = __serviceImg[index].replace('_off','_on');
}


/** Hangame Header Generation */
function setHeader(serviceId, gameid) {
	// Set images
	var index = findServiceIndex(serviceId);
	setServiceImg(index);
	
	// Set Login host infomation
	var loginHost = getLoginHostInfo();

	var __s = '';
	if(arguments.length <= 1){
		gameid = "";
	}

	__s += '<style type="text/css">';
	__s += '<!--';
	__s += '*,.*';
	__s += '{';
	__s += '	font-family : "MS Gothic" ;';
	__s += '	font-family : "MS UI Gothic" ;';
	__s += '}';
	__s += '.t11_in {font-size: 11px; color: #666666; line-height: 120%;}';
	__s += '.t12_in {font-size: 12px; color: #666666; line-height: 120%;}';
	__s += 'a.noglay_in:link {color: #666666;text-decoration: none;}';
	__s += 'a.noglay_in:active {color: #666666;text-decoration: none;}';
	__s += 'a.noglay_in:visited {color: #666666;text-decoration: none;}';
	__s += 'a.noglay_in:hover{color: #666666; text-decoration: underline}';
	__s += '.aff {';
	__s += ' text-align:right;';
	__s += ' position:relative;';
	__s += ' top:44px;';
	__s += ' left:30px;';
	__s += ' margin-right:2px;';
	__s += ' font-weight:normal;';
	__s += ' font-size:11px;';
	__s += ' color:#777777;';
	__s += '}';
	__s += '-->';
	__s += '</style>';

	__s += '<table width="770" border="0" cellpadding="0" cellspacing="0" align="center">';
	__s += '<tr>';
	__s += '<td width="199"><span class="aff" style="' + loginHost[5] + '">Powered by HANGAME</span><a href="' + loginHost[1] + '" target="' + loginHost[3] + '"><img src="' + loginHost[4] + '" alt="' + loginHost[2] + '" border="0"></a></td>';
	__s += '<td width="571"><table width="571" height="68" border="0" cellpadding="0" cellspacing="0">';
	__s += '<tr>';
	__s += '<td align="right" valign="top"><table border="0" cellpadding="0" cellspacing="0">';
	__s += '<tr>';
	__s += '<td><img src="http://images.hangame.co.jp/_images/top200506/img_top/shim.gif" width="2" height="6"></td>';
	__s += '</tr>';
	__s += '<tr>';
	__s += '<td><span class="t12_in"><a href="http://www.hangame.co.jp/event/promotion/index.asp" class="noglay_in">2005年キャンペーン</a>｜<a href="http://www.hangame.co.jp/sitemap/sitemap.asp" class="noglay_in">サイトマップ</a>｜<a href="http://www.hangame.co.jp/pamphlet/index.asp" class="noglay_in">はじめての方へ</a>｜<a href="http://customer.hangame.co.jp/" class="noglay_in">ヘルプ</a></span></td>';
	__s += '</tr>';
	__s += '</table></td>';
	__s += '</tr>';
	__s += '<tr>';
	__s += '<td height="33" valign="bottom"><table width="571" border="0" cellpadding="0" cellspacing="0">';
	__s += '<tr>';
	__s += '<td><a href="' + __serviceUrl[4] + '"><img src="' + __headerImgPath + __serviceImg[4] + '" alt="トップページ" width="91" height="33" border="0"></a></td>';
	__s += '<td><a href="' + __serviceUrl[0] + '"><img src="' + __headerImgPath + __serviceImg[0] + '" onMouseOver="this.src=\'' + __headerImgPath + __serviceImgSelected[0] + '\'" onMouseOut="this.src=\'' + __headerImgPath + __serviceImg[0] + '\'" alt="ゲームで遊ぼう ゲーム" width="120" height="33" border="0"></a></td>';
	__s += '<td><a href="' + __serviceUrl[1] + '"><img src="' + __headerImgPath + __serviceImg[1] + '" onMouseOver="this.src=\'' + __headerImgPath + __serviceImgSelected[1] + '\'" onMouseOut="this.src=\'' + __headerImgPath + __serviceImg[1] + '\'" alt="友達を作ろう コミュニティ" width="120" height="33" border="0"></a></td>';
	__s += '<td><a href="' + __serviceUrl[2] + '"><img src="' + __headerImgPath + __serviceImg[2] + '" onMouseOver="this.src=\'' + __headerImgPath + __serviceImgSelected[2] + '\'" onMouseOut="this.src=\'' + __headerImgPath + __serviceImg[2] + '\'" alt="おしゃれをしよう アバター" width="120" height="33" border="0"></a></td>';
	__s += '<td><a href="' + __serviceUrl[3] + '"><img src="' + __headerImgPath + __serviceImg[3] + '" onMouseOver="this.src=\'' + __headerImgPath + __serviceImgSelected[3] + '\'" onMouseOut="this.src=\'' + __headerImgPath + __serviceImg[3] + '\'" alt="動画・占い・ケータイ エンタメ" width="120" height="33" border="0"></a></td>';
	__s += '</tr>';
	__s += '</table></td>';
	__s += '</tr>';
	__s += '</table></td>';
	__s += '</tr>';
	__s += '</table>';
	__s += '<table width="770" border="0" cellpadding="0" cellspacing="0" align="center"><tr><td bgcolor="#666666"><img src="http://images.hangame.co.jp/_images/top200506/img_top/shim.gif" width="2" height="2"></td></tr></table>';
	__s += '<EMBED id="D22AABF2-BFF0-4b20-B5F8-441DC33D9D94" class="' + gameid + '" width=0 height=0 style="display: none;"></EMBED>';

	document.write(__s);

	var elem = document.getElementsByTagName("BODY");
	elem[0].style.marginTop = 0;
}

var __dynamic_index = 10;
var __temp_host = getLoginHostInfo();
if(__temp_host[0] != "www"){
	__dynamic_index = 5;
}

/** Hangame Footer Generation */
function setFooter(serviceId) {
	var __s = '';

	__s += '<table align="center" border="0" cellpadding="0" cellspacing="0" width="770">';
	__s += '<tr><td height="3" bgcolor="#D2D2D2"></td></tr>';
	__s += '<tr><td height="2" bgcolor="#EFEFEF"></td></tr>';
__s += '<tr><td height="28" align="center"><a href="http://www.nhncorp.jp/" target="_blank" class="copy"><img src="' + __footerImgPath + '/logo_nhncorp.gif" width="100" height="24" border="0" align="absmiddle" hspace="10" alt="NHN Japan Corporation"> Copyright&copy; since 2000. <b>NHN Japan Corporation</b>. All Rights Reserved.</a></td></tr>';
	__s += '</table>';

	document.write(__s);
	//document.write("<iframe src='http://lcs.hangame.co.jp/u{"+document.URL+"}' width=0 height=0 frameborder=0></iframe>");
	
	initFooterMune();
}

setTitle();

/** Hangame Title */
function setTitle() {
	if (document.title.match("楽しい１日が始まる")) {
		document.title = "Happy Everyday ハンゲーム";
	}
}

function openSearchid(){
	ckID = getCookie(CK_MEMBERID);
	if (ckID.length==0) {
		alert("ログインされていませんので、ともだち検索をご利用いただけません。");
		return;
	}
	openProfile("/userinfo/finduser.asp");
}
function openPost(){
	openWin(__urlMinimail, "postList", 540, 600, "no");
}

function openMypage(){
	ckID = getCookie(CK_MEMBERID);
	if (ckID.length==0) {
		alert("ログインされていませんので、マイページをご利用いただけません。");
		return;
	}
	openProfile("/userinfo/index.asp");
}
function clickLogout(){
	top.location.href = __urlLogout;
}

function buyItem(s, sex){
	ckID = getCookie(CK_MEMBERID);
	if (ckID.length==0) {
		alert("ログインされていませんので、アイテムをご購入いただけません。");
		return;
	}
	if( (sex != "A") && (sex != getCookie(CK_SEX)) ){
		alert("性別が違うアイテムは購入できません。");
	}else{
		openWin( sSubDomain + "/avatar/popAvitem.asp?proc=buy&linkfrom=top&lstItem=" + s + "@", "avItem", 400, 460, "yes");
	}
}

function giftItem(s){
	ckID = getCookie(CK_MEMBERID);
	if (ckID.length==0) {
		alert("ログインされていませんので、プレゼント機能をご利用いただけません。");
		return;
	}
	openWin( sSubDomain + "/avatar/popAvitem.asp?proc=gift&linkfrom=top&lstItem=" + s + "@", "avItem", 400, 460, "yes");
}

function buyAvapri(s, sInfo){
	ckID = getCookie(CK_MEMBERID);
	if (ckID.length==0) {
		alert("ログインされていませんので、アイテムをご購入いただけません。");
		return;
	}
	
	openWin( sSubDomain + "/avatar/popAvitem.asp?proc="+sInfo+"&linkfrom=top&lstItem=" + s + "@", "avItem", 400, 460, "yes");
}

function buyProc(s, sInfo){
	ckID = getCookie(CK_MEMBERID);
	if (ckID.length==0) {
		alert("ログインされていませんので、アイテムをご購入いただけません。");
		return;
	}
	
	openWin( sSubDomain + "/avatar/popAvitem.asp?proc="+sInfo+"&linkfrom=top&lstItem=" + s + "@", "avItem", 400, 460, "yes");
}

function setNDScode(){
	//document.write("<iframe src='http://lcs.hangame.co.jp/u{"+document.URL+"}' width=0 height=0 frameborder=0></iframe>");
}


function buyTicketUranai(s, sInfo){
	ckID = getCookie(CK_MEMBERID);
	if (ckID.length==0) {
		alert("ログインされていませんので、アイテムをご購入いただけません。");
		return;
	}
		openWin( sSubDomain + "/avatar/popAvitem.asp?proc="+sInfo+"&linkfrom=top&lstItem=" + s + "@", "avItem", 400, 460, "yes");
}

// footer menu functions
var footer_menu_id = "hg_footer_menu";
var footer_margin = 0;


function hg_checkIsZenkaku(value) {
	for (var i = 0; i < value.length; ++i) {
		var c = value.charCodeAt(i);
		if (c < 256 || (c >= 0xff61 && c <= 0xff9f)) {
			return false;
		}
	}
	return true;
}

function hg_getByteCount(value) {
	var count = 0;
	for ( var i = 0; i < value.length; ++i ) {
		var sub = value.substring(i, i + 1);
		if( hg_checkIsZenkaku(sub) ){
			count += 2;
		} else {
			count += 1;
		}
	}
	return count;
}

function openFooterMenuChat(){
	ckID = getCookie(CK_MEMBERID);
	if (ckID.length == 0) {
		alert("ログインされていませんので、チャットをご利用いただけません。");
		return false;
	}
	//exec_chat_area.location.href = __urlchat + '/pasteller/chat_create_room.asp?roomname=&maxuser=20&sCategoryname=&execution=1';
	exec_chat_area.location.href = __urlchat + '/pasteller/chat_create_room.asp?roomname=' + escape("交流用広場001") + '&maxuser=50&cat_code=1&kwinsize=2';

	return true;
}

function execSearchid(){
	var target_id = "";
	target_id = document.footer_frm.find.value;

	if(!isFindInitialize || target_id == "" || target_id.length <= 0){
		//openProfile("/userinfo/finduser.asp");
		alert("検索したいハンゲームIDを入力してください");
		document.footer_frm.find.value = "";
		isFindInitialize = true;
		
		document.footer_frm.find.focus();
		return false;
	}

	if(hg_getByteCount(target_id) > 20){
		alert("ハンゲームIDを正しく入力してください。\n（全角10文字半角20文字まで）");
		isFindInitialize = true;
		
		document.footer_frm.find.focus();
		return false;
	}

	openProfile("/userinfo/finduser.asp?find=" + escape(target_id));
	return false;
}

function getElementLeft(obj){
	var width = 0;
	var p;

	width = obj.offsetLeft;
	for(p = obj.offsetParent; p.tagName != 'BODY'; p = p.offsetParent){
		width += p.offsetLeft;
	}
	
	return width;
}

function getElementtop(obj){
	var top = 0;
	var p;

	top = obj.offsetTop;
	for(p = obj.offsetParent; p.tagName != 'BODY'; p = p.offsetParent){
		top += p.offsetLeft;
	}
	
	return top;
}

function showToolChip(obj, comment){
	var width = getElementLeft(obj);
	var top = getElementtop(obj);

	document.getElementById("menu_alt").innerHTML = comment;
	var menubar = document.getElementById(footer_menu_id);
	
	document.getElementById("menu_comment").style.left = width - (document.getElementById("menu_comment").width / 2) + (obj.width / 2);
	document.getElementById("menu_comment").style.top = (document.body.clientHeight + document.body.scrollTop + 5) - (menubar.clientHeight * 2);

	document.getElementById("menu_alt").style.lineHeight = 1;
	document.getElementById("menu_alt").style.color = "#000000";
	document.getElementById("menu_comment").style.display = "inline";
}

function hiddenToolChip(obj){
	document.getElementById("menu_comment").style.display = "none";
}

var isFindInitialize = false;
function initFind(obj){
	if(isFindInitialize){
		return;
	}
	obj.value = "";
	isFindInitialize = true;
}

function createFooterMenu(){
	var value  = "";

	value += '<form name="footer_frm" onsubmit="return execSearchid();">';

	value += '<table id="hg_footer_menu" style="left: 0px;position: absolute;display: none;" border="0" cellpadding="0" cellspacing="0" width="100%" background="http://images.hangame.co.jp/_images/top200503/footer/bg_glay.gif">';
	value += '<tr height="28">';
	value += '	<td align="center">';
	value += '	<table border="0" cellpadding="0" cellspacing="0" width="770">';
	value += '	<tr><td height="1"></td></tr>';
	value += '	<tr><td>';
	value += '		<table cellspacing="3" cellpadding="0" border="0">';
	value += '		<tr>';
	value += '		<td><img src="http://images.hangame.co.jp/_images/top200503/footer/line.gif"></td>';
	value += '		<td><img src="http://images.hangame.co.jp/_images/top200503/footer/footer_img1.gif" align="absmiddle">';
	value += '		  <input name="find" type="text" onclick="initFind(this);" value="IDを入力してください"></td>';
	value += '		<td><img onclick="execSearchid();" src="http://images.hangame.co.jp/_images/top200503/footer/btn_seach_off.gif" onMouseOver="this.src=\'http://images.hangame.co.jp/_images/top200503/footer/btn_seach_on.gif\'" onMouseOut="this.src=\'http://images.hangame.co.jp/_images/top200503/footer/btn_seach_off.gif\'"></td>';
	value += '		<td><img src="http://images.hangame.co.jp/_images/top200503/footer/line.gif" hspace="10"></td>';
	value += '		</tr>';
	value += '		</table>';
	value += '		</td>';
	value += '		<td align="right">';
	value += '		<table cellspacing="3" cellpadding="0" border="0">';
	value += '		<tr>';
	value += '		<td><a href="javascript:openMypage();"><img src="http://images.hangame.co.jp/_images/top200503/footer/btn_profile_off.gif" onMouseOver="this.src=\'http://images.hangame.co.jp/_images/top200503/footer/btn_profile_on.gif\'" onMouseOut="this.src=\'http://images.hangame.co.jp/_images/top200503/footer/btn_profile_off.gif\'" style="cursor: hand;" border="0"></a></td>';
	value += '		<td><a href="javascript:void(location.href=\'' + sSubDomain + '/avatar/itemshop.asp?menu=5\');"><img src="http://images.hangame.co.jp/_images/top200503/footer/btn_bag_off.gif" onMouseOver="this.src=\'http://images.hangame.co.jp/_images/top200503/footer/btn_bag_on.gif\'" onMouseOut="this.src=\'http://images.hangame.co.jp/_images/top200503/footer/btn_bag_off.gif\'" style="cursor: hand;" border="0"></a></td>';
	value += '		<td><a href="javascript:void(openPost());"><img src="http://images.hangame.co.jp/_images/top200503/footer/btn_minimail_off.gif" onMouseOver="this.src=\'http://images.hangame.co.jp/_images/top200503/footer/btn_minimail_on.gif\'" onMouseOut="this.src=\'http://images.hangame.co.jp/_images/top200503/footer/btn_minimail_off.gif\'" style="cursor: hand;" border="0"></a></td>';
	value += '		<td><a href="javascript:void(location.href=\'http://circle.hangame.co.jp/circle/index.asp?view=mycircle\');"><img src="http://images.hangame.co.jp/_images/top200503/footer/btn_circle_off.gif" onMouseOver="this.src=\'http://images.hangame.co.jp/_images/top200503/footer/btn_circle_on.gif\'" onMouseOut="this.src=\'http://images.hangame.co.jp/_images/top200503/footer/btn_circle_off.gif\'" style="cursor: hand;" border="0"></a></td>';
	value += '		<td><a href="javascript:void(openFooterMenuChat());"><img src="http://images.hangame.co.jp/_images/top200503/footer/btn_chat_off.gif" onMouseOver="this.src=\'http://images.hangame.co.jp/_images/top200503/footer/btn_chat_on.gif\'" onMouseOut="this.src=\'http://images.hangame.co.jp/_images/top200503/footer/btn_chat_off.gif\'" style="cursor: hand;" border="0"></a></td>';
	value += '		<td><img onclick="javascript:void(clickLogout());" src="http://images.hangame.co.jp/_images/top200503/footer/btn_logout_off.gif" onMouseOver="this.src=\'http://images.hangame.co.jp/_images/top200503/footer/btn_logout_on.gif\'" onMouseOut="this.src=\'http://images.hangame.co.jp/_images/top200503/footer/btn_logout_off.gif\'" hspace="10" style="cursor: hand;"></td>';
	value += '		</tr>';
	value += '		</table>';
	value += '	</td></tr>';
	value += '	</table>';
	value += '</td></tr>';
	value += '</table>';
	value += '</form>';

	value += '<iframe src="" name="exec_chat_area" style="display:none"></iframe>';
	
	document.write(value);
}

function initFooterMune(){
	createFooterMenu();
	document.getElementById("hg_footer_menu").style.display = "inline";

	var elem = document.getElementsByTagName("BODY");
	elem[0].style.marginBottom = document.getElementById(footer_menu_id).clientHeight + footer_margin;
	elem[0].style.marginLeft = 0;
	elem[0].style.marginRight = 0;
	
	setInterval("moeFooterMenu()", 100);
}

function moeFooterMenu(){
	var menubar = document.getElementById(footer_menu_id);
	menubar.style.top = (document.body.clientHeight + document.body.scrollTop) - menubar.clientHeight;
}

function hg_chgButton(btObj){
	btObj.style.display='none';
	if (typeof(btObj.form) == "object"){
		disObj = eval("document." + btObj.form.name + "." + btObj.name + "_dis");
	}else{
		disObj = eval("document." + btObj.name + "_dis");
	}
	disObj.style.display='';
}

// footer menu functions

/** Hangame Event(MSN Sports) Header Generation   2005/07/11(Kyounghwa Park) **/
function setEventHeader() {

	var __s = '';

	__s += '<table width="100%" height="32"  border="0" cellpadding="0" cellspacing="0">';
 	__s += '<tr>';
 	__s += '<td width="131" valign="top" background="http://images.hangame.co.jp/_images/top200506/img_nw/top_pt.gif"><a href="http://www.hangame.co.jp/" target="_blank"><img src="http://images.hangame.co.jp/_images/top200506/img_nw/logo_nw.gif" width="131" height="30" border="0"></a></td>';
  	__s += '<td width="*" valign="top" background="http://images.hangame.co.jp/_images/top200506/img_nw/top_pt.gif"><img src="http://images.hangame.co.jp/_images/top200506/img_nw/catch.gif" width="120" height="30"></td>';
	__s += '<td width="104" valign="top" background="http://images.hangame.co.jp/_images/top200506/img_nw/top_pt.gif"><a href="http://customer.hangame.co.jp/" target="_blank"><img src="http://images.hangame.co.jp/_images/top200506/img_nw/help.gif" width="66" height="30" border="0"></a></td>';
	__s += '</tr>';
	__s += '</table>';
//	__s += '<EMBED id="D22AABF2-BFF0-4b20-B5F8-441DC33D9D94" class="" width=0 height=0 style="display: none;"></EMBED>';

	document.write(__s); 

}


/** Hangame Event(MSN Sports) Footer Generation   2005/07/11(Kyounghwa Park) **/
function setEventFooter(serviceId) {
	var __s = '';

	__s += '<table width="100%" height="60"  border="0" cellpadding="0" cellspacing="0">';
 	__s += '<tr>';
 	__s += '<td width="175" align="center" background="http://images.hangame.co.jp/_images/top200506/img_nw/bottom_pt.gif"><img src="http://images.hangame.co.jp/_images/top200506/img_nw/nhnlogo_nw.gif" width="67" height="22"></td>';
  	__s += '<td width="*" background="http://images.hangame.co.jp/_images/top200506/img_nw/bottom_pt.gif"><img src="http://images.hangame.co.jp/_images/top200506/img_nw/bottom_prm.gif" width="581" height="34" border="0"></td>';
	__s += '</tr>';
	__s += '</table>';

	document.write(__s);
	
}


function setHgAB(){
	var OBJECTID, CLASSID;
	OBJECTID = "HgAB";
	CLASSID = "C71C8580-B76B-4FA4-8592-1160E8CE2BBC";
	document.write('<OBJECT ID="'+OBJECTID+'" width=0 Height=0 CLASSID="CLSID:'+CLASSID+'" CODEBASE="http://down.hangame.co.jp/jp/dist/hgstart/HanGamePluginJP16.cab" style="display:none"></OBJECT>');
	return eval(OBJECTID);
}

function setHgPlugin(){
	var OBJECTID, CLASSID;
	OBJECTID = "HanGamePluginJP16";
	CLASSID = "2C079F28-EE92-4700-A44B-AF5FA285FCCA";
	document.write('<OBJECT ID="'+OBJECTID+'" width=0 Height=0 CLASSID="CLSID:'+CLASSID+'" CODEBASE="http://down.hangame.co.jp/jp/dist/hgstart/HanGamePluginJP16.cab#version=16,0,0,0" style="display:none"></OBJECT>');
	return eval(OBJECTID);
}
