
	$(document).ready(function() {
		// 데이트피커 적용
		$( ".datepicker" ).datepicker({
			monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],   
			dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],   
			dateFormat: 'yy-mm-dd',   
			prevText: '이전달',   
			nextText: '다음달',  
			yearSuffix: '<div style="position:absolute;left:96px;top:28px;margin-top:-25px">년</div><div style="position:absolute;left:162px;top:28px;margin-top:-25px">월</div>', 				
			changeMonth: true,   
			changeYear: true
		});

		// 토글 적용
		$(".toggle .fold").click(function() {
			var idx = $(this).attr("fold_idx");
			var display = $(".toggle .fold_detail_"+idx).css("display");

			//$(this).attr("src","../../img/common/etc/arr_fold_blue.gif");

			$(".toggle .fold").each(function() {
				$(this).attr("src","../../img/common/etc/arr_fold_blue.gif");
			});

			$(".toggle .fold_detail").each(function() {
				$(this).hide();
			});

			if(display == "none") {
				$(this).attr("src","../../img/common/etc/arr_fold_blue2.gif");
				$(".toggle .fold_detail_"+idx).show();
			}
		});

		// 로그아웃 버튼 클릭
		$("#logout").click(function() {
			location.href = "../common/logout.html";
		});	

		$(".content_lst3:odd").css("background-color","#f5f5f5"); 

		$("h3").each(function() {
			$(this).before("<div style='float:left;padding-left:5px'><img src='../../img/common/etc/square_title_blue.gif'></div>");
		});

		$("#ajax_result_div #result").ajaxError(function(evt,xhr,opt) {
			$(this).parents("#ajax_result_div").show();
			$(this).html("");
			$(this).append("type : " + evt.type + "<br>status : " + xhr.status + "<br>url : " +opt.url + "<br>dataType : " +opt.dataType + "<br>data : " + opt.data + "<br><strong>데이터 처리에 실패하였습니다. 담당 개발자에게 문의 바랍니다.</strong>");
		});

		$("##ajax_result_div #close").click(function() {
			$("#ajax_result_div").hide();
		});

		$("#ajax_loading").ajaxSend(function(evt,xhr,opt) {
			$("#ajax_loading").show();
		});

		$("#ajax_loading").ajaxComplete(function(evt, xhr, opt) {
			$("#ajax_loading").hide();
		});
	});
