// 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);
}

// copyright popup
function copyrightPop(type)
{
	if(type == 'company')
	{
		openPop('http://www.geopia.com/company/home.ggi','company',750,600,'no');
	}
	else if(type == 'agree')
	{
		openPop('http://www.infomaster.co.kr/infoGuide/agree.php','agree',600,770,'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 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];}
}


function hompy(userid)
{
	window.open('http://hompy.geopia.com/?masterid='+userid,'','width=940,height=540');
}

function todayV(userid)
{
	window.open('http://hompy.geopia.com/?masterid='+userid+'&view=todayV','','width=940,height=540');
}

function todayW(userid)
{
	window.open('http://hompy.geopia.com/?masterid='+userid+'&view=todayW','','width=940,height=540');
}


function open_join()
{
	window.open('https://addusrs.geopia.com:448/?vfrom=g','','width=772,height=580');
}

function open_idpass()
{
	window.open('http://login.geopia.com/geopia/login_pass_01.ggi','','width=400,height=260')
}	

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();
}
