/*--------------------------------------------------------------------------------------------------*/
/* File Name        : style_common.js */
/* File Type        : Java Script (JS) */
/* Discription      : ½ºÅ¸ÀÏ °øÅë javascript function */

/* Author           : Donho Ko - Korea Software Lab. co., ltd.*/
/* Last update date : 2003 / 05 / 27 */
/*--------------------------------------------------------------------------------------------------*/



//////////////////////////////////////////////////////////////////////////////
// Left Frame ¸Þ´º ¹Ù²Ù±â
// selectObj   = ¼±ÅÃÇÑ ¸Þ´º Object ID
// evt         = ¸¶¿ì½º ÀÌº¥Æ® (click,over,out)
// subObj      = ÇÏÀ§ ¸Þ´ºÀÇ ·¹ÀÌ¾î Object
//////////////////////////////////////////////////////////////////////////////
function menuChangeLeft01(selectObj,evt,subObj){

	var orgColor,chgColor;
	var selectedObj,menuNum;
	var subNum;
	selectedObj  = menu_01.selectedObj.value;
	menuNum      = parseInt(menu_01.menuNum.value);
	orgForeColor = "#000000";
	orgBackColor = "";
	chgForeColor = "#000000";
	chgBackColor = "#AFE6FF";

	// Å¬¸¯ ÇßÀ»¶§
	if(evt == "click"){
		//¸Þ´º »ö±ò ¿ø·¡·Î µÇµ¹¸®±â
		for(i=0;i<menuNum;i++){
			document.all["menu"+i].style.color               = orgForeColor;
			document.all["menu"+i].style.backgroundColor     = orgBackColor;

			//·¹ÀÌ¾î ´Ý±â
			if(document.all["subObj"+i]){ //·¹ÀÌ¾î Á¸Àç¿©ºÎ Ã¼Å©
				document.all["subObj"+i].style.display       = 'none';
			}
		}
		//¼±ÅÃµÈ°Í¸¸ »ö±ò ¹ÝÀü
		document.all[selectObj+""].style.color                  = chgForeColor;
		document.all[selectObj+""].style.backgroundColor        = chgBackColor;
		menu_01.selectedObj.value = selectObj;

		//¼­ºê ·¹ÀÌ¾î°¡ ÀÖÀ»°æ¿ì º¸ÀÌ±â
		if(subObj != '' && subObj != null){
			document.all[subObj+""].style.display = '';
		}

	// ¸¶¿ì½º ¿À¹ö ÀÏ¶§
	}else if(evt == "over"){
		if(selectObj != selectedObj){
			document.all[selectObj+""].style.color              = chgForeColor;
			document.all[selectObj+""].style.backgroundColor    = chgBackColor;
		}

	// ¸¶¿ì½º ¾Æ¿ô ÀÏ¶§
	}else if(evt == "out"){
		if(selectObj != selectedObj){
			document.all[selectObj+""].style.color              = orgForeColor;
			document.all[selectObj+""].style.backgroundColor    = orgBackColor;
		}
	}
}

// Color Change for The 2nd Menu
function menuChangeLeft02(selectObj,evt,alink){
	
	orgForeColor = "#00558B";
	chgForeColor = "#FF0000";
	
	// Å¬¸¯ ÇßÀ»¶§
	if(evt == "click"){

	// ¸¶¿ì½º ¿À¹ö ÀÏ¶§
	}else if(evt == "over"){
		selectObj.style.color              = chgForeColor;
	// ¸¶¿ì½º ¾Æ¿ô ÀÏ¶§
	}else if(evt == "out"){
		selectObj.style.color              = orgForeColor;
	}
	
}


var ret_window;
var PrivSeq=-1;

function ovStyle(sg) {
	document.all["SG"+sg].style.color = "#AD5D0D";
}
function outStyle(sg) {
	if (PrivSeq!=sg)
		document.all["SG"+sg].style.color = "#565656";
}
function showsub(sg) {
	if (document.all["PG"+sg].style.display == "none"){
		document.all["PG"+sg].style.display = ""
		document.all["IMG"+sg].src = "imgs/left/menu_icon2.gif";
	}
	else {
		document.all["PG"+sg].style.display = "none"
		document.all["IMG"+sg].src = "imgs/left/menu_icon.gif";
	}
	document.all["SG"+sg].style.color = "#AD5D0D";	// ¼±ÅÃµÈ ¸Þ´º»ö
	if (PrivSeq!=-1 && PrivSeq!=sg)
		document.all["SG"+PrivSeq].style.color = "#565656";	// ¼±ÅÃµÇÁö ¾ÊÀº ¸Þ´º»ö
	PrivSeq=sg;
}
function showsub2(sg) {

	document.all["SG"+sg].style.color = "#AD5D0D";
	if (PrivSeq!=-1 && PrivSeq!=sg)
		document.all["SG"+PrivSeq].style.color = "#565656";
	PrivSeq=sg;
}
function showsub3(sg) {
	if (document.all["PG"+sg].style.display == "none"){
		document.all["PG"+sg].style.display = ""
		document.all["IMG"+sg].src = "/imgs/left/menu_icon.gif";
	}
	else {
		document.all["PG"+sg].style.display = "none"
		document.all["IMG"+sg].src = "/imgs/left/menu_icon.gif";
	}
	document.all["SG"+sg].style.color = "#AD5D0D";	// ¼±ÅÃµÈ ¸Þ´º»ö
	if (PrivSeq!=-1 && PrivSeq!=sg)
		document.all["SG"+PrivSeq].style.color = "#565656";;	// ¼±ÅÃµÇÁö ¾ÊÀº ¸Þ´º»ö
	PrivSeq=sg;
}

function editUrl(strUrl, strHght, strWdth) {
	var ret;
	ret = window.open(strUrl,'edit',"width="+strWdth+",height="+strHght+", scrollbars=yes");
}

function WinOpen(strUrl, w, h) {
	var ret;
	ret = window.open(strUrl, "Service", "left=150,top=80,status=yes,width="+w+",height="+h+",resizable=yes")
}
function reload(strUrl,RecId){
	document.frames[RecId].location=strUrl;
}
function openLink(lnkUrl){
	var ret;
	ret = window.open(lnkUrl, "openLnk", "left=150,top=80,status=yes,width=800,height=500,resizable=yes,scrollbars=yes")
}
function goUrl(str1, woflag){
	alert(str1 + " " + woflag)
	strUrl = "../../" + str1
	if (str1.charAt(0) == "G") {
		str1 = str1.substring(0, str1.indexOf("|"));
		if (woflag == "Y") {
			strUrl = "./EP_GoOpenWin.jsp?sgid="+str1;
			window.open(strUrl, 'bb', "left=150,top=80,status=no,width=800,height=600,resizable=yes")
		} else if (woflag == "B") {
			strUrl = "./EP_GoOpenWin.jsp?sgid="+str1;
			window.open(strUrl, 'bb', "location=yes, direction=yes, status=yes, menubar=yes, toolbar=yes, left=150, top=80, status=no, width=800, height=600, resizable=yes")
		} else {
			parent.parent.document.location.href = "./EP_Bridge.jsp?gubun=D&sgid="+str1;
		}
	} else {
		if (woflag == "Y") {
			window.open(strUrl,'aa', "left=150,top=80,status=no,width=800,height=600,resizable=yes")
		} else if (woflag == "B") {
			window.open(strUrl,'aa', "location=yes, direction=yes, status=yes, menubar=yes, toolbar=yes, left=150, top=80, status=no, width=800, height=600, resizable=yes")
		} else {
			document.location.href = strUrl;
		}
	}
}
function goUrl(str1, flag, woflag){
	if (str1.charAt(0) == "G") {
		str1 = str1.substring(0, str1.indexOf("|"));
		if (woflag == "Y") {
			strUrl = "./EP_GoOpenWin.jsp?sgid="+str1;
			window.open(strUrl, 'bb', "left=150,top=80,status=no,width=800,height=600,resizable=yes")
		} else if (woflag == "B") {
			strUrl = "./EP_GoOpenWin.jsp?sgid="+str1;
			window.open(strUrl, 'bb', "location=yes, direction=yes, status=yes, menubar=yes, toolbar=yes, left=150, top=80, status=no, width=800, height=600, resizable=yes")
		} else {
			parent.parent.document.location.href = "./EP_Bridge.jsp?gubun=D&sgid="+str1;
		}
	} else {
		if (flag == "Y") strUrl = "../../" + str1;
		else strUrl = str1;
		if (woflag == "Y") {
			window.open(strUrl,'aa', "left=150,top=80,status=no,width=800,height=600,resizable=yes")
		} else if (woflag == "B") {
			window.open(strUrl,'aa', "location=yes, direction=yes, status=yes, menubar=yes, toolbar=yes, left=150, top=80, status=no, width=800, height=600, resizable=yes")
		} else {
			document.location.href = strUrl;
		}
	}
}

function goServiceUrl(wflag, retUrl, width, height, syscode, mnuid, mnuname){
	//edited 2002.12.10 ONS(¼­ºñ½º ¸Þ´º Á¶È¸ ±â·Ï)
	if (mnuid != "") {
		document.usrlogframe.form1.sgid.value = "G200401270846461711028";
		document.usrlogframe.form1.pgid.value = "L200401270847117961031";
		document.usrlogframe.form1.mnuid.value = mnuid;
		document.usrlogframe.form1.sgname.value = "³ªÀÇ¾÷¹«";
		document.usrlogframe.form1.mnuname.value = mnuname;
		document.usrlogframe.form1.submit();
	}
	if (syscode != "") {
		document.hfname.document.usrform.syscode.value = syscode;
		document.hfname.document.usrform.submit();
	}
	if(wflag == "Y"){
		var ret;
		ret_window = window.open(retUrl, "Service", "left=150,top=80,status=yes,width="+width+",height="+height+",resizable=yes,scrollbars=yes")
	}else if(wflag == "B"){
		var ret;
		ret_window = window.open(retUrl, "Service", "left=150,top=80,status=yes,width="+width+",height="+height+",toolbar=yes,menubar=yes,location=yes,direction=yes,resizable=yes")
	}else{
		parent.FR_RIGHT.location.href = retUrl;
	}
}

//====================================================================================================================
//ÇÁ·Î±×·¥¸í   : gj_includeFlashObjectControl
//ÇüÅÂ         : function
//ÀÛ¼ºÀÚ       : ¾ç¼ö¿­
//ÀÛ¼ºÀÏ       : 2006.03.11
//³»¿ë         : HTML³»¿¡ Flash <Object> ÅÂÅ©¸¦ Æ÷ÇÔ½ÃÅ²´Ù.
//¼öÁ¤ÀÚ       :
//¼öÁ¤ÀÏ       :
//¼öÁ¤³»¿ë     :
//Parameter    : sid, sfilenm, squality, sheight, swidth
//Return       : 
//====================================================================================================================
//¼¼ºÎ³»¿ë     :
//====================================================================================================================
function gj_includeFlashObjectControl(sid, sfilenm, squality, sheight, swidth)
{
    document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'");
    document.write("    codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0'");
    document.write("    width='" + swidth + "' height='" + sheight + "' id='" + sid + "' VIEWASTEXT>");
    document.write("    <param name='movie'   value='" + sfilenm + "'>");
    document.write("    <param name='quality' value='" + squality + "'>");
    document.write("    <embed src='" + sfilenm + "' quality='" + squality + "'");
    document.write("        pluginspage='http://www.macromedia.com/go/getflashplayer'");
    document.write("        type='application/x-shockwave-flash' width='" + swidth + "' height='" + sheight + "'>");
    document.write("    </embed>");
    document.write("</object>");
}

/*-----------------------------------------------------------------------------
'±×·ì¿þ¾î Àü¿ëÇÔ¼ö ³¡
-------------------------------------------------------------------------------*/
