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.01
  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 && d.getElementById) x=d.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];}
}

// window.open
function openPop(src,target,width,height,scroll)
{
	var wid = (screen.availwidth - width) / 2;
	var hei = (screen.availheight - height) / 2;
	var opt = 'width='+width+',height='+height+',top='+hei+',left='+wid;+',resizable=no,scrollbars='+scroll;
	window.open(src,target,opt);
}

function windowOpen(url,width,height,scroll)
{
	wid = ( screen.availwidth - width ) / 2;
	hei = ( screen.availheight - height ) / 2;
	size = 'width=' + width + ',height=' + height + ',top=' + hei + ',left=' + wid;
	etc = size + ',resizable=no,scrollbars='+scroll;
	window.open(url,'mainpopup',etc);
}

// copyright popup
function copyrightPop(type)
{
	if(type == 'company')
	{
		openPop('http://www.geopia.com/company/home.ggi?visitfrom=geo','company',775,600,'yes');
	}
	else if(type == 'agree')
	{
		openPop('http://www.geopia.com/privacy/useAgree.ggi','agree',550,615,'no');
	}
	else if(type =='privacy')
	{
		openPop('http://www.geopia.com/privacy/privacy.html','privacy',597,650,'yes');
	}
	else if(type =='junior')
	{
		openPop('http://www.geopia.com/privacy/junior.ggi','junior',597,650,'yes');
	}
	else if(type == 'noemail')
	{
		openPop('http://www.geopia.com/noemail.ggi','noemail',380,220,'no');
	}
	else if(type == 'ad')
	{
		openPop('http://www.geopia.com/popup/ad_mail.ggi','ad',400,535,'no');
	}
	else if(type == 'recruit')
	{
		openPop('http://www.geopia.com/company/company4_3.ggi?visitfrom=geo','recruit',771,604,'yes');
	}
}

function open_join()
{
	windowOpen('https://addusrs.geopia.com:448/?vfrom=g',772,580,'yes');
}

function open_idpass()
{
	windowOpen('http://login.geopia.com/geopia/login_pass_01.ggi',400,260,'yes');
}

function hompy(userid)
{
	windowOpen('http://hompy.geopia.com/?masterid='+userid,940,540,'no');
}

function saveid_func(userid, ip){
	var chk = document.login_form.saveid.checked;

	if(chk == true && userid && ip){
		document.hidden_save.action.value = 'saveId';
		document.hidden_save.mode.value = 'save';
		document.hidden_save.save_id.value = userid;
		document.hidden_save.save_ip.value = ip;
	}else{
		document.hidden_save.action.value = 'saveId';
		document.hidden_save.mode.value = 'del';
	}
	document.hidden_save.target = 'hidden_frame';
	document.hidden_save.submit();
}

function allCheck(status)
{
	for(i=0;i < document.manager.elements.length;i++)
	{
		if(document.manager.elements[i].type == 'checkbox')
		{
			document.manager.elements[i].checked = status;
		}
	}
}

// °ü¸®ÀÚ ±â´É
function helpManager(type)
{
	var fn = document.manager;
	var check = false;

	for(var i=0;i<fn.elements.length;i++)
	{
		if(fn.elements[i].type == 'checkbox' && fn.elements[i].checked == true)
		{
			check = true;
			break;
		}
	}

	if(check == false)
	{
		alert('°Ô½Ã¹°À» ¼±ÅÃÇÏ¼¼¿ä.');
	}
	else
	{
		if(type == 'delete' && confirm('¼±ÅÃÇÑ °Ô½Ã¹°À» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?'))
		{
			fn.actionType.value = type;
			fn.submit();
		}
		else if(type == 'move')
		{
			if(!fn.moveCt.value)
			{
				alert('ÀÌµ¿Ä«Å×°í¸®¸¦ ¼±ÅÃÇÏ¼¼¿ä.');
			}
			else
			{
				fn.actionType.value = type;
				fn.submit();
			}
		}
		else if(type == 'noticeN')
		{
			fn.actionType.value = type;
			fn.submit();
		}
	}
}

// ¼ýÀÚ¸¸ ÀÔ·Â
function onlynumber()
{
	if((event.keyCode < 48) || (event.keyCode>57))
	{
		event.returnValue=false;
	}
}
