/********************************************************************************************
* System		: Sawh
* Program ID	: Common.js
* Program Name	: °øÅë JavaScript
* Author		: sawh
* Created Date	: 2008-11-03
* -------------------------------------------------------------------------------------------
* Description
* - 
* -------------------------------------------------------------------------------------------
* Update History
* - 
*******************************************************************************************/
/************************************************************************************************************
* µ¶¼º¹°ÁúÁ¤º¸ »ó¼¼ ÆË¾÷
************************************************************************************************************/
function getDetailChemTcd(sArg01)
{
	var winPop = null;
	var sAttr = "toolbar=no,scrollbars=no,location=no,directories=no,menubar=no,resizable=yes,status=no";
	var sWidth = 760;
	var sHeight = 600;
	var sXpos = (screen.width/2) - (eval(sWidth)/2)+50;
	var sYpos = (screen.height/2) - (eval(sHeight)/2);

	winPop = openWindow2("", "getDetailChemTcd"+sArg01, sAttr, sWidth, sHeight, sXpos, sYpos);

	document.FormHidden.action = "/SearchUtil.action";
	document.FormHidden.Action.value = "getDetailChemTcd";
	document.FormHidden.hddnToxicCode.value = sArg01;
	document.FormHidden.target = winPop.name;
	document.FormHidden.submit();

	winPop.focus();
	winPop.opener = self;
}

/************************************************************************************************************
* Áßµ¶¹°ÁúÁ¤º¸ »ó¼¼ ÆË¾÷
************************************************************************************************************/
function getDetailChemTid(sArg01)
{
	var winPop = null;
	var sAttr = "toolbar=no,scrollbars=no,location=no,directories=no,menubar=no,resizable=yes,status=no";
	var sWidth = 760;
	var sHeight = 600;
	var sXpos = (screen.width/2) - (eval(sWidth)/2)+100;
	var sYpos = (screen.height/2) - (eval(sHeight)/2);

	winPop = openWindow2("", "getDetailChemTid"+sArg01, sAttr, sWidth, sHeight, sXpos, sYpos);

	document.FormHidden.action = "/SearchUtil.action";
	document.FormHidden.Action.value = "getDetailChemTid";
	document.FormHidden.hddnToxicCode.value = sArg01;
	document.FormHidden.target = winPop.name;
	document.FormHidden.submit();

	winPop.focus();
	winPop.opener = self;
}

/************************************************************************************************************
* »óÇ°Á¤º¸ »ó¼¼ ÆË¾÷
************************************************************************************************************/
function getDetailChemPid(sArg01)
{
	var winPop = null;
	var sAttr = "toolbar=no,scrollbars=no,location=no,directories=no,menubar=no,resizable=yes,status=no";
	var sWidth = 900;
	var sHeight = 680;
	var sXpos = (screen.width/2) - (eval(sWidth)/2)+150;
	var sYpos = (screen.height/2) - (eval(sHeight)/2);

	winPop = openWindow2("", "getDetailChemPid"+sArg01, sAttr, sWidth, sHeight, sXpos, sYpos);

	document.FormHidden.action = "/SearchUtil.action";
	document.FormHidden.Action.value = "getDetailProduct";
	document.FormHidden.hddnToxicCode.value = sArg01;
	document.FormHidden.target = winPop.name;
	document.FormHidden.submit();

	winPop.focus();
	winPop.opener = self;
}

/************************************************************************************************************
* Main ÅëÇÕ°Ë»ö
************************************************************************************************************/
function getSearchTextDefault()
{
	if (document.forms[0].txtSearchText_Con.value == "")
	{
		alert("°Ë»ö¾î¸¦ ÀÔ·Â ÇÏ½Ê½Ã¿À.");
		document.forms[0].txtSearchText_Con.focus();
		return;
	}

	document.forms[0].hddnLang_Con.value = "";
	document.forms[0].hddnRealKeyWord_Con.value = "";
	document.forms[0].hddnStartKeyWord_Con.value = "";
	document.forms[0].hddnEndKeyWord_Con.value = "";

	document.forms[0].action = "/SearchUtil.action";
	document.forms[0].Action.value = "getSearchTextDefault";
	document.forms[0].target = "_self";
	document.forms[0].submit();
}

function getSearchText()
{
	if (document.forms[0].txtSearchText_Con.value == "")
	{
		alert("°Ë»ö¾î¸¦ ÀÔ·Â ÇÏ½Ê½Ã¿À.");
		document.forms[0].txtSearchText_Con.focus();
		return;
	}

	document.forms[0].hddnLang_Con.value = "";
	document.forms[0].hddnRealKeyWord_Con.value = "";
	document.forms[0].hddnStartKeyWord_Con.value = "";
	document.forms[0].hddnEndKeyWord_Con.value = "";

	document.forms[0].action = "/SearchUtil.action";
	document.forms[0].Action.value = "getSearchText";
	document.forms[0].target = "SearchTextFrame";
	document.forms[0].submit();
}

function getSearchIndexDefault(sArgLang, sArgsRealKeyWord, sArgStartKeyWord, sArgEndKeyWord)
{
	document.forms[0].hddnLang_Con.value = sArgLang;
	document.forms[0].hddnRealKeyWord_Con.value = sArgsRealKeyWord;
	document.forms[0].hddnStartKeyWord_Con.value = sArgStartKeyWord;
	document.forms[0].hddnEndKeyWord_Con.value = sArgEndKeyWord;
	document.forms[0].action = "/SearchUtil.action";
	document.forms[0].Action.value = "getSearchIndexDefault";
	document.forms[0].target = "_self";
	document.forms[0].submit();
}

function getSearchIndex(sArgLang, sArgsRealKeyWord, sArgStartKeyWord, sArgEndKeyWord)
{
	document.forms[0].hddnLang_Con.value = sArgLang;
	document.forms[0].hddnRealKeyWord_Con.value = sArgsRealKeyWord;
	document.forms[0].hddnStartKeyWord_Con.value = sArgStartKeyWord;
	document.forms[0].hddnEndKeyWord_Con.value = sArgEndKeyWord;
	document.forms[0].action = "/SearchUtil.action";
	document.forms[0].Action.value = "getSearchIndex";
	document.forms[0].target = "SearchIndexFrame";
	document.forms[0].submit();
}

/************************************************************************************************************
* Áßµ¶,µ¶¼º Sub Menu ÅëÇÕ°Ë»ö
************************************************************************************************************/
function getSubSearchText()
{
	if (document.forms[0].txtSearchText_Con.value == "")
	{
		alert("°Ë»ö¾î¸¦ ÀÔ·Â ÇÏ½Ê½Ã¿À.");
		document.forms[0].txtSearchText_Con.focus();
		return;
	}

	showLoading(window);

	document.forms[0].hddnLang_Con.value = "";
	document.forms[0].hddnRealKeyWord_Con.value = "";
	document.forms[0].hddnStartKeyWord_Con.value = "";
	document.forms[0].hddnEndKeyWord_Con.value = "";

	document.forms[0].action = "/SearchUtil.action";
	document.forms[0].Action.value = "getSubSearchText";
	document.forms[0].hddnCurrentPage.value = "1";
	document.forms[0].target = "_self";
	document.forms[0].submit();
}

function getSubSearchIndex(sArgLang, sArgsRealKeyWord, sArgStartKeyWord, sArgEndKeyWord)
{
	document.forms[0].hddnLang_Con.value = sArgLang;
	document.forms[0].hddnRealKeyWord_Con.value = sArgsRealKeyWord;
	document.forms[0].hddnStartKeyWord_Con.value = sArgStartKeyWord;
	document.forms[0].hddnEndKeyWord_Con.value = sArgEndKeyWord;
	document.forms[0].action = "/SearchUtil.action";
	document.forms[0].Action.value = "getSubSearchIndex";
	document.forms[0].hddnCurrentPage.value = "1";
	document.forms[0].target = "_self";
	document.forms[0].submit();
}

/************************************************************************************************************
* ÆÄÀÏ ´Ù¿î·Îµå
************************************************************************************************************/
function exeFileDownload(fileDir, SysFileName, fileRealName)
{
	var agent = navigator.userAgent;
	document.FormHidden.action =  "/DownloadController";
	document.FormHidden.hddnUserAgent.value = agent;
	document.FormHidden.hddnFilePath.value = fileDir;
	document.FormHidden.hddnMadeFileName.value = SysFileName;
	document.FormHidden.hddnRealFileName.value = fileRealName;
	document.FormHidden.target = "_self";
	document.FormHidden.submit();
}

/************************************************************************************************************
* »óÇ° ÅÇ ¸Þ´º ¸®½ºÆ®
************************************************************************************************************/
function getPidTabDefault()
{
	removeConditionObject();
	document.forms[0].action = "/Pid.action";
	document.forms[0].Action.value = "getDefault";
	document.forms[0].submit();
}

function getPidTabChem()
{
	removeConditionObject();
	document.forms[0].action = "/Pid.action";
	document.forms[0].Action.value = "getPidTabChem";
	document.forms[0].hddnCurrentPage.value = "1";
	document.forms[0].submit();
}

function getPidTabCompany()
{
	removeConditionObject();
	document.forms[0].action = "/Pid.action";
	document.forms[0].Action.value = "getPidTabCompany";
	document.forms[0].hddnCurrentPage.value = "1";
	document.forms[0].submit();
}

function getPidTabImage()
{
	removeConditionObject();
	document.forms[0].action = "/Pid.action";
	document.forms[0].Action.value = "getPidTabImage";
	document.forms[0].submit();
}

function getPidTabDivSearch()
{
	removeConditionObject();
	document.forms[0].action = "/Pid.action";
	document.forms[0].Action.value = "getPidTabDivSearch01";
	document.forms[0].submit();
}

/************************************************************************************************************
* ·Î±×¾Æ¿ô »óÅÂ¿¡¼­ Áßµ¶, »óÇ° ¹°Áú »ó¼¼ È­¸é¿¡ Á¢±ÙÇÒ½Ã ·Î±×ÀÎ È­¸éÀ¸·Î ÀÌµ¿.
************************************************************************************************************/
function getLogin()
{
	parent.parent.goLeftMenu('1', 'GBL', '/Gbl', '·Î±×ÀÎ', '·Î±×ÀÎ', '');
}

/************************************************************************************************************
* ¸ÞÀÎÈ­¸éÀ¸·Î ÀÌµ¿. HOME ¹öÆ° Å¬¸¯½Ã.
************************************************************************************************************/
function goBannerUrl()
{
	if (document.FormDefault.hddnLang_Con != undefined)
	{
		document.forms[0].hddnLang_Con.value = "";
	}
	if (document.FormDefault.hddnRealKeyWord_Con != undefined)
	{
		document.forms[0].hddnRealKeyWord_Con.value = "";
	}
	if (document.FormDefault.hddnStartKeyWord_Con != undefined)
	{
		document.forms[0].hddnStartKeyWord_Con.value = "";
	}
	if (document.FormDefault.hddnEndKeyWord_Con != undefined)
	{
		document.forms[0].hddnEndKeyWord_Con.value = "";
	}

	document.forms[0].action = "/Index";
	document.forms[0].Action.value = "getIndex";
	document.forms[0].target = "_self";
	document.forms[0].submit();
}