/*
	Author : Geun
	Language : Java Script
*/



function ClearTextare(t)
{
	ClearTextarea(t);
}
function ClearTextarea(t)
{
	var obj = document.getElementById(t);
	obj.innerText = "";
	obj.focus();
}

function PopupLinkModeConfirm(msg, url)
{
	var IsPopup = confirm(msg);
	if (IsPopup)
	{
		window.open(url);
	}
	else
	{
		location.href = url;
	}
}

function RedirectOldBold()
{	
	var currUrl = window.location.pathname;
	var newUrl = "http://season01.gdiary.net" + currUrl;
	location.href = newUrl;
}

function CheckOldBlogArticle()
{
	var DocStr = this.document.getElementById('ContentsBox').innerText;

	if (DocStr.indexOf('잘못된 주소이거나,') == 0)
	{
		var cfm = confirm('현재 블로그에 일치하는 내용이 존재하지 않습니다.\r\n\r\n이전 블로그까지 검색하시겠습니까?');
		if (cfm == true)
		{
			RedirectOldBold();
		}
	}


}





//==================================================================================
// Embeded Script
//==================================================================================

// main function
function showTitle(srcUrl, srcFilename, width, height, titleStr, linkStr, hAlign, tColor)
{	
	var str = "<embed id=\"viewTitle\" name=\"viewTitle\" type=\"application/x-shockwave-flash\" src=\"" +
				srcUrl + srcFilename + "\" width=\"" + width + "\" height=\"" + height + "\" wmode=\"transparent\"" + " allowScriptAccess=\"always\"" + "FlashVars=\"" +
				"articleTitle="+ pEncode(titleStr) +"&linkTo=" + linkStr + "&hAlign=" + hAlign + "&tColor="+ tColor + "\"/>";

//	window.alert(str);
	document.write(str);
}

// percent-encoding
function pEncode(str)
{
	str = str.replace(/&amp;/g, "%26");
	//str = str.replace(/[&]/g, "%26");
	str = str.replace(/[+]/g, "%2b");
	
	return str;
}
