function handleBBSTitleLink(strBBS_TYPE_ID, strBBS_ID)
{
	wndWidth = "640";
	wndHeight = "550";
	window.open("/dlsearch/SC_Board/ComWBoardGate.asp?BBS_TYPE_ID=" + strBBS_TYPE_ID + "&BBS_ID=" + strBBS_ID, 
			"BBSList", "toolbar=no,width=" + wndWidth + ",height=" + wndHeight + ",scrollbars=yes,location=no,status=no,directory=no,menubar=no");
}

function handleBBSCntDLLink(strSysDiv, strControlNo, strLink_Type)
{
	if (strLink_Type == "FULLVIEW")
	{
		strLocation = "/dlsearch/dlsearch/TOTWSearchfullview.asp?FullViewSysDiv=" + strSysDiv + "&FullViewControlNo=" + strControlNo;
		LinkDLTarget("down", strLocation);
	}
	else
	{
		if (strLink_Type == "OLD")
			strIdentifier = "IMG"
		else
			strIdentifier = strLink_Type; 
		ServiceDisplay(strLink_Type, strIdentifier, strSysDiv, strControlNo);
	}
}

function handleBBSCntURLLink(strURL, strTarget)
{
	var strUpperURL = strURL.toUpperCase();
	// "/dlsearch/"·Î ½ÃÀÛÇÏ¸é ¿¬°áÇÒ ¼ö ÀÖ´Â ¼­ºñ½º ÆÐÅÏÀÌ¹Ç·Î, menubarµîÀ» ¸ðµÎ ¾ø¾Ø´Ù. resize, scrollingµîÀº °¡´É 
	if (strUpperURL.indexOf("/DLSEARCH/") == 0)
		window.open(strURL, strTarget, "toolbar=no,location=no,status=no,directory=no,menubar=no, resizable=yes, width=700, height=600");		
	else
	{
		// "http://"¸¦ ºÙ¿©ÁØ´Ù. 
		if (strUpperURL.indexOf("HTTP://") == -1)
			strURL = "http://" + strURL; 
		LinkTarget(strTarget, strURL);
	}
}

function handleBBSContentLink(strBBS_TYPE_ID, strBBS_ID, strCONTENT_ID, strVIEW_CNT)
{
	wndWidth = "400";
	wndHeight = "440";
	window.open("/dlsearch/SC_Board/ComWBoardDetailPopup.asp?BBS_TYPE_ID=" + strBBS_TYPE_ID + "&BBS_ID=" + strBBS_ID + "&CONTENT_ID=" + strCONTENT_ID + "&VIEW_CNT=" + strVIEW_CNT, 
			"BBSDetail", "toolbar=no,width=" + wndWidth + ",height=" + wndHeight + ",scrollbars=yes,resizable=yes,location=no,status=no,directory=no,menubar=no");
}

// Á¶°Ç½Ä ¸µÅ©
function handleConditionLink(strLinkType, strQUERY_STRING, strTarget)
{
	if (strLinkType == "FullView")
		strURL = "/dlsearch/dlsearch/TOTWSearchFullView.asp";
	else if (strLinkType == "CritDetail")
		strURL = "/dlsearch/dlsearch/TOTWServiceCriticismDetail.asp";
	else if (strLinkType == "Poll")
		strURL = "/dlsearch/SC_Poll/ComWPoll.asp";
	else
		return;
	strURL = strURL + "?" + strQUERY_STRING;

	handleBannerLink(strURL, strTarget);
}


// ¹è³Ê ¸µÅ© Ã³¸®
function handleBannerLink(strDivLink, strTarget)
{
	// Target¿¡ °ø¹éÀÌ³ª ""ÀÌ ÀúÀåµÇ¾î ÀÖÀ¸¸é, ±âº»ÀûÀ¸·Î ÇöÀçÈ­¸éÀ¸·Î ÇÑ´Ù. 
	if (removeAllSpace(strTarget) == "")
		strTarget = "_self";

	// »õ Ã¢ÀÌ¸é, 
	if (strTarget == "_blank")
	{
		var strUpperURL = strDivLink.toUpperCase();
		// "/dlsearch/"·Î ½ÃÀÛÇÏ¸é ¿¬°áÇÒ ¼ö ÀÖ´Â ¼­ºñ½º ÆÐÅÏÀÌ¹Ç·Î, menubarµîÀ» ¸ðµÎ ¾ø¾Ø´Ù. resize, scrollingµîÀº °¡´É 
		if (strUpperURL.indexOf("/DLSEARCH/") == 0)
			window.open(strDivLink, strTarget, "toolbar=no,location=no,status=no,directory=no,menubar=no, resizable=yes, width=700, height=600");		
		else
			LinkTarget(strTarget, strDivLink);
	}
	else
		LinkTarget(strTarget, strDivLink);

}

function LinkTarget(strTarget, strURLlink)
{
	if (removeAllSpace(strURLlink) == "") 
		return;
	// "/DLSearch/..." ÀÌ¸é, À¥ÇÁ·ÎÁ§Æ®³»ÀÇ °æ·Î 
	else if (strURLlink.substr(0,1) == "/");
	// "http://" °¡ ¾øÀ¸¸é ºÙ¿©ÁØ´Ù. 
	else if (strURLlink.indexOf("http://") == -1)
		strURLlink = "http://"+strURLlink;

	// ÇöÀç Ã¢ÀÎÁö ¾Æ´ÑÁö¿¡ µû¶ó..
	if (strTarget == "CurrentWindow")
		self.top.location.href = strURLlink;
	else
		window.open (strURLlink, strTarget);

}

function LinkDLTarget(strTarget, strURLlink)
{
	// ÆË¾÷µÈ Ã¢ÀÌ¸é, 
	if (window.opener)
		// ÆË¾÷µÈ È­¸éÀÌ ´ÝÇûÀ¸¸é, »õ Ã¢À» ¶ç¿î´Ù. ÆË¾÷µÈ Ã¢ÀÇ ÇÁ·¹ÀÓ Áß¿¡ ÇØ´çµÇ´Â °ÍÀÌ ÀÖÀ¸¸é, 
		if (!window.opener.closed && window.opener.top.frames && window.opener.top.frames(strTarget))
			window.opener.top.frames(strTarget).location = strURLlink;
		else
			window.open(strURLlink, strTarget);
	else
		// ÇöÀçÃ¢ÀÇ ÇÁ·¹ÀÓ Áß¿¡ ÇØ´çµÇ´Â °ÍÀÌ ÀÖÀ¸¸é, 
		if (self.window.top.frames && self.window.top.frames(strTarget))
			self.window.top.frames(strTarget).location = strURLlink;
		else
			window.open(strURLlink, strTarget);

}

function removeAllSpace(strString)
{
	var rgExp = / /g ;
	return strString.replace(rgExp, "");
}

// ÀÏÁ¤/´Þ·Â ¿¬°á
function handleCalendarLink()
{
	wndWidth = "640";
	wndHeight = "550";
	window.open("/dlsearch/SC_Calendar/ComWCalendar.asp", 
			"BBSList", "toolbar=no,width=" + wndWidth + ",height=" + wndHeight + ",scrollbars=yes,location=no,status=no,directory=no,menubar=no");

}

// ´Þ·Â¿¡¼­ ³¯Â¥¿¡ ¸¶¿ì½º¸¦ °®´Ù ´ë¾úÀ» ¶§, ÀÌ¹ÌÁö º¯È­
function imgMouseOver(objImg)
{
	with (objImg)
	{
		src = ImgName + "_1.gif";
	}
}

function imgMouseOut(objImg)
{
	with (objImg)
	{
		src = ImgName + Dummy + ".gif";
	}
}
