function bluring(){
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;

$(function() {
	$('.rollover').hover(function() {
		var currentImg = $(this).attr('src');
		$(this).attr('src', $(this).attr('hover'));
		$(this).attr('hover', currentImg);
	}, function() {
		var currentImg = $(this).attr('src');
		$(this).attr('src', $(this).attr('hover'));
		$(this).attr('hover', currentImg);
	});
});

function setPng24(obj) { 
    obj.width=obj.height=1; 
    obj.className=obj.className.replace(/\bpng24\b/i,''); 
    obj.style.filter = 
    "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
    obj.src='';  
    return ''; 
} 


//** ---------------------------------------------------------------------------
//함 수 명 : 
//인    자 : method		(Http 전송방식)
//			: address		(서버 주소)
//			: data			(서버에 전달할 파라미터)
//			: sync			(동기/비동기 여부)
//결    과	: String
//목    적 : XML객체를 이용해 페이지를 호출한다.
//플 로 우 : 
//검    수 :
//생 성 일 : 
//수    정 :
//사용예제 : uf_sendRequest(method,address,data)
//주의사항 : 
//** ---------------------------------------------------------------------------
function uf_sendRequest2(method,address,data,sync)
{ 
	//xml 객체 생성 
	request						= uf_getXmlHttpRequestObject(); 

	if ( request == null )
	{
		alert("XMLHttpRequest 객체를 생성할 수 없습니다.");
	}
	
	data 						= data + "&txtMNGR_MENU_STATE=" + document.getElementById("txtMNGR_MENU_STATE").value;

	//전송방식에 따라 data 및 address를 조작하자   
	if(method == 'GET') 
	{
		address					= address + "?" + data; 

		data					= null; 
	}

	//open 
	request.open(method,address,sync); 

	//요청의 header 설정 
	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 

	//send 
	request.send(data);

	if (request.responseText == null || request.readyState != 4)
	{
		return "ERRORS|";
	}
	else
	{
		try{
			var json = eval('(' + request.responseText + ')' );
			
			var temp_Result;

			temp_Result						= uf_getReplace( json.data, '\r\n', '' ).split("|");

			if(temp_Result[0] == "E1")
			{
				top.window.location.href	= "/jsp/include_files/common_jsp/error_session.jsp";	//"/common/error_msg2.do?txtCRUD_C_CD=R&ERROR_MSG=" + escape(encodeURIComponent(msg));
				return;
			}
			else if(temp_Result[0] == "E2")
			{
				top.window.location.href	= "/jsp/include_files/common_jsp/error_msg2.do?txtCRUD_C_CD=R&ERROR_MSG=" + escape(encodeURIComponent(temp_Result[1]));
				return;
			}
			
			json.data = uf_getReplace( json.data, '\r\n', '' );
			
			return json;

		}
		catch(e)
		{
			//alert("[common.js]response is wrong..\n method : " + method + "\n address : " + address + "\n");
			return uf_getReplace( request.responseText, '\r\n', '' );
		}
		
	}
}

//** ---------------------------------------------------------------------------
//함 수 명 : 
//인    자 : 1. sID			: CheckBox/RadioBox/ComboBox id, name
//			  2. sWIDTH			: CheckBox/RadioBox/ComboBox width
//			  3. sHEIGHT		: CheckBox/RadioBox/ComboBox height
//			  4. sSELECTED_1	: 등록시 선택되어야 할 값 (순서 0부터 시작 / 값|값| 형식 / combobox일때는 값 형식)
//			  5. sSELECTED_2	: 수정시 선택되어야 할 값 (값|값| 형식 / combobox일때는 값 형식)
//			  6. sNUM			: CheckBox/RadioBox 한줄에 보여줄 개수
//			  7. sTYPE			: CheckBox/RadioBox/ComboBox 구분 값 (checkbox / radio / combobox)
//			  8. sPARENT_CD		: 공통코드 테이블에서 Data를 불러올때의 상위코드 값
//			  9. sETC1_CD		: 공통코드 테이블에서 Data를 불러올때의 기타1코드 값
//			  10. sETC2_CD		: 공통코드 테이블에서 Data를 불러올때의 기타2코드 값
//			  11. sVALUE		: CheckBox/RadioBox/ComboBox 수동으로 만들경우 값
//			  12. sONCLICK		: Y이면 OnClick이벤트 핸들러를 만들고 그렇지 않으면 이벤트 핸들러를 만들지 않는다.
//			  13. sONCHANGE		: Y이면 OnChange이벤트 핸들러를 만들고 그렇지 않으면 이벤트 핸들러를 만들지 않는다.
//			  14. sDISABLED		: Y이면 컨트롤을 disalbled 시킨다
//			  15. sKIND			: checkbox / radio / combobox 종류와 DB에서 Data를 가져와서 만들지 수동으로 만들지의 구분값
//								  (uf_SetComboBox_System, uf_SetComboBox_User, uf_SetCheckBoxRadio_System, uf_SetCheckBoxRadio_User)
//결    과	: 
//목    적 : 1. CheckBox/RadioBox/ComboBox 만드는 함수
//			  2. OnClick이벤트에서 sID + _Click라는 형태의 이벤트 핸들러를 연결시킨다.
//			  3. OnChange이벤트에서 sID + _Change라는 형태의 이벤트 핸들러를 연결시킨다.
//플 로 우 : 
//검    수 :
//생 성 일 : 
//수    정 :
//사용예제 : sTemp = uf_SetCheckRadioCombo_System("cbxVocTypeDetail", "150", "19", "0", "0", "5", "checkbox" "CO003", "", "", "", "N", "N", "N")
//주의사항 :
//** ---------------------------------------------------------------------------  
function uf_SetCheckRadioCombo_System2(sID, sWIDTH, sHEIGHT, sSELECTED_1, sSELECTED_2, sNUM, sTYPE, sPARENT_CD, sETC1_CD, sETC2_CD, sVALUE, sONCLICK, sONCHANGE, sDISABLED, sKIND, sCD) 
{
	uf_showwait();

	var sStr;

	sStr = "txtID="						+ escape(encodeURIComponent(sID));
	sStr = sStr + "&txtWIDTH="			+ escape(encodeURIComponent(sWIDTH));
	sStr = sStr + "&txtHEIGHT="			+ escape(encodeURIComponent(sHEIGHT));
	sStr = sStr + "&txtSELECTED_1="		+ escape(encodeURIComponent(sSELECTED_1));
	sStr = sStr + "&txtSELECTED_2="		+ escape(encodeURIComponent(sSELECTED_2));
	sStr = sStr + "&txtNUM="			+ escape(encodeURIComponent(sNUM));
	sStr = sStr + "&txtTYPE="			+ escape(encodeURIComponent(sTYPE));
	sStr = sStr + "&txtPARENT_CD="		+ escape(encodeURIComponent(sPARENT_CD));
	sStr = sStr + "&txtETC1_CD="		+ escape(encodeURIComponent(sETC1_CD));
	sStr = sStr + "&txtETC2_CD="		+ escape(encodeURIComponent(sETC2_CD));
	sStr = sStr + "&txtVALUE="			+ escape(encodeURIComponent(sVALUE));
	sStr = sStr + "&txtONCLICK="		+ escape(encodeURIComponent(sONCLICK));
	sStr = sStr + "&txtONCHANGE="		+ escape(encodeURIComponent(sONCHANGE));
	sStr = sStr + "&txtDISABLED="		+ escape(encodeURIComponent(sDISABLED));
	sStr = sStr + "&txtKIND="			+ escape(encodeURIComponent(sKIND));
	sStr = sStr + "&txtCD="				+ escape(encodeURIComponent(sCD));

	var result;

	result							= uf_sendRequest("POST","/jsp/include_files/common_jsp/common_code_client.do",sStr,false);

//	document.getElementById("Errors").value	= result
//	alert(result);

	var temp_Result;

	temp_Result						= result.split("|");

	switch (temp_Result[0])
	{
		case "Y":

//			var objEle;
//
//			objEle					= document.getElementById("DIV_"+ sID );
//
//			objEle.innerHTML		= temp_Result[1];

			return temp_Result[1];

			break;

		case "N":

			alert(temp_Result[1]);

			break;

		default:
			
			alert("처리에 실패했습니다. 관리자에게 문의하세요.");

			break;
	}

	uf_removewait();
}
