//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//
//	IFRAMEÀÇ ½ºÅ©·Ñ Bar¸¦ ¸ÞÀÎ ÇÁ·¹ÀÓ¹Ù·Î Á¶Àý
//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//

        var c=false;
        // Æ÷Ä¿½º°¡ ÀÎÇ² ¹Ú½º¾È¿¡ ÀÖÀ»¶§ ¹è°æÀÌ¹ÌÁö Áö¿ì±â
        function ch (valueid) {
                if(valueid ==  'id')  document.frmlogin.id.style.backgroundImage="";
                else document.frmlogin.pass.style.backgroundImage="";
                c=true;
        }

        // Æ÷Ä¿½º°¡ ÀÎÇ² ¹Ú½º¸¦ ¹þ¾î³µÀ»¶§ ¹è°æÀÌ¹ÌÁö »ì¸®±â (ÀÔ·Â°ªÀÌ ÀÖÀ¸¸é »ì¸®Áö ¾Ê±â)
        function chout (valueid) {
                if(valueid ==  'id') {
                        if(!document.frmlogin.id.value) document.frmlogin.id.style.backgroundImage="url(../images/loginBox_Tid.gif)"; // ¾ÆÀÌµð¿¡ ¾²ÀÏ ÀÌ¹ÌÁö°æ·Î
                }
                else {
                        if(!document.frmlogin.pass.value) document.frmlogin.pass.style.backgroundImage="url(../images/loginBox_Tpw.gif)"; //ÆÐ½º¿öµå ¾²ÀÏ ÀÌ¹ÌÁö°æ·Î
                }
                c=true;
        }
function check_keycode(e) {
                if (e.type == "keypress") var whichCode = e.keyCode;
                if (whichCode == 13)
                         chkinput();
        }

// ¸ÞÀÎÆäÀÌÁö..
function reSize() {
	var objBody = ifrm.document.body;
	var objFrame = document.all["ifrm"];

	objFrame.style.height = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight)
	objFrame.style.width = '100%'

}


// iframe ÆäÀÌÁö..
function frame_init() {

	parent.reSize();
	var locate = parent.document.location.href;
}
//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//



//ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©
function Jumin_chk(it) {
	IDtot = 0;
	IDAdd="234567892345";

	for(i=0;i<12;i++) {
		IDtot=IDtot+parseInt(it.substring(i,i+1))*parseInt(IDAdd.substring
		(i,i+1));
	}

	IDtot=11-(IDtot%11);

	if(IDtot==10) {
		IDtot=0;
	}
	else if(IDtot==11){
		IDtot=1;
	}
	if(parseInt(it.substring(12,13))!=IDtot) 
		return true;
} 
  
function CheckJumin() {
	jumin = document.frm._0000_karse_prenum1.value + document.frm._0000_karse_prenum2.value;

	if(Jumin_chk(jumin)){
		alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ Æ²¸³´Ï´Ù.");
		document.frm._0000_karse_prenum1.value = "";
		document.frm._0000_karse_prenum2.value = "";
		document.frm._0000_karse_prenum1.focus();
		document.frm._0000_karse_birth1.value = "";
		document.frm._0000_karse_birth2.value = "";
		document.frm._0000_karse_birth3.value = "";
		return true;
	}
}
function CheckJumin1() {
	jumin = document.frm1.prenum1.value + document.frm1.prenum2.value;

	if(Jumin_chk(jumin)){
		alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ Æ²¸³´Ï´Ù.");
		document.frm1.prenum1.value = "";
		document.frm1.prenum2.value = "";
		document.frm1.prenum1.focus();
		
		return true;
	}
}
function CheckJumin4() {
	jumin = document.frm2.prenum1.value + document.frm2.prenum2.value;

	if(Jumin_chk(jumin)){
		alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ Æ²¸³´Ï´Ù.");
		document.frm2.prenum1.value = "";
		document.frm2.prenum2.value = "";
		document.frm2.prenum1.focus();	
		return true;
	}
}
function CheckJumin3() {
	jumin = document.frm2._0000_karse_prenum1.value + document.frm2._0000_karse_prenum2.value;

	if(Jumin_chk(jumin)){
		alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ Æ²¸³´Ï´Ù.");
		document.frm2._0000_karse_prenum1.value = "";
		document.frm2._0000_karse_prenum2.value = "";
		document.frm2._0000_karse_prenum1.focus();
		document.frm2._0000_karse_birth1.value = "";
		document.frm2._0000_karse_birth2.value = "";
		document.frm2._0000_karse_birth3.value = "";
		return true;
	}
}
function CheckJumin2() {
	jumin = document.frm._0000_karse_prenum1.value;
	if (jumin.length==6) {
		t1 = jumin.substring(0,2);
		t2 = jumin.substring(2,4);
		t3 = jumin.substring(4,6);
		if (parseInt(t1)<20) {
			t1 = "20" + t1;
		}
		else {
			t1 = "19" + t1;
		}

		document.frm._0000_karse_birth1.value = t1;
		document.frm._0000_karse_birth2.value = t2;
		document.frm._0000_karse_birth3.value = t3;
	}

}

function onlyNumber() {
  if ((event.keyCode < 48) || (event.keyCode > 57)) {
    event.returnValue=false;
	}
}

// ID Ã¼Å©
function typeCheck(str) {
/*
	var Alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
	var Num   = '0123456789';
	var Alnum = Alpha + Num;
	var Userid = Alnum + '_';
    var f;
//    f = document.frm.userid.value;
    f = str;
	for (i=0; i<f.length; i++) {
		if (Alnum.indexOf(f.substring(i,i+1)) < 0 ) {
			alert("ID´Â ¿µ¹®ÀÚ³ª ¼ýÀÚÀÌ¾î¾ßÇÕ´Ï´Ù.");
			document.frm.userid.select()
			return false;
		}
		else {
		}
	}
	if (f.length<4) {
		alert("ID´Â 4±ÛÀÚ ÀÌ»óÀÔ´Ï´Ù.");
		document.frm.userid.select()
		return false;
	}

	return true;
*/
	tmp = str ;
	if (tmp.length < 4 || tmp.length > 12) {
		alert("ID´Â 4 ~ 12±ÛÀÚ ÀÌ³»ÀÇ ¿µ¹®ÀÚ ¶Ç´Â ¼ýÀÚÀÇ Á¶ÇÕÀ¸·Î ÇØÁÖ¼¼¿ä.");
		frm.s_0011_karse_userid.focus();
		return false ;
	}

	for (i = 0; i < tmp.length; i++) {
		if (tmp.charAt(i) >= '0' && tmp.charAt(i) <= '9')
			continue;
		else if (tmp.charAt(i) >= 'a' && tmp.charAt(i) <= 'z')
			continue;
		else if (tmp.charAt(i) >= 'A' && tmp.charAt(i) <= 'Z')
			continue;
		else {
			alert("ID¿¡´Â ¿µ¹®, ¼ýÀÚ¸¸ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
			frm.s_0011_karse_userid.value = "" ;
			frm.s_0011_karse_userid.focus();
			return false;
		}
	}
	return true ;

}
function typeCheck2() {
	var f = true;
	tmp = document.frm.s_0011_karse_userid.value;
	if (tmp.length < 4 || tmp.length > 8) {
		f = false ;
	}

	for (i = 0; i < tmp.length; i++) {
		if (tmp.charAt(i) >= '0' && tmp.charAt(i) <= '9')
			continue;
		else if (tmp.charAt(i) >= 'a' && tmp.charAt(i) <= 'z')
			continue;
		else if (tmp.charAt(i) >= 'A' && tmp.charAt(i) <= 'Z')
			continue;
		else {
			f =  false;
		}
	}
	return f ;
}

// ºñ¹Ð¹øÈ£ Ã¼Å©
function CheckPass() {
	pass1 = document.frm._0000_karse_userpass1.value;
	pass2 = document.frm._0000_karse_userpass2.value;

	if(pass1.length<4 ){
		alert("ºñ¹Ð¹øÈ£´Â 4 ~ 8±ÛÀÚ ÀÌ³»ÀÇ ¿µ¹®ÀÚ ¶Ç´Â ¼ýÀÚÀÇ Á¶ÇÕÀ¸·Î ÇØÁÖ¼¼¿ä.");
		frm._0000_karse_userpass1.value = "";
		frm._0000_karse_userpass2.value = "";
		frm._0000_karse_userpass1.focus();
		return true ;
	}

	if(pass1!=pass2){
		alert("ºñ¹Ð¹øÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.\nÈ®ÀÎÇØ ÁÖ½Ê½Ã¿À.");
		frm._0000_karse_userpass1.value = "";
		frm._0000_karse_userpass2.value = "";
		frm._0000_karse_userpass1.focus();
		return true;
	}
}

// ID Áßº¹°Ë»ç È®ÀÎ Ã¢
function IDCheck(str) {
    if (typeCheck(str)) {
		window.open("../user/user_idcheck.jsp?userid="+str,"","width=380,height=205");
	}
  	
}
function IDCheck2(str) {
    if (typeCheck(str)) {
		window.open("../user/user_idcheck2.jsp?userid="+str,"","width=380,height=205");
	}
  	
}

// ¿ìÆí¹øÈ£ °Ë»ö Ã¢
function PostCheck(str) {
  	window.open ("../user/user_postcheck_01.jsp?ctrl="+str,"","width=416,height=220");
}

// °Ô½ÃÆÇ
function LoginMsg() {
	alert("·Î±×ÀÎÀ» ÇÏ¼Å¾ß¸¸ ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
}

// ÆÄÀÏ ´Ù¿î·Îµå
function FileDown(fcode, fname, fname2) {		// (fcode: ÆÄÀÏÀ§Ä¡, fname: ÆÄÀÏ¸í, fname2: ¿øº»ÆÄÀÏ¸í)
	window.open("../servlet/Karse_FileDownload?filecode="+fcode+"&filename="+fname+"&filename2="+fname2,"_self");
}

// °øÁö»çÇ× ÆË¾÷
function getCookie(name) {
	var Found = false
	var start, end
	var i = 0

	// cookie ¹®ÀÚ¿­ ÀüÃ¼¸¦ °Ë»ö
	while(i <= document.cookie.length) {
		 start = i
		 end = start + name.length
		 // name°ú µ¿ÀÏÇÑ ¹®ÀÚ°¡ ÀÖ´Ù¸é
		 if(document.cookie.substring(start, end) == name) {
			 Found = true
			 break
		 }
		 i++
	}

	// name ¹®ÀÚ¿­À» cookie¿¡¼­ Ã£¾Ò´Ù¸é
	if(Found == true) {
		start = end + 1
		end = document.cookie.indexOf(";", start)
		// ¸¶Áö¸· ºÎºÐÀÌ¶ó´Â °ÍÀ» ÀÇ¹Ì(¸¶Áö¸·¿¡´Â ";"°¡ ¾ø´Ù)
		if(end < start)
			end = document.cookie.length
		// name¿¡ ÇØ´çÇÏ´Â value°ªÀ» ÃßÃâÇÏ¿© ¸®ÅÏÇÑ´Ù.
		return document.cookie.substring(start, end)
	}
	// Ã£Áö ¸øÇß´Ù¸é
	return ""
}

function ViewNotice(num) {
  var eventCookie=getCookie('nPopup' + num);
  if (eventCookie != "no")
	window.open('../board/notice_view.jsp?num='+num, 'nWin'+num, 'scrollbars=yes,width=506,height=556');
}

// Login½Ã Æ÷Ä¿½º ÀÌµ¿
function EnterCheck(i) {
	if (event.keyCode == 13 && i == 1) {
		document.frmlogin.pass.focus();
	}
	if (event.keyCode == 13 && i == 2) {
		Login();
	}
}
function EnterCheck2(i) {
	if (event.keyCode == 13 && i == 1) {
		document.frmlogin2.pass.focus();
	}
	if (event.keyCode == 13 && i == 2) {
		Login2();
	}
}

function CheckLoginForm() {	
	if(frmlogin.id.value=="") {
		alert("ID¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		frmlogin.id.focus();
		return false;
	}
	if(frmlogin.pass.value=="") {
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		frmlogin.pass.focus();
		return false;
	}
	return true;
}
function CheckLoginForm2() {
	if(frmlogin2.id.value=="") {
		alert("ID¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		frmlogin2.id.focus();
		return false;
	}
	if(frmlogin2.pass.value=="") {
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		frmlogin2.pass.focus();
		return false;
	}
	return true;
}

function Login() {
	if (CheckLoginForm()) {
		frmlogin.submit();
	}
	
}
function Login2() {
	if (CheckLoginForm2()) {
		frmlogin2.submit();
	}
	
}


function Back() {
	history.back();
}

function Logout() {
	frmlogin.submit();
}

function wClose() {
	self.close();
}

function wClose2() {
	opener.location.reload();
	self.close();
}

// ÇÁ¸°Æ®
function bPrint() {
	window.print();
}

function FileUp(s1, s2, s3) { // (µð·ºÅä¸® ÄÚµå, ¼³¸í, ÄÚµå )
	window.open("../file/attfile.jsp?step1="+s1+"&step2="+s2+"&step3="+s3,"","height=118,width=382");
}

function FileUp2(s1, s2, s3, s4, s5) { // (µð·ºÅä¸® ÄÚµå, ¼³¸í, ÄÚµå, hiddenÇÊµåÀÌ¸§, ÅØ½ºÆ®ÇÊµåÀÌ¸§)
	window.open("../file/attfile.jsp?step1="+s1+"&step2="+s2+"&step3="+s3+"&step4="+s4+"&step4t="+s5,"","height=118,width=382");
}
function FileUp11(s1, s2, s3) { // (µð·ºÅä¸® ÄÚµå, ¼³¸í, ÄÚµå )
	window.open("../file/attfile2.jsp?step1="+s1+"&step2="+s2+"&step3="+s3,"","height=118,width=382");
}

function FileUp12(s1, s2, s3, s4, s5) { // (µð·ºÅä¸® ÄÚµå, ¼³¸í, ÄÚµå, hiddenÇÊµåÀÌ¸§, ÅØ½ºÆ®ÇÊµåÀÌ¸§)
	window.open("../file/attfile2.jsp?step1="+s1+"&step2="+s2+"&step3="+s3+"&step4="+s4+"&step4t="+s5,"","height=118,width=382");
}

// È¸ºñ³»¿ª
function UserViewPay() {
	window.open("../user/user_pay_01.jsp","", "width=550,height=500,scrollbars=yes");
}
function UserViewPay2(usercode) {
	window.open("../user/b_user_pay_01.jsp?usercode="+usercode,"", "width=550,height=500,scrollbars=yes");
}

function ImgView(str)	{
	img_pre = 'pre';
	str = str.toLowerCase();
	if(str.match(/(.jpg|.jpeg|.gif)/)) {
		opener.document.images[img_pre].src = str;
		opener.document.images[img_pre].style.display = '';
	}
	else {
		alert("ÀÌ¹ÌÁö ÆÄÀÏ(GIF,JPG)¸¸ ¿Ã¸±¼ö ÀÖ½À´Ï´Ù.");
//		document.frm._0000_aikftemp.value = "";
		opener.document.images[img_pre].style.display = 'none';
	}

}

function DownExcel(url) {					// Excel ÀúÀå..
//	window.open(url,"lbottomzFrame");
	window.open(url,"");
}

/* window status string */
function hidestatus() {
	window.status='¿Ï·á';
	return true;
}

if ( document.layers ) {
	document.captureEvents( Event.MOUSEOVER | Event.MOUSEOUT );
}

document.onmouseover = hidestatus;
document.onmousedown = hidestatus;
document.onmouseup = hidestatus;
document.onmouseout = hidestatus;
function getFileName(path){
    var NameArray = path.split('\\');
    var SplitName = NameArray[NameArray.length - 1]; 
    return SplitName;
}