<!--

//	Default Status
window.defaultStatus="Rho Gallery";

// onfocus bluring (a,img ÅÂ±× clickÇÒ¶§ »ý±â´Â Á¡¼±focusÀÇ bluring Ã³¸®)
function bluring()
{
	if(event.srcElement.tagName=="a" || event.srcElement.tagName=="img")
	{
		document.body.focus();
	}
}
document.onfocusin=bluring;

function loginEnter(i)
{
	if(event.keyCode ==13)
	{
		switch(i)
		{
			case 1:
				login.join_pin.focus();
				break;
			case 2:
				loginSubmit();
				break;
		}
	}
}

function loginSubmit()
{

	if(login.join_id.value =="")
	{
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		login.join_id.focus();
		return;
	}
	if(login.join_pin.value =="")
	{
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		login.join_pin.focus();
		return;
	}
	
	var letters = 'ghijklabvwxyzABCDEFef)_+|<>?:mnQRSTU~!@#$%^VWXYZ`1234567opGHIJKLu./;'+"'"+'[]MNOP890-='+'\\'+'&*("{},cdqrst'+"\n";
	var split = letters.split("");
	var num = "";
	var c = "";
	var encrypted = "";
	var it = login.join_pin.value;
	var b = "0";
	var chars = it.split("");
	while(b<it.length)
	{
		c = "0";
		while(c<letters.length)
		{
			if(split[c] == chars[b])
			{
				if(c == "0")
					c = "";
				if(eval(c+10) >= letters.length)
				{
					num = eval(10-(letters.length-c));
					encrypted += split[num];
				}
				else
				{
					num = eval(c+10);
					encrypted += split[num];
				}
			}
			c++;
		}
		b++;
	}
	login.join_pin.value = encrypted;
	encrypted = "";
	
	login.submit();
}

function mFormSubmit(num)
{
	if(confirm(" ¼±ÅÃÇÏ½Å °Ô½Ã¹°À» ÀüÃ¼È¸¿ø¿¡°Ô ¹ß¼ÛÇÏ½Ã°Ú½À´Ï±î?   "))
	{
		mForm.num.value=num;
		mForm.submit();
	}
	else
	{
		return false;
	}
}

//	open window
function openWindow(url,name,intWidth,intHeight)
{
	window.open(url,name,"width="+intWidth+",height="+intHeight+",resizable=0,scrollbars=1");
}

// ¹®Àå Trim
function strTrim(str)
{
	pos=str.indexOf("  ");
	while(pos!=-1)
	{
		str=str.replace("  "," ");
		pos=str.indexOf("  ");
	}
	if(str.indexOf(" ")==0)
	{
		str=str.substr(1,str.length-1);
	}
	if(str.substr(str.length-1,1)==" ")
	{
		str=str.substr(0,str.length-1);
	}
	return str;
}

// °ø¹é Delete
function spaceDel(str)
{
	pos=str.indexOf(" ");
	while(pos!=-1)
	{
		str=str.replace(" ","");
		pos=str.indexOf(" ");
	}
	return str;
}

// ¹®Àå ´ëÄ¡
function strReplace(str,str1,str2)
{
	pos=str.indexOf(str1);
	while(pos!=-1)
	{
		str=str.replace(str1,str2);
		pos=str.indexOf(str1);
	}
	return str;
}

// E-Mail °Ë»ç
function emailCheck(str)
{
	if(str.indexOf("@")==-1 || str.indexOf(".")==-1)
	{
		return false;
	}
	
}

//	°ø¶õ Ã¼Å©
function inputNullCheck(obj,alertStr)
{
	obj.value=strTrim(obj.value);
	if(obj.value=="")
	{
		alert(alertStr);
		obj.focus();
		return false;
	}
}

//	¹®ÀÚÃ¼Å© Ã¼Å©
function inputStrCheck(obj,str,alertStr)
{
	obj.value=strTrim(obj.value);
	if(obj.value==str)
	{
		alert(alertStr);
		obj.focus();
		return false;
	}
}

//	¹®ÀÚ À¯È£¼º Ã¼Å©
function Validator(str,type)
{
	valid="";
	alertStr="";
	if(type=="eng")
	{
		valid="abcdefghijklmnopqrstuvwxyz_";
		alertStr="¿µ¹®°ú _";
	}
	else if(type=="num")
	{
		valid="0123456789";
		alertStr="¼ýÀÚ";
	}
	else if(type=="all")
	{
		valid="abcdefghijklmnopqrstuvwxyz0123456789_";
		alertStr="¿µ¹®°ú ¼ýÀÚ, _";
	}
	else if(type=="email")
	{
		valid="abcdefghijklmnopqrstuvwxyz0123456789_-@.";
		alertStr="¿µ¹®°ú ¼ýÀÚ, @ , _ , - , .";
	}
	else
	{
		alert("Çü½ÄÀÌ ¿ÇÁö ¾Ê½À´Ï´Ù !\nµÎ¹øÂ° ÀÎÀÚ¿¡ eng,num,allÀÌ ¿Ã¼ö ÀÖ½À´Ï´Ù !");
		return false;
	}
	for(i=0;i<str.length;i++)
	{ 
    	temp=str.substring(i,i+1);
		if(valid.indexOf(temp)==-1)
		{
			alert(alertStr+" ·Î¸¸ ÀÌ·ç¾îÁú¼ö ÀÖ½À´Ï´Ù.");
			return false;
		}
	}
}

function GetRadioValue(rdoObj)
{
	var rtnValue;
	for(i = 0; i < rdoObj.length; i++)
	{
		if(rdoObj[i].checked)
		{
			rtnValue = rdoObj[i].value;
			break;
		}
	}	
	
	return rtnValue;
}

function GoTop(page)
{
	top.location.href = page;
}

function GoPage(page)
{
	location.href = page;
}

function GoCheck(page)
{
	CheckFrame.location.href = page;
}

function SiteEnter(lang)
{
	GoCheck("/Include/Controls/FuncLanguage.asp?mode=enter&lang=" + lang);
}

function LangSwitch(lang)
{
	GoCheck("/Include/Controls/FuncLanguage.asp?mode=switch&lang=" + lang);
}

function FgRollOver(obj, color)
{
	obj.style.color = color;
}

function BgRollOver(obj, color)
{
	obj.style.backgroundColor = color;
}

function ImgRollOver(imgObj, srcPath)
{
	imgObj.src = srcPath
}

function ClassRollOver(obj, class_name)
{
	obj.className = class_name;
}

function OpenExhibitionsReg(r_mode, ex_seq)
{
	w_width		= 430;
	w_height	= 260;
	w_left		= (screen.width - w_width) / 2;
	w_top		= (screen.height - w_height) / 2;
	EXrWindow = window.open("/Admin/ExhibitionsReg.asp?r_mode=" + r_mode + "&ex_seq=" + ex_seq, "EXrWin", "width=" + w_width + ", height=" + w_height + ", left=" + w_left + ", top=" + w_top);
	EXrWindow.moveTo(w_left, w_top);
	EXrWindow.focus();
}

function OpenExhibitionsContentsReg(r_mode, ex_seq, ec_seq)
{
	w_width		= 590;
	w_height	= 465;
	w_left		= (screen.width - w_width) / 2;
	w_top		= (screen.height - w_height) / 2;
	ECrWindow = window.open("/Admin/ExhibitionsContentsReg.asp?r_mode=" + r_mode + "&ex_seq=" + ex_seq+ "&ec_seq=" + ec_seq, "ECrWin", "width=" + w_width + ", height=" + w_height + ", left=" + w_left + ", top=" + w_top);
	ECrWindow.moveTo(w_left, w_top);
	ECrWindow.focus();
}

function ExecExhibitionsDel(chk, seq, period)
{
	var confirmMsg;
	if(chk == "ex")
		confirmMsg = "¼±ÅÃÇÏ½Å Àü½Ã Á¤º¸¸¦ »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?     ";
	else
		confirmMsg = "¼±ÅÃÇÏ½Å Àü½ÃÄÁÅÙÃ÷¸¦ »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?     ";;
	if(confirm(confirmMsg))
		GoCheck("/Admin/ExhibitionsDel.asp?chk=" + chk + "&seq=" + seq + "&period=" + period);
}

function OpenMainImageUpload()
{
	w_width		= 400;
	w_height	= 200;
	w_left		= (screen.width - w_width) / 2;
	w_top		= (screen.height - w_height) / 2;
	MiuWindow = window.open("/Admin/MainImageUpload.asp", "MiuWin", "width=" + w_width + ", height=" + w_height + ", left=" + w_left + ", top=" + w_top);
	MiuWindow.moveTo(w_left, w_top);
	MiuWindow.focus();
}

function ECRegModeChange(mode_value)
{
	if(mode_value == 1)
	{
		TrImg.style.display = "block";
		TrTxt.style.display = "block";
		self.resizeTo(590, 515);
	}
	else if(mode_value == 2)
	{
		TrImg.style.display = "block";
		TrTxt.style.display = "none";
		self.resizeTo(590, 270);
	}
	else if(mode_value == 3)
	{
		TrImg.style.display = "none";
		TrTxt.style.display = "block";
		self.resizeTo(590, 410);
	}
}

function ConfigKeyCreate(code)
{
	w_width		= 600;
	w_height	= 200;
	w_left		= (screen.width - w_width) / 2;
	w_top		= (screen.height - w_height) / 2;
	CkcWindow = window.open("/Board/admin/config_key_create.asp?code=" + code, "CkcWin", "width=" + w_width + ", height=" + w_height + ", left=" + w_left + ", top=" + w_top);
	CkcWindow.moveTo(w_left, w_top);
	CkcWindow.focus();
}

function ConfigKeyDelete(part, key)
{
	if(confirm("¼±ÅÃÇÏ½Å ÄÚµå¸¦ »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?       "))
		GoCheck("/Board/admin/config_key_delete.asp?cfg_part=" + part + "&cfg_key=" + key);
}

//-->