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_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 opnlayer(ly) {
	if (document.getElementById(ly).style.display == "none")
	{
		document.getElementById(ly).style.display = "block";
	} else {
		document.getElementById(ly).style.display = "none";
	}
}

function overlayeropen(ly) {
	document.getElementById(ly).style.display = "block";
}

function outlayerclose(ly) {
	document.getElementById(ly).style.display = "none";
}

//¼ýÀÚ Ã¼Å©
   function numchk(obj)
   {
		if (isNaN(obj.value)){
			alert("¼ýÀÚ¸¸ ÀÔ·ÂÀÌ °¡´ÉÇÕ´Ï´Ù");
			obj.value="";
			obj.focus();
			return;
		}
   }

	//ÇÑ±Û ¿µ¾î Ã¼Å©
   function engchk(obj)
   {
		var pattern = /[^(a-zA-Z°¡-ÆR¤¡-¤¾)]/;
		if(pattern.test(obj.value)){
			alert("¿µ¹® ÇÑ±Û¸¸ Çã¿ëÇÕ´Ï´Ù.");
			obj.value = "";
			obj.focus();
			return;
		}
   }

	//ÇÑ±Û ¿µ¾î Ã¼Å©
   function engnumchk(obj)
   {
		var pattern = /[^(a-zA-Z0-9_)]/;
		if(pattern.test(obj.value)){
			alert("¿µ¹® ¼ýÀÚ¸¸ Çã¿ëÇÕ´Ï´Ù.");
			obj.value = "";
			obj.focus();
			return;
		}
   }

//ÀÌ¸ÞÀÏÁÖ¼ÒÃ¼Å©
   function checkEmail(obj1,obj2){
    var str = obj1.value+"@"+obj2.value;
    var reg = /^((\w|[\-\.])+)@((\w|[\-\.][^(\.)\1])+)\.([A-Za-z]+)$/;
     if (str.search(reg) != -1) {
         return true;
     }
     return false;
   }

	function enterchk(e,type) {
		if (e.keyCode == 13)
		{
			if (type=="J")
			{
				juminchk();
			} else if (type=="L")
			{
				login_ok();
			} else if (type=="O")
			{
				send_it();
			} else {
				idchk();
			}
		}
	}

	function comma(no) {
		var reg = /(^[+-]?\d+)(\d{3})/;
		no += '';
		while (reg.test(no))
		{
			no = no.replace(reg, '$1'+','+'$2');
		}
		return no;
	}

	function postpop(post1, post2, addr1, addr2) {
		window.open("/popup/popup_address.asp?post1="+post1+"&post2="+post2+"&addr1="+addr1+"&addr2="+addr2,"","width=400, height=310")
	}

	function popup(url, widval, heival) {
		window.open(url,"","width="+widval+", height="+heival+",location=no, status=no")
	}

	function popup_scroll(url, widval, heival) {
	window.open(url,"","width="+widval+", height="+heival+",location=no, status=no, scrollbars=yes")
	}

	function setCookie( name, value, expiredays )
	{
	 var todayDate = new Date();

	 //ÄíÅ°À¯È¿±â°£ ¼³Á¤
	 todayDate.setDate( todayDate.getDate() + expiredays );
	 //ÄíÅ°³»¿ë
	 document.cookie = name + "=" + escape( value ) + "; path=/ ; expires=" + todayDate.toUTCString() + ";" ;

	}

	function getCookie( name )
	{
	 var nameOfCookie = name + "=";
	 var x = 0;

	 //ÄíÅ°¸¦ ºÐ¸®ÇÑ´Ù.
	 while ( x <= document.cookie.length )
	 {
	  //Ã£À» ÄíÅ°ÀÌ¸§ ±æÀÌ ¹Þ¾Æ¿À±â
	  var y = (x + nameOfCookie.length);

	  //Ã£À» ÄíÅ° ÀÌ¸§°ú °°ÀºÁö?
	  if ( document.cookie.substring( x, y ) == nameOfCookie )
	  {
		//°°´Ù¸é
		//ÄíÅ°¿¡¼­ µ¥ÀÌÅÍ¸¦ ±¸ºÐÀÚ·Î ÀÚ¸¥ÈÄ ±æÀÌ°¡ -1ÀÎÁö?
		if ( (endOfCookie = document.cookie.indexOf( ";", y )) == -1 )
		{
		 //±¸ºÐÀÚ°¡ ¾ø´Ù¸é ÄíÅ° ±æÀÌ¸¸Å­ ÀÚ¸¥´Ù.
		 endOfCookie = document.cookie.length;
		}

		//Àß¶ó³½ ÄíÅ°¿¡¼­ µ¥ÀÌÅÍ¸¸ ºÐ¸®ÇÑ´Ù.
		return unescape( document.cookie.substring( y, endOfCookie ) );
	  }

	  //´ÙÀ½ ÄíÅ° ½ÃÀÛÁöÁ¡À¸·Î ÀÌµ¿
	  x = document.cookie.indexOf( " ", x ) + 1;

	  //´õÀÌ»ó ÀÌµ¿ÇÒ °ÍÀÌ ¾ø´Ù¸é ¸ØÃá´Ù.
	  if ( x == 0 )
	  {
		break;
	  }
	 }

	 return "";
	}

	function back() {
		history.back();
		location.reload();
	}

	function login(redurl) {
		location.href="/member/login.asp?redurl="+redurl
	}



