document.onmousedown = HideContextMenu;

oCM_width = 0;
oCM_height = 0;
oCMH_width = 0;
oCMH_height = 0;

MakePopObj();
MakeCMHtml();
MakeCMHtml_gbook();
MakeCMHtml_hompy();
destCMObj = document.all.oCM;
destCMObj_gbook = document.all.oCMG;
destCMObj_hompy = document.all.oCMH;
tUserID = null;
tUserIDX = null;
tHompyIDX = null;
tURL = null;

//document.write('<object id="winCtlClose" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><param name="Command" value="Close"></object>');

/*
function ForceCloseWindow()
{
	winCtlClose.Click();
}
*/

function GetWinTop(height)
{
	return ((screen.height/2) - (height/2))-20;
}

function GetWinLeft(width)
{
	return ((screen.width/2) - (width/2))-5;
}

function Positioning()
{
	window.top.moveTo(GetWinLeft(1000), GetWinTop(620));
}

function PopMsg(msg)
{
	var rtn = showModalDialog('/_web/common/def_popMsg.htm?mode=msg&msg='+msg, 'hompyMsg', 'dialogWidth: 320px; dialogHeight: 230px; status: no; resizable: no; scroll: no;');

	if (rtn != null)
	{
		return rtn;
	}
}

function popmsg(msg)
{
	var rtn = PopMsg(msg);

	if (rtn != null)
	{
		return rtn;
	}
}

function PopConfirm(msg)
{
	var rtn = showModalDialog('/_web/common/def_popMsg.htm?mode=confirm&msg='+msg, 'hompyMsg', 'dialogWidth: 320px; dialogHeight: 220px; status: no; resizable: no; scroll: no;');

	if (rtn == null)
	{
		return false;
	}
	else
	{
		return rtn;
	}
}

function popconfirm(msg)
{
	return PopConfirm(msg);
}

function PopLogin()
{
	var tWidth = 300;
	var tHeight = 220;

	var whnd = window.open('/_web/login/poplogin_form.htm', 'loginPop', "width="+tWidth+", height="+tHeight+", scrollbars=no, resizable=no, top="+GetWinTop(tHeight)+", left="+GetWinLeft(tWidth));

	whnd.focus();
}

function poplogin()
{
	PopLogin();
}

function PopContextMenu(userid, useridx)
{
	tUserID = userid;
	tUserIDX = useridx;

	
	var btype = document.info_for_popup.btype.value;
	var useridx = document.info_for_popup.useridx.value;
	var h_useridx = document.info_for_popup.h_useridx.value;
	var isadmin = document.info_for_popup.isadmin.value;

	if(tUserIDX != '' && btype == 'GBOOK' && (useridx == h_useridx || isadmin==true))
	{
		ShowContextMenu(destCMObj_gbook);
	}else {
		ShowContextMenu(destCMObj);
	}
}

function PopContextMenuHompy(hompyidx, url)
{
	tHompyIDX = hompyidx;

	if (url == null)
	{
		tURL = '';
	}
	else
	{
		tURL = url;
	}

	ShowContextMenu(destCMObj_hompy);
}

function ShowContextMenu(tgObj)
{
	if (tgObj == destCMObj)
	{
		chkWidth = oCM_width;
		chkHeight = oCM_height;
	}
	else
	{
		chkWidth = oCMH_width;
		chkHeight = oCMH_height;
	}

	tY = event.y + document.body.scrollTop + 5;
	tX = event.x + document.body.scrollLeft;

	if (tX > document.body.clientWidth + document.body.scrollLeft - chkWidth)
	{
		tX -= chkWidth;
	}

	if (tY > document.body.clientHeight + document.body.scrollTop - chkHeight)
	{
		tY -= chkHeight;
	}

	tgObj.style.top = tY;
	tgObj.style.left = tX;

	tgObj.style.display = 'inline';
}

function HideContextMenu()
{
	tUserID = null;
	tUserIDX = null;
	tHompyIDX = null;
	tURL = null;

	destCMObj.style.display = 'none';
	destCMObj_gbook.style.display = 'none';
	destCMObj_hompy.style.display = 'none';
}

function MakeCMHtml()
{

	if (document.all.oCM == null)
	{
		document.write("<div id='oCM' style='position: absolute; top: 0; left: 0; z-index: 999; display: inline'>");
		document.write("<table border=0 cellspacing=0 cellpadding=0 width=105 style='border: 1 solid #6A6A6A'>");
		document.write("<col style='padding: 3 3 3 3'>");
		document.write("<!--tr><td bgcolor=white onMouseOver='this.style.backgroundColor=\"#F5F5F5\"' onMouseOut='this.style.backgroundColor=\"\"'><a class='popcm' href='#' onMouseDown='ViewProfile(); return false'>Á¤º¸º¸±â</a></td></tr-->");
		document.write("<tr><td bgcolor=white onMouseOver='this.style.backgroundColor=\"#F5F5F5\"' onMouseOut='this.style.backgroundColor=\"\"'><a class='popcm' href='#' onMouseDown='RequestFam(\"\", \"\"); return false'>ÆÔ ½ÅÃ»ÇÏ±â</a></td></tr>");
		document.write("<tr><td bgcolor=white onMouseOver='this.style.backgroundColor=\"#F5F5F5\"' onMouseOut='this.style.backgroundColor=\"\"'><a class='popcm' href='#' onMouseDown='GoHompyNewWindow(0); return false'>È¨ÇÇ°¡±â(»õÃ¢)</a></td></tr>");
		document.write("<tr><td bgcolor=white onMouseOver='this.style.backgroundColor=\"#F5F5F5\"' onMouseOut='this.style.backgroundColor=\"\"'><a class='popcm' href='#' onMouseDown='GoHompy(0); return false'>È¨ÇÇ°¡±â(ÇöÀçÃ¢)</a></td></tr>");		
		document.write("<tr><td bgcolor=white onMouseOver='this.style.backgroundColor=\"#F5F5F5\"' onMouseOut='this.style.backgroundColor=\"\"'><a class='popcm' href='#' onMouseDown='AddBuddy(); return false'>Ä£±¸·Î Ãß°¡</a></td></tr>");
		document.write("<tr><td bgcolor=white onMouseOver='this.style.backgroundColor=\"#F5F5F5\"' onMouseOut='this.style.backgroundColor=\"\"'><a class='popcm' href='#' onMouseDown='KeepOffUser(); return false'>Á¢±Ù±ÝÁöµî·Ï</a></td></tr>");
		document.write("</table>");
		document.write("</div>");
		document.write("");

		oCM_width = document.all.oCM.offsetWidth;
		oCM_height = document.all.oCM.offsetHeight;
		document.all.oCM.style.display = "none";
	}
}


function MakeCMHtml_gbook()
{

	if (document.all.oCMG == null)
	{
		document.write("<div id='oCMG' style='position: absolute; top: 0; left: 0; z-index: 999; display: inline'>");
		document.write("<table border=0 cellspacing=0 cellpadding=0 width=105 style='border: 1 solid #6A6A6A'>");
		document.write("<col style='padding: 3 3 3 3'>");
		document.write("<!--tr><td bgcolor=white onMouseOver='this.style.backgroundColor=\"#F5F5F5\"' onMouseOut='this.style.backgroundColor=\"\"'><a class='popcm' href='#' onMouseDown='ViewProfile(); return false'>Á¤º¸º¸±â</a></td></tr-->");
		document.write("<tr><td bgcolor=white onMouseOver='this.style.backgroundColor=\"#F5F5F5\"' onMouseOut='this.style.backgroundColor=\"\"'><a class='popcm' href='#' onMouseDown='RequestFam(\"\", \"\"); return false'>ÆÔ ½ÅÃ»ÇÏ±â</a></td></tr>");
		document.write("<tr><td bgcolor=white onMouseOver='this.style.backgroundColor=\"#F5F5F5\"' onMouseOut='this.style.backgroundColor=\"\"'><a class='popcm' href='#' onMouseDown='GoHompyNewWindow(0); return false'>È¨ÇÇ°¡±â(»õÃ¢)</a></td></tr>");
		document.write("<tr><td bgcolor=white onMouseOver='this.style.backgroundColor=\"#F5F5F5\"' onMouseOut='this.style.backgroundColor=\"\"'><a class='popcm' href='#' onMouseDown='GoHompy(0); return false'>È¨ÇÇ°¡±â(ÇöÀçÃ¢)</a></td></tr>");		
		document.write("<tr><td bgcolor=white onMouseOver='this.style.backgroundColor=\"#F5F5F5\"' onMouseOut='this.style.backgroundColor=\"\"'><a class='popcm' href='#' onMouseDown='AddBuddy(); return false'>Ä£±¸·Î Ãß°¡</a></td></tr>");
		document.write("<tr><td bgcolor=white onMouseOver='this.style.backgroundColor=\"#F5F5F5\"' onMouseOut='this.style.backgroundColor=\"\"'><a class='popcm' href='#' onMouseDown='KeepOffUser(); return false'>Á¢±Ù±ÝÁöµî·Ï</a></td></tr>");
		document.write("<tr><td bgcolor=white onMouseOver='this.style.backgroundColor=\"#F5F5F5\"' onMouseOut='this.style.backgroundColor=\"\"'><a class='popcm' href='#' onMouseDown='DelAllContents(); return false'>µî·Ï±Û ÀüÃ¼»èÁ¦</a></td></tr>");
		document.write("</table>");
		document.write("</div>");
		document.write("");

		oCMM_width = document.all.oCMG.offsetWidth;
		oCMM_height = document.all.oCMG.offsetHeight;
		document.all.oCMG.style.display = "none";
	}
}


function KeepOffUser()
{	
	if(tUserID == document.info_for_popup.userid.value)
	{
		alert("ÀÚ½ÅÀÇ ¾ÆÀÌµð´Â Á¢±Ù±ÝÁö ÇÒ ¼ö ¾ø½À´Ï´Ù.");
		return false;
	}
	

	if( confirm("ID:"+tUserID+" »ç¿ëÀÚ¸¦ ÀÌ¿ëÀÚ´Ô È¨ÇÇ¿¡ Á¢±Ù±ÝÁö »ç¿ëÀÚ·Î µî·ÏÇÏ½Ã°Ú½À´Ï±î?") )
	{
			var args = 'action=add_keepoff_user&tg_userid='+tUserID;
			
			RequestHttp('/_web/hompy_manage/process_ajax.php', ResultProcess, args);
	}
}

function DelAllContents()
{
	var hompyidx = document.info_for_popup.hompyidx.value;
	var btype = document.info_for_popup.btype.value;
	var bidx = document.info_for_popup.bidx.value;

	if( confirm("ID:"+tUserID+" »ç¿ëÀÚ°¡ µî·ÏÇÑ ±ÛÀ» ¸ðµÎ »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?") )
	{
		var args = 'action=del_all_contents&tg_useridx='+tUserIDX+'&hompyidx='+hompyidx+'&btype='+btype+'&bidx='+bidx;
		
		RequestHttp('/_web/hompy_manage/process_ajax.php', ResultProcess, args);

	}

}

function AddBuddy()
{
	if(tUserID == document.info_for_popup.userid.value)
	{
		alert("ÀÚ±â ÀÚ½ÅÀº Ä£±¸·Î µî·ÏÇÒ ¼ö ¾ø½À´Ï´Ù.");
		return false;
	}

	if( confirm("ID:"+tUserID+" »ç¿ëÀÚ¸¦ ³ªÀÌ½º3355 Ä£±¸·Î Ãß°¡ÇÏ½Ã°Ú½À´Ï±î?") )
	{
		var args = 'action=add_buddy&tg_userid='+tUserID;
		
		RequestHttp('/_web/hompy_manage/process_ajax.php', ResultProcess, args);

	}


}

function ResultProcess(data)
{
	//alert(data);
	//return;
	
	var JSON = eval('(' + data + ')');

	if(JSON.result != 'ok')
	{
		alert(JSON.result_str);
		return;
	}else {
		switch (JSON.action)
		{
			case 'add_keepoff_user':
				alert(JSON.result_str);
				break

			case 'del_all_contents':
				alert(JSON.result_str);
				location.reload();
				break
			case 'add_buddy':
				alert(JSON.result_str);
				break;

		}
	}
}


function MakeCMHtml_hompy()
{
	if (document.all.oCMH == null)
	{
		document.write("<div id='oCMH' style='position: absolute; top: 0; left: 0; z-index: 999; display: inline'>");
		document.write("<table border=0 cellspacing=0 cellpadding=0 width=105 style='border: 1 solid #6A6A6A'>");
		document.write("<col style='padding: 3 3 3 3'>");
		document.write("<tr><td bgcolor=white onMouseOver='this.style.backgroundColor=\"#F5F5F5\"' onMouseOut='this.style.backgroundColor=\"\"'><a class='popcm' href='#' onMouseDown='GoHompyNewWindow(1); return false'>È¨ÇÇ°¡±â(»õÃ¢)</a></td></tr>");
		document.write("<tr><td bgcolor=white onMouseOver='this.style.backgroundColor=\"#F5F5F5\"' onMouseOut='this.style.backgroundColor=\"\"'><a class='popcm' href='#' onMouseDown='GoHompy(1); return false'>È¨ÇÇ°¡±â(ÇöÀçÃ¢)</a></td></tr>");
		document.write("</table>");
		document.write("</div>");
		document.write("");

		oCMH_width = document.all.oCMH.offsetWidth;
		oCMH_height = document.all.oCMH.offsetHeight;
		document.all.oCMH.style.display = "none";
	}
}

function ViewProfile()
{
	PopMsg('ÁØºñÁßÀÔ´Ï´Ù.<br>'+tUserID+'/'+tUserIDX+' Á¤º¸º¸±â');
}

function GoHompy(method, arg)
{
	switch (method)
	{
		case (0):
			if (arg != null)
			{
				top.location.href = "/_web/pophompy.htm?userid="+arg;
			}
			else
			{
				top.location.href = "/_web/pophompy.htm?userid="+tUserID;
			}
			break;

		case (1):
			if (tURL == null)
			{
				tURL = '';
			}

			if (arg != null)
			{
				top.location.href = "/_web/pophompy.htm?hompyidx="+arg+'&tgurl='+tURL;
			}
			else
			{
				top.location.href = "/_web/pophompy.htm?hompyidx="+tHompyIDX+'&tgurl='+tURL;
			}
			break;
	}
}

function GoHompyNewWindow(method)
{
	try
	{
		top.opener.OpenHompy(method, tUserID, tHompyIDX, tURL);
	}
	catch(e)
	{
		try
		{
			OpenHompy(method, tUserID, tHompyIDX, tURL);
		}
		catch(e)
		{
			PopMsg("ÁË¼ÛÇÕ´Ï´Ù.<br>ÇöÀç »õ Ã¢À¸·Î È¨ÇÇ¸¦ ¶ç¿ï ¼ö ¾ø½À´Ï´Ù.");

			return;
		}
	}
}

function OpenHompy(method, tUserID, tHompyIDX, tURL)
{
	var tWidth = 1000;
	var tHeight = 620;

	switch (method)
	{
		case (0):

			try
			{
				var wHnd = window.open("/_web/pophompy.htm?userid="+tUserID, tUserID.replace(/-/g, ""), "width="+tWidth+", height="+tHeight+", scrollbars=no, resizable=no, top="+GetWinTop(tHeight)+", left="+GetWinLeft(tWidth));
			}
			catch(e)
			{
				var wHnd = window.open("/_web/pophompy.htm?userid="+tUserID, "hangulD", "width="+tWidth+", height="+tHeight+", scrollbars=no, resizable=no, top="+GetWinTop(tHeight)+", left="+GetWinLeft(tWidth));
			}
			break;
		
		case (1):
			var wHnd = window.open("/_web/pophompy.htm?hompyidx="+tHompyIDX+'&tgurl='+tURL, tHompyIDX, "width="+tWidth+", height="+tHeight+", scrollbars=no, resizable=no, top="+GetWinTop(tHeight)+", left="+GetWinLeft(tWidth));
			break;
		
		case (2):
			var wHnd = window.open("/_web/pophompy.htm?useridx="+tUserID, tUserID.replace(/-/g, ""), "width="+tWidth+", height="+tHeight+", scrollbars=no, resizable=no, top="+GetWinTop(tHeight)+", left="+GetWinLeft(tWidth));
			break;
	}

	wHnd.focus();
}

function MoveArticle(reqs, pid)
{
	var rtn = showModalDialog('/_web/board/move.htm?'+reqs+'&pid='+pid, 'hompyMsg', 'dialogWidth: 290px; dialogHeight: 220px; status: yes; resizable: no; scroll: no;');

	return rtn;
}

function ScrapArticle(reqs, pid)
{
	var rtn = showModalDialog('/_web/board/scrap.htm?'+reqs+'&pid='+pid, 'hompyMsg', 'dialogWidth: 285px; dialogHeight: 300px; status: yes; resizable: no; scroll: no;');

	return rtn;
}

actMenu = 'home';
imgpath = '/_web/images';

function AccuseArticle(reqs, btable, pid)
{
	if (PopConfirm("ºÎ´ç/°ÅÁþ ½Å°í½Ã ºÒÀÌÀÍÀ» ¹ÞÀ» ¼ö ÀÖÀ¸´Ï ÁÖÀÇ ¹Ù¶ø´Ï´Ù.<br>½Å°íÇÏ½Ã°Ú½À´Ï±î?"))
	{
		var rtn = showModalDialog('/_web/board/accuse.htm?'+reqs+'&btable='+btable+'&pid='+pid, 'accuse', 'dialogWidth: 285px; dialogHeight: 220px; status: yes; resizable: no; scroll: no;');

		return rtn;
	}
}

function AccuseHompy(hompyidx)
{
	if (PopConfirm("ºÎ´ç/°ÅÁþ ½Å°í½Ã ºÒÀÌÀÍÀ» ¹ÞÀ» ¼ö ÀÖÀ¸´Ï ÁÖÀÇ ¹Ù¶ø´Ï´Ù.<br>½Å°íÇÏ½Ã°Ú½À´Ï±î?"))
	{
		var rtn = showModalDialog('/_web/accuse_hompy.htm?hompyidx='+hompyidx, 'accuseHompy', 'dialogWidth: 285px; dialogHeight: 285px; status: yes; resizable: no; scroll: no;');

		return rtn;
	}
}

function CopyText(obj)
{
	var rng = obj.createTextRange();
	rng.select();
	rng.execCommand('copy');
	PopMsg("º¹»çµÇ¾ú½À´Ï´Ù.<br>¿øÇÏ½Ã´Â °÷¿¡´Ù ºÙ¿©³Ö±â(ctrl+v) ÇÏ¼¼¿ä.");
}

function MainMenuOver(tg)
{
	if (tg != actMenu)
	{
		document.images['btn_main_'+tg].src = iMainMenu[tg]["over"].src;
	}
}

function MainMenuOut(tg)
{
	if (tg == actMenu)
	{
		document.images['btn_main_'+tg].src = iMainMenu[tg]["act"].src;
	}
	else
	{
		document.images['btn_main_'+tg].src = iMainMenu[tg]["off"].src;
	}
}

function ReloadMenuBtn()
{
	var menuLength = top.iMainMenuInfo.length;

	for (var i=0; i<menuLength; i++)
	{
		if (top.iMainMenuInfo[i] == top.actMenu)
		{
			top.document.images["btn_main_"+top.iMainMenuInfo[i]].src = top.iMainMenu[top.iMainMenuInfo[i]]["act"].src;
		}
		else
		{
			top.document.images["btn_main_"+top.iMainMenuInfo[i]].src = top.iMainMenu[top.iMainMenuInfo[i]]["off"].src;
		}
	}
}

function ChangeLeftPanel(menuIdx)
{
	//lp = findLastParent(self);
	lp = top;
	tg = top.document.all;

	switch(menuIdx)
	{
		case('home'):
		case('profile'):
		case('favorites'):
		case('manage'):
		case('gbook'):
			tg.arLeftPanel.style.display = "none";
			tg.arUserInfo.style.display = "inline";
			tg.arLeftWhole.style.display = "inline";
			break;

		case('normal'):
		case('picture'):
			tg.arLeftPanel.style.display = "inline";
			tg.arUserInfo.style.display = "none";
			tg.arLeftWhole.style.display = "none";
			lp.DisplayMenuTree(menuIdx);
			break;

		case('diary'):
			tg.arLeftPanel.style.display = "inline";
			tg.arUserInfo.style.display = "none";
			tg.arLeftWhole.style.display = "inline";
			lp.DisplayCalendar(lp.menuInfo[menuIdx][1]["bidx"]);
			break;

/*
		case('gbook'):
			tg.arLeftPanel.style.display = "none";
			tg.arUserInfo.style.display = "none";
			tg.arLeftWhole.style.display = "inline";
			lp.DisplayMenuTree(menuIdx);
			break;
*/

		case('avahome'):
			tg.arLeftPanel.style.display = "inline";
			tg.arUserInfo.style.display = "none";
			tg.arLeftWhole.style.display = "none";
			lp.DisplayAvaHomeMenu();
			break;
	}
}

function ActivateMainMenu(menuIdx)
{
	try
	{
		if (parent.actMenu == menuIdx)
		{
			return;
		}

		ChangeLeftPanel(menuIdx);
		parent.document.images['btn_main_'+menuIdx].src = parent.iMainMenu[menuIdx]["act"].src;
		parent.document.images['btn_main_'+parent.actMenu].src = parent.iMainMenu[parent.actMenu]["off"].src;
		parent.actMenu = menuIdx;
	}
	catch(e)
	{
		return;
	}
}

function ActivateMainMenu_self(menuIdx)
{
	try
	{
		if (actMenu == menuIdx)
		{
			return;
		}

		ChangeLeftPanel(menuIdx);
		document.images['btn_main_'+menuIdx].src = iMainMenu[menuIdx]["act"].src;
		document.images['btn_main_'+actMenu].src = iMainMenu[actMenu]["off"].src;
		actMenu = menuIdx;
	}
	catch(e)
	{
		return;
	}
}

function RequestFam(hidx, name)
{
	if (tUserID != null)
	{
		id = tUserID;
	}
	else
	{
		id = "";
	}

	var rtn = showModalDialog('/_web/fam/request_fam.htm?hidx='+hidx+'&name='+name+'&tg_id='+id, 'reqFam', 'dialogWidth: 350px; dialogHeight: 285px; status: yes; resizable: no; scroll: no;');
}

function AddFavorite(hidx)
{
	var rtn = showModalDialog('/_web/favorites/add_favorite_form.htm?hidx='+hidx, 'addFav', 'dialogWidth: 285px; dialogHeight: 205px; status: yes; resizable: no; scroll: no;');
}

oTimer = null;
myCoverSkin = null;
tryonSecond = 10;
function TryOnCoverSkin(skin)
{
	myCoverSkin = top.document.all.cover_table.style.backgroundImage;
	top.document.all.cover_table.style.backgroundImage = "url(http://imagenew.myhompy.to/images/COVER/"+skin+".gif)";
	
	PopMsg("È¨ÇÇ ½ºÅ² ¹Ì¸®º¸±â°¡ Àû¿ëµÇ¾ú½À´Ï´Ù.<br>È®ÀÎÀ» ´©¸£½Ã¸é ¿ø·¡ ½ºÅ²À¸·Î µ¹¾Æ°©´Ï´Ù.");

	top.document.all.cover_table.style.backgroundImage = myCoverSkin;

/*
	if (oTimer != null)
	{
		clearTimeout(oTimer);
		oTimer = null;
	}

	oTimer = setTimeout("RestoreCoverSkin()", tryonSecond*1000);
*/
}

function RestoreCoverSkin()
{
	if (oTimer != null)
	{
		clearTimeout(oTimer);
		oTimer = null;
	}

	if (myCoverSkin != null)
	{
		top.document.all.cover_table.style.backgroundImage = myCoverSkin;
		myCoverSkin = null;
	}
}

function PreviewCoverSkin(skin, isMain)
{
	if (isMain == null)
	{
		TryOnCoverSkin(skin);
		return;
	}
	else
	{
		var tWidth = 1000;
		var tHeight = 640;

		var whnd = window.open('/_web/pophompy_preview.htm?skin='+skin, '', 'width='+tWidth+', height='+tHeight+', resizeable=no, scrollbars=no, status=yes, top='+GetWinTop(tHeight)+', left='+GetWinLeft(tWidth));

/*
		whnd.document.write("<html><head><title>È¨ÇÇ½ºÅ² ¹Ì¸®º¸±â - Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.</title></head><body bgcolor=white onClick='self.close()' onContextMenu='return true' onDragStart='return false' onSelectStart='return false' topmargin=0 leftmargin=0 style='cursor: hand'>");
		whnd.document.write("<img name='oImg' src='http://imagenew.myhompy.to/images/COVER/"+skin+".gif' title='Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.'>");
		whnd.document.write("</body></html>");
*/

		whnd.focus();
	}
}

function PreviewMainView(skin)
{
	var tWidth = 700;
	var tHeight = 400;

	var whnd = window.open('', '', 'width='+tWidth+', height='+tHeight+', resizeable=no, scrollbars=no, top='+GetWinTop(tHeight)+', left='+GetWinLeft(tWidth));

	whnd.document.write("<html><head><title>È¨ÇÇ ºä ¹Ì¸®º¸±â - Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.</title></head><body bgcolor=white onClick='self.close()' onContextMenu='return true' onDragStart='return false' onSelectStart='return false' topmargin=0 leftmargin=0 style='cursor: hand'>");
	whnd.document.write("<img name='oImg' src='http://imagenew.myhompy.to/images/MAINVIEW/"+skin+".gif' title='Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.'>");
	whnd.document.write("</body></html>");

	whnd.focus();
}

function PreviewBoardSkin(skin, skinname)
{
	var tWidth = 660;
	var tHeight = 555;

	var whnd = window.open('/_web/hompy_manage/boardskin_preview.htm?skin='+skin+'&skinname='+skinname, '', 'width='+tWidth+', height='+tHeight+', resizeable=no, scrollbars=no, status=yes, top='+GetWinTop(tHeight)+', left='+GetWinLeft(tWidth));

/*
	whnd.document.write("<html><head><title>½ºÅ² ¹Ì¸®º¸±â - Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.</title></head><body bgcolor=white onClick='self.close()' onContextMenu='return true' onDragStart='return false' onSelectStart='return false' topmargin=0 leftmargin=0 style='cursor: hand'>");
	whnd.document.write("<img name='oImg' src='http://hompy.nice3355.co.kr/_web/board/skin/"+skin+"/"+skin+".gif' title='Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.'>");
	whnd.document.write("</body></html>");
*/

	whnd.focus();
}

function PreviewMenuBtn(itemIdx)
{
	var menuLength = top.iMainMenuInfo.length;

	for (var i=0; i<menuLength; i++)
	{
		if (top.iMainMenuInfo[i] == top.actMenu)
		{
			top.document.images["btn_main_"+top.iMainMenuInfo[i]].src = "http://imagenew.myhompy.to/images/MAINBTN/menubtn_"+itemIdx+"_"+top.iMainMenuInfo[i]+"_act.gif";
		}
		else
		{
			top.document.images["btn_main_"+top.iMainMenuInfo[i]].src = "http://imagenew.myhompy.to/images/MAINBTN/menubtn_"+itemIdx+"_"+top.iMainMenuInfo[i]+".gif";
		}
	}

	PopMsg("¹Ì¸®º¸±â°¡ Àû¿ëµÇ¾ú½À´Ï´Ù.<br>È®ÀÎÀ» ´©¸£½Ã¸é ¿ø·¡ ¸Þ´º ¹öÆ°À¸·Î µ¹¾Æ°©´Ï´Ù.");
	ReloadMenuBtn();

	/*
	var tWidth = 700;
	var tHeight = 400;

	var whnd = window.open('', '', 'width='+tWidth+', height='+tHeight+', resizeable=no, scrollbars=no, top='+GetWinTop(tHeight)+', left='+GetWinLeft(tWidth));

	whnd.document.write("<html><head><title>½ºÅ² ¹Ì¸®º¸±â - Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.</title></head><body bgcolor=white onClick='self.close()' onContextMenu='return true' onDragStart='return false' onSelectStart='return false' topmargin=0 leftmargin=0 style='cursor: hand'>");
	whnd.document.write("<img name='oImg' src='http://imagenew.myhompy.to/images/MAINBTN/"+skin+"_preview.gif' title='Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.'>");
	whnd.document.write("</body></html>");

	whnd.focus();
	*/
}

function PreviewHompyItem(itemcode)
{
	switch(itemcode)
	{
		case('wfont_001'):
			PopBoardWebFont(null, 'PREVIEW', null);
			break;

		case('deco_001'):
			PreviewDecoFrame('PREVIEW');
			break;
	}
}

function PreviewHouseItem(itemcode)
{
	eachData = itemcode.split('|');
	wmidx = eachData[0];
	tmidx = eachData[1];
	bmidx = eachData[2];
	hmidx = eachData[3];

	//alert(wmidx+"/"+tmidx+"/"+bmidx+"/"+hmidx);

	if (wmidx == undefined || wmidx == "" || tmidx == undefined || tmidx == "" || bmidx == undefined || bmidx == "")
	{
		PopMsg("ÁË¼ÛÇÕ´Ï´Ù.<br>¸¶ÀÌÈ¨ Á¤º¸°¡ ¾ø½À´Ï´Ù.");
		return;
	}

	tgURL = "/_web/htown/main.htm?wmidx="+wmidx+"&tmidx="+tmidx+"&bmidx="+bmidx+"&hmidx="+hmidx;
	try
	{
		var dest = top.opener;
		if (dest.location.href)
		{
			dest.location.href = tgURL;
			dest.focus();
		}
		else
		{
			window.open(tgURL, '' , '');
		}
	}
	catch(e)
	{
		window.open(tgURL, '' , '');
	}
}

function PreviewDecoFrame(frmCode)
{
	if (frmCode == null)
	{
		frmCode = '';
	}

	var rtn = showModalDialog('/_web/board/preview_deco_frame.htm?frmCode='+frmCode, 'previewDecoFrame', 'dialogWidth: 500px; dialogHeight: 575px; status: yes; resizable: no; scroll: no;');

	if (rtn != null && frmCode != 'PREVIEW')
	{
		document.all._deco_frame.value = rtn;
	}

	//var tWidth = 500;
	//var tHeight = 500;
	//var wHnd = window.open('/_web/board/preview_deco_frame.htm?frmCode='+frmCode, 'popBoardskin', 'width='+tWidth+', height='+tHeight+', top='+GetWinTop(tHeight)+', left='+GetWinLeft(tWidth));
	//wHnd.focus();
}

function PreviewScriptItem(script, scriptname)
{
	var tWidth = 660;
	var tHeight = 415;

	var whnd = window.open('/_web/script_items/'+script+'/preview.htm?itemcode='+script+'&scriptname='+scriptname, '', 'width='+tWidth+', height='+tHeight+', resizeable=no, scrollbars=no, top='+GetWinTop(tHeight)+', left='+GetWinLeft(tWidth)+', status=yes');

/*
	whnd.document.write("<html><head><title>½ºÅ² ¹Ì¸®º¸±â - Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.</title></head><body bgcolor=white onClick='self.close()' onContextMenu='return true' onDragStart='return false' onSelectStart='return false' topmargin=0 leftmargin=0 style='cursor: hand'>");
	whnd.document.write("<img name='oImg' src='http://hompy.nice3355.co.kr/_web/board/skin/"+skin+"/"+skin+".gif' title='Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.'>");
	whnd.document.write("</body></html>");
*/

	whnd.focus();
}

function PopBoardSkinList(hompyidx, btype, bidx)
{
	try
	{
		isUpdated = true;
	}
	catch(e)
	{
		return;
	}
	
	var tWidth = 500;
	var tHeight = 603;

	var wHnd = window.open('/_web/hompy_manage/boardskin_pop_list.htm?hompyidx='+hompyidx+'&btype='+btype+'&bidx='+bidx, 'popBoardskin', 'width='+tWidth+', height='+tHeight+', top='+GetWinTop(tHeight)+', left='+GetWinLeft(tWidth)+', status=yes');
	wHnd.focus();
}

function PopScriptItemList(hompyidx, btype, bidx)
{
	try
	{
		isUpdated = true;
	}
	catch(e)
	{
		return;
	}
	
	var tWidth = 500;
	var tHeight = 580;

	var wHnd = window.open('/_web/hompy_manage/scriptitem_pop_list.htm?hompyidx='+hompyidx+'&btype='+btype+'&bidx='+bidx, 'popBoardskin', 'width='+tWidth+', height='+tHeight+', top='+GetWinTop(tHeight)+', left='+GetWinLeft(tWidth)+', status=yes');
	wHnd.focus();
}


function PopBoardWebFont(hompyidx, btype, bidx)
{
	try
	{
		isUpdated = true;
	}
	catch(e)
	{
		return;
	}

	var rtn = showModalDialog('/_web/hompy_manage/webfont_setting.htm?hompyidx='+hompyidx+'&btype='+btype+'&bidx='+bidx, 'popBoardWebfont', 'dialogWidth: 500px; dialogHeight: 340px; status: yes; resizable: no; scroll: no;');
}

function PopMainWebFont(hompyidx)
{
	var rtn = showModalDialog('/_web/hompy_manage/webfont_setting_for_main.htm?hompyidx='+hompyidx, 'popMainWebfont', 'dialogWidth: 500px; dialogHeight: 340px; status: yes; resizable: no; scroll: no;');
}

function PopPhoneSetting(hompyidx, bidx)
{
	var tWidth = 400;
	var tHeight = 354;

	var wHnd = window.open('/_web/hompy_manage/phoneFolder_setting.htm?hompyidx='+hompyidx+'&bidx='+bidx, 'phoneFldSetting', 'width='+tWidth+', height='+tHeight+', top='+GetWinTop(tHeight)+', left='+GetWinLeft(tWidth)+', status=yes');
	wHnd.focus();
}

function PopFrameSetting(hompyidx, bidx, btype)
{
	var rtn = showModalDialog('/_web/hompy_manage/frame_setting.htm?hompyidx='+hompyidx+'&bidx='+bidx+'&btype='+btype, 'frameSetting', 'dialogWidth: 300px; dialogHeight: 275px; status: yes; resizable: no; scroll: no;');
}

function PopBoardCategory(hompyidx, bidx)
{
	var rtn = showModalDialog('/_web/hompy_manage/board_category.htm?hompyidx='+hompyidx+'&bidx='+bidx, 'categorySetting', 'dialogWidth: 300px; dialogHeight: 235px; status: yes; resizable: no; scroll: no;');
}

function PopAddr(hompyidx)
{
	hompyid = top.hompyAddr;
	var rtn = showModalDialog('/_web/hompy_manage/addr.htm?hompyidx='+hompyidx+'&hompyid='+hompyid, 'regAddr', 'dialogWidth: 300px; dialogHeight: 225px; status: yes; resizable: no; scroll: no;');

	if (rtn != null)
	{
		top.document.all.hompy_url.value = 'http://myhompy.to/'+rtn;
		top.hompyAddr = rtn;
	}
}

function PopNotifyDetail(hompyidx)
{
	var rtn = showModalDialog('/_web/hompy_manage/notify_detail.htm?hompyidx='+hompyidx, 'buyCoverSkin', 'dialogWidth: 300px; dialogHeight: 332px; status: yes; resizable: no; scroll: no;');

	document.all._oNotifyCount.innerHTML = 0;
	document.images._notifyIcon.src = "/_web/images/dummy.gif";

	if (rtn != null)
	{
		switch(rtn)
		{
			case(1):
				GoManageFamRequest(hompyidx);
				break;

			case(2):
				GoManageFamResult(hompyidx);
				break;

			case(3):
				GoManageProfileQna(hompyidx);
				break;

			case(4):
				GoManageVisitEventResult(hompyidx);
				break;

			case(5):
				GoManageRcvPresent(hompyidx);
				break;

			case(6):
				GoManageRcvBGM(hompyidx);
				break;
		}
	}
}

function BuyCoverSkin(hompyidx, pid, itemcode, buyMode)
{
	var rtn = showModalDialog('/_web/hompy_manage/coverskin_buy.htm?hompyidx='+hompyidx+'&pid='+pid+'&itemcode='+itemcode, 'buyCoverSkin', 'dialogWidth: 300px; dialogHeight: 422px; status: yes; resizable: no; scroll: no;');

	if (rtn != null)
	{
		if (rtn == "GoBuyCoupon")
		{
			GoBuyCoupon()
		}
		else if (buyMode != 'main')
		{
			top.document.all.cover_table.style.backgroundImage = "url("+rtn+".gif)";
		}
	}
}

function PresentCoverSkin(hompyidx, pid, itemcode)
{
	var rtn = showModalDialog('/_web/hompy_manage/coverskin_present.htm?hompyidx='+hompyidx+'&pid='+pid+'&itemcode='+itemcode, 'buyCoverSkin', 'dialogWidth: 300px; dialogHeight: 550px; status: yes; resizable: no; scroll: no;');

	if (rtn != null)
	{
		if (rtn == "GoBuyCoupon")
		{
			GoBuyCoupon();
		}
	}
}

function BuyMainView(hompyidx, pid, itemcode)
{
	//window.open('/_web/hompy_manage/coverskin_buy.htm?hompyidx='+hompyidx+'&pid='+pid, 'buyCoverSkin', '');
	var rtn = showModalDialog('/_web/hompy_manage/mainview_buy.htm?hompyidx='+hompyidx+'&pid='+pid+'&itemcode='+itemcode, 'buyMainView', 'dialogWidth: 300px; dialogHeight: 422px; status: yes; resizable: no; scroll: no;');

	if (rtn != null)
	{
		if (rtn == "GoBuyCoupon")
		{
			GoBuyCoupon();
		}
	}
}

function PresentMainView(hompyidx, pid, itemcode)
{
	var rtn = showModalDialog('/_web/hompy_manage/mainview_present.htm?hompyidx='+hompyidx+'&pid='+pid+'&itemcode='+itemcode, 'buyCoverSkin', 'dialogWidth: 300px; dialogHeight: 560px; status: yes; resizable: no; scroll: no;');

	if (rtn != null)
	{
		if (rtn == "GoBuyCoupon")
		{
			GoBuyCoupon();
		}
	}
}

function BuyBoardSkin(hompyidx, pid, itemcode)
{
	//window.open('/_web/hompy_manage/coverskin_buy.htm?hompyidx='+hompyidx+'&pid='+pid, 'buyCoverSkin', '');
	var rtn = showModalDialog('/_web/hompy_manage/boardskin_buy.htm?hompyidx='+hompyidx+'&pid='+pid+'&itemcode='+itemcode, 'buyBoardSkin', 'dialogWidth: 300px; dialogHeight: 300px; status: yes; resizable: no; scroll: no;');

	if (rtn != null)
	{
		if (rtn == "GoBuyCoupon")
		{
			GoBuyCoupon();
		}
	}
}

function PresentBoardSkin(hompyidx, pid, itemcode)
{
	var rtn = showModalDialog('/_web/hompy_manage/boardskin_present.htm?hompyidx='+hompyidx+'&pid='+pid+'&itemcode='+itemcode, 'buyCoverSkin', 'dialogWidth: 300px; dialogHeight: 470px; status: yes; resizable: no; scroll: no;');

	if (rtn != null)
	{
		if (rtn == "GoBuyCoupon")
		{
			GoBuyCoupon();
		}
	}
}

function BuyHompyItem(hompyidx, pid, itemcode)
{
	//window.open('/_web/hompy_manage/coverskin_buy.htm?hompyidx='+hompyidx+'&pid='+pid, 'buyCoverSkin', '');
	var rtn = showModalDialog('/_web/hompy_manage/hompyitem_buy.htm?hompyidx='+hompyidx+'&pid='+pid+'&itemcode='+itemcode, 'buyHompyItem', 'dialogWidth: 300px; dialogHeight: 425px; status: yes; resizable: no; scroll: no;');

	if (rtn != null)
	{
		if (rtn == "GoBuyCoupon")
		{
			GoBuyCoupon();
		}
	}
}

function PresentHompyItem(hompyidx, pid, itemcode)
{
	var rtn = showModalDialog('/_web/hompy_manage/hompyitem_present.htm?hompyidx='+hompyidx+'&pid='+pid+'&itemcode='+itemcode, 'buyCoverSkin', 'dialogWidth: 300px; dialogHeight: 550px; status: yes; resizable: no; scroll: no;');

	if (rtn != null)
	{
		if (rtn == "GoBuyCoupon")
		{
			GoBuyCoupon();
		}
	}
}

function BuyScriptItem(hompyidx, pid, itemcode)
{
	//window.open('/_web/hompy_manage/coverskin_buy.htm?hompyidx='+hompyidx+'&pid='+pid, 'buyCoverSkin', '');
	var rtn = showModalDialog('/_web/hompy_manage/scriptitem_buy.htm?hompyidx='+hompyidx+'&pid='+pid+'&itemcode='+itemcode, 'buyHompyItem', 'dialogWidth: 300px; dialogHeight: 425px; status: yes; resizable: no; scroll: no;');

	if (rtn != null)
	{
		if (rtn == "GoBuyCoupon")
		{
			GoBuyCoupon();
		}
	}
}

function PresentScriptItem(hompyidx, pid, itemcode)
{
	var rtn = showModalDialog('/_web/hompy_manage/scriptitem_present.htm?hompyidx='+hompyidx+'&pid='+pid+'&itemcode='+itemcode, 'buyCoverSkin', 'dialogWidth: 300px; dialogHeight: 470px; status: yes; resizable: no; scroll: no;');

	if (rtn != null)
	{
		if (rtn == "GoBuyCoupon")
		{
			GoBuyCoupon();
		}
	}
}

function ApplyScriptItem(hompyidx, pid, title, free, bidx, btype)
{
	if (bidx == null)
	{
		bidx = 0;
	}

	if (btype == null)
	{
		btype = "";
	}

	var rtn = showModalDialog('/_web/hompy_manage/scriptitem_apply.htm?hompyidx='+hompyidx+'&pid='+pid+'&title='+title+'&free='+free+'&bidx='+bidx+'&btype='+btype, 'applyScriptItem', 'dialogWidth: 285px; dialogHeight: 245px; status: yes; resizable: no; scroll: no;');

	if (rtn == "popClose")
	{
		self.close();
	}
}

function RevokeScriptItem(hompyidx, free, bidx, btype)
{
	if (bidx == null)
	{
		bidx = 0;
	}

	if (btype == null)
	{
		btype = "";
	}

	var rtn = showModalDialog('/_web/hompy_manage/scriptitem_revoke.htm?hompyidx='+hompyidx+'&free='+free+'&bidx='+bidx+'&btype='+btype, 'revokeScriptItem', 'dialogWidth: 285px; dialogHeight: 245px; status: yes; resizable: no; scroll: no;');

	if (rtn == "popClose")
	{
		self.close();
	}
}


function ApplyBoardSkin(hompyidx, pid, free, bidx, btype)
{
	if (bidx == null)
	{
		bidx = 0;
	}

	if (btype == null)
	{
		btype = "";
	}

	var rtn = showModalDialog('/_web/hompy_manage/boardskin_apply.htm?hompyidx='+hompyidx+'&pid='+pid+'&free='+free+'&bidx='+bidx+'&btype='+btype, 'applyBoardSkin', 'dialogWidth: 305px; dialogHeight: 245px; status: yes; resizable: no; scroll: no;');

	if (rtn == "popClose")
	{
		self.close();
	}
}

function SellCoverSkin(hompyidx, pid)
{
	var rtn = showModalDialog('/_web/hompy_manage/coverskin_sell.htm?hompyidx='+hompyidx+'&pid='+pid, 'sellCoverSkin', 'dialogWidth: 300px; dialogHeight: 358px; status: yes; resizable: no; scroll: no;');

	if (rtn != null)
	{
		if (rtn != 'ok')
		{
			top.document.all.cover_table.style.backgroundImage = "url("+rtn+")";
		}

		self.location.reload();
	}
}

function SellMainView(hompyidx, pid)
{
	var rtn = showModalDialog('/_web/hompy_manage/mainview_sell.htm?hompyidx='+hompyidx+'&pid='+pid, 'sellCoverSkin', 'dialogWidth: 300px; dialogHeight: 358px; status: yes; resizable: no; scroll: no;');

	if (rtn != null)
	{
		self.location.reload();
	}
}

function SellBoardSkin(hompyidx, pid)
{
	var rtn = showModalDialog('/_web/hompy_manage/boardskin_sell.htm?hompyidx='+hompyidx+'&pid='+pid, 'sellBoardSkin', 'dialogWidth: 300px; dialogHeight: 358px; status: yes; resizable: no; scroll: no;');

	if (rtn != null)
	{
		self.location.reload();
	}
}

function GoBuyCoupon()
{
	if (top.opener)
	{
		top.opener.location.href = "/_web/charge.htm?st=2";
		top.opener.focus();
	}
	else
	{
		top.location.href = "/_web/charge.htm?st=2";
	}
}

function BuyCoupon(closeIt)
{
	/*
	var tWidth = 350;
	var tHeight = 430;

	//var winHandle = window.open("http://pay.nicenet.co.kr/coupon/nicemoney_start.php", "buycoupon", "width="+tWidth+", height="+tHeight+", scrollbars=no, top="+GetWinTop(tHeight)+", left="+GetWinLeft(tWidth));
	var winHandle = window.open("http://pay.nicenet.co.kr/coupon_new/charge_coupon.htm?st=2", "buycoupon", "width="+tWidth+", height="+tHeight+", scrollbars=no, top="+GetWinTop(tHeight)+", left="+GetWinLeft(tWidth));
	winHandle.focus();
	*/
	
	if (window.dialogArguments != null)
	{
		returnValue = "GoBuyCoupon";
	}
	else
	{
		GoBuyCoupon();
	}

	if (closeIt == null)
	{
		self.close();
	}
}

function ZoomAvaHome(useridx)
{
	var tWidth = 700;
	var tHeight = 400;

	var winHandle = window.open("/_web/avahome/zoom_avahome.htm?useridx="+useridx, "", "width="+tWidth+", height="+tHeight+", scrollbars=no, top="+GetWinTop(tHeight)+", left="+GetWinLeft(tWidth));
	winHandle.focus();
}

function GoAvaHome(useridx)
{
	//obj = findActiveX(self);
	obj = top.opener;

	if (obj)
	{
		obj.location.href = "http://www.nice3355.co.kr/town/tw_lobbyConfirm.php?houseOwnerIdx="+useridx;
		obj.focus();
	}
	else
	{
		//var winHandle = window.open("http://www.nice3355.co.kr");
		PopMsg("ÁË¼ÛÇÕ´Ï´Ù.<br>ÇöÀç ¾Æ¹ÙÈ¨À¸·Î °¡½Ç ¼ö ¾ø½À´Ï´Ù.");
	}
}

function OpenAvaHomeGuestBook(useridx)
{
	var tWidth = 540;
	var tHeight = 600;

	var whnd = window.open("http://bbs.nice3355.co.kr/board/individual/list.htm?bid=ah&owneridx="+useridx, "guestbook", "width="+tWidth+", height="+tHeight+", top="+GetWinTop(tHeight)+", left="+GetWinLeft(tWidth)+", status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes");
	whnd.focus();
}

function findLastParent(obj)
{
        var dest = obj;
        var p;
        var i = 0;

		try
		{
			while( dest.parent )
			{
					p = dest.parent;
					if( p==dest.parent )
							return p;

					dest = p;

					i++;

					if( i==10 )
					{
							return false;
					}
			}
		}
		catch(e)
		{
			return false;
		}

        return obj;
}

function findActiveX(obj)
{
        var dest = obj;
        var i = 0;

        if( obj.mainApplet )
                return obj;

        while(true)
        {
                dest = findLastParent(dest);
                if( !dest )
                        return false;

                if( dest.mainApplet )
                        return dest;

				try
				{
					if( dest.opener )
					{
							dest = dest.opener;
							continue;
					}
				}
				catch(e)
				{
					alert(e);
				}

                i++;
                if( i==10 )
                        break;
        }

        return false;
}

function FindActiveX()
{
	var oDest = top;

	for (var i=1; i<=3; i++)
	{
		oDest = oDest.opener;

		//try
		//{

			//alert(eval(oDest.document));

			if (oDest.mainApplet)
			{
				oDest.focus();
				break;
			}
		//}
		//catch(e)
		//{
		//	alert("¿¡·¯:"+e);
		//}
	}
}

function ImageErrorHandler(oImg, size)
{
	oImg.onerror = ImageErrorSkipper;
	//oImg.src = "http://hompy.nice3355.co.kr/_web/images/no_image_"+size+".gif";
	oImg.src = "http://imagenew.myhompy.to/images/PICTURE/no_image_"+size+".gif";
	oImg.title = "ÁË¼ÛÇÕ´Ï´Ù. ÀÌ¹ÌÁö¸¦ Ç¥½ÃÇÒ¼ö ¾ø½À´Ï´Ù.\nÀÌ¹ÌÁö°¡ »èÁ¦µÇ¾ú°Å³ª ³×Æ®¿öÅ© »çÁ¤À¸·Î\nÀÌ¹ÌÁö¸¦ ´Ù¿î·Îµå ¹ÞÁö ¸øÇÑ °æ¿ìÀÔ´Ï´Ù.";
	oImg.width = size;
	oImg.height = size;
}

function ImageErrorSkipper()
{
	return;
}

function UploadProfilePicture(hompyidx)
{
	if (hompyidx == null)
	{
		return;
	}

	var tWidth = 525;
	var tHeight = 732;

	var wHnd = window.open('/_web/profile/upload_picture.htm?hompyidx='+hompyidx, 'upProfileImg', 'width='+tWidth+', height='+tHeight+', top=0, left='+GetWinLeft(tWidth)+', status=yes, scrollbars=yes');
	wHnd.focus();
}

function ZoomProfileImage(img)
{
	var whnd = window.open('', '', 'width=500, height=520, resizeable=yes, scrollbars=yes, status=yes, top='+(window.screenTop-20)+', left='+(window.screenLeft+200));

	whnd.document.write("<html><head><title>ÇÁ·ÎÇÊ »çÁø º¸±â - Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.</title><script> function ResizeWin() { var width=document.images.oImg.width+26; var height=document.images.oImg.height+34; if (width>screen.width-20){width=screen.width-20;} if (height>screen.height-50){height=screen.height-50;} resizeTo(width, height); if (width+window.screenLeft > screen.width) { nWidth=10; }else{ nWidth=window.screenLeft-3; } if (height+window.screenTop > screen.height) { nHeight=10; }else{ nHeight=window.screenTop-27; } moveTo(nWidth, nHeight); }</script></head><body bgcolor=white onClick='self.close()' onContextMenu='return true' onDragStart='return false' onSelectStart='return false' topmargin=0 leftmargin=0 style='cursor: hand'>");
	//whnd.document.write("<html><head><title>ÇÁ·ÎÇÊ »çÁø º¸±â - Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.</title><script> function ResizeWin() { var width=document.images.oImg.width+26; var height=document.images.oImg.height+34; if (width>screen.width-20){width=screen.width-20;} if (height>screen.height-50){height=screen.height-50;} resizeTo(width, height); }</script></head><body bgcolor=white onClick='self.close()' onContextMenu='return false' onDragStart='return false' onSelectStart='return false' topmargin=0 leftmargin=0 style='cursor: hand'>");
	whnd.document.write("<img name='oImg' src='"+img+"' onLoad='ResizeWin()' title='Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.'>");
	whnd.document.write("</body></html>");

	whnd.focus();
}

oRepeater = null;
document.onmouseout = StopScroll;

function DoScroll(obj, direction, amount)
{
	if (amount == null)
	{
		amount = 10;
	}

	if (direction == 'up')
	{
		document.all[obj].scrollTop -= amount;
	}
	else
	{
		document.all[obj].scrollTop += amount;
	}

	if (oRepeater == null)
	{
		oRepeater = setInterval("DoScroll('"+obj+"', '"+direction+"', "+amount+")", 200);
	}
}

function DoScrollWheel(obj)
{
	amount = 15;

	if (event.wheelDelta >= 120)
	{
		document.all[obj].scrollTop -= amount;
	}
	else if (event.wheelDelta <= -120)
	{
		document.all[obj].scrollTop += amount;
	}
}

function StopScroll()
{
	if (oRepeater != null)
	{
		clearInterval(oRepeater);
		oRepeater = null;
	}
}

function TableTopRound(width, color, borderColor) {
	if (borderColor == null)
	{
		borderColor = color;
	}

	var top_html;

	top_html="<table cellpadding=0 cellspacing=0 border=0 width="+width+">";
	top_html+="<tr height=1><td rowspan=4 width=1></td><td rowspan=3 width=1></td>";
	top_html+="<td rowspan=2 width=1></td><td width=2></td><td bgcolor="+borderColor+"></td>";
	top_html+="<td width=2></td><td rowspan=2 width=1></td><td rowspan=3 width=1></td>";
	top_html+="<td rowspan=4 width=1></td></tr><tr height=1><td bgcolor="+borderColor+"></td>";
	top_html+="<td bgcolor="+color+"></td><td bgcolor="+borderColor+"></td></tr>";
	top_html+="<tr height=1><td bgcolor="+borderColor+"></td><td colspan=3 bgcolor="+color+"></td>";
	top_html+="<td bgcolor="+borderColor+"></td></tr><tr height=2><td bgcolor="+borderColor+"></td>";
	top_html+="<td colspan=5 bgcolor="+color+"></td><td bgcolor="+borderColor+"></td></tr></table>";

	document.write(top_html);
}

function TableBtmRound(width, color, borderColor) {
	if (borderColor == null)
	{
		borderColor = color;
	}

	var bottom_html;

	bottom_html="<table cellpadding=0 cellspacing=0 border=0 width="+width+">";
	bottom_html+="<tr height=2><td rowspan=4 width=1></td><td width=1 bgcolor="+borderColor+"></td><td width=1 bgcolor="+color+"></td>";
	bottom_html+="<td width=2 bgcolor="+color+"></td><td bgcolor="+color+"></td><td width=2 bgcolor="+color+"></td>";
	bottom_html+="<td width=1 bgcolor="+color+"></td><td width=1 bgcolor="+borderColor+"></td><td rowspan=4 width=1></td></tr>";
	bottom_html+="<tr height=1><td rowspan=3></td><td bgcolor="+borderColor+"></td><td colspan=3 bgcolor="+color+"></td>";
	bottom_html+="<td bgcolor="+borderColor+"></td><td rowspan=3></td>  </tr><tr height=1><td rowspan=2></td>";
	bottom_html+="<td bgcolor="+borderColor+"></td><td bgcolor="+color+"></td><td bgcolor="+borderColor+"></td><td rowspan=2></td></tr>";
	bottom_html+="<tr height=1><td></td><td bgcolor="+borderColor+"></td><td></td></tr></table>";

	document.write(bottom_html);
}

function GetTableBtmRound(width, color) {
	var bottom_html;

	bottom_html="<table cellpadding=0 cellspacing=0 border=0 width="+width+">";
	bottom_html+="<tr height=2><td rowspan=4 width=1></td><td width=1 bgcolor="+color+"></td><td width=1 bgcolor="+color+"></td>";
	bottom_html+="<td width=2 bgcolor="+color+"></td><td bgcolor="+color+"></td><td width=2 bgcolor="+color+"></td>";
	bottom_html+="<td width=1 bgcolor="+color+"></td><td width=1 bgcolor="+color+"></td><td rowspan=4 width=1></td></tr>";
	bottom_html+="<tr height=1><td rowspan=3></td><td bgcolor="+color+"></td><td colspan=3 bgcolor="+color+"></td>";
	bottom_html+="<td bgcolor="+color+"></td><td rowspan=3></td>  </tr><tr height=1><td rowspan=2></td>";
	bottom_html+="<td bgcolor="+color+"></td><td bgcolor="+color+"></td><td bgcolor="+color+"></td><td rowspan=2></td></tr>";
	bottom_html+="<tr height=1><td></td><td bgcolor="+color+"></td><td></td></tr></table>";

	return bottom_html;
}

function FamArticle()
{
	PopMsg('ÆÔ¿¡°Ô¸¸ °ø°³µÇ¾î ÀÖ½À´Ï´Ù.');
	return;
}

function InvalidArticle()
{
	PopMsg('½Å°í Á¢¼öÁßÀÎ °Ô½Ã¹°ÀÔ´Ï´Ù.');
	return;
}

function GoToRandomHompy(hidx)
{
	location.href = "/_web/goto_random_hompy.htm?hompyidx="+hidx;
}

function GoToMyHompy(userid)
{
	if (userid == "")
	{
		PopMsg("·Î±×ÀÎ ÈÄ ÀÌ¿ëÇØÁÖ¼¼¿ä.");
		return;
	}

	location.href = "/_web/pophompy.htm?userid="+userid;
}

function ManageFamGroup(hompyidx)
{
	var rtn = showModalDialog('/_web/fam/mng_fam_group.htm?hompyidx='+hompyidx, 'mngFamGrp', 'dialogWidth: 300px; dialogHeight: 290px; status: yes; resizable: no; scroll: no;');

	var tg = document.all.fam_grp;
	var tg2 = document.all.fam_grp2;
	var eachLine = rtn.split('_SeP2_');

	tg.length = eachLine.length;
	tg[0].value = '';
	tg[0].text = 'ÀüÃ¼';
	tg2.length = eachLine.length;
	tg2[0].value = '';
	tg2[0].text = 'ÀüÃ¼';
	for(var i=0; i<eachLine.length-1; i++)
	{
		var eachData = eachLine[i].split('_SeP1_');

		tg[i+1].value = eachData[0];
		tg[i+1].text = eachData[1];
		tg2[i+1].value = eachData[0];
		tg2[i+1].text = eachData[1];
	}
}

function FamRename(hompyidx, pid)
{
	var rtn = showModalDialog('/_web/fam/fam_rename.htm?hompyidx='+hompyidx+'&pid='+pid, 'renameFam', 'dialogWidth: 300px; dialogHeight: 207px; status: yes; resizable: no; scroll: no;');

	if (rtn != null)
	{
		document.all['fname_'+pid].innerHTML = rtn;
	}
}

function SlideShow(hompyidx, bidx)
{
	var tWidth = 627;
	var tHeight = 620;

	var wHnd = window.open('/_web/board/slideshow.htm?hompyidx='+hompyidx+'&bidx='+bidx, 'slideShow', 'width='+tWidth+', height='+tHeight+', scrollbars=yes, resizable=yes, status=yes, top='+(GetWinTop(tHeight)-30)+', left='+GetWinLeft(tWidth));
	wHnd.focus();
}

function ZoomBoardImage(img)
{
	var whnd = window.open('', '', 'width=640, height=620, left='+(window.parent.screenLeft+80)+', top='+(window.parent.screenTop-20)+', resizeable=yes, scrollbars=yes, status=yes');

	whnd.document.write("<html><head><title>»çÁø º¸±â - Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.</title><script>function ImageErrorHandler(oImg, size){	oImg.src = 'http://imagenew.myhompy.to/images/PICTURE/no_image_'+size+'.gif'; oImg.title = 'ÁË¼ÛÇÕ´Ï´Ù. ÀÌ¹ÌÁö¸¦ Ç¥½ÃÇÒ¼ö ¾ø½À´Ï´Ù.\\nÀÌ¹ÌÁö°¡ »èÁ¦µÇ¾ú°Å³ª ³×Æ®¿öÅ© »çÁ¤À¸·Î\\nÀÌ¹ÌÁö¸¦ ´Ù¿î·Îµå ¹ÞÁö ¸øÇÑ °æ¿ìÀÔ´Ï´Ù.'; oImg.width = size; oImg.height = size; } function ResizeWin() { var width=document.images.oImg.width+27; var height=document.images.oImg.height+59; if (width>screen.width-20){width=screen.width-20;} if (height>screen.height-50){height=screen.height-50;} resizeTo(width, height); if (width+window.screenLeft > screen.width) { nWidth=10; }else{ nWidth=window.screenLeft-3; } if (height+window.screenTop > screen.height) { nHeight=10; }else{ nHeight=window.screenTop-27; } moveTo(nWidth, nHeight); window.status=' '; }</script></head><body bgcolor=white onClick='self.close()' onContextMenu='return false' onDragStart='return false' onSelectStart='return false' topmargin=0 leftmargin=0 style='cursor: hand'>");
	whnd.document.write("<img name='oImg' src='http://imagenew.myhompy.to/images/PICTURE/"+img+"' onLoad='ResizeWin()' title='Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.' onError='ImageErrorHandler(this, 300)'>");
	whnd.document.write("</body></html>");

	whnd.focus();
}

function ToggleMbox(tg)
{
	switch(tg)
	{
		case('pic'):
			document.all.mb_avatar_area.style.display = "none";
			document.all.mb_pic_area.style.display = "inline";
			break;

		default:
			document.all.mb_avatar_area.style.display = "inline";
			document.all.mb_pic_area.style.display = "none";
			break;
	}
}

var famOwner = 'hompy';
var loginHompyidx = null;

var iFam_hompy = new Image();
iFam_hompy.src = '/_web/images/fam_top_owner.gif';
var iFam_hompy_over = new Image();
iFam_hompy_over.src = '/_web/images/fam_top_owner_over.gif';
var iFam_mine = new Image();
iFam_mine.src = '/_web/images/fam_top_mine.gif';
var iFam_mine_over = new Image();
iFam_mine_over.src = '/_web/images/fam_top_mine_over.gif';

function ChangeFamListBoxOwner(owner)
{
	if (owner == 'mine')
	{
		famOwner = 'mine';
		DisplayMyFamListBox(document.all.oFamListBox);
	}
	else
	{
		famOwner = 'hompy';
		DisplayFamListBox(document.all.oFamListBox);
	}

	ChangeFamOwnerImage(owner);
}

function ChangeFamOwnerImage(owner)
{
	if (owner == 'mine')
	{
		document.images.img_fam_hompy.src = iFam_hompy.src;
		document.images.img_fam_mine.src = iFam_mine_over.src;
	}
	else
	{
		document.images.img_fam_hompy.src = iFam_hompy_over.src;
		document.images.img_fam_mine.src = iFam_mine.src;
	}
}

function FamListBoxHandler(hompyidx, owneridx, tObj)
{
	if (tObj.value == '')
	{
		return;
	}

	if (famOwner == 'hompy')
	{
		if (tObj.value == "")
		{
			return;
		}
		else if (tObj.value == 'mng')
		{
			GoManageFam(hompyidx);
		}
		else if (tObj.value == 'sg')
		{
			DisplayFamListBox(document.all.oFamListBox);
		}
		else if (tObj.value.substr(0, 1) == 'f')
		{
			GoHompy(1, tObj.value.substr(1));
		}
		else
		{
			document.frames._frmAction.location.href = "/_web/fam/get_fam_list.htm?hompyidx="+hompyidx+"&owneridx="+owneridx+"&fgidx="+tObj.value;
		}
	}
	else
	{
		if (tObj.value == "")
		{
			return;
		}
		else if (tObj.value == 'sg')
		{
			DisplayMyFamListBox(document.all.oFamListBox);
		}
		else if (tObj.value.substr(0, 1) == 'f')
		{
			GoHompy(1, tObj.value.substr(1));
		}
		else
		{
			document.frames._frmAction.location.href = "/_web/fam/get_myfam_list.htm?&hompyidx="+loginHompyidx+"&fgidx="+tObj.value;
		}
	}
}

var xmlDoc;
function CategoryLoad()
{
	xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
	xmlDoc.async=false;
	rtn = xmlDoc.load("/_web/config/hompy_category.xml");

	cnt = xmlDoc.getElementsByTagName("root").length;

	this.text=new Array(cnt);
	this.index=new Array(cnt);

	for(i=0; i<cnt; i++)
	{
		this.index[i] = xmlDoc.getElementsByTagName("root/@index").item(i).text; 
		this.text[i] = xmlDoc.getElementsByTagName("root/@text").item(i).text;
	}
}

function SetRootCategory(oSelect)
{
	categorySel = new CategoryLoad();
	cnt = categorySel.index.length;

	for(i=0; i<cnt; i++)
	{
		var oOption = document.createElement('option');
		oOption.text = categorySel.text[i];
		oOption.value = categorySel.index[i];

		oSelect.add(oOption);
	}
}

function SetSubCategory(oSelect1, oSelect2)
{
	subCnt = oSelect2.length;
	for (i=1; i<subCnt; i++)
	{
		oSelect2.remove(1);
	}
	oSelect2.options[0].selected = true;

	selIndex = oSelect1.selectedIndex;
	rootIndex = oSelect1.options[selIndex].value;

	if (rootIndex == 0)
	{
		return;
	}

	subCatIndex = xmlDoc.getElementsByTagName("sub"+rootIndex+"/@index");
	subCatText = xmlDoc.getElementsByTagName("sub"+rootIndex+"/@text");

	for (i=0; i<subCatIndex.length; i++)
	{
		var oOption = document.createElement('option');
		oOption.text = subCatText.item(i).text;
		oOption.value = subCatIndex.item(i).text;

		oSelect2.add(oOption);
	}
}

function PopBoardManage(hidx, btype, bidx)
{
	var tWidth = 460;
	var tHeight = 210;

	//var rtn = showModalDialog('/_web/board/pop_manage.htm?hompyidx='+hidx+'&btype='+btype+'&bidx='+bidx+'&ispop=yes', 'editWelcomMsg', 'dialogWidth: 460px; dialogHeight: 200px; status: no; resizable: no; scroll: no;');
	
	var whnd = window.open('/_web/board/pop_manage.htm?hompyidx='+hidx+'&btype='+btype+'&bidx='+bidx+'&ispop=yes', 'boardManage', "width="+tWidth+", height="+tHeight+", scrollbars=no, resizable=no, status=yes, top="+GetWinTop(tHeight)+", left="+GetWinLeft(tWidth));

	whnd.focus();
}

function GoManageFam(hidx)
{
	if (hidx == null)
	{
		return;
	}

	//lastParent = findLastParent(self);
	top.main.location.href = "/_web/hompy_manage/main.htm?def_url=/_web/fam/fam_list.htm&def_menuidx=12&hompyidx="+hidx;
	ActivateMainMenu_self('manage');
}

function GoManageFamResult(hidx)
{
	top.main.location.href = "/_web/hompy_manage/main.htm?def_url=/_web/fam/fam_request_list.htm&def_menuidx=17&hompyidx="+hidx;
}

function GoManageFamRequest(hidx)
{
	if (hidx == null)
	{
		return;
	}

	//lastParent = findLastParent(self);
	top.main.location.href = "/_web/hompy_manage/main.htm?def_url=/_web/fam/fam_requested_list.htm&def_menuidx=13&hompyidx="+hidx;
	//top.main.location.href = "/_web/fam/fam_requested_list.htm?hompyidx="+hidx;
	ActivateMainMenu_self('manage');
}

function GoManageHompyInfo(hidx)
{
	if (hidx == null)
	{
		return;
	}

	//lastParent = findLastParent(self);
	top.main.location.href = "/_web/hompy_manage/main.htm?def_url=/_web/hompy_manage/hompy_mng.htm&def_menuidx=2&hompyidx="+hidx;
	ActivateMainMenu_self('manage');
}

function GoManageProfileQna(hidx)
{
	if (hidx == null)
	{
		return;
	}

	//lastParent = findLastParent(self);
	top.main.location.href = "/_web/profile/main.htm?def_url=qna&hompyidx="+hidx;
	ActivateMainMenu_self('profile');
}

function GoManageBoard(hidx, btype, bidx)
{
	//alert(hidx+"/"+btype+"/"+bidx);
	if (hidx == null)
	{
		return;
	}

	//lastParent = findLastParent(self);

	if (bidx == 0)
	{
		bidx = '';
	}

	top.main.location.href = "/_web/hompy_manage/main.htm?def_url=/_web/hompy_manage/board_mng.htm&def_menuidx=12&hompyidx="+hidx+"&btype="+btype+"&bidx="+bidx;
	ActivateMainMenu_self('manage');
}

function GoManageVisitEventResult(hidx)
{
	if (hidx == null)
	{
		return;
	}

	top.main.location.href = "/_web/hompy_manage/main.htm?def_url=/_web/hompy_manage/visit_event_pastlist.htm&def_menuidx=16&hompyidx="+hidx;
	ActivateMainMenu_self('manage');
}

function GoManageRcvPresent(hidx)
{
	if (hidx == null)
	{
		return;
	}

	top.main.location.href = "/_web/hompy_manage/main.htm?def_url=/_web/hompy_manage/rcv_present_list.htm&def_menuidx=17&hompyidx="+hidx;
	ActivateMainMenu_self('manage');
}

function GoManageRcvBGM(hidx)
{
	if (hidx == null)
	{
		return;
	}

	top.main.location.href = "/_web/hompy_manage/main.htm?def_url=/_web/hompy_manage/rcv_present_bgm_list.htm&def_menuidx=18&hompyidx="+hidx;
	ActivateMainMenu_self('manage');
}

function EditWelcomeMsg(hidx)
{
	if (hidx == null)
	{
		return;
	}

	var rtn = showModalDialog('/_web/profile/input_message.htm?hompyidx='+hidx, 'editWelcomMsg', 'dialogWidth: 250px; dialogHeight: 260px; status: yes; resizable: no; scroll: no;');

	if (rtn == "OK")
	{
		//lastParent = findLastParent(self);
		//top.document.all.profile_message.innerHTML = rtn;
		top.location.reload();
	}
}

function initWelcomeMsg(hidx)
{
	if (hidx == null)
	{
		return;
	}

	var rtn = showModalDialog('/_web/profile/init_message.htm?hompyidx='+hidx, 'initWelcomMsg', 'dialogWidth: 250px; dialogHeight: 237px; status: no; resizable: no; scroll: no;');

	if (rtn != null)
	{
		//lastParent = findLastParent(self);
		top.document.all.profile_message.innerHTML = rtn;
	}
}

function MakePopObj()
{
	if (document.all.__oDesc == null)
	{
		document.write("<div id='__oDesc' style='position:absolute; top:0; left:0; z-index:99999; display:none'></div>");
	}
}

function PopDesc(content)
{
	var oTg = document.all.__oDesc;

	if (oTg == null || destCMObj.style.display != 'none' || destCMObj_hompy.style.display != 'none')
	{
		return;
	}

	oTg.innerHTML = '<div style="background-color:#FFFFCC; border:1 solid #777777; padding: 2 2 2 2">'+content+'</div>';
	oTg.style.top = window.event.y + document.body.scrollTop - 20;
	oTg.style.left = window.event.x + document.body.scrollLeft + 5;
	oTg.style.display = 'inline';
}

function HideDesc()
{
	var oTg = document.all.__oDesc;

	if (oTg == null)
	{
		return;
	}

	oTg.style.display = 'none';
}

function ReloadHompy(hidx)
{
	//lastParent = findLastParent(self);
	top.location.href = "/_web/pophompy.htm?hompyidx="+hidx;
}

function OpenerAction(tgURL)
{
	try
	{
		var dest = opener.top.opener;
		if (dest.location.href)
		{
			dest.location.href = tgURL;
		}
		else
		{
			window.open(tgURL, '' , '');
		}
	}
	catch(e)
	{
		window.open(tgURL, '' , '');
	}
}

// DEPRECATED.
function FindIDPwd()
{
	var tgURL = 'http://www.nice3355.co.kr';
	OpenerAction(tgURL);
}

function JoinMember()
{
	var tgURL = "http://nas.nice3355.co.kr/join/join.html?origin="+location.href;
	OpenerAction(tgURL);
}

function ColorPicker(previewObj, tgStyle)
{
    var selColor = showModalDialog ("/_web/hompy_manage/color_picker.htm", null, "dialogWidth:470px; dialogHeight:360px; center:yes; help:no; status:yes");

	if (selColor != null)
	{

	}

	if (previewObj != null)
	{
		previewObj.style[tgStyle] = selColor;
		//alert(previewObj.style.cssText);
	}

	/*
	var selColor = document.all.dlgColor.ChooseColorDlg();

	if (selColor <= 0)
	{
		return;
	}

	selColor = selColor.toString(16);

	if (selColor.length < 6)
	{
		sTmpStr = "000000".substring(0, 6-selColor.length);
		selColor = sTmpStr.concat(selColor);
	}

	if (previewObj != null)
	{
		previewObj.style[tgStyle] = selColor;
		//alert(previewObj.style.cssText);
	}
	*/
}

function ToggleBold(previewObj)
{
	//alert(previewObj.style.fontWeight);

	if (previewObj.style.fontWeight == "bold")
	{
		previewObj.style.fontWeight = "normal";
	}
	else
	{
		previewObj.style.fontWeight = "bold";
	}
}

function PopDoneFamCount(hidx, accepted, rejected)
{
	var tWidth = 300;
	var tHeight = 201;

	//var rtn = showModalDialog('/_web/board/pop_manage.htm?hompyidx='+hidx+'&btype='+btype+'&bidx='+bidx+'&ispop=yes', 'editWelcomMsg', 'dialogWidth: 460px; dialogHeight: 200px; status: no; resizable: no; scroll: no;');
	
	var whnd = window.open('/_web/fam/fam_result_pop.htm?hompyidx='+hidx+'&accepted='+accepted+'&rejected='+rejected, '', "width="+tWidth+", height="+tHeight+", scrollbars=no, resizable=no, status=yes, top="+GetWinTop(tHeight)+", left="+GetWinLeft(tWidth));

	whnd.focus();
}

function PopEventCatch(hidx, event_pid)
{
	var tWidth = 320;
	var tHeight = 332;

	//var rtn = showModalDialog('/_web/hompy_manage/visit_event_catch.htm?hompyidx='+hidx, '', 'dialogWidth: 460px; dialogHeight: 200px; status: no; resizable: no; scroll: no;');
	
	var whnd = window.open('/_web/hompy_manage/visit_event_catch.htm?hompyidx='+hidx+'&event_pid='+event_pid, '', "width="+tWidth+", height="+tHeight+", scrollbars=no, resizable=no, status=yes, top="+GetWinTop(tHeight)+", left="+GetWinLeft(tWidth));

	whnd.focus();
}
