function check_jumin(obj1,obj2){
	var J1=obj1.value;
	var J2=obj2.value;
	
	// ÁÖ¹Îµî·Ï¹øÈ£ 1 ~ 6 ÀÚ¸®±îÁöÀÇ Ã³¸®
	// ÁÖ¹Îµî·Ï¹øÈ£¿¡ ¼ýÀÚ°¡ ¾Æ´Ñ ¹®ÀÚ°¡ ÀÖÀ» ¶§ Ã³¸®
	for(i=0;i<J1.length;i++){
		if (J1.charAt(i) >= 0 || J1.charAt(i) <= 9) {
			// ¼ýÀÚ¸é °ªÀ» °öÇØ ´õÇÑ´Ù.
			if(i == 0){
				SUM = (i+2) * J1.charAt(i);
			}else{ 
				SUM = SUM +(i+2) * J1.charAt(i);
			}
		}else{
			// ¼ýÀÚ°¡ ¾Æ´Ñ ¹®ÀÚ°¡ ÀÖÀ» ¶§ÀÇ Ã³¸®
			alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä");
			return false;
		}
	}

	for(i=0;i<2;i++){
		// ÁÖ¹Îµî·Ï¹øÈ£ 7 ~ 8 ÀÚ¸®±îÁöÀÇ Ã³¸®
		if (J2.charAt(i) >= 0 || J2.charAt(i) <= 9) {
			SUM = SUM + (i+8) * J2.charAt(i);
		}else{
			// ¼ýÀÚ°¡ ¾Æ´Ñ ¹®ÀÚ°¡ ÀÖÀ» ¶§ÀÇ Ã³¸®
			alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä");
			return false;
		}
	}

	for(i=2;i<6;i++){
		// ÁÖ¹Îµî·Ï¹øÈ£ 9 ~ 12 ÀÚ¸®±îÁöÀÇ Ã³¸®
		if (J2.charAt(i) >= 0 || J2.charAt(i) <= 9) {
			SUM = SUM + (i) * J2.charAt(i);
		}else{
			// ¼ýÀÚ°¡ ¾Æ´Ñ ¹®ÀÚ°¡ ÀÖÀ» ¶§ÀÇ Ã³¸®
			alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä");
			return false;
		}
	}

	var checkSUM = SUM % 11;
	if(checkSUM == 0){
		var checkCODE = 10;
	}else if(checkSUM ==1){
		var checkCODE = 11;
	}else{
		var checkCODE = checkSUM;
	}

	// ³ª¸ÓÁö¸¦ 11 ¿¡¼­ »«´Ù
	var check1 = 11 - checkCODE;
	if (J2.charAt(6) >= 0 || J2.charAt(6) <= 9) {
		var check2 = parseInt(J2.charAt(6))
	}else{
		alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä");
		return false;
	}
	if(check1 != check2){
		alert("ÁÖ¹Îµî·Ï ¹øÈ£¸¦ ´Ù½Ã È®ÀÎ ÇÏ¼¼¿ä.");
		return false;
	}else{
		return true;
	}			
}


function check_number(obj){
	var str = obj.value;
	var i;
	for(i=0;i<str.length;i++){
		if (str.charAt(i) >= 0 || str.charAt(i) <= 9) {
			// ¼ýÀÚ
			return true;
		}else{
			// ¹®ÀÚ Æ÷ÇÔ
			return false;
		}
	}
}

function check_special_character(obj,given_msg){
	var str = obj.value;
	var prohibit = new Array(30);
	var check = 0;
	prohibit[0] = "`";
	prohibit[1] = "~";
	prohibit[2] = "@";
	prohibit[3] = "#";
	prohibit[4] = "$";
	prohibit[5] = "%";
	prohibit[6] = "^";
	prohibit[7] = "&";
	prohibit[8] = "*";
	prohibit[9] = "(";
	prohibit[10] = ")";
	prohibit[11] = "-";
	prohibit[12] = "+";
	prohibit[13] = "=";
	prohibit[14] = "|";
	prohibit[15] = "\\";
	prohibit[16] = "{";
	prohibit[17] = "}";
	prohibit[18] = "[";
	prohibit[19] = "]";
	prohibit[20] = ";";
	prohibit[21] = ":";
	prohibit[22] = "'";
	prohibit[23] = "\"";
	prohibit[24] = "<";
	prohibit[25] = ">";
	prohibit[26] = ",";
	prohibit[27] = ".";
	prohibit[28] = "?";
	prohibit[29] = "/";

	for (var i=0; i < prohibit.length; i++){
		if( str.indexOf(prohibit[i]) != -1)	check++;
	}
	if( check>0 ){
		alert(given_msg+'¿¡´Â <,>,%,* µî°ú °°Àº Æ¯¼ö¹®ÀÚ°¡ ¿Ã ¼ö ¾ø½À´Ï´Ù.');
		obj.focus();
		return false;
	}
	return true;
}

//¼ýÀÚ °Ë»ç ·çÆ¾
function onlyNumber()
{
	if((event.keyCode<48)||(event.keyCode>57)) event.returnValue=false;
}

//¼ýÀÚÀÔ·Â Ã¼Å©·çÆ¾
function checkNumber(obj){
	var str = obj.value;
	for (i = 0; i < str.length; i++) {
		var code = str.charCodeAt(i)
		var ch = str.substr(i,1).toUpperCase()
		code = parseInt(code)
		if ((ch < "0" || ch > "9") || ((code > 255) || (code < 0)) || ((code > 57) || (code < 48))) {
			alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
			obj.value="";
		}
	}
	//return true;
}

//¼ýÀÚÀÔ·Â Ã¼Å©·çÆ¾
function checkEngNumber(obj){
	var str = obj.value;
	for (i = 0; i < str.length; i++) {
		var code = str.charCodeAt(i)
		var ch = str.substr(i,1).toUpperCase()
		code = parseInt(code)
		if ((ch < "0" || ch > "9") && (ch < "A" || ch > "Z")  && ((code > 57) || (code < 48))) {
			alert("¼ýÀÚ¿Í ¿µ¾î¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
			obj.value="";
		}
	}
	//return true;
}

function check_msg(given) {
	var ans
	ans = confirm(given);
	if( ans == true){
			return true;
	}
	else{
		return false;
	}
}

function check_input(obj,given_msg) {
	var str = obj.value;
	if(str.length==0){
		alert(given_msg);
		obj.focus();
		return false;	
	}
	return true;
}

function check_space(obj,given_msg) {
	var str = obj.value;
	if(str.indexOf(' ') != -1) {
		alert(given_msg+'¿¡´Â °ø¹éÀÌ µé¾î °¥ ¼ö ¾ø½À´Ï´Ù.');
 		obj.focus();
		return false;
	}
	return true;
}

function check_length_lower(obj,given_length,given_msg) {
	var str = obj.value;
	if (str.length<given_length) {
		alert(given_msg+'(Àº)´Â '+given_length+'ÀÚ ÀÌ»ó ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
		obj.focus();
		return false;
	}
	return true;
}

function check_length_upper(obj,given_length,given_msg) {
	var str = obj.value;
	if (str.length>given_length) {
		alert(given_msg+'(Àº)´Â '+given_length+'ÀÚ ÀÌ³»·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
		obj.focus();
		return false;
	}
	return true;
}

function check_length_mid(obj,llength,ulength,given_msg) {
	var str = obj.value;
	if (str.length<llength || str.length>ulength) {
		alert(given_msg+'(Àº)´Â '+llength+'ÀÚ ÀÌ»ó '+ulength+'ÀÚ ÀÌ³»·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
		obj.focus();
		return false;
	}
	return true;
}

function check_hangul(obj,given_msg){
	var str = obj.value;
	var retCode = 0;
	for (i = 0; i < str.length; i++) {
		var code = str.charCodeAt(i);
		var ch = str.substr(i,1).toUpperCase();
		code = parseInt(code);
		if( (ch < "0" || ch > "9") && (ch < "A" || ch > "Z") && ((code > 255) || (code < 0)) ){
			alert(given_msg+'¿¡´Â ÇÑ±ÛÀ» ¾µ ¼ö ¾ø½À´Ï´Ù.');
			obj.focus();
			return false;
		}
	}
	return true;
}

function check_email(obj){
	if(!check_input(obj,'E-mail ÁÖ¼Ò¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.')) return false;
	str = obj.value;
	if(str.indexOf('@') == -1) {
     		alert("¿Ã¹Ù¸¥ E-mailÇü½ÄÀÌ ¾Æ´Õ´Ï´Ù.\r\n      ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		obj.focus();
		return false;
	}
	return true;
}
		
function check_equal(obj1,obj2, given_msg){
	if (obj1.value != obj2.value ) { 
		alert(given_msg+'(ÀÌ)°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.');
		obj1.value="";
		obj2.value="";
		obj1.focus();
		return false;
	}		
	return true;
}

function open_new_window(URL,width,height) {
	var str,width,height;
	str="'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,";
	str=str+"width="+width;
	str=str+",height="+height+"'";
	window.open(URL,'remote',str);
}

function open_new_window2(URL,width,height) {
	var str,width,height;
	str="'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,";
	str=str+"width="+width;
	str=str+",height="+height+"'";
	window.open(URL,'remote',str);
}

function check_top_login() {
	if(!check_input(loginform.user_id,'ID¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.')) return false;
	if(!check_special_character(loginform.user_id,'ID')) return false;
	if(!check_hangul(loginform.user_id,'ID')) return false;
	if(!check_input(loginform.passwd,'ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.')) return false;
	if(!check_space(loginform.passwd,'ºñ¹Ð¹øÈ£')) return false;
}


function check_logout() {
		var ans
		ans = confirm("Á¤¸» ·Î±×¾Æ¿ôÇÏ½Ã°Ú½À´Ï±î?")
		if( ans == true){
			return true;
		}
		else{
			return false;
		}
}

function check_delete() {
		var ans
		ans = confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")
		if( ans == true){
			return true;
		}
		else{
			return false;
		}
}

//When we get Enter Key Event, Run submick for checking
function EnterCheck(i) {
	if(event.keyCode ==13 && i==1) {
		submitck(1);
	}
}

//When order submit, Check their condition
function submitck(flag) {
	//Searching Condition
	if (flag==1) document.xform.flag.value="1";
	//Moving Condition
	if (flag==2)  document.xform.flag.value="2";
	//Searching Condition
	if (flag==3)  document.xform.flag.value="1";
	//Submit
	document.xform.submit();
}


function NumCheck(obj)
{
	if (isNaN(obj.value)){
		alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À.");
		obj.value = "";
		obj.focus();
	}
}



function printPages(xref) {
	window.open('../print_page.php?ref='+xref,'kado_page_print','width=640,height=600,toolbars=no,scrollbars=yes');
}


function Go_topPage() { 
	document.body.scrollTop = 0; 
} 



function toggleWindow(sWindow)
{
	if (document.all(sWindow).style.display == 'none') {
		document.all(sWindow).style.display = 'block';
	}
	else {
		document.all(sWindow).style.display = 'none';
	}
}


function toggleWindow2(sWindow)
{
	var xwin=sWindow;
	var xwin2=sWindow+'s';
	if (document.all(xwin).style.display == 'none') {
		document.all(xwin).style.display = 'block';
		document.all(xwin2).style.display = 'block';
	}
	else {
		document.all(xwin).style.display = 'none';
		document.all(xwin2).style.display = 'none';
	}
}

function show_flash(url,xwidth,xheight){
	document.write('<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="'+xwidth+'" height="'+xheight+'">');
	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=quality VALUE=high>');
	//document.write('<PARAM NAME=wmode VALUE=transparent>');
	document.write('<embed src="'+url+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+xwidth+'" height="'+xheight+'"></embed>');
	document.write('</object>');
}

function show_flash2(url,xwidth,xheight){
	document.write('<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="'+xwidth+'" height="'+xheight+'">');
	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=quality VALUE=high>');
	document.write('<PARAM NAME=wmode VALUE=transparent>');
	document.write('<embed src="'+url+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+xwidth+'" height="'+xheight+'"></embed>');
	document.write('</object>');
}

function show_media(murl,xwidth,xheight){

	document.write('<object id="NSPlay" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" align="absmiddle"  width="'+xwidth+'" height="'+xheight+'" viewastext>');
	document.write('<param name="Filename" value="'+murl+'">');
	document.write('<param name="AnimationAtStart" value="1">');
	document.write('<param name="AutoResize" value="0">');
	document.write('<param name="AutoSize" value="0">');
	document.write('<param name="Autostart" value="1">');
	document.write('<param name="DefaultFrame" value="Slide">');
	document.write('<param name="EnableContextMenu" value="0">');
	document.write('<param name="ShowControls" value="0">');
	document.write('<param name="ShowDisplay" value="0">');
	document.write('<param name="ShowStatusBar" value="0">');
	document.write('<param name="Volume" value="-600">');
	document.write('<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/download/default.asp" defaultframe="Slide" width="1" height="1" src="/makeasx.asp?id=94&type=high">');
	document.write('</embed>');
	document.write('</object>');
	
}						 

var step = 0; 

function cma_status() { 
	var status_name="¹«ÇÑ»ç¶û ¹«ÇÑÃ¥ÀÓ Ãß¹Ì¾ÖÀÇ È¨ÆäÀÌÁöÀÔ´Ï´Ù.";
	step++ ;
	if (step==5) {step=1} 
	if (step==1) {window.status='¢º¢º¢º' + status_name + '¢¸¢¸¢¸'} 
	if (step==2) {window.status='¢¹¢º¢º' + status_name + '¢¸¢¸¢·'}
	if (step==3) {window.status='¢º¢¹¢º' + status_name + '¢¸¢·¢¸'} 
	if (step==4) {window.status='¢º¢º¢¹' + status_name + '¢·¢¸¢¸'}
	setTimeout("cma_status()",100); 
} 



