
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function Change_WMplayer(file_name){

 document.WMPlayer.Filename = file_name;
 document.WMPlayer.Play();
}
function MM_showHideLayers() { //v3.0
		var i,p,v,obj,args=MM_showHideLayers.arguments;
		for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
			if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
			obj.visibility=v; }
	}
function openWindow(theURL,winName,features) 
{
	window.open(theURL,winName,features);
}


function na_restore_img_src(name, nsdoc)
{
	var img = (navigator.appName.indexOf('Netscape', 0) != -1 ? eval(nsdoc+'.'+name) : document.all[name]);
	if (name == '')
		return;
	if (img && img.altsrc) {
		img.src		= img.altsrc;
		img.altsrc = null;
	} 
}

function na_preload_img()
{ 
	var img_list = na_preload_img.arguments;
	if (document.preloadlist == null) 
		document.preloadlist = new Array();
	var top = document.preloadlist.length;
	for (var i=0; i < img_list.length; i++) {
		document.preloadlist[top+i]		 = new Image;
		document.preloadlist[top+i].src = img_list[i+1];
	} 
}

function na_change_img_src(name, nsdoc, rpath, preload)
{ 
	var img = (navigator.appName.indexOf('Netscape', 0) != -1 ? eval(nsdoc+'.'+name) : document.all[name]);
	if (name == '')
		return;
	if (img) {
		img.altsrc = img.src;
		img.src		= rpath;
	} 
}

function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

function TabControl(parent)
{
	var menus = new Array;
	this.addMenus = function()
	{
		for(var i = 0; i < arguments.length; i++)
			menus.push(arguments[i]);
	}
	this.removeMenu = function(menuIndex)
	{
		var temp = new Array;
		for(var i = 0; i < menus.length; i++)
			if(i != menuIndex)
				temp.push(menus[i]);
		menus = temp;
	}
	this.onchange = null;
	function onChange(obj, cell)
	{
		if(obj.selectedIndex != cell.cellIndex)
		{
			obj.selectedIndex = cell.cellIndex;
			if(obj.onchange)
				obj.onchange(cell.cellIndex);
		}
	}
	this.selectedIndex = 0;
	this.select = function(menuIndex)
	{
		this.selectedIndex = menuIndex;
		this.paint();
	}
	var currentTab = null;
	this.paint = function()
	{
		parent.innerHTML = "";
		var table = document.createElement("table");
		table.cellSpacing = table.cellPadding = 0;
		table.height = 19;
		var row = table.insertRow();
		row.align = "center";
		var obj = this;
		for(var i = 0; i < menus.length; i++)
		{
			var cell = row.insertCell(i);
			cell.innerHTML = menus[i];
			cell.className = "tab_out";
			cell.width = 100;
			cell.onclick = function()
			{
				if(currentTab != null)
					currentTab.className = "tab_out";
				currentTab = this;
				currentTab.className = "tab_click";
				onChange(obj, this);
			}
			cell.onmouseover = function()
			{
				if(currentTab != this)
				{
					this.className = "tab_over";
				}
			}
			cell.onmouseout = function()
			{
				if(currentTab != this)
				{
					this.className = "tab_out";
				}
			}
			if(i == this.selectedIndex)
			{
				currentTab = cell;
				cell.className = "tab_click";
			}
		}
		parent.appendChild(table);
	}
}

function JSPager(totalRows, pageSize, currentPage)
{
    var rowsTotalCount = totalRows;
    var rowsPerPage = pageSize;
    var n = rowsTotalCount % rowsPerPage;
    n = (n == 0?0:rowsPerPage - n);
    var lastPage = (rowsTotalCount + n) / rowsPerPage;
    var pageOffset = 20;
    var elem;
    var onchange = null;
    
    function paint()
    {
        elem.innerHTML = "[ÃÑ " + totalRows + " °Ç]";
        var dec = pageOffset * parseInt((currentPage - 1) / pageOffset);
        if(currentPage > 1)
        {
            var font = document.createElement("font");
            font.innerHTML = "[Ã³À½]";
            font.onclick = new fwrapper(change, [1]).invoke;
            font.style.cursor = "pointer";
            elem.appendChild(font);
        }
        
        if(dec > 0)
        {
            var font = document.createElement("font");
            font.innerHTML = "[ÀÌÀü]";
            font.onclick = new fwrapper(change, [dec]).invoke;
            font.style.cursor = "pointer";
            elem.appendChild(font);
        }
        for(var i = dec + 1, j = 0; i <= lastPage && j < pageOffset; i++, j++)
        {
            var font = document.createElement("font");
            if(i != currentPage)
            {
                font.onclick = new fwrapper(change, [i]).invoke;
                font.style.cursor = "pointer";
                font.innerHTML = "<font color=blue>[" + i + "]</font>";
            }
            else
            {
                font.innerHTML = "<font color=tomato>[" + i + "]</font>";
            }
            elem.appendChild(font);
        }
        
        if(i <= lastPage)
        {
            var font = document.createElement("font");
            font.innerHTML = "[´ÙÀ½]";
            font.onclick = new fwrapper(change, [i]).invoke;
            font.style.cursor = "pointer";
            elem.appendChild(font);
        }
        
        if(i < lastPage)
        {
            var font = document.createElement("font");
            font.innerHTML = "[³¡]";
            font.onclick = new fwrapper(change, [lastPage]).invoke;
            font.style.cursor = "pointer";
            elem.appendChild(font);
        }
    }
    
    function change(newPage)
    {
        currentPage = newPage;
        if(onchange != null)
        {
            onchange(currentPage);
        }
        //paint();
    }
    
    this.setPageSize = function(size)
    {
        rowsPerPage = size;
    }
    
    this.setTotalCount = function(rows)
    {
        rowsTotalCount = rows;
    }
    
    this.setCurrentPage = function(newPage)
    {
        currentPage = newPage;
    }
    
    this.setHandler = function(func)
    {
        onchange = func;
    }
    
    this.paint = function(_elem)
    {
        elem = _elem;
        paint();
    }
}

function resizeImage(img, maxwidth)
{
	if(img.width)
	{
		if(img.width > maxwidth)
		{
			img.width = maxwidth;
			img.style.cursor = "pointer";
			img.onclick = function()
			{
				window.open(img.src, "imgwin", "");
			}
			img.alt = "¿ø·¡ Å©±â·Î º¸±â";
		}
	}
	else
	{
		window.setTimeout(new fwrapper(resizeImage, [img, maxwidth]).invoke, 10);
	}
}

function resizeImg(img, max)
{
	if(max){}
	else{max = 500;}
	if(img.width)
	{
		if(img.width > img.height)
		{
			if(img.width > max)
				img.width = max;
		}
		else
		{
			if(img.height > max)
				img.height = max;
		}
	}
	else
	{
		window.setTimeout(new fwrapper(resizeImg, [img, max]).invoke, 10);
	}
}

//Á¤±Ô½Ä ÆÐÅÏ¿¡ ºÎÇÕµÇ´ÂÁö ¿©ºÎ ¹ÝÈ¯
//ex) "abc123".validate(/[a-z0-9]+/gm), true ¹ÝÈ¯
String.prototype.validate = function(regEx)
{
	return (this.replace(regEx, "") == "");
}

//¾ÕµÚ °ø¹éÀ» »èÁ¦ ÈÄ ¹ÝÈ¯
//ex) " 123 123 ".trim(), "123 123" ¹ÝÈ¯
String.prototype.trim = function()
{
	return this.replace(/^\s+|\s+$/, "");
}

//¹®ÀÚ¿­ÀÇ byte ±æÀÌ¸¦ ¹ÝÈ¯
//ex) "abc°¡³ª´Ù¶ó".bytelength(), 11 ¹ÝÈ¯
String.prototype.bytelength = function()
{
	var c = 0, i = 0, len = 0;
	while(!isNaN(c = this.charCodeAt(i++)))
		len += (c > 0xFF?2:1);
	return len;
}

//Æ÷¸Ë¿¡ ¸ÂÃç º¯È¯µÈ ¹®ÀÚ¿­ ¹ÝÈ¯
//ex) "{0} is less than {1} {2}".format(0, 1), "0 is less than 1 {2}" ¹ÝÈ¯
String.prototype.format = function()
{
	var args = arguments;
	return this.replace(/\{(\d+)\}/g, function(whole, match){
			var n = Number(match);
			if(n < args.length)
				return args[n].toString();
			else
				return whole;
		}
	);
}

//¿À¸¥ÂÊ¿¡ ÇØ´ç ¹®ÀÚ¸¦ ±æÀÌ¿¡ ¸Â°Ô µ¡ºÙÀÎ ÈÄ ¹ÝÈ¯
//ex) "a".padRight("b", 3), "abb" ¹ÝÈ¯
String.prototype.padRight = function(ch, len)
{
	return this + new Array(len - this.length + 1).join(ch);
}


//¿ÞÂÊ¿¡ ÇØ´ç ¹®ÀÚ¸¦ ±æÀÌ¿¡ ¸Â°Ô µ¡ºÙÀÎ ÈÄ ¹ÝÈ¯
//ex) "12".padLeft("0", 4), "0012" ¹ÝÈ¯
String.prototype.padLeft = function(ch, len)
{
	return new Array(len - this.length + 1).join(ch) + this;
}

//SELECT ELEMENT ÀÇ ÇØ´ç value¸¦ °®´Â OPTION ELEMENT ¸¦ ¹ÝÈ¯
//ex) findOption(document.forms[0].select1, "1")
function findOption(select, value)
{
	for(var i = 0; i < select.options.length; i++)
		if(select.options[i].value == value)
			return select.options[i];
	return new Object;
}

//ÇØ´ç ³âµµ¿Í ¿ùÀÇ ¸¶Áö¸· ÀÏÀ» ¹ÝÈ¯
//ex) getDaysInMonth(2001, 2), 28 ¹ÝÈ¯
function getDaysInMonth(year, month)
{
	return (new Date(year, month, 0)).getDate();
}

//»ç¿ëÀÚÁ¤ÀÇ ¼Ó¼º°ªÀ» Åä´ë·Î FORM ÀÇ À¯È¿¼º °Ë»ç
function checkFormValidation(form)
{
	for(var i = 0; i < form.elements.length; i++)
	{
		var elem = form.elements[i];
		if(elem.getAttribute("required") != null)
		{
			if(elem.value.trim() == "")
			{
				alert("ÇÊ¼öÀÔ·Â»çÇ×ÀÔ´Ï´Ù");
				if(elem.focus)
					elem.focus();
				return false;
			}
		}
		if(elem.getAttribute("maxbyte"))
		{
			var bytelen = elem.value.bytelength();
			if(bytelen > Number(elem.getAttribute("maxbyte")))
			{
				var over = bytelen - Number(elem.getAttribute("maxbyte"));
				alert("Çã¿ë±æÀÌ¸¦ ÃÊ°úÇß½À´Ï´Ù\n\nÃÊ°ú±æÀÌ{0}(ÇÑ±Û±âÁØ ¾à{1}±ÛÀÚ, ¿µ¹®±âÁØ ¾à{0}±ÛÀÚ)".format(over, parseInt(over / 2)));
				if(elem.focus)
					elem.focus();
				return false;
			}
		}
		if(elem.getAttribute("numberonly") != null)
		{
			if(elem.value.replace(/\d+/, "") != "")
			{
				alert("¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù");
				if(elem.focus)
					elem.focus();
				return false;
			}
		}
		if(elem.getAttribute("valid") != null)
		{
			if(!elem.value.validate(eval("/" + elem.getAttribute("valid") + "/gm")))
			{
				alert("¿Ã¹Ù¸¥ Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù");
				if(elem.focus)
					elem.focus();
				return false;
			}
		}
	}
	return true;
}

//Date°³Ã¼¸¦ ÁöÁ¤µÈ Æ÷¸Ë¹®ÀÚ¿­·Î º¯È¯ ÈÄ ¹ÝÈ¯
//ex) new Date().format("yyyy-MM-dd")
Date.prototype.format = function(strFormat)
{
	var d = this;
	return strFormat.replace(
		/[a-z]+/ig,
		function(pattern){
			switch(pattern){
				case "yyyy":
					return d.getFullYear();
				case "yy":
					return d.getYear();
				case "MM":
					return (d.getMonth() + 1).toString().padLeft("0", 2);
				case "M":
					return d.getMonth() + 1;
				case "dd":
					return d.getDate().toString().padLeft("0", 2);
				case "d":
					return d.getDate();
				case "hh":
					return d.getHours().toString().padLeft("0", 2);
				case "h":
					return d.getHours();
				case "mm":
					return d.getMiniutes().toString().padLeft("0", 2);
				case "m":
					return d.getMinutes();
				case "ss":
					return d.getSeconds().toString().padLeft("0", 2);
				case "s":
					return d.getSeconds();
				case "ms":
					return d.getMilliSeconds();
				default:
					return pattern;
				}
			}
		);
}

function JSCalendar(parent, width, height, align, backColor)
{
	/*
	STYLESHEET GUIDE
	<style type="text/css">
	td.calendar_hover {cursor:pointer;text-decoration:underline;}
	table.calendar {color:black;margin:0 0 5 0;border:solid 1px silver;font-size:9pt;}
	</style>
	*/
	var visibleDate;
	var year, month, date;
	var weeks = "ÀÏ¿ùÈ­¼ö¸ñ±ÝÅä";
	var enableChangeMonth = true;
	var weekVisible = true;
	
	this.setWeekVisible = function(value){weekVisible = value;}
	this.getWeekVisible = function(){return weekVisible;}
	this.setVisibleDate = function()
	{
		if(arguments[0] instanceof Date)
		{
			visibleDate = arguments[0];
		}
		else if(arguments.length == 3)
		{
			visibleDate.setFullYear(arguments[0]);
			visibleDate.setMonth(arguments[1] - 1);
			visibleDate.setDate(arguments[2]);
		}
		year = visibleDate.getFullYear();
		month = visibleDate.getMonth() + 1;
		date = visibleDate.getDate();
	}
	
	this.setEnableChangeMonth = function(value){enableChangeMonth = value;}
	this.getEnableChangeMonth = function(){return enableChangeMonth;}
	
	this.getYear = function(){return year;}
	this.getMonth = function(){return month;}
	this.getDay = function(){return date;}
	
	this.getVisibleDate = function()
	{
		return visibleDate;
	}

	function ondayrender(sender, tableCell, dt)
	{
		if(sender.ondayrender)
			sender.ondayrender(sender, tableCell, dt);
	}
	
	function onmonthchange(sender, add)
	{
		var dt = sender.getVisibleDate();
		dt.setMonth(dt.getMonth() + add);
		sender.setVisibleDate(dt);
		if(sender.onmonthchange)
			sender.onmonthchange(sender, dt);
		//sender.paint();
	}
	
	function onchange(sender, dt)
	{
		sender.setVisibleDate(dt);
		if(sender.onchange)
			sender.onchange(sender, dt);
		//sender.paint();
	}

	function onlabelclick(sender)
	{
		if(sender.onlabelclick)
			sender.onlabelclick(sender, sender.getVisibleDate());
	}
	
	function hoverOn(cell, idx)
	{
		for(var i = -2; i < 3; i++)
			if(cells[i + idx])
				cells[i + idx].style.fontSize = (12 - Math.abs(i) * 2) + "pt";
		cell.className = "calendar_hover";
	}
	
	function hoverOff(cell, idx)
	{
		for(var i = -2; i < 3; i++)
			if(cells[i + idx])
				cells[i + idx].style.fontSize = "8pt";
		cell.className = "";
	}
	
	var cells;
	
	this.paint = function()
	{
		parent.innerHTML = "";
		var tempDate = new Date(visibleDate.getTime());
		tempDate.setDate(1);
		var startColumn = tempDate.getDay();
		var table = document.createElement("table");
		table.className = "calendar";
		if(align)
			table.setAttribute("align", align);
		if(backColor)
			table.bgColor = backColor;
		table.border = 0;
		table.cellSpacing = table.cellPadding = 0;
		var row = table.insertRow(table.rows.length);
		var prev = row.insertCell(0);
		if(enableChangeMonth)
			prev.innerHTML = "¢¸";
		var label = row.insertCell(1);
		label.style.cssText = "font-size:9pt;font-family:verdana, µ¸¿ò;text-align:center;";
		label.height = 20;
		label.colSpan = 5;
		var current = document.createElement("span");
		current.innerHTML = visibleDate.format("yyyy - MM");
		label.appendChild(current);
		var next = row.insertCell(2);
		if(enableChangeMonth)
			next.innerHTML = "¢º";
		prev.style.cssText = next.style.cssText = "font-size:8pt;font-family:µ¸¿ò;text-align:center;cursor:pointer;";
		prev.onmouseover = next.onmouseover = function(){this.className = "calendar_hover";}
		prev.onmouseout = next.onmouseout = function(){this.className = "";}
		var sender = this;
		prev.onclick = new fwrapper(onmonthchange, [sender, -1]).invoke;
		next.onclick = new fwrapper(onmonthchange, [sender, 1]).invoke;
		current.onclick = new fwrapper(onlabelclick, [sender]).invoke;
		current.onmouseover = function(){this.style.textDecoration = "underline";}
		current.onmouseout = function(){this.style.textDecoration = "none";}
		current.style.cssText = "cursor:pointer;";
		if(weekVisible)
		{
			var row = table.insertRow(table.rows.length);
			for(var i = 0; i < 7; i++)
			{
				var cell = row.insertCell(i);
				cell.style.cssText = "font-size:8pt;font-family:verdana, µ¸¿ò;text-align:center;width:"+width+";height:"+height+";";
				cell.innerHTML = weeks.charAt(i);
			}
		}
		row = table.insertRow(table.rows.length);
		var col = 0;
		for(; col < startColumn; col++)
		{
			var cell = row.insertCell(col);
		}
		cells = new Array;
		for(var i = 1;tempDate.getMonth() == visibleDate.getMonth(); tempDate.setDate(++i), col++)
		{
			if(col > 0 && col % 7 == 0)
			{
				row = table.insertRow(table.rows.length);
			}
			var cell = row.insertCell(col % 7);
			cells.push(cell);
			cell.style.cssText = "font-size:8pt;font-family:verdana;text-align:center;cursor:pointer;width:"+width+";height:"+height+";overflow:hidden;";
			if(col % 7 == 0)
				cell.style.color = "red";
			//if(tempDate.toDateString() == visibleDate.toDateString())
			//	cell.style.color = "black";
			cell.onclick = new fwrapper(onchange, [this, new Date(tempDate)]).invoke;
			cell.innerHTML = tempDate.getDate();
			cell.onmouseover = new fwrapper(hoverOn, [cell, i - 1]).invoke;
			cell.onmouseout = new fwrapper(hoverOff, [cell, i - 1]).invoke;
			ondayrender(this, cell, tempDate);
		}
		parent.appendChild(table);
	}
	
	this.setVisibleDate(new Date());
}

function NewsTicker(s, delay)
{
	var t;
	this.initiated = false;
	this.init = function()
	{
		var d = (delay == null?1000:delay);
		var mouseFlag = false;
		var i = 0;
		function adScroll()
		{
			if(mouseFlag)
				return;
			if(--i <= 0)
			{
				window.clearInterval(t);
				s.appendChild(s.childNodes[0]);
				s.scrollTop = 0;
				window.setTimeout(startScroll, d);
				return;
			}
			s.scrollTop++;
		}
		
		function startScroll()
		{
			i = s.childNodes[0].offsetHeight;
			t = window.setInterval(adScroll, 50);
		}
		
		if(s.childNodes.length > 0 && s.offsetHeight < s.scrollHeight)
		{
			s.onmouseover = function(){mouseFlag = true;}
			s.onmouseout = function(){mouseFlag = false;}
			window.setTimeout(startScroll, d);
		}
		this.initiated = true;
	}
	
	this.dispose = function()
	{
		window.clearInterval(t);
	}
}

function NewsTicker2(s, delay)
{
	var t;
	this.initiated = false;
	this.init = function()
	{
		var d = (delay == null?1000:delay);
		var mouseFlag = false;
		var i = 0;
		function adScroll()
		{
			if(mouseFlag)
				return;
			if(--i <= 0)
			{
				window.clearInterval(t);
				s.appendChild(s.childNodes[0]);
				s.scrollLeft = 0;
				window.setTimeout(startScroll, d);
				return;
			}
			s.scrollLeft++;
		}
		
		function startScroll()
		{
			i = s.childNodes[0].offsetWidth;
			t = window.setInterval(adScroll, 50);
		}
		
		if(s.childNodes.length > 0 && s.offsetWidth < s.scrollWidth)
		{
			s.onmouseover = function(){mouseFlag = true;}
			s.onmouseout = function(){mouseFlag = false;}
			window.setTimeout(startScroll, d);
		}
		this.initiated = true;
	}
	
	this.dispose = function()
	{
		window.clearInterval(t);
	}
}

function fwrapper(func, args)
{
	this.invoke = function(){
		func.apply(null, args);
	}
}

function openShowroom(showroom_idx)
{
	var wndShowroom = window.open("/webbase/museum/showroom.aspx?m=" + showroom_idx,'wndShowroom','width=810, height=700, left=50, top=50, status=no, scrollbars=no, resizable=no');
	wndShowroom.focus();
}

window.prompt = function(message, defaultValue)
{
	var dArg = [message, defaultValue];
	return window.showModalDialog("/webbase/prompt.htm", dArg, "dialogWidth:330px;dialogHeight:220px;status=no;help=no;");
}

function isNumeric()
{
	for(var i = 0; i < arguments.length; i++)
		if(String(arguments[i]) == "" || String(arguments[i]).replace(/\d+/, "") != "")
			return false;
	return true;
}

function idp()
{
	if(arguments.length > 0 && arguments[0])
	{
		var sendUrl = "/webbase/letter/sendletter.aspx?recv_id=" + arguments[0];
		try{
			var opener = window;
			var wndPop = window.createPopup();
			var menu1 = wndPop.document.createElement("div");
			menu1.innerHTML = "id:<b>" + arguments[0] + "</b>";
			menu1.style.cursor = "default";
			var menu2 = wndPop.document.createElement("div");
			menu2.style.cursor = "pointer";
			menu2.onmouseover = function()
			{
				menu2.style.backgroundColor = "white";
			}
			menu2.onmouseout = function()
			{
				menu2.style.backgroundColor = "";
			}
			menu2.innerHTML = "ÂÊÁö º¸³»±â";
			menu2.onclick = function()
			{
				opener.location.href = sendUrl;
				wndPop.hide();
			}
			wndPop.document.body.appendChild(menu1);
			wndPop.document.body.appendChild(menu2);
			wndPop.document.body.style.cssText = "border:solid 1px silver;font-size:9pt;overflow:hidden;margin:0 0 0 0;padding:2 2 2 2;background:whitesmoke;line-height:140%;";
			wndPop.show(0, 20, 120, 40, window.event.srcElement);
		}
		catch(e){
			location.href = sendUrl;
		}
	}
}

function SetCookie(sName, sValue, expireDate){
	if(expireDate)
		document.cookie = sName + "=" +sValue+ "; path=/; expires=" + expireDate.toUTCString() + ";";
	else
		document.cookie = sName + "=" +sValue+ "; path=/;";
}

function DelCookie(sName){
	document.cookie = sName + "='temp'; path=/; expires=Fri, 31 Dec 1999 23:59:59 GMT;";
}

function ReadCookie(CookieName){
	var name = CookieName;
	var Found = false;
	var start, end;
	var i = 0
	while(i < document.cookie.length){
		start = i
		end	= start + name.length;
		if(document.cookie.substring(start,end) == name){
			Found = true;
			break;
		}
		i++;
	}
	if(Found == true){
		start = end + 1;
		end	= document.cookie.indexOf(";",start);
		if(end < start){
			end	= document.cookie.length;
		}
		return document.cookie.substring(start, end);
	}
	else
	{
		return null;
	}
}

function openImage(imgSrc)
{
	window.open("/webbase/image.htm?" + imgSrc, "", "status=yes,resizable=yes,width=200px,height=100px").focus();
}

function openImage2(img)
{
	if(img.alt)
	{
		window.open("/webbase/image2.htm?" + img.src + "^" + escape(img.alt), "", "status=yes,resizable=yes,width=200px,height=100px").focus();
	}
	else
	{
		openImage(img.src);
	}
}

function viewArtwork(href)
{
	var wndArtwork = window.open(href, "wndArtwork", "width=500px,height=480px,status=yes");
	wndArtwork.focus();
	wndArtwork.moveTo((window.screen.availWidth - 500) / 2, (window.screen.availHeight - 480) / 2);
}

function openEbook(idx)
{
	var wndEbook = window.open("/webbase/ebook/ebook" + idx + "/application.htm", "wndEbook", "width=1024px,height=740px,status=no");
	wndEbook.focus();
	wndEbook.moveTo((screen.availWidth - 1024) / 2, (screen.availHeight - 740) / 2);
}

function openDic()
{
	var wndWonDic = window.open("http://rev.wonbulgyo.org/weic/weicdictionary/dictionary_list.asp","wndWonDic","width=640px,height=600px,resizable=yes,status=yes,scrollbars=yes");
	wndWonDic.focus();
}

function openPilgrimage()
{
	var wndPilgrim = window.open("http://www.woni.net/cyberpilgrimage/", "wndPilgrim", "width=800px, height=600px");
	wndPilgrim.focus();
}

function openMuseum()
{
	var url;
	if(arguments.length == 0)
		url = "/webbase/cyber/main.htm";
	else if(arguments.length == 1)
		url = "/webbase/cyber/cyber.aspx?room={0}".format(arguments[0]);
	else if(arguments.length == 2)
		url = "/webbase/cyber/cyber.aspx?room={0}&place={1}".format(arguments[0], arguments[1]);
	else
		return;
	var wndMuseum = window.open(url, "wndMuseum", "width=845px,height=505px,status=yes,resizable=no");
	wndMuseum.focus();
	wndMuseum.moveTo((screen.availWidth - 845) / 2, (screen.availHeight - 505) / 2);
}

function getAvailSize(w, h, mw, mh)
{
	if(w > mw || h > mh)
	{
		//width ±âÁØ Ãà¼Ò
		if(h / w > mh / mw)
		{
			return [(mh * w) / h, mh];
		}
		//height ±âÁØ Ãà¼Ò
		else
		{
			return [mw, (mw * h) / w];
		}
	}
	else
		return [w, h];
}

function resizeImgEx(img, maxw, maxh)
{
	if(img.width)
	{
		var avail = getAvailSize(img.width, img.height, maxw, maxh);
		if(avail[0] != 0 && avail[1] != 0 && !isNaN(avail[0]) && !isNaN(avail[1]))
		{
			img.width = avail[0];
			img.height = avail[1];
		}
		else
		{
			img.width = maxw;
			img.height = maxh;
		}
	}
	else
	{
		window.setTimeout(new fwrapper(resizeImgEx, [img, maxw, maxh]).invoke, 10);
	}
}
//-->

