/*=================================================================================
' ÆÄ  ÀÏ À§ Ä¡  : /html_common/common_javascript.js
' ÇÁ·Î±×·¥ ±â´É : °øÅëÀûÀ¸·Î »ç¿ëµÇ´Â ÀÚ¹Ù½ºÅ©¸³Æ®
' ÀÛ   ¼º   ÀÚ  : ¾ç¿ë¼ö(04.09.03)
'=================================================================================*/
	

// »õÃ¢¶ç¿ì±â ÇÔ¼ö
function OpenWin(dest,title,scroll,width,height,top,left)
{
   window.open(dest,title, "scrollbars="+scroll+",toolbar=no,location=no,directories=no,status=no,width="+width+",height="+height+",resizable=no,menubar=no,top="+top+",left="+left+"");
}

// »èÁ¦½Ã ÀÀ´äÀ» ¹Þ´Â ÇÔ¼ö.
function QuestionDelete(msg){
	if(msg == ""){
		msg = "Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?";
	}

	return confirm(msg);
}
// °¡¿îµ¥ ÆË¾÷ ¶ç¿ì±â
function NewWindow(mypage,myname,w,h,scroll){
var win = null;
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

function callme(msg)
{
	var popWin = window.createPopup();
	var tot_msg, msg1, msg2, msg;
	msg1 = "<DIV STYLE='background:#ffffcc; border:1px solid black; padding:4px; width:200px; font-family:verdana; font-size:70%; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=yellowgreen, EndColorStr=#FFFFFF)'>";
	msg2 = "</DIV>";
	tot_msg = msg1 + msg + msg2;
	
	 popWin.document.body.innerHTML = tot_msg;
    
    var popupBody = popWin.document.body;
        popWin.show(0, 0, 200, 50);
    var realHeight = popupBody.scrollHeight;
        popWin.hide();
    popWin.show(0, 15 , 200, realHeight, event.srcElement);
}

// Æ÷Ä¿½ºÀÌµ¿ ÇÔ¼ö
function moveFocus(num,fromform,toform){
	var str = fromform.value.length;
	if(str == num)
		 toform.focus();
}

// ¼ýÀÚ¸¦ Ã¼Å©ÇÏ´Â ÇÔ¼ö
function IsNumeric(checkStr){
	 var strLength = 0;
	 for (i=0; i<checkStr.length; i++)
	 {
	  		ch = checkStr.charAt(i);
	  if (ch < "0" || ch > "9")
	   		return (false);
	 }
	 return(true);
}

// ÁÖ¹Îµî·Ï¹øÈ£¸¦ Ã¼Å©ÇÏ´Â ÇÔ¼ö
function juminCheck(source_temp1, source_temp2){
	 var  jumin;
  	var  gop="234567892345";
  	var  i=0;
  	var  sum=0;
  	var  a, b;
  	var  endpoint;

	 jumin=source_temp1 + source_temp2;

  	while(i<=5) {
		a=jumin.charAt(i);	
		b=gop.charAt(i);
		sum+=eval(a*b);
		i++;
  	}

  	i=6;
  	while(i<=11) {
		a=jumin.charAt(i);
		b=gop.charAt(i);
		sum+=eval(a*b);
		i++;
  	}

  	endpoint=11-(sum%11)+"";
  	endpoint=endpoint.substring(endpoint.length-1,endpoint.length);
  	bunho=jumin.charAt(12)+"";
  	
	if(bunho!=endpoint) {
		return (false);
  	}else
  	{
		return(true);
  	}
}

function IsImage(source_temp){
	var image_name2 = source_temp.substring(source_temp.length-3,source_temp.length);
	//¼±ÅÃµÈ ÆÄÀÏÀÇ È®ÀåÀÚ°¡ gif, jpgÀÎÁö Ã¼Å©ÇÑ´Ù.
	if((image_name2 != "gif")&&(image_name2 != "jpg")&&(image_name2 != "GIF")&&(image_name2 != "JPG")){
		return(false);
	}

	return(true);
}

//¸ÞÀÏÁÖ¼Ò°¡ ¿Ã¹Ù¸¥ Çü½ÄÀÎÁö Ã¼Å©ÇÏ´Â ÇÔ¼ö
function checkEmail(strEmail){	
	var arrMatch = strEmail.match(/^(\".*\"|[A-Za-z0-9_-]([A-Za-z0-9_-]|[\+\.])*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z0-9][A-Za-z0-9_-]*(\.[A-Za-z0-9][A-Za-z0-9_-]*)+)$/);
	if (arrMatch == null) {
		return false;
	}

	var arrIP = arrMatch[2].match(/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/);
	if (arrIP != null) {
		for (var i = 1; i <= 4; i++) {
			if (arrIP[i] > 255) {
				return false;
				}
			}
	}
	
	return true;
}