	function setCookie(name, value, expiredays) {
		var todayDate = new Date();
		todayDate.setDate(todayDate.getDate() + expiredays);
		document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
	}

	function getCookie(name) {
		var nameOfCookie = name + "=";
		var x = 0;
		while (x <= document.cookie.length) {
			var y = (x+nameOfCookie.length);
			if (document.cookie.substring(x, y) == nameOfCookie) {
				if ((endOfCookie=document.cookie.indexOf( ";", y )) == -1)
					endOfCookie = document.cookie.length;
				return unescape(document.cookie.substring( y, endOfCookie ));
			}
			x = document.cookie.indexOf(" ", x) + 1;
			if (x == 0) break;
		}
		return "";
	}


	function div_popup_close() {
		var obj_popup = document.getElementById("mainpopup");		
		var obj_popup_chk = document.getElementById("popday");		
		if (obj_popup_chk.checked == true) {
			setCookie("200911", "done" , 1);
		}
		obj_popup.style.display = 'none';
	}

	function div_popup_start() {
		var obj_popup = document.getElementById("mainpopup");
		if (getCookie( "200911" ) !="done") {
			obj_popup.style.display = '';
		}
	}


	function port_popup_event_start(in_form_name,in_zip1, in_zip2, in_add, div_name, in_imgurl) {
		var obj_btnPort = new btnPost_view;
		obj_btnPort.DivId = div_name;
		obj_btnPort.btnImg = in_imgurl;
		obj_btnPort.href_url = '/korea/popup/address.asp?form_name='+in_form_name+'&zip1=' + in_zip1 + '&zip2=' + in_zip2 + '&add='+in_add;

		obj_btnPort.onclick_event = function() {
			window_open(this.href,'PostSearch','width=400,height=400,scrollbars=no,resizable=no');
			return false;
		}
		obj_btnPort.Start();
	}

	function port_popup_start(in_form_name,in_zip1, in_zip2, in_add, div_name) {
		var obj_btnPort = new btnPost_view;
		obj_btnPort.DivId = div_name;
		obj_btnPort.btnImg = "/korea/images/joinplace/btn_matter.gif";
		obj_btnPort.href_url = '/korea/popup/address.asp?form_name='+in_form_name+'&zip1=' + in_zip1 + '&zip2=' + in_zip2 + '&add='+in_add;

		obj_btnPort.onclick_event = function() {
			window_open(this.href,'PostSearch','width=400,height=400,scrollbars=no,resizable=no');
			return false;
		}
		obj_btnPort.Start();
	}

	function window_open(in_url, in_name, in_option) {
		window.open(in_url, in_name, in_option);
	}



	function btnPost_view() {
		this.Start = function() {
			this.TargetObj = document.getElementById(this.DivId);
			this.PostBtn = document.createElement('a');
			this.PostBtn.href = this.href_url;
			this.PostBtnImg = document.createElement('img');
			this.PostBtnImg.src = this.btnImg;
			this.PostBtnImg.alt = "우편번호 검색(팝업)";
			this.PostBtnImg.className = "vtop";
			this.TargetObj.appendChild(this.PostBtn);
			this.PostBtn.onclick = this.onclick_event;
			this.PostBtn.appendChild(this.PostBtnImg);
		}
	}



	function Leftmnu_event(n){
		if(!n){
			return;
		}else{
			var i=1;
			for(i=1;i<=Leftmnu_count;i++){
				var obj_mnu = document.getElementById("m"+i);
				if(i == n){
					if(obj_mnu.style.display == "none"){
						obj_mnu.style.display = "";
					}else{
						//frm.style.display = "none";
					}
				}else{
					obj_mnu.style.display = "none";
				}
			}		
		}
	}

	function Leftmnu_defaultView() {
		var i=1;
		for(i=1;i<=Leftmnu_count;i++){
			var obj_mnu = document.getElementById("m"+i);
			if(i != Leftdefault_mnu){
				obj_mnu.style.display = "none";
			}
		}	
	}


	function Leftmnu_event_sub(n){
		if(!n){
			return;
		}else{
			var i=1;
			for(i=1;i<=Leftmnu_count_sub;i++){
				var obj_mnu = document.getElementById("sm"+i);
				if(i == n){
					if(obj_mnu.style.display == "none"){
						obj_mnu.style.display = "";
					}else{
						//frm.style.display = "none";
					}
				}else{
					obj_mnu.style.display = "none";
				}
			}		
		}
	}

	function Leftmnu_defaultView_sub() {
		var i=1;
		for(i=1;i<=Leftmnu_count_sub;i++){
			var obj_mnu = document.getElementById("sm"+i);
			if(i != Leftdefault_mnu_sub){
				obj_mnu.style.display = "none";
			}
		}	
	}

	function html_copay(in_obj) {
		var cp = eval("document.all."+in_obj);
		cp.select();
		therange=cp.createTextRange();
		therange.execCommand("Copy");
		alert("소스가 복사되었습니다.");
	}


	function QuickView() {
		var obj_quick = document.getElementById("topbar");
		obj_quick.style.display = "";
	}
		
	function printPreview() {
	  window.open('/korea/include/forPrint.html','popprint', 'width=770,height=540,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=yes');
	}

		
	function popup_viewer() {
	  window.open('/korea/popup/viewer.asp','popup_viewer', 'width=680,height=540,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=yes');
	}

	function popup_copyright() {
	  window.open('/korea/popup/copyright.asp','popup_copyright', 'width=680,height=540,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=yes');
	}

	function popup_banner() {
	  window.open('/korea/popup/banner.asp','popup_banner', 'width=680,height=540,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=yes');
	}

	function event_popup_200911_1() {
		if (event_datechk_200911() == true) {
			window.open('/korea/events/200911/event_200911_01.asp','200911_event_popup1', 'width=700,height=600,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=yes');
			return false;
		}
	}

	function event_popup_200911_2() {
		if (event_datechk_200911() == true) {
			window.open('/korea/events/200911/event_200911_04.asp','200911_event_popup2', 'width=700,height=600,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=yes');
			return false;
		}
	}

	function event_datechk_200911() {
		var ret = false;
		var on_date=new Date();
		var start_date = new Date('2009', ('11')-1, '11');
		var end_date = new Date('2009', ('11')-1, '25');
		if (on_date.getTime() < start_date.getTime()) {
			alert('이벤트 기간이 아닙니다.');
		} else if (on_date.getTime() > end_date.getTime()) {
			alert('이벤트가 종료되었습니다.');
		} else {
			ret = true;
		}
		return ret;
	}



	function event_popup_200912() {
		window.open('/korea/events/200912/event_200912.asp','200912_event_popup', 'width=700,height=600,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=yes');
		return false;
	}

	function event_datechk_200912() {
		var ret = false;
		var on_date=new Date();
		var start_date = new Date('2009', ('12')-1, '04');
		var end_date = new Date('2009', ('12')-1, '18');
		if (on_date.getTime() < start_date.getTime()) {
			alert('이벤트 기간이 아닙니다.');
		} else if (on_date.getTime() > end_date.getTime()) {
			alert('이벤트가 종료되었습니다.');
		} else {
			ret = true;
		}
		return ret;
	}



	function event_popup_200912_2() {
		window.open('/korea/events/200912_2/event_relay.asp','200912_2_event_popup', 'width=700,height=600,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=no');
		return false;
	}

	function event_datechk_200912_2() {
		// 2009.12.24 ~ 2010.01.04
		var ret = false;
		var on_date=new Date();
		var start_date = new Date('2009', ('12')-1, '24');
		var end_date = new Date('2010', ('01')-1, '05');
		if (on_date.getTime() < start_date.getTime()) {
			alert('이벤트 기간이 아닙니다.');
		} else if (on_date.getTime() > end_date.getTime()) {
			alert('이벤트가 종료되었습니다.');
		} else {
			ret = true;
		}
		return ret;
	}



	function event_popup_200912_3() {
		window.open('/korea/events/200912_3/univ_journalist_02.asp','200912_3_event_popup', 'width=700,height=615,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=no');
		return false;
	}

	function event_datechk_200912_3() {
		// 2009.12.29 ~ 2010.01.15
		var ret = false;
		var on_date=new Date();
		var start_date = new Date('2009', ('12')-1, '29');
		var end_date = new Date('2010', ('01')-1, '16');
		if (on_date.getTime() < start_date.getTime()) {
			alert('공고 기간이 아닙니다.');
		} else if (on_date.getTime() > end_date.getTime()) {
			alert('공고가 종료되었습니다.');
		} else {
			ret = true;
		}
		return ret;
	}

	function event_popup_201001_1() {
		window.open('/korea/events/201001_1/event_relay.asp','event_popup_201001_1', 'width=700,height=600,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=no');
		return false;
	}

	function event_popup_201001_2() {
		window.open('/korea/events/20100111_01/event_20100111_write.asp','event_popup_201001_2', 'width=700,height=600,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=no');
		return false;
	}

	function event_popup_201001_3() {
		window.open('/korea/events/20100125/quiz_20100125.asp','event_popup_201001_3', 'width=700,height=600,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=no');
		return false;
	}

	function event_popup_201003_1() {
		window.open('/korea/events/20100317/quiz_20100317.asp','event_popup_201003_1', 'width=700,height=600,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=no');
		return false;
	}

	function event_popup_201004_1() {
		window.open('/korea/events/20100331/quiz_20100331.asp','event_popup_201004_1', 'width=700,height=600,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=no');
		return false;
	}

	function event_popup_201004_2() {
		window.open('/korea/events/20100420/quiz_20100420.asp','event_popup_201004_2', 'width=700,height=600,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=no');
		return false;
	}

	function event_popup(obj) {
		var winWidth = obj.getAttribute("winWidth");
		var winHeight = obj.getAttribute("winHeight");
		var winTitle = obj.getAttribute("winTitle");
		var winScrollbars = obj.getAttribute("winScrollbars");
		winWidth		= winWidth		== "" ? "700" : winWidth;
		winHeight		= winHeight		== "" ? "600" : winHeight;
		winTitle		= winTitle		== "" ? "events" : winTitle;
		winScrollbars	= winScrollbars	== "" ? "yes" : winScrollbars;

		window.open(obj.href,winTitle, 'width='+winWidth+',height='+winHeight+',location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,menubar=yes');
		return false;
	}


//가로탭 설정

var currentTab;
var isBack = false;

// JavaScript Document
function fnTabMenu_Type1() {
	this.CurrentMenu = 0;
	currentTab = 0;	
	this.Start = function() {
		this.MenuBox = document.getElementById(this.MenuName).getElementsByTagName("table");
		this.MenuLength = this.MenuBox.length;
		this.MenuLayer = document.getElementById(this.MenuName).getElementsByTagName("div");
		
		for ( var i=0; i<this.MenuLength; i++ ) {
			this.MenuLink = this.MenuLayer.item(i).getElementsByTagName("a")[0];
			this.MenuLinkBtn = this.MenuLink.getElementsByTagName("img")[0];
			if ( i == this.CurrentMenu ) {
				document.getElementById(this.DivName + i).style.display = "block";
				this.MenuLinkBtn.src = this.MenuLinkBtn.src.replace("_off.", "_on.");
			} else {
				document.getElementById(this.DivName + i).style.display = "none";
				this.MenuLinkBtn.src = this.MenuLinkBtn.src.replace("_on.", "_off.");
			}
			this.MenuLink.i = i;
			this.MenuLink.fnName = this.fnName;

			this.MenuLink.onclick = this.MenuLink.onfocus = function() { 
				eval( this.fnName +".fnMouseOver(" + this.i + ")") 
			}
		}
	}
	
	this.fnMouseOver = function(val) {
		isBack = false;
		if(currentTab > val){
			isBack = true;
		}
		currentTab = val;		
		for ( var i=0; i<this.MenuLength; i++) {
			this.MenuLink = this.MenuLayer.item(i).getElementsByTagName("a")[0];
			this.MenuLinkBtn = this.MenuLink.getElementsByTagName("img")[0];
			if ( i == val ) {
				document.getElementById(this.DivName + i).style.display = "block";
				this.MenuLinkBtn.src = this.MenuLinkBtn.src.replace("_off.", "_on.");
			} else {
				document.getElementById(this.DivName + i).style.display = "none";
				this.MenuLinkBtn.src = this.MenuLinkBtn.src.replace("_on.", "_off.");
			}
		}
	}
}