
//== NULL Ã¼Å© ==//
function NullCheck(obj,msg) {
if (obj.value == "") {
alert(msg + ' ±âÀÔÇØ ÁÖ¼¼¿ä')
obj.focus()
return true
}
}
//============

//== NULL & ±æÀÌ Á¦ÇÑ Ã¼Å© ==/
function LenCheck(obj, msg, lmin, lmax) {
	if (obj.value == "") {
        alert(msg + 'À»(¸¦) ±âÀÔÇØ ÁÖ¼¼¿ä');
        obj.focus();
        return true;
        }
	else if (obj.value.length < lmin || obj.value.length > lmax) {
		alert(msg + 'Àº(´Â) ' + lmin + '~' + lmax + 'ÀÌ³» ÀÌ¾î¾ß ÇÕ´Ï´Ù.');
		obj.focus();
        return true;
        }
    
	}
//============================



//== ¿µ¹® ¼ýÀÚ Á¶ÇÕ Ã¼Å© ==//
function CombinationCheck(obj, msg)
	{
		var re = new RegExp("[^0-9a-zA-Z]", "g");
		if(re.exec(obj.value) != null)
		{
			alert(msg + " ¿µ¹®°ú ¼ýÀÚÀÇ Á¶ÇÕÀ¸·Î ¸¸µå¼Å¾ß ÇÕ´Ï´Ù.");
			obj.focus();
			return true;
		}
		return false;
	}
//========================

//== ÇÑ±Û Á¶ÇÕ Ã¼Å© ==/
function Hangulcheck(obj,msg) {
var Alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';

var str_name = obj.value;
	for(var i=0; i < str_name.length; i++) {
		if (Alpha.indexOf( str_name.charAt(i)) >= 0) {
			alert(msg + 'ÇÑ±Û·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
			obj.focus();
			return true;
		}
	}
}
//===============

//== ÁÖ¹Î Ã¼Å© ==//

function resnoCheck(ResNo1, ResNo2)
{
		var identity01 = ResNo1;
		var identity02 = ResNo2;
		
		// ÀÚ¸®¼ö ¹× °ø¹é Ã¼Å©
		if ((identity01.value.length != 6) || (identity01.value.indexOf(" ")!=-1))
		{
			alert("ÁÖ¹Î¹øÈ£ ¾Õ 6 ÀÚ¸®¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			identity01.focus();
			return true;
		}
		else if ((identity02.value.length != 7) || (identity02.value.indexOf(" ")!=-1))
		{
			alert("ÁÖ¹Î¹øÈ£ µÚ 7 ÀÚ¸®¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			identity02.focus();
			return true;
		}
		
		// ¼ýÀÚ·Î ÀûÇôÀÖ´ÂÁö Ã¼Å©
		var int01
		var int02
		for(int01=0;int01<identity01.value.length;int01++)
		if ((identity01.value.charAt(int01)<'0') || (identity01.value.charAt(int01)>'9'))
		{
			alert("ÁÖ¹Î¹øÈ£´Â ¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			identity01.focus();
			return true;
		}
		for(int02=0;int02<identity02.value.length;int02++)
		if ((identity02.value.charAt(int02)<'0') || (identity02.value.charAt(int02)>'9'))
		{
			alert("ÁÖ¹Î¹øÈ£´Â ¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			identity02.focus();
			return true;
		}	
		
		// Àß¸øµÈ ÁÖ¹Î¹øÈ£µé Ã¼Å©
		var identitysex = identity02.value.substring(0,1);
		var birth01 = identity01.value.substring(0,2);
		var birth02 = identity01.value.substring(2,4);
		var birth03 = identity01.value.substring(4,6);		
		if (identitysex>4 || identitysex==0)
		{
			alert("Àß¸øµÈ ÁÖ¹Î¹øÈ£ ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			identity02.focus();
			return true;
		}
		else if (birth02>12)
		{
			alert("Àß¸øµÈ ÁÖ¹Î¹øÈ£ ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			identity01.focus();
			return true;
		}		
		else if (birth03>31)
		{
			alert("Àß¸øµÈ ÁÖ¹Î¹øÈ£ ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			identity01.focus();
			return true;
		}
		else if (identity01.value=="111111" && identity02.value=="1111118")
		{
			alert("Àß¸øµÈ ÁÖ¹Î¹øÈ£ ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			identity01.focus();
			return true;
		}		
		else if (identity01.value=="111111" && identity02.value=="1111123")
		{
			alert("Àß¸øµÈ ÁÖ¹Î¹øÈ£ ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			identity01.focus();
			return true;
		}		
		else if (identity01.value=="111112" && identity02.value=="1214141")
		{
			alert("Àß¸øµÈ ÁÖ¹Î¹øÈ£ ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			identity01.focus();
			return true;
		}		

		// ÁÖ¹Î¹øÈ£ Ã¼Å©
		var a1 = identity01.value.substring(0,1);
		var a2 = identity01.value.substring(1,2);
		var a3 = identity01.value.substring(2,3);
		var a4 = identity01.value.substring(3,4);
		var a5 = identity01.value.substring(4,5);
		var a6 = identity01.value.substring(5,6);
		var a_check = (a1*2)+(a2*3)+(a3*4)+(a4*5)+(a5*6)+(a6*7)

		var b1 = identity02.value.substring(0,1);
		var b2 = identity02.value.substring(1,2);
		var b3 = identity02.value.substring(2,3);
		var b4 = identity02.value.substring(3,4);
		var b5 = identity02.value.substring(4,5);
		var b6 = identity02.value.substring(5,6);
		var b7 = identity02.value.substring(6,7);
		var identity_check = a_check+(b1*8)+(b2*9)+(b3*2)+(b4*3)+(b5*4)+(b6*5)
		
		identity_check = identity_check%11
		identity_check = 11-identity_check
		identity_check = identity_check%10
		if (identity_check != b7)
		{
			alert("Àß¸øµÈ ÁÖ¹Î¹øÈ£ ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			identity01.focus();
			return true;
		}
}
//=====================
//== ÀüÀÚ¿ìÆí Ã¼Å© ==//
function Mailcheck(mail) {
var Alpha_mail = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@.-';
var str_email = mail.value;
	for(var i = 0; i < str_email.length ; i++ )
	{
		if(Alpha_mail.indexOf(str_email.charAt(i)) == -1) {
			alert('¸ÞÀÏ Çü½ÄÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.');
			mail.focus();
			return  true;
		}
	}
	if ((str_email.length != 0) && (str_email.search(/(\S+)@(\S+)\.(\S+)/) == -1)){
	alert('¸ÞÀÏ Çü½ÄÀÌ Àß¸øµÇ¾ú½À´Ï´Ù');
	mail.focus();
	return true;
	}
}
//==========================

//======== ÀÌ¹ÌÁö(¿Â,¾Æ¿ô ¸¶¿ì½º) ========== 
function imageOn(iname,im) { 
    var d = eval('document.'+iname);
    d.src=im;
 } 
 
 function imageOut(iname,im) { 
    var d = eval('document.'+iname);
    d.src=im;
 } 