

//¸µÅ©
function move_location(on){
	location=on;
}

//¸ÞÀÏº¯°æ
function mail_change(on){
	if (document.all[on+"_email3"].value=="-"){
		document.all[on+"_email2"].value="";
		document.all[on+"_email2"].readOnly=false;
		document.all[on+"_email2"].focus();
	}else{
		document.all[on+"_email2"].value=document.all[on+"_email3"].value;
		document.all[on+"_email2"].readOnly=true;
	}
}

//±âº» ÇÃ·¹½¬ ¿­¶§
function script_flash2(flash_root,w,h){
	flash_str=" <object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+w+"' height='"+h+"'> ";
	flash_str=flash_str+" <param name='movie' value='"+flash_root+"'> ";
	flash_str=flash_str+" <param name='quality' value='high'> ";
	flash_str=flash_str+" <param name='wmode' value='transparent' /> ";
	flash_str=flash_str+" <embed src='"+flash_root+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+w+"' height='"+h+"'></embed> ";
	flash_str=flash_str+" </object> ";

	document.write(flash_str);
}

//±âº» ÇÃ·¹½¬(ÇÃ·¡½Ã¹Ù½º) ¿­¶§
function script_flash3(flash_root,w,h,xmlurl){
	flash_str=" <object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+w+"' height='"+h+"'> ";
	flash_str=flash_str+" <param name='movie' value='"+flash_root+"'> ";
	flash_str=flash_str+" <param name='quality' value='high'> ";
	flash_str=flash_str+" <param name='wmode' value='transparent' /> ";
	flash_str=flash_str+" <param name='flashvars' value='"+xmlurl+"' /> ";
	flash_str=flash_str+" <embed src='"+flash_root+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+w+"' height='"+h+"'></embed> ";
	flash_str=flash_str+" </object> ";

	document.write(flash_str);
}

//ÇÃ·¹½¬ À§Ä¡ÁöÁ¤ÇØ¼­ ¿­¶§
function script_flash(flash_root,w,h,left,top){
	flash_str=" <object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+w+"' height='"+h+"' style='position:absolute; left:"+left+"px; top:"+top+"px;'> ";
	flash_str=flash_str+" <param name='movie' value='"+flash_root+"'> ";
	flash_str=flash_str+" <param name='quality' value='high'> ";
	flash_str=flash_str+" <param name='wmode' value='transparent' /> ";
	flash_str=flash_str+" <embed src='"+flash_root+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+w+"' height='"+h+"'></embed> ";
	flash_str=flash_str+" </object> ";

	document.write(flash_str);
}

//ÀÔ·Â°ª ±æÀÌ °Ë»ç
function check_value(on,str,n) {
	str_value=on.value;
	str_value=str_value.replace(/ /g,"");
	str_value=str_value.replace(/\r\n/g,"");

	if (str_value.length==0) {
		alert(str + " ÀÔ·ÂÇÏ¼¼¿ä.");
		on.value="";
		on.focus();
		return false;
	} else if (str_value.length<n) {
		alert(str + " " + n + "±ÛÀÚ ÀÌ»ó ÀÔ·ÂÇÏ¼¼¿ä.");
		on.focus();
		return false;
	}
}

//³¯Â¥ Çü½Ä °Ë»ç : 2006-07-08
function check_date(date_year,date_month,date_day) {
	if (
			((date_month=="02")&&(date_day>28))
			||((date_month=="04")&&(date_day>30)) || ((date_month=="06")&&(date_day>30))
			||((date_month=="09")&&(date_day>30)) || ((date_month=="11")&&(date_day>30))
		) {
		alert("Àß¸øµÈ ³¯Â¥ÀÔ´Ï´Ù. ´Ù½Ã ¼±ÅÃÇÏ¼¼¿ä.");
		return false;
	}
}



//ÀÌ¸ÞÀÏ °Ë»ç
function verify_email(on) {
	var reg = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/;
	
	if (reg.test(on)==false) {
		alert("Àß¸øµÈ ÀÌ¸ÞÀÏ ÁÖ¼ÒÀÔ´Ï´Ù. \n´Ù½Ã ÀÛ¼ºÇÏ¼¼¿ä.");
		return false;
	}
}

//¿µ¹®,¼ýÀÚ¸¸ ¾²±â °æ°í~!
function check()
{
 var form = document.form1;
 var str = form.m_id.value;
 for(var i=0; i<str.length; i++)
 {
  if(((str.charCodeAt(i) >= 48 && str.charCodeAt(i) <=57) || (str.charCodeAt(i) >=65 && str.charCodeAt(i) <= 90) || (str.charCodeAt(i) >= 97 && str.charCodeAt(i) <= 122)))
  {

  }
  else {   alert("¿µ¹®ÀÌ³ª ¼ýÀÚ¸¸ ¾µ¼ö ÀÖ½À´Ï´Ù.");
   form.m_id.value = "";
   return false;} // Ã³¸®
 }
}

//ÇÑ±Û,¿µ¹®¸¸ ¾²±â °æ°í~!
function check2()
{
 var form = document.form1;
 var str = form.m_nick.value;
 for(var i=0; i<str.length; i++)
 {
  if(((str.charCodeAt(i)<65)||((str.charCodeAt(i)<=127)&&
	(str.charCodeAt(i)>122)))&&((str.charCodeAt(i))<48||(str.charCodeAt(i))>57))
  {
 alert("ÇÑ±ÛÀÌ³ª ¿µ¾î¸¸ ¾µ¼ö ÀÖ½À´Ï´Ù.");
   form.m_nick.value = "";
   return false;
  }
  else {   } // Ã³¸®
 }
}

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

//¼ýÀÚ¸¸ ÀÔ·Â2
function onlynum2(on) {
	var str = document.all[on].value;
	for(var i=0; i<str.length; i++) {
		if(((str.charCodeAt(i))<48||(str.charCodeAt(i))>57)) {
		document.all[on].value = "";
		return false;
		} else {   } // Ã³¸®
	}
}


//¹®ÀÚ¸¸ ÀÔ·Â
function onlykorchar() {
	if ((((event.keyCode>=97)&&(event.keyCode<=122))||
	(event.keyCode==13))==false) {
		event.returnValue=false;
	}
}

//¹®ÀÚ, ¼ýÀÚ, ¾ð´õ¹Ù ÀÔ·Â
function onlychar() {
	if ((((event.keyCode>=97)&&(event.keyCode<=122))||
	((event.keyCode>=48)&&(event.keyCode<=57))||
	(event.keyCode==95)||(event.keyCode==13))==false) {
		event.returnValue=false;
	}
}

//ÀüÈ­¹øÈ£ ÀÔ·Â
function onlytel() {
	if ((((event.keyCode>=48)&&(event.keyCode<=57))||
	(event.keyCode==45)||(event.keyCode==13))==false) {
		event.returnValue=false;
	}
}





//ÀÌ¹ÌÁö ÆÄÀÏ °Ë»ç
function check_image(on) {
	extension=on.substr(on.length-3,3);
	extension=extension.toLowerCase();

	if (((extension=="jpg")||(extension=="gif")||(extension=="swf"))==false) {
		alert("JPG / GIF / SWF ÀÌ¹ÌÁö¸¦ ¼±ÅÃÇÏ¼¼¿ä.");
		return false;
	}
}


//°ü¸®ÀÚ ¸ÞÀÎ ¸Þ´º ºä
function sub_view(on){
	if (document.all["sub_menu_"+on].style.display=="none"){
		document.all["sub_menu_"+on].style.display="";
	}else{
		document.all["sub_menu_"+on].style.display="none";
	}
	
}


//¿ìÆí¹øÈ£ °Ë»ö
function post_pop(on){
	window.open("/include/exe/zip.php?chk="+on,"zip","top=20,left=20,width=500,height=300");
}

function post_pop_02(on){
	window.open('/include/exe/window_address.php?fg=1&chk='+on, 'memRegZip', "width=346, height=228");
}


//°Ë»ö À¯È¿¼º °Ë»ç
function search_sendit(on){
	if (check_value(on.s_str,"°Ë»ö¾î¸¦",2)==false){
		return false;
	}
}

//ÁÖ¹Îµî·Ï¹øÈ£ °Ë»ç
function verify_ssn(on1,on2) {
	a=on1.value.charAt(0); b=on1.value.charAt(1); c=on1.value.charAt(2);
	d=on1.value.charAt(3); e=on1.value.charAt(4); f=on1.value.charAt(5);

	g=on2.value.charAt(0); h=on2.value.charAt(1); i=on2.value.charAt(2);
	j=on2.value.charAt(3); k=on2.value.charAt(4); l=on2.value.charAt(5);
	m=on2.value.charAt(6);

	q=c+d;
	r=0;
	num=0;
	if ((a+b)<20) {
		t=4;
	} else {
		t=2;
	}
	if ((q>12)||(q<1)) {
		num=1;
	} else if ((q==4)||(q==6)||(q==9)||(q==11)) {
		r=30;
	} else if (q==2) {
		r=29;
	} else {
		r=31;
	}
	if (((e+f)>r)||((e+f)<1)) {
		num=1;
	} else if (g>t) {
		num=1;
	} else {
		n=a*2 + b*3 + c*4 + d*5 + e*6 + f*7 + g*8 + h*9 + i*2 + j*3 + k*4 + l*5;
		p=11-(n%11);
		if (p==10) {
			p=0;
		} else if (p==11) {
			p=1;
		}
		if (p!=m) {
			num=1;			
		}
	}
	if (num==1) {
		alert("Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù. \n´Ù½Ã ÀÛ¼ºÇÏ¼¼¿ä.")
		on2.value=""
		on2.focus();
		return false;
	}	
}






function search_duplicate(on) {

	
	process_page="/include/exe/id.php?m_id="+on;


//	alert(process_page);

	axo=new ActiveXObject("Microsoft.XMLHTTP");

	axo.Open("POST", process_page, true);
	axo.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	axo.onreadystatechange=function() {return_value(axo)};
	axo.Send(null);

	return axo;
}


function trim(str){
   //Á¤±Ô Ç¥Çö½ÄÀ» »ç¿ëÇÏ¿© È­ÀÌÆ®½ºÆäÀÌ½º¸¦ ºó¹®ÀÚ·Î ÀüÈ¯
   str = str.replace(/^s*/,'').replace(/s*$/, ''); 
   return str; //º¯È¯ÇÑ ½ºÆ®¸µÀ» ¸®ÅÏ.
} 



//¸®ÅÏ°ª Áßº¹ È®ÀÎ
function return_value(axo) {


	if ((axo==null)||(axo.readyState !=4)) {
		return false;
	}
	
//	alert(axo.responseText);

	if ((trim(axo.responseText)==1)) {  
		if (confirm("»ç¿ë°¡´ÉÇÕ´Ï´Ù.»ç¿ëÇÏ½Ã°Ú½À´Ï±î?")==true){
			document.all.m_id_chk.value="ok";
		}

	} else {
		alert("ÀÌ¹Ì µî·ÏµÈ È¸¿ø¾ÆÀÌµðÀÔ´Ï´Ù.");
		document.all.m_id_chk.value="no";
	}

}






var showFlashObject=function(objID,objSource,objWidth,objHeight,objQuality,objWmode,objBgcolor,objXML){
if(objXML){var chkMovie=0;if(objSource.match(/=/))objSource=objSource+"&server="+objXML+"&chkMovie="+chkMovie;else objSource=objSource+"?server="+objXML+"&chkMovie="+chkMovie;}
var pageUrl=self.window.location.href;
if(pageUrl.substring(0,5)=="https") swfUrl="https";
else swfUrl="http";
if(!objID)objID="ShockwaveFlash1";
if(!objWidth)objWidth="0";
if(!objHeight)objHeight="0";
if(!objQuality)objQuality="high";
if(!objWmode)objWmode="transparent";
document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+swfUrl+'://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0" width="'+objWidth+'" height="'+objHeight+'" id="'+objID+'" type="application/x-shockwave-flash" data="'+objSource+'">');
document.writeln('<param name="movie" value="'+objSource+'" />');
document.writeln('<param name="allowFullScreen" value="false" />');
document.writeln('<param name="scale" value="noscale" />');
document.writeln('<param name="allowScriptAccess" value="always" />');
document.writeln('<param name="menu" value="false" />');
document.writeln('<param name="quality" value="high" />');
document.writeln('<param name="bgcolor" value="'+objBgcolor+'" />');
document.writeln('<param name="wmode" value="'+objWmode+'" />');
document.writeln('<embed src="'+objSource+'" allowScriptAccess="always" menu="false" quality="high" bgcolor="'+objBgcolor+'" wmode="'+objWmode+'" width="'+objWidth+'" height="'+objHeight+'" name="'+objID+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.writeln('</object>');};





function auto_close(){
	if (/MSIE/.test(navigator.userAgent)) {
	   //Explorer 7
	   if(navigator.appVersion.indexOf("MSIE 7.0") == 17) {
//		  window.open('about:blank','_self').close();
	  window.opener='Self';
	  window.open('','_parent','');
	  window.close();
	   }
	   //Explorer 8
	   else if(navigator.appVersion.indexOf("MSIE 8.0") == 17) {
	  window.opener='Self';
	  window.open('','_parent','');
	  window.close();
	 }
	   //Explorer 7ÀÌÇÏÀÏ¶§
	   else {
		  window.opener = self;
		  self.close();
	   }
	} 
}


//ÀÚµ¿Ä­¶ç¿ì±â
function autoTab(tabno, invalue) {
  if(invalue.length == tabno.maxLength) {
  var nextin = tabno.tabIndex;
  	if(nextin < document.forms[0].elements.length)
		document.forms[0].elements[nextin].focus();
  }
}
//ÀÚµ¿Ä­¶ç¿ì±â


//radio readyonly È¿°ú
function setRadioChk(e){ 
   var srcEl = getSrc(e);
   var radiochk = srcEl.form[srcEl.name]
    for(var i=0;i<radiochk.length;i++){
      if(radiochk[i].checked) radiochk[i].onpropertychange = function(e){getSrc(e).click()}
      else radiochk[i].onclick = function(){return false};
    }
  }
  function getSrc(e){
    return e? e.target || e.srcElement : event.srcElement;
  }
//radio readyonly È¿°ú

function winResize(){ 
	var Dwidth = parseInt(document.body.scrollWidth); 
	var Dheight = parseInt(document.body.scrollHeight); 
	var divEl = document.createElement("div");   //document¾ÈÀÇ "div"ÀÇ °´Ã¼,º¯¼ö,¸Þ¼Òµå¸¦
	divEl.style.position = "absolute";            //divEI¿¡°Ô ³Ñ°ÜÁØ´Ù. ¿©±â¼­ "div"´Â popupÃ¢ bodyÀüÃ¼
	divEl.style.left = "0px"; 
	divEl.style.top = "0px"; 
	divEl.style.width = "100%"; 
	divEl.style.height = "100%"; 

	document.body.appendChild(divEl);          //appendChild : body¿¡´Ù°¡ divEI¸¦ Àû¿ë½ÃÅ°°Ú´Ù

	window.resizeBy(Dwidth-divEl.offsetWidth, Dheight-divEl.offsetHeight-18); 
	document.body.removeChild(divEl); 
}

//ÁØºñÁß ¹®±¸
function ready(){
	alert("ÁØºñÁßÀÔ´Ï´Ù.");
}


function search_duplicate(on) {

	
	process_page="/include/exe/id.php?m_id="+on;


//	alert(process_page);

	axo=new ActiveXObject("Microsoft.XMLHTTP");

	axo.Open("POST", process_page, true);
	axo.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	axo.onreadystatechange=function() {return_value(axo)};
	axo.Send(null);

	return axo;
}


function trim(str){
   //Á¤±Ô Ç¥Çö½ÄÀ» »ç¿ëÇÏ¿© È­ÀÌÆ®½ºÆäÀÌ½º¸¦ ºó¹®ÀÚ·Î ÀüÈ¯
   str = str.replace(/^s*/,'').replace(/s*$/, ''); 
   return str; //º¯È¯ÇÑ ½ºÆ®¸µÀ» ¸®ÅÏ.
} 



//¸®ÅÏ°ª Áßº¹ È®ÀÎ
function return_value(axo) {


	if ((axo==null)||(axo.readyState !=4)) {
		return false;
	}
	
//	alert(axo.responseText);

	if ((trim(axo.responseText)==1)) {  
		if (confirm("»ç¿ë°¡´ÉÇÕ´Ï´Ù.»ç¿ëÇÏ½Ã°Ú½À´Ï±î?")==true){
			document.all.m_id_chk.value="ok";
		}

	} else {
		alert("ÀÌ¹Ì µî·ÏµÈ È¸¿ø¾ÆÀÌµðÀÔ´Ï´Ù.");
		document.all.m_id_chk.value="no";
	}

}


//¾ÆÀÌÇÁ·¹ÀÓ »çÀÌÁîÀÚµ¿
function resize_me(){ 
  var bodyHeight = document.body.scrollHeight;  
  var bodyWidth = document.body.scrollWidth;  
  resizeTo(bodyWidth,bodyHeight); 
  //alert(bodyWidth+","+bodyHeight); 
}
function iframe_autoresize(arg) {
	arg.height = eval(arg.name+".document.body.scrollHeight");
}




// ÇÃ·¡½¬ È£Ãâ
function Flash( src,width,height )
{
 html = '';
 html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="param" width="'+width+'" height="'+height+'">';
 html += '<param name="movie" value="'+src+'">';
 html += '<param name="quality" value="high">';
 html += '<param name="bgcolor" value="#ffffff">';
 html  +='<param name="wmode" value="transparent">';
 html += '<param name="swliveconnect" value="true">';
 html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" width="'+width+'" height="'+height+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
 html += '</object>';
 document.write(html);
}



function resizeFrame(iframeObj){
    var innerBody = iframeObj.contentWindow.document.body;
    var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
    var innerWidth = innerBody.scrollWidth + (innerBody.offsetWidth - innerBody.clientWidth);
    iframeObj.style.height = innerHeight;
    iframeObj.style.width = innerWidth;
}
