var nMyTongId = 0;
var nMyBoxId = 0;
var nMyPostId = 0;
var nMyGuestbookId = 0;
var strViewMode = 'mytong';
var strSearchKeyword = '';
var strOwnerNickName = '';
var strVisitorNateId = '';
var nBoxCount = 0;
var nMyClippingBoxId = 0;
var nMyFirstBoxId = 0;
var nTickerBoxId = 0;
var bOwner = false;

function PageInit()
{
	//frameLeftVisitorList.location.href = '/user/main.do?myTongID=' + nMyTongId;

	// »óÀÚ ¸¶¹ý»ç ½ÇÇà Àü (ÁÖÀÎ)
	/*	 »ç¿ë¾ÈÇÔ
	if(strViewMode == 'boxwizard')
	{
		GoToWizard(false, nMyTongId)
		return ;
	}
	// »óÀÚ ¸¶¹ý»ç ½ÇÇà Àü (¹æ¹®ÀÚ)
	else 
	*/
	if(strViewMode == 'nobox')
	{
		GoToNoBox(false, nMyTongId)
		return ;
	}

	frameLeftBoxList.location.href = '/mytong/box.do?action=menu&myTongID=' + nMyTongId;
	
	if (strViewMode == 'mytong')
		GoToTong(false, nMyTongId);
	else if (strViewMode == 'box')
		GoToBox(false, nMyTongId, nMyBoxId);
	else if (strViewMode == 'post')
		GoToPost(false, nMyTongId, nMyBoxId, nMyPostId);
	else if (strViewMode == 'puzzle')
		GoToAdmin(3);
	else if (strViewMode == 'recommand')
		GoToRecommand(nMyTongId, nMyBoxId);
	else if (strViewMode == 'linkmap')
		GoToLinkmap(nMyTongId, nMyBoxId);
	else if (strViewMode == 'comment')
		GoToComment(nMyTongId, nMyBoxId, nMyPostId);
	else if (strViewMode == 'weave')
		GoToWeave(nMyTongId, nMyBoxId, nMyPostId);
	else if (strViewMode == 'sympathy')
		GoToSympathy(nMyTongId, nMyBoxId, nMyPostId);
	else if (strViewMode == 'rss')
		GoToRss(nMyTongId, nMyBoxId);
	else if (strViewMode == 'today')
		GoToToday();
	else if (strViewMode == 'search')
		GoToSearch();
	else if (strViewMode == 'guest')
		GoToGuestbook(nMyGuestbookId);
	/*
	else if (strViewMode == 'withme')
	{
		if (_GetCookieValue('SYS_USER_ID') != nMyTongId)
			GoToWithMe();
		else
		{
			strViewMode = 'mytong';
			GoToTong(false, nMyTongId);
		}
	}
	*/
	else if (strViewMode == 'together')
		GoToTogether(nMyTongId, nMyBoxId);
	else if (strViewMode == 'list' || strViewMode == 'clist' || strViewMode == 'plist')
		GoToBox(false, nMyTongId, nMyBoxId, strViewMode);
	else if (strViewMode == 'admin_invite')
		GoToAdmin(4);
	else
		GoToTong(false, nMyTongId);
}
function RefreshBoxList()
{
	var tbl = document.getElementById('tblBoxList');
	var nRowCount = tbl.rows.length;
	
	for (var i = 0; i < nRowCount; i++)
		tbl.deleteRow(0);
	
	nBoxCount = 0;
	nMyFirstBoxId = 0;
	
	frameLeftBoxList.location.href = '/mytong/box.do?action=menu&myTongID=' + nMyTongId;
}
function RefreshVisitorList()
{
	var tbl = document.getElementById('tblVisitorList');
	var nRowCount = tbl.rows.length;
	
	for (var i = 0; i < nRowCount; i++)
		tbl.deleteRow(0);
	
	document.getElementById('tblVisitorListNone').style.display = "";
	
	document.getElementById('tdVisitorListMore').style.display = "none";
	
	if (nMyBoxId)
		//frameLeftVisitorList.location.href = '/user/visitList.do?action=box&myTongID=' + nMyTongId + '&boxID=' + nMyBoxId;
				frameLeftVisitorList.location.href = '/user/visitList.do?action=box&myTongID=' + nMyTongId + '&boxID=' + nMyBoxId;
	else
		frameLeftVisitorList.location.href = '/user/main.do?myTongID=' + nMyTongId;
}
function RefreshLinkBoxList()
{
	var tbl = document.getElementById('tblLinkBoxList');
	var nRowCount = tbl.rows.length;
	
	for (var i = 0; i < nRowCount; i++)
		tbl.deleteRow(0);
	
	if(bOwner)
		document.getElementById('trLinkBoxNews').style.display = (nMyBoxId ? "none" : "");
	else
		document.getElementById('trLinkBoxListTop').style.display = (nMyBoxId ? "none" : "");
	document.getElementById('trLinkBoxList').style.display = (nMyBoxId ? "" : "none");
	document.getElementById('tblLinkBoxListNone').style.display = (nMyBoxId ? "" : "none");
	document.getElementById('imgLinkBoxAll').style.display = "none";
	
	if (nMyBoxId)
		frameLeftLinkBoxList.location.href = '/mytong/happened.do?action=list_linkbox&mode=simple&rowsPerPage=5&myTongID=' + nMyTongId + '&boxID=' + nMyBoxId;
}
//
function WriteNewPost()
{
	strViewMode = 'box';
	ShowNickLayer(null,false);
	ShowBoxLayer(null,false);
	ShowTicker(true);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/boxitem/jini.do?action=boxDesc&_tongID=' + nMyTongId + '&_boxID=' + (nMyFirstBoxId ? nMyFirstBoxId : nMyClippingBoxId) + '&viewMode=write';
}
function ClippingTong(bTabChangeOnly)
{
	document.getElementById('tblClippingTong').style.display = "";
	document.getElementById('tblClassifyTong').style.display = "none";
	document.getElementById('tblClassifyNoTong').style.display = "none";
	document.getElementById('tblClippingTongTail').style.display = "";
	document.getElementById('tblClassifyTongTail').style.display = "none";
	if(!bTabChangeOnly)
		GoToBox(false, nMyTongId, nMyClippingBoxId);
}
function ClassifyTong(bTabChangeOnly)
{
	document.getElementById('tblClippingTong').style.display = "none";
	document.getElementById('tblClassifyTong').style.display = (nBoxCount ? "" : "none");
	document.getElementById('tblClassifyNoTong').style.display = (nBoxCount ? "none" : "");
	document.getElementById('tblClippingTongTail').style.display = (nBoxCount ? "none" : "");
	document.getElementById('tblClassifyTongTail').style.display = (nBoxCount ? "" : "none");
	document.getElementById('imgFFCompatible').style.display = "";
	document.getElementById('imgFFCompatible').style.display = "none";
	if (!bTabChangeOnly && nBoxCount)
		GoToBox(false, nMyTongId, nMyFirstBoxId);
}
function GoToAdmin(nType)
{
	ShowNickLayer(null,false);
	ShowBoxLayer(null,false);
	nMyBoxId = (nType == 1 ? nMyBoxId : 0);
	ShowTicker(nType == 1);
	RefreshVisitorList();
	RefreshLinkBoxList();

	switch (nType)
	{
		case 0:
    		frameMain.location.href = '/mytong/mytong.do?action=form&myTongID=' + nMyTongId;
    		break;
		case 1:
			frameMain.location.href = '/mytong/box.do?action=manageform&myTongID=' + nMyTongId + '&boxID=' + nMyBoxId;
			break;
		case 2:
			frameMain.location.href = '/mytong/box.do?action=manageform&myTongID=' + nMyTongId;
			break;
		case 3:
			frameMain.location.href = '/mytong/puzzle.do?action=form&myTongID=' + nMyTongId;
			break;
		case 4:
			frameMain.location.href = '/friend/inviteList.do?myTongID=' + nMyTongId;
			break;
		default:
			break;
	}
}

function GoToNoBox(bTopNavigate, nTongId)
{
	nMyTongId = nTongId;
	strViewMode = 'nobox';
	ShowNickLayer(null,false);
	ShowBoxLayer(null,false);
	nMyBoxId = 0;
	ShowTicker(false);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/html/boxwizard_nobox.html';
}
/* »ç¿ë ¾ÈÇÔ Version 1.2
function GoToWizard(bTopNavigate, nTongId)
{
	nMyTongId = nTongId;
	strViewMode = 'boxwizard';
	ShowNickLayer(null,false);
	ShowBoxLayer(null,false);
	nMyBoxId = 0;
	ShowTicker(false);
	RefreshVisitorList();
	frameMain.location.href = '/mytong/box.do?action=wizard&myTongID=' + nTongId;
}
*/
function GoToTong(bTopNavigate, nTongId)
{
	if (bTopNavigate)
	{
		self.location.href = '/mytong/mytong.do?action=main&myTongID=' + nTongId;
		return;
	}
	
	nMyTongId = nTongId;
	strViewMode = 'mytong';
	ShowNickLayer(null,false);
	ShowBoxLayer(null,false);
	nMyBoxId = 0;
	ShowTicker(false);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/mytong/mytong.do?action=body&myTongID=' + nTongId;
}
function GoToBox(bTopNavigate, nTongId, nBoxId, strMode)
{
	if (!strMode || strMode == '')
		strMode = 'box';
	
	if (bTopNavigate)
	{
		self.location.href = '/mytong/mytong.do?action=' + (strMode == 'box' ? 'main' : 'redirect') + '&myTongID=' + nTongId + '&boxID=' + nBoxId + '&viewMode=' + strMode;
		return;
	}
	
	nMyTongId = nTongId;
	nMyBoxId = nBoxId;
	strViewMode = 'box';
	ShowNickLayer(null,false);
	ShowBoxLayer(null,false);
	nMyBoxId = nBoxId;
	ShowTicker(true);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/boxitem/jini.do?action=boxDesc&_tongID=' + nTongId + '&_boxID=' + nBoxId + '&viewMode=' + strMode;
}
function GoToPost(bTopNavigate, nTongId, nBoxId, nPostId)
{
	if (bTopNavigate)
	{
		self.location.href = '/mytong/mytong.do?action=main&myTongID=' + nTongId + '&boxID=' + nBoxId + '&postID=' + nPostId + '&viewMode=post';
		return;
	}
	
	nMyTongId = nTongId;
	nMyBoxId = nBoxId;
	strViewMode = 'post';
	nMyBoxId = nBoxId;
	ShowTicker(true);
	RefreshVisitorList();
	RefreshLinkBoxList();
	if (nMyClippingBoxId == nBoxId)
		ClippingTong(true);
	frameMain.location.href = '/boxitem/jini.do?action=boxDesc&_tongID=' + nTongId + '&_boxID=' + nBoxId + '&_boxItemID=' + nPostId + '&viewMode=post';
}
function GoToToday()
{
	GoToLastChange();
	return;
	
	strViewMode = 'box';
	nMyBoxId = 0;
	ShowTicker(false);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/mytong/happened.do?action=listall&myTongID=' + nMyTongId;
}
function GoToSearch()
{
	strViewMode = 'mytong';
	nMyBoxId = 0;
	ShowTicker(false);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/search/search.do?action=searchintong&myTongID=' + nMyTongId + '&keyword=' + strSearchKeyword;
}
function GoToWithMe()
{
	strViewMode = 'box';
	nMyBoxId = 0;
	ShowTicker(false);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/mytong/connected.do?action=match&ownerID=' + nMyTongId;
}
function GoToRecommand(nTongId, nBoxId)
{
	strViewMode = 'box';
	nMyBoxId = nBoxId;
	ShowTicker(true);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/boxitem/jini.do?action=boxDesc&_tongID=' + nTongId + '&_boxID=' + nBoxId + '&viewMode=recommand';
}
function GoToRecommandByPuzzle(nTongId, nBoxId)
{
	strViewMode = 'box';
	nMyBoxId = nBoxId;
	ShowTicker(true);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/boxitem/jini.do?action=boxDesc&_tongID=' + nTongId + '&_boxID=' + nBoxId + '&viewMode=recommand';
}
function GoToLinkmap(nTongId, nBoxId, bPostAll)
{
	strViewMode = 'box';
	nMyBoxId = nBoxId;
	ShowTicker(true);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/boxitem/jini.do?action=boxDesc&_tongID=' + nTongId + '&_boxID=' + nBoxId + '&viewMode=' + (bPostAll ? 'linkmap_postall' : 'linkmap');
}
function GoToComment(nTongId, nBoxId, nPostId)
{
	strViewMode = 'post';
	nMyBoxId = nBoxId;
	ShowTicker(true);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/boxitem/jini.do?action=boxDesc&_tongID=' + nTongId + '&_boxID=' + nBoxId + '&_boxItemID=' + nPostId + '&viewMode=comment';
}
function GoToWeave(nTongId, nBoxId, nPostId)
{
	strViewMode = 'post';
	nMyBoxId = nBoxId;
	ShowTicker(true);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/boxitem/jini.do?action=boxDesc&_tongID=' + nTongId + '&_boxID=' + nBoxId + '&_boxItemID=' + nPostId + '&viewMode=weave';
}
function GoToSympathy(nTongId, nBoxId, nPostId)
{
	strViewMode = 'post';
	nMyBoxId = nBoxId;
	ShowTicker(true);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/boxitem/jini.do?action=boxDesc&_tongID=' + nTongId + '&_boxID=' + nBoxId + '&_boxItemID=' + nPostId + '&viewMode=sympathy';
}
function GoToRss(nTongId, nBoxId)
{
	strViewMode = 'box';
	nMyBoxId = nBoxId;
	ShowTicker(true);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/boxitem/jini.do?action=boxDesc&_tongID=' + nTongId + '&_boxID=' + nBoxId + '&viewMode=rss';
}
function GoToTogether(nTongId, nBoxId)
{
	strViewMode = 'box';
	nMyBoxId = nBoxId;
	ShowTicker(true);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/boxitem/jini.do?action=boxDesc&_tongID=' + nTongId + '&_boxID=' + nBoxId + '&viewMode=together';
}
function GoToGuestbook(nGuestbookId)
{
	strViewMode = 'mytong';
	nMyBoxId = 0;
	ShowTicker(false);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/mytong/mytong.do?action=body&myTongID=' + nMyTongId + '&guestbookid=' + nGuestbookId + '&viewMode=guestbook';
}
function TickerLoaded()
{
	if (document.getElementById('tdTicker').style.display == "")
		ShowTicker(true);
}
function ShowTicker(bShow)
{
	if (bSafari)
		return;
	
	document.getElementById('tdTitle').width = (bShow ? 529 : 782);
	document.getElementById('tdTickerMargin').style.display = (bShow ? "" : "none");
	document.getElementById('tdTicker').style.display = (bShow ? "" : "none");
	
	if (nMyBoxId && nTickerBoxId != nMyBoxId)
	{
		var nOldTickerBoxId = nTickerBoxId;
		nTickerBoxId = nMyBoxId;
		
		try
		{
			var objTicker = document.getElementById((bIE ? 'object' : 'embed') + '_ticker_interface');
			objTicker.SetVariable("/:tID", nMyTongId);
			objTicker.SetVariable("/:bID", nTickerBoxId);
			objTicker.TCallFrame("/", "3");
		}
		catch (e)
		{
			bShow = false;
			nTickerBoxId = nOldTickerBoxId;
		}
	}
	
	document.getElementById('trWaveLayer').style.display = (bShow ? (nMyClippingBoxId == nMyBoxId ? "none" : "") : "none");
}
function embed_ticker_interface_DoFSCommand(command, args)
{
	// ok we may just return safely
	return;
}
function GoToLastChange()
{
	document.getElementById('imgLastChange').style.display = "none";
	document.getElementById('imgLastChange1').style.display = "none";
	nMyBoxId = 0;
	ShowTicker(false);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/mytong/happened/body_happened.vm?happenedType=M&myTongID=' + nMyTongId;
}
function GoToCommentTrace()
{
	document.getElementById('imgCommentTrace').style.display = "none";
	document.getElementById('imgCommentTrace1').style.display = "none";
	nMyBoxId = 0;
	ShowTicker(false);
	RefreshVisitorList();
	RefreshLinkBoxList();
	frameMain.location.href = '/mytong/happened/body_happened.vm?happenedType=C&myTongID=' + nMyTongId;
}
function GoToLinkBoxNews(bToBox)
{
	if (bOwner)
		document.getElementById('imgLinkBoxNews').style.display = "none";
	
	if (bToBox)
		GoToLinkmap(nMyTongId, nMyBoxId, true);
	else
	{
		nMyBoxId = 0;
		ShowTicker(false);
		RefreshVisitorList();
		RefreshLinkBoxList();
		frameMain.location.href = '/mytong/happened/body_happened.vm?happenedType=U&myTongID=' + nMyTongId;
	}
}

	
function AddBoxToLeftBoxList(nBoxId, nLevelIndex, bNeighbor, strName, bNew, bSameCategory, bHidden, sColor, bHasPermission, bAdultOnly)
{	
	if (nBoxId == -9) // category line
	{
		AddCategoryToLeftBoxList(strName, sColor);
		return;
	}
	
	if (nMyFirstBoxId == 0)
		nMyFirstBoxId = nBoxId;
	
	// icon_new			12 ( 8px + space 4px)
	// level			19 ( 15px + space 4px)
	// hidden			14 ( 10px + space 4px)
	// adultonly		16 ( 12px + space 4px)

	var nAvailPixelWidth = 151; // 170 - level
	strName = strName.split("&quot;").join("\"").split("&lt;").join("<");

	if (bNew)
		nAvailPixelWidth = nAvailPixelWidth - 12;
	if (bHidden)
		nAvailPixelWidth = nAvailPixelWidth - 15;
	if (bAdultOnly)
		nAvailPixelWidth = nAvailPixelWidth - 16;
	
	var strDrawName = GetPixelSizedText(strName, nAvailPixelWidth, false);
	
	var strHtml = '<img src=/images/mytong/tonglevel' + nLevelIndex + '.gif align=absmiddle class=img_bottom03>';
	strHtml = strHtml + ' <a href=javascript:GoToBox(false,' + nMyTongId + ',' + nBoxId + ') class=nodeco>';
	strHtml = strHtml + '<font color=' + sColor + '>' + strDrawName + '</font></a>';
	
	if (bHidden == 1)
		strHtml = strHtml + ' <img src=/images/mytong/icon_hidden.gif align=absmiddle class=img_bottom02>';
		
	if (bHidden == 2 && bHasPermission)
		strHtml = strHtml + ' <img src=/images/mytong/icon_key.gif align=absmiddle class=img_bottom02>';
		
	if (bNew)
		strHtml = strHtml + ' <img src=/images/mytong/icon_new.gif align=absmiddle class=img_bottom02>';
		
	if (bAdultOnly)
		strHtml = strHtml + ' <img src=/images/mytong/icon_19.gif align=absmiddle class=img_bottom02>';
			
	var tbl = document.getElementById('tblBoxList');
	var newRow = tbl.insertRow(-1);
	var newCell = newRow.insertCell(0);
	newCell.width = 170;
	newCell.height = 22;
	newCell.style.paddingTop = 3;
	newCell.innerHTML = strHtml;
	
	nBoxCount++;
}
function AddCategoryToLeftBoxList(strName, sColor)
{
	var nAvailPixelWidth = 170;
	strName = strName.split("&quot;").join("\"").split("&lt;").join("<");
  
	var strDrawName = GetPixelSizedText(strName, nAvailPixelWidth, true);
  
	var strHtml = '<b style=color:' + sColor + '>' + strDrawName + '</b>';

	var tbl = document.getElementById('tblBoxList');
	var newRow = tbl.insertRow(-1);
	var newCell = newRow.insertCell(0);
	if (strDrawName.split(' ').join('') != '')
	{
		newCell.height = 31;
		newCell.style.paddingTop = 13;
		newCell.style.paddingBottom = 6;
		newCell.innerHTML = strHtml;
	}
	else
	{
		newCell.width = 162;
		newCell.height = 5;
	}
	
	newRow = tbl.insertRow(-1);
	newCell = newRow.insertCell(0);
	newCell.width = 170;
	newCell.height = 1;
	newCell.bgColor = '#d8d8d8';
	
	newRow = tbl.insertRow(-1);
	newCell = newRow.insertCell(0);
	newCell.width = 170;
	newCell.height = 5;
}

function AddTongToLeftVisitorList(strNateId, strTongTitle, nLevelIndex, strCategoryName, nBoxId)
{
	document.getElementById('tblVisitorListNone').style.display = "none";
	
	strTongTitle = strTongTitle.split("&quot;").join("\"").split("&lt;").join("<");
	strTongTitle = GetPixelSizedText(strTongTitle, (strVisitorNateId == strNateId ? 148 : 164), false);
	
	var strHtml = '<img src=/images/mytong/icon_square_darkgray.gif align=absmiddle class=img_bottom02> ';
	strHtml = strHtml + '<a href=/' + strNateId + ' class=nick>' + strTongTitle + '</a>';
	if (strVisitorNateId == strNateId)
		strHtml = strHtml;
	
	var tbl = document.getElementById('tblVisitorList');
	var nRowCount = tbl.rows.length;
	var newRow = tbl.insertRow(-1);
	var newCell = newRow.insertCell(0);
	newCell.height = 18;
	newCell.innerHTML = strHtml;
	if (nRowCount >= 5)
	{
		newRow.style.display = "none";
		document.getElementById('tdVisitorListMore').style.display = "";
	}
}
function ToggleLeftVisitorList()
{
	var tbl = document.getElementById('tblVisitorList');
	var strDisplay = (tbl.rows[5].style.display == "" ? "none" : "");
	document.getElementById('imgVisitorListMore').src = '/images/mytong/main/btn_' + (strDisplay == "" ? "close" : "more") + '.gif';
	for (var i = 5; i < tbl.rows.length; i++)
		tbl.rows[i].style.display = strDisplay;
}
function DeleteVisitorHistory()
{
	var tbl = document.getElementById('tblVisitorList');
	var nRowCount = tbl.rows.length;
	
	for (var i = 0; i < nRowCount; i++)
		tbl.deleteRow(0);
	
	document.getElementById('tdVisitorListMore').style.display = "none";

	frameLeftVisitorList.location.href = '/user/visitList.do?action=del&myTongID=' + nMyTongId + (nMyBoxId ? '&boxID=' + nMyBoxId : '');
}
function UpdateVisitorCount(nTodayVisitor, nTotalVisitor)
{
	document.getElementById('spnTodayVisitor').innerHTML = nTodayVisitor;
	document.getElementById('spnTotalVisitor').innerHTML = nTotalVisitor;
}
function AddBoxToLeftLinkBoxList(nTongId, nBoxId, nLevelIndex, strName)
{
	document.getElementById('tblLinkBoxListNone').style.display = "none";
	document.getElementById('imgLinkBoxAll').style.display = "";
	
	// level			19 ( 15px + space 4px)

	var nAvailPixelWidth = 151; // 170 - level
	strName = strName.split("&quot;").join("\"").split("&lt;").join("<");

	var strDrawName = GetPixelSizedText(strName, nAvailPixelWidth, false);
	
	var strHtml = '<img src=/images/mytong/tonglevel' + nLevelIndex + '.gif align=absmiddle class=img_bottom03>';
	strHtml = strHtml + ' <a href=javascript:GoToBox(true,' + nTongId + ',' + nBoxId + ') class=tong>';
	strHtml = strHtml + strDrawName + '</a>';

	var tbl = document.getElementById('tblLinkBoxList');
	var newRow = tbl.insertRow(-1);
	var newCell = newRow.insertCell(0);
	newCell.width = 170;
	newCell.height = 18;
	newCell.style.paddingTop = 3;
	newCell.innerHTML = strHtml;
}
function AddFavorite()
{
	if (confirm('Áñ°ÜÃ£±â·Î µî·ÏÇÏ½Ã°Ú½À´Ï±î?'))
	{
		frameLeftAddFavorite.location.href = '/friend/bookmark.do?bookmarked=' + nMyTongId;
		document.getElementById('imgAddFavorite').style.display = "none";
	}
}
function ShowInfoPostList(strListName)
{
	var styleNeighborBox = document.getElementById('tblNeighborBox').style;
	var styleNeighborBlog = document.getElementById('tblNeighborBlog').style;
	var styleRecommendBox = document.getElementById('tblRecommendBox').style;
	
	if (strListName == "NeighborBox")
	{
		styleNeighborBox.display = "";
		styleNeighborBlog.display = "none";
		styleRecommendBox.display = "none";
		objDefaultImg = document.getElementById('imgNeighborBox');
	}
	else if (strListName == "NeighborBlog")
	{
		styleNeighborBox.display = "none";
		styleNeighborBlog.display = "";
		styleRecommendBox.display = "none";
		objDefaultImg = document.getElementById('imgNeighborBlog');
	}
	else if (strListName == "RecommendBox")
	{
		styleNeighborBox.display = "none";
		styleNeighborBlog.display = "none";
		styleRecommendBox.display = "";
		objDefaultImg = document.getElementById('imgRecommendBox');
	}
}
function NavigateBody(strPath)
{
	frameMainBody.location.href = strPath;
}
function PopupTongSummary(strType)
{
	if (strType == 'neighbor')
		window.open('/boxitem/jini.do?action=popupConcerned&value(sort)=0&_boxID=0&_tongID=' + nMyTongId, 'popupConcerned', 'scrollbars=yes,status=yes,width=440,height=476,left=' + (window.screen.availWidth/2 - 210) + ',top=' + (window.screen.availHeight/2 - 238));
	else if (strType == 'scrap')
		window.open('/boxitem/jini.do?action=popupScrapped&value(sort)=0&_boxID=0&_tongID=' + nMyTongId, 'popupScrapped', 'status=yes,width=500,height=454,left=' + (window.screen.availWidth/2 - 250) + ',top=' + (window.screen.availHeight/2 - 227));
}

var strMapLayer = '<div id=divMapLayer style=position:absolute;top:91;left:916;>';
strMapLayer = strMapLayer + '<table border=0 cellspacing=0 cellpadding=0>';
strMapLayer = strMapLayer + '<tr id=trWaveLayer style=display:none><td>';
strMapLayer = strMapLayer + '<a href=javascript:PopupBoxLinkMap(nMyTongId,nMyBoxId,nMyTongId)><img src=/images/mytong/main/icon_wave.gif></a><br><br>';
strMapLayer = strMapLayer + '</td></tr>';
strMapLayer = strMapLayer + '<tr><td id=tdMapLayer>';
strMapLayer = strMapLayer + '</td></tr></table></div>';

var objMapLayer = null;
function UseMapLayer()
{
	MyInsertAdjacentHTML("BeforeEnd", strMapLayer, document.body);
	objMapLayer = document.getElementById('divMapLayer');
}
function AddEventImgToMapLayer(strImg, strLink, strTarget)
{
	if (!objMapLayer)
		return;
	var strHtml = '';
	if (strLink != '')
		strHtml = '<a href="' + strLink + '" target="' + strTarget + '"><img src="' + strImg + '"></a><br><br>';
	else
		strHtml = '<img src="' + strImg + '"><br><br>';
	MyInsertAdjacentHTML("BeforeEnd", strHtml, document.getElementById('tdMapLayer'));
}









