// ÀÌ¹ÌÁö ÆËÀ¸·Î º¸±â
var imgObj = new Image();
function photoView(img_url) { //v2.0
  imgObj.src = img_url;
  setTimeout("createImgWin(imgObj)", 100);
}
function createImgWin(imgObj) {
  if (! imgObj.complete) {
    setTimeout("createImgWin(imgObj)", 100);
    return;
  }  
  imgH=imgObj.height;     
  imgW=imgObj.width;
  
  AnotherWin = window.open("/admin/photo_view.html?img_url="+imgObj.src,"imgview","width="+imgW+",height="+imgH+",top=50,left=50");
  AnotherWin.focus();
}

//ÀÌ¹ÌÁö ¹Ù²î´Â ÇÔ¼ö
function changImg(image_src){ 
	document.good_image.src=image_src;
}

// ÀÌ¹ÌÁöÀÎÁö È®ÀÎ  onChange="checkFile(this)"
function checkImgAll(obj)
{
    if(event.srcElement.value.match(/(.jpg|.jpeg|.gif|.JPG|.JPEG|.GIF)/)) {
    }
    else {
        alert('ÀÌ¹ÌÁö ÆÄÀÏ¸¸(gif,jpg,jpeg) °¡´ÉÇÕ´Ï´Ù.');
    }
}


// jpg ÀÌ¹ÌÁöÀÎÁö È®ÀÎ
function checkImgJpg(obj)
{
    if(event.srcElement.value.match(/(.jpg|.jpeg|.JPG|.JPEG)/)) {
    }
    else {
        alert('jpg ÀÌ¹ÌÁö ÆÄÀÏ¸¸(jpg,jpeg) °¡´ÉÇÕ´Ï´Ù.');
    }
}


// ¹®ÀÚ±æÀÌ È®ÀÎ-- ÇÑ±Û2 ¿µ¹®1
function getLength(str){
     return(str.length+(escape(str)+"%u").match(/%u/g).length-1);
}

// ¼ýÀÚ¸¸ ÀÔ·Â ¹Þ±â onkeyup="onlyNumber(this)"
function onlyNumber( el ) {
	el.value = el.value.replace( /\D/g, '' );
}

// »èÁ¦ °Ë»ç È®ÀÎ
function deleteConfirm(href) 
{
	if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")) 
		document.location.href = href;
}

// ¾çÂÊ °ø¹é ¾ø¾Ö±â
function strTrim(fld) 
{
	var pattern = /(^\s*)|(\s*$)/g; // \s °ø¹é ¹®ÀÚ
	fld.value = fld.value.replace(pattern, "");
	return fld.value;
}


// ÁÖ¹Îµî·Ï¹øÈ£ °Ë»ç ¼ýÀÚ¸¸ ÀÖÀ»°æ¿ì
function juminChk(juminNum) {
    if(juminNum.length != 13 || isNaN(juminNum) || juminNum.charAt(6)<1 || juminNum.charAt(6)>4) { 
        alert ("ÁÖ¹Îµî·Ï¹øÈ£¸¦ È®ÀÎÇÏ½Ê½Ã¿À"); 
        return false; 
    } 

    var check = 0 ; 
    for (var i=0 ; i<12 ; i++) { 
        check += (i%8+2) * juminNum.charAt(i); 
    } 
    check = (11-check%11) % 10; 

    if(check != juminNum.charAt(12)) { 
        alert ("À¯È¿ÇÏÁö ¾ÊÀº ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù."); 
        return false; 
    } 
    return true;
}
