<!--

// °ø¹é Ã¼Ä¿
function checkNull(obj, msg) {
  // obj°¡ ¾ø´Ù¸é true ¸¦ ¸®ÅÏÇÑ´Ù. ½ºÅ©¸³Æ® ¿À·ù¸¦ ¸·±âÀ§ÇØ¼­¸®..
	if( !eval(obj) ) return true;
	exam = obj.value.replace(/\s/g,'');		
	if(exam==""){alert(msg);obj.focus();return false;}  
	return true;
}

function popimg(src)
{
	url = "/inc/imgwin.html?src="+src;
	window.open(url,"popimg","status=no,scrollbars,fullscreen");
}

function del_chk_tname(seq,tname)
{
	if(confirm("»èÁ¦ÇÒ±î¿ä?"))
	{
		if(tname=="tbl_manager")
		{
			url = "./enroll.php?type=del_manager&seq="+seq+"&tname="+tname;
		}
		else if(tname=="tbl_partner")
		{
			url = "./p_enroll.php?type=del&seq="+seq;
		}
		else
		{
			url = "./enroll.php?type=del&seq="+seq+"&tname="+tname;
		}
		location.href = url;
	}
	return;
}

function del_chk(seq)
{
	if(confirm("»èÁ¦ÇÒ±î¿ä?"))
	{
		url = "./enroll.php?type=del&seq="+seq;
		location.href = url;
	}
	return;
}
function check_focus()
{
    var form = document.loanform;
    var str = form.pid1.value.length;
    if(str == 6)
    {
        form.pid2.focus();
    }
}

function open_popup(theURL,winName,w,h,scroll) 
{ 
	if(w=="full")
	{
		w = screen.width;
		h = screen.height;		
		opt = "status=false,left=0,top=0,scrollbars,width="+w+",height="+h;	
	}
	else
	{
		l = (screen.width - w )/2;
		t = (screen.height - h)/2;
		if(h==0){h = screen.height - 150;}
		opt = "status=no,left="+l+",top="+t+",width="+w+",height="+h+",scrollbars="+scroll;	
	}
	
	var pops = window.open(theURL,winName,opt);
	pops.focus();
}

function post_search(form, zip, address, addrdtl) {
  window.open('/include/post.php?frm=' + form + '&zip=' + zip + '&addrdtl=' + addrdtl + '&address=' + address, 'ZipWin',
  'width=400,height=303,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=50,left=300');
}

function chk_frm(form)
{
	var len = form.elements.length;	
	j=0;	
	for(i=0;i<len;i++)
	{
		var title = form.elements[i].getAttribute("title");	
		obj = form.elements[i];	
		
		if(form.elements[i].getAttribute("prop")=="is")
		{			
			exam = obj.value.replace(/\s/g,'');		
			var str = title + "À»(¸¦) È®ÀÎÇØ ÁÖ¼¼¿ä";
			if(exam==""){alert(str);obj.focus();return false;j++;}
		}
		if(form.elements[i].getAttribute("opt")=="num")
		{		
			var str = title + "´Â ¼ýÀÚ¿©¾ß ÇÕ´Ï´Ù";
			if(isNaN(obj.value)){alert(str);obj.select();return false;j++;}
		}
		if(form.elements[i].getAttribute("opt")=="han")
		{		
			var str = title + "´Â °ø¹é¾øÀÌ ÇÑ±ÛÀÌ¾î¾ß ÇÕ´Ï´Ù";
			if(!isKorean(obj)){alert(str);obj.select();return false;j++;}
		}
		if(form.elements[i].getAttribute("opt")=="email")
		{		
			var str = "emailÁÖ¼Ò°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù";
			if(obj.value)
			{
				if(!validEmail(obj)){alert(str);obj.select();return false;j++;}
			}
		}
		if(form.elements[i].getAttribute("opt")=="chk")
		{		
			var str = title + "¸¦ Ã¼Å©ÇØ¾ß µË´Ï´Ù.";
			if(!obj.checked){alert(str);obj.select();return false;j++;}
		}		
	}
	if(form.pid1)
		{
			if(form.pid1.value)
			{
				if(chkpid(form.pid1,form.pid2)==false){return false;j++;}	
			}
		}		
		if(form.num1)
		{
			if(form.num3.value && form.num1.value && form.num2.value)
			{
				chknum = form.num1.value+form.num2.value+form.num3.value;				
				if(chk_num(chknum)==false){alert("»ç¾÷ÀÚ ¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù");form.num1.value="";form.num2.value="";form.num3.value="";form.num1.focus();return false;j++;}
			}
		}
	if(j==0)	return true;
}
function isKorean(obj)
{
	x=0;
	obj.value = obj.value.replace(/\s/g,'');
	var len = obj.value.length;
	for(k=0;k<len;k++)
	{
		x=obj.value.charCodeAt(k);
		if(x<44032 || x>55197) return false;
	}
	return true;
}
function validEmail(obj)
{
	exam = obj.value.replace(/\s/g,'');
	var chk = /^\w{1,12}@{1}(\w+\.?){1,3}\w+\.{1}\w{2,5}$/i;
	return chk.test(exam);
}
function chkpid(obj1, obj2)
{
	var aStr = "ÁÖ¹Î¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù";
	var objVal = obj1.value +"-"+ obj2.value;	
	
	var chk = 0;
	temp = objVal.replace(/\D/g,'');
	var tempLen = temp.length;
	for(i=0;i<tempLen-1;i++)
	{
		chk += ((i%8+2)*parseInt(temp.substr(i,1)));
	}
	chk = 11-(chk%11);
	chk%=10;
	if(chk != temp.substr(tempLen-1,1))
	{
		alert(aStr);
		obj1.focus();
		return false;
	}
	return true;
}


function chk_corpnum(vencod)
	{		
        var sum = 0;
        var getlist =new Array(10);
        var chkvalue =new Array("1","3","7","1","3","7","1","3","5");
        for(var k=0;k<10;k++) { getlist[k] = vencod.substring(k, k+1); }
        for(var k=0; k<9; k++) { sum += getlist[k]*chkvalue[k]; }
        sum = sum + parseInt((getlist[8]*5)/10);
        sidliy = sum % 10;
        sidchk = 0;
        if(sidliy != 0) { sidchk = 10 - sidliy; }
        else { sidchk = 0; }
        if(sidchk != getlist[9]) { return false; }
        return true;
	}
	// ¾ÆÀÌµð Ã¼Ä¿(»ç¿ë°¡´ÉÇÑ ¹®ÀÚÃ¼Ä¿)
function chk_id(string)
{
	var comparestr = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	aa = 0;	
	for (a = 0; a < string.length; a++)
	{
		if(comparestr.indexOf(string.substring(a, a+1)) < 0){ aa++;}
    }
	if(aa > 0){return false;}
	else{ return true;  }
}



function updateChar2(length_limit, obj)
{
	var comment='';
	//comment = eval("document.bbsForm.comment_"+seq);
	//var form = document.bbsForm;
	var length = calculate_msglen(obj.value);
	document.getElementById("textlimit").innerHTML = length;
	if (length > length_limit) {
		alert("ÃÖ´ë " + length_limit + "byteÀÌ¹Ç·Î ÃÊ°úµÈ ±ÛÀÚ¼ö´Â ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù.");
		obj.value = obj.value.replace(/\r\n$/, "");
		obj.value = assert_msglen(obj.value, length_limit);
	}
}
function updateChar(length_limit, obj, _div)
{
	var comment='';
	//comment = eval("document.bbsForm.comment_"+seq);
	//var form = document.bbsForm;
	var length = calculate_msglen(obj.value);
	document.getElementById(_div).innerHTML = length;
	if (length > length_limit) {
		alert("ÃÖ´ë " + length_limit + "byteÀÌ¹Ç·Î ÃÊ°úµÈ ±ÛÀÚ¼ö´Â ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù.");
		obj.value = obj.value.replace(/\r\n$/, "");
		obj.value = assert_msglen(obj.value, length_limit);
	}
}

function calculate_msglen(message)
{
	var nbytes = 0;

	for (i=0; i<message.length; i++) {
		var ch = message.charAt(i);
		if(escape(ch).length > 4) {
			nbytes += 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				nbytes += 1;
			}
		} else if (ch == '<' || ch == '>') {
			nbytes += 4;
		} else {
			nbytes += 1;
		}
	}

	return nbytes;
}

function assert_msglen(message, maximum)
{
	var inc = 0;
	var nbytes = 0;
	var msg = "";
	var msglen = message.length;

	for (i=0; i<msglen; i++) {
		var ch = message.charAt(i);
		if (escape(ch).length > 4) {
			inc = 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				inc = 1;
			}
		} else if (ch == '<' || ch == '>') {
			inc = 4;
		} else {
			inc = 1;
		}
		if ((nbytes + inc) > maximum) {
			break;
		}
		nbytes += inc;
		msg += ch;
	}
	document.getElementById("textlimit").innerHTML = nbytes;
	return msg;
}

function isImageFile( fileName )
	{
		var fileSuffix = fileName.substring(fileName.lastIndexOf(".") + 1);
		fileSuffix = fileSuffix.toLowerCase();
		if ( "jpg" == fileSuffix || "jpeg" == fileSuffix  || "gif" == fileSuffix || "bmp" == fileSuffix ) 
			return true;
		else 
			return false;
	}	

function flash(url,width,height) 
{ 
document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='" + width + "' height='" + height + "'>") 
document.write("<param name=movie value='" + url + "'>") 
document.write("<param name=quality value=high>") 
document.write("<PARAM NAME=menu VALUE=false>") 
document.write("<PARAM NAME=wmode VALUE=transparent>") 
document.write("<embed src='" + url + "' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "'>") 
document.write("</embed>") 
document.write("</object>") 
} 
//-->