//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//
//	IFRAMEÀÇ ½ºÅ©·Ñ Bar¸¦ ¸ÞÀÎ ÇÁ·¹ÀÓ¹Ù·Î Á¶Àý
//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//-//

// ¸ÞÀÎÆäÀÌÁö..
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.subFrm._0000_aik_prenum1.value + document.subFrm._0000_aik_prenum2.value;

	if(Jumin_chk(jumin)){
		alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ Æ²¸³´Ï´Ù.");
		document.subFrm._0000_aik_prenum1.value = "";
		document.subFrm._0000_aik_prenum2.value = "";
		document.subFrm._0000_aik_prenum1.focus();
		return true;
	}
}

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.subFrm.userid.value;
    f = str;
	for (i=0; i<f.length; i++) {
		if (Alnum.indexOf(f.substring(i,i+1)) < 0 ) {
			alert("ID´Â ¿µ¹®ÀÚ³ª ¼ýÀÚÀÌ¾î¾ßÇÕ´Ï´Ù.");
			document.subFrm.userid.select()
			return false;
		}
		else {
		}
	}
	if (f.length<4) {
		alert("ID´Â 4±ÛÀÚ ÀÌ»óÀÔ´Ï´Ù.");
		document.subFrm.userid.select()
		return false;
	}

	return true;
*/
	tmp = str ;
	if (tmp.length < 4 || tmp.length > 8) {
		alert("ID´Â 4 ~ 8±ÛÀÚ ÀÌ³»ÀÇ ¿µ¹®ÀÚ ¶Ç´Â ¼ýÀÚÀÇ Á¶ÇÕÀ¸·Î ÇØÁÖ¼¼¿ä.");
		subFrm.s_0012_aik_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¿¡´Â ¿µ¹®, ¼ýÀÚ¸¸ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
			subFrm.s_0012_aik_userid.value = "" ;
			subFrm.s_0012_aik_userid.focus();
			return false;
		}
	}
	return true ;

}
function typeCheck2() {
	var f = true;
	tmp = document.subFrm.s_0012_aik_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.subFrm._0000_aik_userpass1.value;
	pass2 = document.subFrm._0000_aik_userpass2.value;

	if(pass1.length<4 ){
		alert("ºñ¹Ð¹øÈ£´Â 4 ~ 8±ÛÀÚ ÀÌ³»ÀÇ ¿µ¹®ÀÚ ¶Ç´Â ¼ýÀÚÀÇ Á¶ÇÕÀ¸·Î ÇØÁÖ¼¼¿ä.");
		subFrm._0000_aik_userpass1.value = "";
		subFrm._0000_aik_userpass2.value = "";
		subFrm._0000_aik_userpass1.focus();
		return true ;
	}

	if(pass1!=pass2){
		alert("ºñ¹Ð¹øÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.\nÈ®ÀÎÇØ ÁÖ½Ê½Ã¿À.");
		subFrm._0000_aik_userpass1.value = "";
		subFrm._0000_aik_userpass2.value = "";
		subFrm._0000_aik_userpass1.focus();
		return true;
	}
}


// Ã·ºÎ »çÁø ¹Ì¸®º¸±â
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 FileUp() {		// Á¹¾÷Áõ¸í
	window.open("../file/attfile.jsp?step1=05&step2=user_etc&step3=03","","height=150,width=380");
}

function FileUp2() {	// »çÁø
	window.open("../file/attfile.jsp?step1=02&step2=user_img&step3=03&step4=_0000_attfile2&step4t=_0000_aikftemp2","","height=150,width=380");
}

function FileUp3() {	// °Ô½ÃÆÇ ÆÄÀÏ
	window.open("../file/attfile.jsp?step1=06&step2=old_files&step3=03","","height=150,width=380");
}
/*
function FileUp4() {	//  °Ô½ÃÆÇ ÆÄÀÏ2
	window.open("../file/attfile.jsp?step1=06&step2=old_files&step3=03","","height=150,width=380");
}
*/
function FileUp4() {	// °Ô½ÃÆÇ ÆÄÀÏ2
	window.open("../file/attfile.jsp?step1=06&step2=old_files&step3=03&step4=_0000_attfile2&step4t=file2","","height=150,width=380");
}
/*
function FileUp4() {	// Çà»ç°ü¸® ÆÄÀÏ
	window.open("../file/attfile.jsp?step1=08&step2=sms_files&step3=03","","height=150,width=380");
}
*/


function FileDown(fcode, fname, fname2) {		// (fcode: ÆÄÀÏÀ§Ä¡, fname: ÆÄÀÏ¸í, fname2: ¿øº»ÆÄÀÏ¸í)
	window.open("/servlet/Aik_FileDownload?filecode="+fcode+"&filename="+fname+"&filename2="+fname2,"_self");
}



// Login½Ã Æ÷Ä¿½º ÀÌµ¿
function EnterCheck(i) {
	if (event.keyCode == 13 && i == 1) {
		document.frm.pass.focus();
	}
	if (event.keyCode == 13 && i == 2) {
		Login();
	}
}

function CheckLoginForm() {
	if(frm.id.value=="") {
		alert("ID¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		frm.id.focus();
		return false;
	}
	if(frm.pass.value=="") {
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		frm.pass.focus();
		return false;
	}
	return true;
}
function CheckLoginForm2() {
	if(subFrm.id.value=="") {
		alert("ID¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		frm.id.focus();
		return false;
	}
	if(subFrm.pass.value=="") {
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		frm.pass.focus();
		return false;
	}
	return true;
}

function Login() {
	if (CheckLoginForm()) {
		frm.submit();
	}
}

function Logout() {
	lfrm.submit();
}

function MM_jumpMenu2(targ,selObj) { 
        window.open(selObj.options[selObj.selectedIndex].value,targ);
}

function openFramePage(purl,turl) {
	frm.target = "topMain";
	frm.turl.value = turl;
	frm.action = purl;
	frm.submit();
//	window.open(purl+"?turl="+turl, "topz");

}

function NoticeView(ncode, num) {
	newWin = window.open("board/notice_view.jsp?ncode=" + ncode + "&num=" + num, "pop1", "width=558, height=500,scrollbars=yes");
	newWin.focus();
}

function Back() {
	history.back();
}

// ÇÐ·ÂÁ¤º¸
function ScholarAddValue() {

		add_text = subFrm._0000_aik_t_0015_t.value;
		add_value = subFrm._0000_aik_t_0015_v.value;
		subFrm._0000_aik_t_0015.options[subFrm._0000_aik_t_0015.options.length] = new Option(add_text,add_value);
}

// Àü°øÁ¤º¸
function ScholarAddValue2() {

		add_text = subFrm._0000_aik_t_0016_t.value;
		add_value = subFrm._0000_aik_t_0016_v.value;
		subFrm._0000_aik_t_0016.options[subFrm._0000_aik_t_0016.options.length] = new Option(add_text,add_value);
}

// °Ô½ÃÆÇ
function LoginMsg() {
	alert("·Î±×ÀÎÀ» ÇÏ¼Å¾ß¸¸ ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
}

// °øÁö»çÇ× ÆË¾÷
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,ncode) {
  var eventCookie=getCookie('nPopup' + num);
  if (eventCookie != "no")
	window.open('../board/notice_view.jsp?num='+num+'&ncode='+ncode, 'nWin'+num+ncode, 'scrollbars=yes,width=556,height=500');
}

// È¸ºñ³»¿ªº¸±â
function viewDuelist() {
	window.open("../user/user_due_list.jsp","pdue", "width=550,height=500,scrollbars=yes");
}

// ³í¹®¼±ÅÃ½Ã ¸Þ¼¼Áö Ã¢
function nCheck() {
	//alert("³í¹®±¸µ¶¼±ÅÃ½Ã º°µµÀÇ È¸ºñ¸¦ ³³ºÎÇÏ¼Å¾ß ÇÏ¿À´Ï, \n¿øÄ¡ ¾Ê´Â ºÐÀº '¼±ÅÃ¾ÈÇÔ'À» Ã¼Å©ÇØ ÁÖ¼¼¿ä");
	var value_won;
	if(subFrm.s_0012_aik_code_ncode.value=="01"){
		value_won="40,000";
		}
	else if (subFrm.s_0012_aik_code_ncode.value=="02"){
		value_won="40,000";
		}
	else if (subFrm.s_0012_aik_code_ncode.value=="03"){
		value_won="60,000";
		}
	else if (subFrm.s_0012_aik_code_ncode.value=="04"){
		value_won="0";
		}
	else if (subFrm.s_0012_aik_code_ncode.value=="05"){
		value_won="30,000";
		}
	else if (subFrm.s_0012_aik_code_ncode.value=="06"){
		value_won="70,000";
		}
	else if (subFrm.s_0012_aik_code_ncode.value=="07"){
		value_won="70,000";
		}
	else if (subFrm.s_0012_aik_code_ncode.value=="08"){
		value_won="90,000";
		}
	subFrm.ncode_value.value=value_won;
	
}
function uCheck() {
	//alert("³í¹®±¸µ¶¼±ÅÃ½Ã º°µµÀÇ È¸ºñ¸¦ ³³ºÎÇÏ¼Å¾ß ÇÏ¿À´Ï, \n¿øÄ¡ ¾Ê´Â ºÐÀº '¼±ÅÃ¾ÈÇÔ'À» Ã¼Å©ÇØ ÁÖ¼¼¿ä");
	var value_won;
	if(subFrm.s_0012_aik_code_ucode.value=="03"){
		value_won="95,000";
		}
	else if (subFrm.s_0012_aik_code_ucode.value=="01"){
		value_won="770,000";
		}
	else if (subFrm.s_0012_aik_code_ucode.value=="04"){
		value_won="15,000";
		}
	
	
	subFrm.ucode_value.value=value_won;
	
}

/* 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;

//////////////////////////////////////
// IE Embed patch
//
// @author iezn@iezn.com
// @homepage http://iezn.com
// @create date 2006.04.19
// @last modify 2006.04.26
// @version 0.42
// ¹èÆ÷½Ã À§³»¿ëÀ» Æ÷ÇÔÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù
//////////////////////////////////////
/**
* embed ÆÐÄ¡ Àû¿ë ÄÁÅ×ÀÌ³Ê
* nullÀÎ°æ¿ì document °ªÀ» ±âº»À¸·Î ÇÕ´Ï´Ù
* id°ªÀ» ¼³Á¤ÇÑ°æ¿ì ¼³Á¤¹üÀ§ ³»¿¡¸¸ Àû¿ëÀÌ µË´Ï´Ù
* 
* º»¹®ÀÌ³ª ÀÏºÎ ³ëµå¿¡¸¸ Àû¿ëÇÒ°æ¿ì ÇØ´ç ³ëµåÀÇ id °ªÀ» ÀÔ·ÂÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù
* ¿¹)
* var __embed_target_id = "contents";
* ·Î Ã³¸®ÇÑ°æ¿ì body ³»¿¡ <ÅÂ±× id="contents">ÇÃ·¡½¬,µ¿¿µ»ó...</ÅÂ±×>
* ¾È¿¡ ³»¿ë¿¡¸¸ ÆÐÄ¡°¡ Àû¿ëµË´Ï´Ù
*/
if(typeof(__embed_target_id)=='undefined'){
	var __embed_target_id = null;
}

/**
* embed ÆÐÄ¡¸¦ Àû¿ëÇÒ ÅÂ±×¸¦ ¼³Á¤ÇÕ´Ï´Ù
* ±âº»°ªÀº object,eembed,appelt ÅÂ±×ÀÔ´Ï´Ù
* false °ªÀÎ°æ¿ì ÆÐÄ¡¿¡¼­ Á¦¿ÜµË´Ï´Ù
*/
if(typeof(__embed_tags)=='undefined'){
	var __embed_tags = {object:true,embed:true,applet:false}
}

/**
* ÇÃ·¡½¬ÆÄÀÏÁß flashvars ¸¦ »ç¿ëÇÒ°æ¿ì ÇØ´ç ÇÃ·¡½¬ÀÇ ¿ÀºêÁ§Æ®¾ÆÀÌµð:true °ªÀ¸·Î object¸¦ µî·ÏÇØ ÁÖ¼¼¿ä
*/
var __flash_force_objs = {};

if(document.attachEvent){
	document.write('<style type="text/css">');
	document.write('object,embed{display:none;}');
	document.write('</style>');
	document.attachEvent('onreadystatechange',
		function (){
			
			if(__embed_target_id===null){
				var __target = document;
			}else{
				var __target = document.getElementById(__embed_target_id);
			}
			if (document.readyState == "complete"){
				function _replace(obj){
					var obj_re = document.createElement(obj.outerHTML);					
					obj_re.style.display='inline';
					obj.parentNode.replaceChild(obj_re,obj);
				}
				function _inner(obj){
					obj.style.display='inline';					
					var html = obj.outerHTML;
					var classid = obj.classid.toLowerCase();
					if(classid=='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' && typeof(__flash_force_objs[obj.id])=='undefined'){//flash ÀÎ°æ¿ì
						obj.insertAdjacentHTML('beforeBegin',html);
						obj.parentNode.removeChild(obj);
					}else if(classid=='clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b'){
						//ÄüÅ¸ÀÓ

					}else{
						//º¯°æÇÏ°íÀÚÇÏ´Â ActiveX classid ¸¦ Ãß°¡ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù
						if(classid=='clsid:6bf52a52-394a-11d3-b153-00c04f79faa6' || //media 7
						classid=='clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95' || //6.4
						classid=='clsid:6bf52a52-394a-11d3-b153-00c04f79faa6' ||
						classid=='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'
						){
							embed_pos = html.indexOf('embed');
							if(embed_pos!=-1){//embed °¡ Á¸ÀçÇÏ´Â°æ¿ì
								var embed = '<'+html.substr(embed_pos);
								embed = embed.substr(0,embed.length-9);
								obj.insertAdjacentHTML('beforeBegin',embed);
								obj.parentNode.removeChild(obj);
							}else{
								//object·Î¸¸ µÇ¾î ÀÖ´Â°æ¿ì µ¿¿µ»ó ºÎºÐ¸¸ ÆÐÄ¡ÇÑ´Ù
								var embed = document.createElement('embed');
								if(obj.id){
									embed.id = obj.id;
								}
								var total = obj.childNodes.length;
								//embed.setAttribute('autostart',0);
								if(obj.width){
									embed.setAttribute('width',obj.width);
								}
								if(obj.height){
									embed.setAttribute('height',obj.height);
								}
								for(var k=0;k<total;k++){
									n = obj.childNodes.item(k).getAttribute("name");
									v = obj.childNodes.item(k).getAttribute("value");
									if(n=='URL' || n=='url' || n=='FileName'){
										n = 'src';
									}
									embed.setAttribute(n,v);
								}
								if(embed.getAttribute('src')){
									embed.style.display = 'inline';
									obj.parentNode.replaceChild(embed,obj);
								}else{
									//ÆÄÀÏ¿¢¼¼½º object°¡ ¾Æ´Ñ°æ¿ì´Â À¯ÁöÇÑ´Ù								
								}
							}
						}
					}
				}

				if(__embed_tags.object===true){
					var objs = __target.getElementsByTagName('object');
					var i = objs.length;
					while(i-->0){
						_inner(objs[i]);
					}
				}
				if(__embed_tags.embed===true){
					var objs = __target.getElementsByTagName('embed');
					var i = objs.length;
					while(i-->0){
						_replace(objs[i])
					}
				}

				if(__embed_tags.applet===true){
					var objs = __target.getElementsByTagName('applet');
					var i = objs.length;
					while(i-->0){
						_replace(objs[i])
					}
				}
			}
		}
	);
}
function getFileName(path){
    var NameArray = path.split('\\');
    var SplitName = NameArray[NameArray.length - 1]; 
    return SplitName;
}

