	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("200913", "done" , 1);
		}
		obj_popup.style.display = 'none';
	}

	function div_popup_start() {
		var obj_popup = document.getElementById("mainpopup");
		if (getCookie( "200913" ) !="done") {
			obj_popup.style.display = '';
		}
	}

	function div_popup_close2() {
		var obj_popup = document.getElementById("mainpopup2");		
		var obj_popup_chk = document.getElementById("popday2");		
		if (obj_popup_chk.checked == true) {
			setCookie("200913", "done" , 1);
		}
		obj_popup.style.display = 'none';
	}

	function div_popup_start2() {
		var obj_popup = document.getElementById("mainpopup2");
		if (getCookie( "200913" ) !="done") {
			obj_popup.style.display = '';
		}
	}

	function div_popup_close3() {
		var obj_popup = document.getElementById("mainpopup3");		
		var obj_popup_chk = document.getElementById("popday3");		
		if (obj_popup_chk.checked == true) {
			setCookie("201105", "done" , 1);
		}
		obj_popup.style.display = 'none';
	}



	function div_popup_start3() {
		var obj_popup = document.getElementById("mainpopup3");
		if (getCookie( "201105" ) !="done") {
			obj_popup.style.display = '';
		}
	}


//°¡·ÎÅÇ ¼³Á¤

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.");
			}
		}
	}
}

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;
	}


// Tab Content
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		if (thismenu.imgEl) {
			thismenu.onmouseover = function () {
				//this.onclick();
			}
		}
		thismenu.onmouseover = tabMenuClick;
		thismenu.onfocus = tabMenuClick;
		
		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	tabContainer.first.onmouseover();
}

function tabMenuClick() {
	currentmenu = this.container.current;
	if (currentmenu != this) {
		if (currentmenu) {
			currentmenu.targetEl.style.display = "none";
			if (currentmenu.imgEl) {
				currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
			} else {
				currentmenu.className = currentmenu.className.replace("", "");
			}
		}

		this.targetEl.style.display = "block";
		if (this.imgEl) {
			this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
		} else {
			this.className += " on";
		}
		this.container.current = this;
	}
	return false;
}

// Tab Content_Click
function initTabMenu02(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		if (thismenu.imgEl) {
			thismenu.onclick = function () {
				//this.onclick();
			}
		}
		thismenu.onclick = tabMenuClick;
		
		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	tabContainer.first.onclick();
}

function tabMenuClick() {
	currentmenu = this.container.current;
	if (currentmenu != this) {
		if (currentmenu) {
			currentmenu.targetEl.style.display = "none";
			if (currentmenu.imgEl) {
				currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
			} else {
				currentmenu.className = currentmenu.className.replace("", "");
			}
		}

		this.targetEl.style.display = "block";
		if (this.imgEl) {
			this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
		} else {
			this.className += " on";
		}
		this.container.current = this;
	}
	return false;
}

