function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_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_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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// ¼ýÀÚ Ã¼Å©
function checkNum(str)
{
	  var isNum = true;

	  if (str == null || str == "")
	  {
		   isNum = false;
		   return isNum;
	  }

	  for (var j = 0 ; j < str.length; j++)
	  {
		   if (      str.substring(j, j + 1) != "0"
				&&   str.substring(j, j + 1) != "1"
				&&   str.substring(j, j + 1) != "2"
				&&   str.substring(j, j + 1) != "3"
				&&   str.substring(j, j + 1) != "4"
				&&   str.substring(j, j + 1) != "5"
				&&   str.substring(j, j + 1) != "6"
				&&   str.substring(j, j + 1) != "7"
				&&   str.substring(j, j + 1) != "8"
				&&   str.substring(j, j + 1) != "9" )
		   {
				isNum = false;
		   }
	  }
	  return isNum;
 }
// jumin 
function checkResidentNO(jumin1, jumin2) {  

	var str_f_num = jumin1;
	var str_l_num = jumin2;

	var i3=0
	for (var i=0;i<str_f_num.length;i++)
	{
			var ch1 = str_f_num.substring(i,i+1);
			if (ch1<'0' || ch1>'9') { i3=i3+1 }
	}
	if ((str_f_num == '') || ( i3 != 0 ))
	{
			return (false);
	}



	  var i4=0
	  for (var i=0;i<str_l_num.length;i++)
	  {
		  var ch1 = str_l_num.substring(i,i+1);
		  if (ch1<'0' || ch1>'9') { i4=i4+1 }
	  }
	  if ((str_l_num == '') || ( i4 != 0 ))
	  {
			return (false);
	  }

	  if(str_f_num.substring(0,1) < 0)
	  {
		   return (false);
	  }

	  if(str_l_num.substring(0,1) > 2)
	  {
		   return (false);
	  }

	  if((str_f_num.length > 7) || (str_l_num.length > 8))
	  {

		   return (false);
	  }

	  if ((str_f_num == '72') || ( str_l_num == '18'))
	  {

		return (false);
	  }

	  var f1=str_f_num.substring(0,1)
	  var f2=str_f_num.substring(1,2)
	  var f3=str_f_num.substring(2,3)
	  var f4=str_f_num.substring(3,4)
	  var f5=str_f_num.substring(4,5)
	  var f6=str_f_num.substring(5,6)
	  var hap=f1*2+f2*3+f3*4+f4*5+f5*6+f6*7
	  var l1=str_l_num.substring(0,1)
	  var l2=str_l_num.substring(1,2)
	  var l3=str_l_num.substring(2,3)
	  var l4=str_l_num.substring(3,4)
	  var l5=str_l_num.substring(4,5)
	  var l6=str_l_num.substring(5,6)
	  var l7=str_l_num.substring(6,7)
	  hap=hap+l1*8+l2*9+l3*2+l4*3+l5*4+l6*5
	  hap=hap%11
	  hap=11-hap
	  hap=hap%10
	  if (hap != l7) 
	  {
		return (false);
	  }

	  return true; 
}

// ÀÌ¸ÞÀÏ Ã¼Å©
function checkEmail(form) {  
	var email = form.email.value;
	var email_1 = "";
	var email_2 = "";
	var check_point = 0;


	if (email.indexOf("@") < 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ @ °¡ ºüÁ®ÀÖ½À´Ï´Ù.");
		form.email.focus();
		return false;
	}
	if (email.indexOf(".") < 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ . °¡ ºüÁ®ÀÖ½À´Ï´Ù.");
		form.email.focus();
		return false;
	}

	if (email.indexOf("|") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ | ´Â Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email.indexOf(">") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ > ´Â Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email.indexOf("<") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ < ´Â Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email.indexOf(" ") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ °ø¹éÀÌ Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}

		  for (var j = 0 ; j < email.length; j++) {
			   if ( email.substring(j, j + 1) != "@"  && check_point == 0 ) {
					email_1 = email_1 + email.substring(j, j + 1)
			   } else if ( email.substring(j, j + 1) == "@" )  {
					check_point = check_point + 1;
			   } else {
					email_2 = email_2 + email.substring(j, j + 1);	
			   }
		  }

	if (email_1.length < 3 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ @ ¾ÕÀÚ¸®´Â 3ÀÚ¸®ÀÌ»ó ÀÔ·ÂÇÏ¼Å¾ßÇÕ´Ï´Ù.");
		form.email.focus();
		return false;
	}
	if (email_1.length < 3 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ @ ¾ÕÀÚ¸®´Â 3ÀÚ¸®ÀÌ»ó ÀÔ·ÂÇÏ¼Å¾ßÇÕ´Ï´Ù.");
		form.email.focus();
		return false;
	}
	if (email_2.length < 2 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ @ µÞÀÚ¸®´Â 2ÀÚ¸®ÀÌ»ó ÀÔ·ÂÇÏ¼Å¾ßÇÕ´Ï´Ù.");
		form.email.focus();
		return false;
	}

	if (check_point > 1 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ @ ´Â 1¹øÀÌ»ó µé¾î°¥¼ö ¾ø½À´Ï´Ù.");
		form.email.focus();
		return false;
	}

	if (email_2.indexOf("(") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ ( ´Â Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email_2.indexOf("(") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ ( ´Â Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email_2.indexOf(")") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ ) ´Â Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email_2.indexOf(",") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ , ´Â Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email_2.indexOf(";") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ ; ´Â Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email_2.indexOf(":") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ : ´Â Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email_2.indexOf("/") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ / ´Â Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email_2.indexOf("[") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ [ ´Â Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email_2.indexOf("]") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ ] ´Â Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email_2.indexOf("{") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ { ´Â Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email_2.indexOf("}") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ } ´Â Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email_2.indexOf(" ") >= 0 ) {
		alert("ÀüÀÚ¿ìÆíÁÖ¼Ò¿¡ ½ºÆäÀÌ½º´Â Æ÷ÇÔÇÒ¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email_2.indexOf("daum.net") >= 0 ) {
		alert("DaumÀÇ hanmailÀº º¸³¾¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	if (email_2.indexOf("hanmail.net") >= 0 ) {
		alert("DaumÀÇ hanmailÀº º¸³¾¼ö ¾ø½À´Ï´Ù..");
		form.email.focus();
		return false;
	}
	return true;
}	

//¾ÆÀÌµðÁßº¹Ã¼Å©
function id_check_win(){
	var id = eval(document.form_reg.id);            
	if(!id.value) {
		alert('¾ÆÀÌµð(ID)¸¦ ÀÔ·ÂÇÏ½Å ÈÄ¿¡ È®ÀÎÇÏ¼¼¿ä!');
		id.focus();
		return;
	} 
	else {
		temp = document.form_reg.id.value;
		window.open("/membership/id_check_post.html?id=" + temp,"post","toolbar=no,width=400,height=245,directories=no,status=no,scrollbars=no,resize=no,menubar=no");
	}
}

//ÁÖ¼ÒÃ£±â
function post_check_win(form_reg){
	window.open('/membership/addr_check.html','post','width=420,height=330,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
}

//ÅõÇ¥ »õÃ¢¶ç¿ì±â
function open1()
{window.open('./poll/index.php','poll','width=320,height=400,menu=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0')} 

function open2()
{window.open('./poll/index_eng.php','poll','width=320,height=400,menu=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0')} 

//°ü¸®ÀÚ °í°´ÀÇ¼Ò¸® ÀÌ¹ÌÁö Ã¢¿­±â ¼¼ºÎ³»¿ë
function open_img(mode,uid)
{window.open('/customer/open_img.inc.html?mode='+mode + '&uid='+uid,'newimg','width=680,height=600,menu=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes')} 

//°ü¸®ÀÚ È¸¿ø°ü¸®  Ã¢¿­±â ¼¼ºÎ³»¿ë
function mem_view(mode,uid)
{window.open('./memlist.inc.html?mode='+mode + '&uid=' +uid,'newimg','width=680,height=500,menu=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes')} 

//°ü¸®ÀÚ ÀÔ»çÁö¿ø¼­  Ã¢¿­±â ¼¼ºÎ³»¿ë
function recruit_view(mode,uid)
{window.open('./recruit.inc.html?mode='+mode + '&uid=' +uid,'recruit','width=800,height=800,menu=no,toolbar=no,location=no,directories=0,status=no,menubar=0,scrollbars=yes,resizable=yes')} 

//°ü¸®ÀÚ ÀÔ»çÁö¿ø¼­  Ã¢¿­±â ¼¼ºÎ³»¿ë
function franchise_view(mode,uid)
{window.open('./franchise.inc.html?mode='+mode + '&uid=' +uid,'recruit','width=600,height=500,menu=no,toolbar=no,location=no,directories=0,status=no,menubar=0,scrollbars=yes,resizable=yes')} 


//°ü¸®ÀÚ press release write
function cate_list(mode)
{window.open('./cate_list.inc.html?mode='+mode,'recruit','width=400,height=500,menu=no,toolbar=no,location=no,directories=0,status=no,menubar=0,scrollbars=yes,resizable=yes')} 

//°ü¸®ÀÚ cms ÀÌº¥Æ® Ä«·»Å¸
function inter_opener(id)
{
			window.open('./calendar.php?cps='+id+'','win','width=155,height=140,scrollbars=no,toolbar=no,menubar=no');
}
	
//È¸»ç ¾àµµ
function map()
{window.open('/about/map.inc.html','map','width=730,height=420,menu=no,toolbar=no,location=no,directories=0,status=no,menubar=0,scrollbars=no,resizable=yes')} 
	
//È¸¿ø°¡ÀÔÄíÆù
function memcoupon()
{window.open('/event/evjoin1.html','memcoupon','width=740,height=840,menu=no,toolbar=no,location=no,directories=0,status=no,menubar=0,scrollbars=auto,resizable=yes')} 

function newcoupon(mode)
{window.open('/customer/coupon.new.inc.html?mode='+mode,'coupon','width=470,height=230,menu=no,toolbar=no,location=no,directories=0,status=no,menubar=0,scrollbars=no,resizable=yes')} 
		
//Ã¼Å©¹Ú½º(checkbox)¸¦ ¶óµð¿À(radio) ¹öÆ°Ã³·³ »ç¿ëÇÏ±â
//<!input type="checkbox" name="owner" value="E" checked onclick="check_all(0)">
//<!input type="checkbox" name="owner" value="E" checked onclick="check_all(1)">
function check_all(str){
var f = document.form2;
for (i=0; i < f.myNumber.length; i++) {
f.myNumber[i].checked=false;
}
f.myNumber[str].checked = true;
}

// ¶óµð¿À(radio) ¹öÆ° ¸µÅ©°É±â
//<input type="radio" name="tel_type" {if $GoMode eq A}checked{else}{/if} onClick="gourl('/registration/?GoMode=A');">
function gourl(url) { 
window.location.href = url; 
} 


function linkTO() {
    document.go.submit();
}

function coupon(){
	window.close();
	opener.location.href='/customer/customer_coupon.html';	
}

function pop1(){
	window.close();
	opener.location.href='/event/lastevent-2.html?cate_uid=4&uid=81&go=now';	
}

function pop2(){
	window.close();
	opener.location.href='/event/lastevent-2.html?cate_uid=4&uid=82&go=now';	
}

//¼­¿ïÆä½ºÆ¼¹ú 
function seoulpop()
{window.open('/popup/mainpop.html','seoulpon','width=350,height=240,menu=no,toolbar=no,location=no,directories=0,status=no,menubar=0,scrollbars=auto,resizable=yes')} 
