document.domain = "kpu.ac.kr";
//¼ýÀÚ+"."ÀÎÁö Ã¼Å©
function isNumericDot( value )
{	
	if (value == 8 || value == 9 || value == 13 || (value >= 37 && value <= 40) || value == 46 || (value >= 48 && value <= 57) ||  value == 110 || value == 190 || value == 192 || value == 27 || value == 116 || (value >= 96 && value <= 105))
		 return true;
	else return false;
}
// ¼ýÀÚ+"."¸¸ ÀÔ·Â
// onkeydownÀ» »ç¿ëÇÒ °Í 2004/05/08 - ¹ÚÀÏÇü
function num_chekDot() { 
  if (isNumericDot(event.keyCode)==false){
		alert("¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
		event.returnValue=false;
	}
}

//¼ýÀÚ+"-"ÀÎÁö Ã¼Å©
function isNumericHyphen( value )
{	
	if (value == 8 || value == 9 || value == 13 || (value >= 35 && value <= 40) || value == 46 || (value >= 48 && value <= 57) || value == 109 || value == 189 || value == 27 || value == 116 || (value >= 96 && value <= 105))
		 return true;
	else return false;
}

// ¼ýÀÚ+"-"¸¸ ÀÔ·Â
// onkeydownÀ» »ç¿ëÇÒ °Í 2004/05/08 - ¹ÚÀÏÇü
function num_chekHyphen() { 
  if (isNumericHyphen(event.keyCode)==false){
		alert("¼ýÀÚ¿Í '-'¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
		event.returnValue=false;
	}
}

//¼ýÀÚÀÎÁö Ã¼Å©
function isNumeric( value )
{
	if (value == 8 || value == 9 || value == 13 || (value >= 37 && value <= 40) || value == 46 || value == 27 || value == 116 || (value >= 48 && value <= 57) || (value >= 96 && value <= 105))
		 return true;
	else return false;
}
// ¼ýÀÚ¸¸ ÀÔ·Â
// onkeydownÀ» »ç¿ëÇÒ °Í 2004/05/08 - ¹ÚÀÏÇü
function num_chek() { 
  if (isNumeric(event.keyCode)==false){
		alert("¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
		event.returnValue=false;
	}
}
// ÆÄÀÏ ºÎºÐ¿¡ ÅØ½ºÆ® ÀÔ·Â ¸øÇÏ°Ô ÇÏ±â À§ÇØ¼­
function fileWriteNot(){  
  event.returnValue=false;
}

// ±â´É: ¹®ÀÚ¿­ÀÇ ¾Õ, µÚ °ø¹éÀ» Á¦°ÅÇÑ´Ù
// ÆÄ¶ó¹ÌÅÍ: ¹®ÀÚ¿­
// ¸®ÅÏ°ª: ¹®ÀÚ¿­
function trim(str)
{
	var s = str.replace(/^ */, "");
	s = s.replace(/ *$/, "");
	return  s;
}

//°³¹ß °ü·Ã °øÅë js

// »õÃ¢ ¶ç¿ì±â
// ÆÄ¶ó¹ÌÅÍ ¼³¸í
// name  : À©µµ¿ì Ã¢ ÀÌ¸§
// url   : »Ñ·ÁÁÙ ÆäÀÌÁö
// width : À©µµ¿ì Ã¢ ³ÐÀÌ
// height: À©µµ¿ì Ã¢ ³ôÀÌ
// toolbar : Åø¹Ù ³ªÅ¸³¾Áö ¿©ºÎ
// menubar : ¸Þ´º¹Ù ³ªÅ¸³¾Áö ¿©ºÎ
// statusbar : »óÅÂ¹Ù ³ªÅ¸³¾Áö ¿©ºÎ
// scrollbar : ½ºÅ©·Ñ¹Ù ³ªÅ¸³¾Áö ¿©ºÎ
// resizable : ¸®»çÀÌÁî ±â´É ¿©ºÎ
// ¿¹Á¦  : open_window('./test.do', 'test', '' ,'' ,'200','100','','','','','')
function open_window(url, name, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  /*
  target = window.open(url, name, 'left='+left+', top='+top+', width='+width+', height='+height+', toolbar='+toolbar_str+', menubar=' +menubar_str+', status='+statusbar_str+', scrollbars='+scrollbar_str+', resizable='+resizable_str);
  target.focus();
  */

  if (url != null && url != ""){
   window.open(url, name, 'left='+left+', top='+top+', width='+width+', height='+height+', toolbar='+toolbar_str+', menubar=' +menubar_str+', status='+statusbar_str+', scrollbars='+scrollbar_str+', resizable='+resizable_str);
  }
}


//°³¹ß °ü·Ã °øÅë js

// »õÃ¢ ¶ç¿ì±â
// ÆÄ¶ó¹ÌÅÍ ¼³¸í
// name  : À©µµ¿ì Ã¢ ÀÌ¸§
// url   : »Ñ·ÁÁÙ ÆäÀÌÁö
// width : À©µµ¿ì Ã¢ ³ÐÀÌ
// height: À©µµ¿ì Ã¢ ³ôÀÌ
// toolbar : Åø¹Ù ³ªÅ¸³¾Áö ¿©ºÎ
// menubar : ¸Þ´º¹Ù ³ªÅ¸³¾Áö ¿©ºÎ
// statusbar : »óÅÂ¹Ù ³ªÅ¸³¾Áö ¿©ºÎ
// scrollbar : ½ºÅ©·Ñ¹Ù ³ªÅ¸³¾Áö ¿©ºÎ
// resizable : ¸®»çÀÌÁî ±â´É ¿©ºÎ
// ¿¹Á¦  : open_window('./test.do', 'test', '' ,'' ,'200','100','','','','','')
function open_window1(url, name, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  /*
  target = window.open(url, name, 'left='+left+', top='+top+', width='+width+', height='+height+', toolbar='+toolbar_str+', menubar=' +menubar_str+', status='+statusbar_str+', scrollbars='+scrollbar_str+', resizable='+resizable_str);
  target.focus();
  */

  if (url != null && url != ""){
  var temp = url.substring(0,7);
  if(temp!="http://"){
		url = "http://"+url;
  }
   window.open(url, name, 'left='+left+', top='+top+', width='+width+', height='+height+', toolbar='+toolbar_str+', menubar=' +menubar_str+', status='+statusbar_str+', scrollbars='+scrollbar_str+', resizable='+resizable_str);
  }
}


// °Ë»ö¾î Æ¯¼ö ¹®ÀÚ Ã¼Å© 
// return : false (°Ë»ö¾ÈµÊ), true (Æ¯¼ö¹®ÀÚ°Ë»ö ¹× ¸Þ¼¼Áö)
function chkSpeChar( oInputCtrl)
{
	var speChar = " `~!#$%^&*+=|\\[]{}:;-,<>/?'\"";
	for(var iCnt = 0; iCnt < speChar.length; iCnt++)
	{
		special = speChar.substr(iCnt, 1);
		if( oInputCtrl.value.indexOf(special) != -1)
		{
			alert("Æ¯¼ö¹®ÀÚ[" + special + "]¸¦ °Ë»ö¾î¿¡ ÀÔ·Â ÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return true;
		}
	}
	return false;
}

//Çà´ç¿ùÀÇ ³¯Â¥ ¼¿·ºÆ® ¹Ú½º
function chkDay(o,valYear, valMonth, valDay, dayValue){
	var tyearName,tMonthName,tDayName, lastDay,i;
	tyearName = eval(o + "." + valYear);
	tMonthName = eval(o + "." + valMonth);
	tDayName = eval(o + "." + valDay);
	//lert(tyearName.selectedIndex)
  //alert(tyearName.selectedIndex);
  //alert(tMonthName.selectedIndex);
	if(tyearName.selectedIndex>0 && tMonthName.selectedIndex>0){
		lastDay = getDayNum(parseInt(tyearName.value,10), parseInt(tMonthName.value,10));
		tDayName.options.length = lastDay+1;
		tDayName.options[0].value = "";
		tDayName.options[0].text  = "ÀÏ";
		
		for(i=0 ; i < lastDay ; i++) {
        //alert(tDayName.options[i].value);
		 if (i+1<10){
			 tDayName.options[i+1].value = "0"+(i+1);		  
			 tDayName.options[i+1].text  = "0"+(i+1);
		 }else{
			 tDayName.options[i+1].value = i+1;		  
			 tDayName.options[i+1].text  = i+1;
		 }
		}
		if (dayValue!=""){
			tDayName.selectedIndex = dayValue;
		}
		tDayName.focus();
	}else{		
		tDayName.options.length = 1;
		tDayName.options[0].value = "";
		tDayName.options[0].text  = "ÀÏ";
	}
}

//ÇØ´ç¿ùÀÇ ¸¶Áö¸·³¯Â¥
function getDayNum(valYear, valMonth){
	var monthDays;
		monthDays = [31,28,31,30,31,30,31,31,30,31,30,31];
		if ((((valYear % 4) == 0) && ((valYear % 100) != 0)) || ((valYear % 400) == 0)){
			monthDays[1] = 29;
		}
		return monthDays[parseInt(valMonth)-1];
}

// ¸ÞÀÏÁÖ¼Ò Ã¼Å©
function chkEmailAddr( sEmail)
{
	var sRegExp = /([\w|\-]+)@([\w|\-]+)\.(\w+)/;
	return sRegExp.test( sEmail)
}

//textarea ¹Ú½ºÀÇ ±ÛÀÚ Á¦¾î ÇÔ¼ö
//pInName : (¿¹ document.frmForm.content)
function showMsgLen(pInName, pLen, pMsgLen){  
   if (getStrLen(eval(pInName+".value"))>pLen){
	  alert("¿µ¹® " + pLen + "ÀÚ, ÇÑ±Û " + pLen/2 + " ÀÌ³»·Î ÀÛ¼ºÇØ ÁÖ¼¼¿ä.");
	  eval(pInName+".focus()");
   }
	  pMsgLen.innerHTML = getStrLen(eval(pInName+".value")) + '/' + pLen;
}
function getStrLen(str){
	var len=0, j;
	
	for (i=0, j=str.length;
		i<j;
		i++, len++)
	{
		if ( (str.charCodeAt(i)<0)||(str.charCodeAt(i)>127) )
		{
			len = len+1;
		}
	}
	return len;
}

//´ÙÀ½ ÅÜÀ¸·Î ÀÌµ¿ÇÏ±â (ÁÖ¹Î¹øÈ£³ª ÀüÈ­ ¹øÈ£ µî)
function numTeb(o, pLen, pPre, pNext){
	if (eval("o." + pPre + ".value.length==" + pLen)){
    eval("o." + pNext + ".focus();");
		return;
	}
}


// Form Validation:
// @author ¿ìµ¿½Ä
// control : text box name
// msg : ("Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.")
// return : false (form validation fail), true (form validation ¼º°ø)

function isFilled(control, msg) {	
	if (control.value == null || control.value.length == 0) {
		alert(msg);
		control.focus();
		control.select();
		return false;
	}
	return true;
}
// Form Validation:
// @author ¿ìµ¿½Ä
// control : radio box 
// return : false (form validation fail), true (form validation ¼º°ø)
function isChecked(control, msg) {	// radio button.
	var val = false;
	for (var i=0; i<control.length; i++) {
		if (control[i].checked == true) val = true;
	}
	if(val==false) alert(msg);
	return val;
}
// Form Validation:
// @author ¿ìµ¿½Ä
// control : select box 
// return : false (form validation fail), true (form validation ¼º°ø)
function isSelected(control, msg) {	// drop box.	
	var val = false;
	for (var i=1; i<control.length; i++) {
		if (control.options[i].selected == true) val = true;		
	}
	if(val==false && msg.length>0) {
		control.focus();
		alert(msg);
	}
	return val;
}


// ¸®½ºÆ®ÀÇ Ã¼Å©¹Ú½º ÀüÃ¼ ¼±ÅÃ ¹× ÇØÁö ÇÔ¼ö ½ÃÀÛ
/*ÀüÃ¼ ¼±ÅÃ ÇØÁ¦*/
function AllChk(o, pAll, pChk){
  var value;
  var tmpChkAll, tmpChk;
  tmpChkAll = eval("o." + pAll);
  tmpChk = eval("o." + pChk);   
  if (tmpChkAll.checked==true){
    value=true;
  }else{
    value=false;
  }
  if ( tmpChk != null ){
    var olen = eval(tmpChk.length);
    if ( olen != null ){
      for ( var i = 0 ; i < tmpChk.length ; i++ ){
        tmpChk[i].checked = value;
       }
    }else{
      tmpChk.checked = value;
    }
  }
}
/*°¢ Ã¼Å© ¹Ú½º¸¦ ¼±ÅÃÇÏ¿© ÀüÃ¼ Ã¼Å©¹Ú½º Á¦¾î*/
function chkBox(o, pAll, pChk){
  var value;
  var tmpChkAll, tmpChk;
  tmpChkAll = eval("o." + pAll);
  tmpChk = eval("o." + pChk);
  value = true;
  if ( tmpChk != null ){
    var olen = eval(tmpChk.length);
    if ( olen != null ){
      for ( var i = 0 ; i < tmpChk.length ; i++ ){
        if (tmpChk[i].checked == false){
          value=false;
          break;
        }
      }
    }else{
      if (tmpChk.checked == false){
          value=false;
      }
    }
  }
  tmpChkAll.checked=value;
}
 // ¸®½ºÆ®ÀÇ Ã¼Å©¹Ú½º ÀüÃ¼ ¼±ÅÃ ¹× ÇØÁö ÇÔ¼ö ³¡
//¼±ÅÃ »èÁ¦ È®ÀÎ
function checkDelete(fName, o){
  var sum;
  sum=0;
  var tmpChk;
  tmpChk = eval("o." + fName)
  if ( tmpChk != null ){
    var olen = eval(tmpChk.length);
    if ( olen != null ){
      for ( var i = 0 ; i < tmpChk.length ; i++ ){
        if (tmpChk[i].checked == true){
          sum++;
        }
      }
    }else{
    
      if (tmpChk.checked==true){
        sum=1;
      } 
    }
  }
  
  if (sum==0){
     alert("¼±ÅÃÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
     return false;
  }
  if (confirm("»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?") == true){
	  return true;
  }  
  return false;
}

 /*±ÝÁö´Ü¾î ÆË¾÷Ã¢*/
 function curseWordOpen(){
  var winWord = window.open("/master/prohibitionlist.do",winWord , "width=420,height=530,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no");
 }

 /*ÆäÀÌÂ¡ Æû submit*/
function listPage(val){
  document.listFrm.page.value = val;
  document.listFrm.submit();
}
//À¥¿¡µðÅÍ ºÎºÐ
function BackGroundColor(o){
  var bgcolorChk;
	bgcolorChk = o.tbContentElement.DOM.body.style.backgroundColor;
    if (bgcolorChk==""){
			o.contentValue.value = o.tbContentElement.DOM.body.innerHTML;
		}else{
			o.contentValue.value = "<div style='background-color: " + bgcolorChk + "'>" + o.tbContentElement.DOM.body.innerHTML + "</div>";
		}
}


// ½Å°í ÆË¾÷ ½ºÅ©¸³Æ®
function openReport(o){
 window.open("","reportForm","width=490,height=350,top=0,left=0,scrollbars=no,resizable=no")
  eval(o+".submit()");
}


// ÄíÅ°°ª °¡Á® ¿À±â (ÁÖ·Î ¿ÀÇÂÃ¢¿¡¼­ ÇÏ·ç¸¸ ºÎºÐ Á¦¿¡ ÇÒ¶§ »ç¿ë
function getCookie(name) {
	var nameOfCookie=name+"=";
	
  var x=0;
  while(x<=document.cookie.length) {
	var y=(x+nameOfCookie.length)
	if(document.cookie.substring(x,y)==nameOfCookie) {
      if((endOfCookie=document.cookie.indexOf(";",y))==-1)
	    endOfCookie=document.cookie.length;
	  return unescape(document.cookie.substring(y,endOfCookie));
    }
    x=document.cookie.indexOf(" ",x) +1;
	if(x==0)
	  break;
  }
  return "";
}

//·Î±×ÀÎ Ã¼Å©
function chkLogin(o){
  if(trim(o.loginName.value)==""){
    alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
    o.loginName.focus();
    return false;
  }
  if(trim(o.password.value)==""){
    alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
    o.password.focus();
    return false;
  }
  return;
}

//·Î±×ÀÎ Ã¼Å©
function chkLoginSSO(o){
  if(trim(o.id.value)==""){
    alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
    o.id.focus();
    return false;
  }
  if(trim(o.passwd.value)==""){
    alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
    o.passwd.focus();
    return false;
  }
  return;
}

//·Î±×ÀÎ Ã¼Å©
function chkLoginSSO_1(o){
  if(trim(o.loginName.value)==""){
    alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
    o.loginName.focus();
    return false;
  }
  if(trim(o.password.value)==""){
    alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
    o.password.focus();
    return false;
  }
  return;
}

//°øÀÎÀÎÁõ¼­ ·Î±×ÀÎ Ã¼Å©
function chkLoginSSO_2(o){
  if(trim(o.ssn1.value)==""){
    alert("ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
    o.ssn1.focus();
    return false;
  }
  if(trim(o.ssn2.value)==""){
    alert("ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
    o.ssn2.focus();
    return false;
  }
  return;
}

//Ä¿¼­ÀÌµ¿
function moveCursor1(o) {
	if(o.ssn1.value.length == 6)
		o.ssn2.focus();
}

//ÀüÃ¼ ¿ÀÇÂ
function linkPopOpen(value, wValue, hValue){
  open_window( value, "linkPop", "10", "10", wValue, hValue, "", "", "", "auto", ""); 
}


// ÀÌ¹ÌÁö width ¸¸ ÁÙÀÌ±â
function resizeImage(o, pWidth){
	var MAX_WIDTH=pWidth;
	if (o.width > MAX_WIDTH) {
		o.width = MAX_WIDTH;
	}
}
// ÀÌ¹ÌÁö width, height ÁÙÀÌ±â
function resizeImageWH(o, pWidth, pHeight){
	var MAX_WIDTH=pWidth;
  var MAX_HEIGHT=pHeight;
	if (o.width > MAX_WIDTH) {
		o.width = MAX_WIDTH;
	}
  if (o.height > MAX_HEIGHT) {
		o.height = MAX_HEIGHT;
	}
}
// ÀÌ¹ÌÁö ÆË¾÷Ã¢ À©µµ¿ì Å©±â¿¡ µû¶ó¼­ Á¦¾î
function ImageReSizeWindow(o){
  var objBody, height, width
  var version;
  version = navigator.appVersion;
  objBody = document.body
  height = objBody.offsetHeight + (objBody.offsetHeight - objBody.clientHeight)
  width = objBody.offsetWidth + (objBody.offsetWidth - objBody.clientWidth)
  if (o.width > o.height) {
    if(o.width <= width){      
      width = o.width + 50;
      height = o.height + 120;
    }else if(o.width < window.screen.Width && o.width > width){
      width = o.width + 50;
      height = o.height + 120;
    }else if(o.width >= window.screen.Width){
      width = window.screen.Width - 100;
      height = window.screen.Height - 100;
    }
    if(version.indexOf("Windows NT 5.1") > -1){
      height = height  + 20;
    }
    window.resizeTo(width, height); 
	}else{
    if(o.height <= height){      
      width = o.width + 50;
      height = o.height + 120;
    }else if(o.height < window.screen.Height && o.height > height){
      width = o.width + 50;
      height = o.height + 120;
    }else if(o.height >= window.screen.Width){
      width = window.screen.Width - 100;
      height = window.screen.Height - 100;
    }
    if(version.indexOf("Windows NT 5.1") > -1){
      height = height  + 20;
    }
    window.resizeTo(width, height);
  }
}

// ¸ÞÀÎ , ¿ìÃø ¸¶¿ì½º ¿Â¿À¹ö½Ã ÀÌ¹ÌÁö º¯°æ ½ºÅ©¸³Æ® ½ÃÀÛ
function replaceImg(imgName,obj)
{
  obj.src = imgName;
}

function showL(num){
  var temp;
  for(i=3;i<=6;i++){
    temp = "layer_" + i;
    if(i == num){
      document.all[temp].style.display = "";
    } else {
      document.all[temp].style.display = "none";
    }
  }
}

function hideL(){
  var temp;
  for(i=3;i<=6;i++){
    temp = "layer_" + i;
    document.all[temp].style.display = "none";
  }
}
//°Ë»ö
function searchSend(o) {
	if(trim(o.qt.value)=="") {
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		o.qt.focus();
		return false;
	}
	return;
}



//  ´Þ·Â
function show_cal(url, what, fName, check){
	if(check==null || check==""){
		check = "";
	}
	var txt = new String("<iframe src=\"" + url + "?what=" + what + "&formName=" + fName + "&check="+check+"\" width=\"142\" height=\"162\" frameborder=\"0\" scrolling=\"No\" ></iframe>");
	document.all[what].innerHTML = txt;
}


// textarea ±ÛÀÚ¼ö Á¦ÇÑ
function fc_chk_byte(aro_name,ari_max,pMsgLen){

	var len=0, j;
	var li_len = 0;
	var str = aro_name.value;
	var ls_str2 = "";
	for (i=0, j=str.length;
		i<j;
		i++, len++)
	{
		if ( (str.charCodeAt(i)<0)||(str.charCodeAt(i)>127) )
		{
			len = len+1;
		}
	    // ÀüÃ¼ Å©±â°¡ li_max¸¦ ³ÑÁö¾ÊÀ¸¸é
		if(len <= ari_max)
		{
			li_len = i + 1;
		}

	}
	if (len > ari_max){
		alert( ari_max + " ±ÛÀÚ¸¦ ÃÊ°ú ÀÔ·ÂÇÒ¼ö ¾ø½À´Ï´Ù. \n ÃÊ°úµÈ ³»¿ëÀº ÀÚµ¿À¸·Î »èÁ¦ µË´Ï´Ù. ");
		ls_str2 = str.substr(0, (li_len-1));
		aro_name.value = ls_str2;
	    len = ari_max
	}
	if ((pMsgLen!="") && (pMsgLen!=null))
	{
	pMsgLen.innerHTML = '[ ' +len + '/' + ari_max + ' ]';
    }
}

function checkSpace( str ){
 if(str.search(/\s/) != -1){
  return 1;
 }
 else {
	 return "";
 }
}

// µð·ºÅÍ¸®¸í Ã¼Å©
function validID( formName , str ){
	var retVal = checkSpace( str ); 
	if( retVal != "" ) {
	    eval("document."+formName+".msg.value='µð·ºÅÍ¸®¸íÀº ºó °ø°£ ¾øÀÌ ¿¬¼ÓµÈ ¿µ¹® ¼Ò¹®ÀÚ¿Í ¼ýÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.'");
		return true; 
	}
	if( str.indexOf("admin") == 0 || str.indexOf("master") == 0 || str.indexOf("superadmin") == 0 || str.indexOf("webmaster") == 0 ){
	  eval("document."+formName+".msg.value='µî·ÏÇÒ¼ö ¾ø´Â µð·ºÅÍ¸®¸íÀÔ´Ï´Ù.'");
	  return true;
	}
	for(var z=0;z<10;z++){
		if( str.charAt(0)==z) {
			eval("document."+formName+".msg.value='µð·ºÅÍ¸®¸íÀÇ Ã¹¹®ÀÚ´Â ¼ýÀÚ·Î ½ÃÀÛÇÒ¼ö ¾ø½À´Ï´Ù.'");
			return true;
		}
	}
	/* checkFormat  var isID = /^[a-z0-9_]{4,12}$/; */
	var isID = /^[a-z0-9]{4,12}$/;
	if( !isID.test(str) ) {
        eval("document."+formName+".msg.value='µð·ºÅÍ¸®¸íÀº 4~12ÀÚÀÇ ¿µ¹® ¼Ò¹®ÀÚ¿Í ¼ýÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.'");
		return true; 
	}
	return false;
}

// ºñ¹Ð¹øÈ£ Ã¼Å©
function validPWD( formName , str ){
	var retVal = checkSpace( str ); 
	if( retVal!=null && retVal != "" ) {
  eval("document."+formName+".msg.value='ºñ¹Ð¹øÈ£´Â ºó °ø°£ ¾øÀÌ ¿¬¼ÓµÈ ¿µ¹® ¼Ò¹®ÀÚ¿Í ¼ýÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.'");
		return true; 
	} 
	/* checkFormat  */
	var isID = /^[a-z0-9]{4,12}$/;
	if( !isID.test(str) ) {
  eval("document."+formName+".msg.value='ºñ¹Ð¹øÈ£´Â 4~12ÀÚÀÇ ¿µ¹® ¼Ò¹®ÀÚ¿Í ¼ýÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.'");
		return true; 
	}
	return false;
}


function checkImgFormat_add(imgPath) 
	{
		if ( imgPath.indexOf(".PNG") != -1 ||
			imgPath.indexOf(".GIF") != -1 ||
			imgPath.indexOf(".png") != -1 ||
			imgPath.indexOf(".gif") != -1 ||
			imgPath.indexOf(".jpg") != -1 ||
			imgPath.indexOf(".GIF") != -1 ||
			imgPath.indexOf(".JPG") != -1) {
			return true;
		}
		else 
		{
			if ( imgPath != "" ) {
				alert("Áö¿øÇÏÁö ¾Ê´Â ÆÄÀÏÇü½ÄÀÌ¹Ç·Î Ã·ºÎÇÏ½Ç¼ö¾ø½À´Ï´Ù.");
				return false;
			} else {
				return false;
			}
		}
	}

//ºñ¹Ð¹øÈ£ Ã¼Å©(¿µ¹®, ¼ýÀÚ¸¸ Çã¿ë)
function isAlphaNum( value )
{	
	if(value == 8 || value == 9 || value == 13 || value == 21 || (value >= 35 && value <= 40) || (value >= 45 && value <= 46) || (value >= 48 && value <= 57) || (value >= 65 && value <= 90) || (value >= 96 && value <= 105) || value == 27 || value == 116)
		 return true;
	else return false;
}

//ºñ¹Ð¹øÈ£ Ã¼Å©(¿µ¹®, ¼ýÀÚ¸¸ Çã¿ë)
// onkeydownÀ» »ç¿ëÇÒ °Í 2004/05/08 - ¹ÚÀÏÇü
function alphaNumCheck() { 
  if (isAlphaNum(event.keyCode)==false){
		alert("¿µ¹®°ú ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
		event.returnValue=false;
	}
}

function newContentImg(tmpDate){
  var chkDate = new Date();  
  var yearStrTmp, monthStrTmp, dayStrTmp;   
  yearStrTmp = chkDate.getYear();    
  monthStrTmp = chkDate.getMonth()+1;   
  dayStrTmp = chkDate.getDate();    
  if (monthStrTmp<10){    
     monthStrTmp = '0' + monthStrTmp;    
  }    
  if (dayStrTmp<10){   
    dayStrTmp = '0' + dayStrTmp;  
  }   
  yearStrTmp = '' + yearStrTmp +  monthStrTmp + dayStrTmp;  
  if (tmpDate<yearStrTmp){
  }else{
    document.write ('<img src=/image/portal_main_18.gif width=10 height=9 align=texttop>');
  }
}


function resizeImg(imgObj,w,h) {
	var imgOriginal = new Image();
	imgOriginal.visibleImgObj = imgObj;
	imgOriginal.onload = function() { resizeImgSub(this,w,h); }  
	imgOriginal.src = imgObj.src;
}

function resizeImgSub(img,w,h) {
  var imgTemp = new Image();
  imgTemp.src = img.src; 
  
  if ( imgTemp.width > w || imgTemp.height > h ){
  if ( (img.width / w) > (img.height / h) )
    img.visibleImgObj.height = Math.round(img.height * (w / img.width));
  else
    img.visibleImgObj.width = Math.round(img.width * (h / img.height));
  } else {
    img.visibleImgObj.width = imgTemp.width;
    img.visibleImgObj.height = imgTemp.height;
  }
}

function reportMember(userID, reportID, returnURL){

  if(reportID == null || reportID == ""){
    alert("·Î±×ÀÎÈÄ ÀÌ¿ë°¡´ÉÇÕ´Ï´Ù.");
    return;
  }else{
      
    window.open("/reportmemberpopup.do?mode=member&userID="+userID+"&reportID="+reportID+"&returnURL="+returnURL, "reportMember" , "width=400,height=300,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");

    return;
  }

  return;
}

function reportaContent(userID, reportID, keyNum, contentNum, returnURL, mode){

  if(reportID == null || reportID == ""){
    alert("·Î±×ÀÎÈÄ ÀÌ¿ë°¡´ÉÇÕ´Ï´Ù.");
    return;
  }else{
    window.open("/reportcontentpopup.do?mode="+mode+"&userID="+userID+"&reportID="+reportID+"&returnURL="+returnURL+"&keyNum="+keyNum+"&contentNum="+contentNum, "reportContent" , "width=400,height=300,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");

    return;
  }

  return;
}

// Ãµ´ÜÀ§ ¿ÀÅä ÄÞ¸¶_mute
function comma_mute(formName, returnName) { 
    var num = trim(eval(formName+"."+returnName+".value"));
    if (eval(formName+"."+returnName+".value.length") >= 4) {
        re = /^$|,/g; 
        num = num.replace(re, ""); 
        fl="" 
//        if(isNaN(num)) { alert("¹®ÀÚ´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");return 0} 
        if(isNaN(num)) { return 0;formName.returnName.focus();formName.returnName.select();} 
        if(num==0) return num 
        if(num<0){ 
            num=num*(-1) 
            fl="-" 
        }
        else{ 
            num=num*1 //Ã³À½ ÀÔ·Â°ªÀÌ 0ºÎÅÍ ½ÃÀÛÇÒ¶§ ÀÌ°ÍÀ» Á¦°ÅÇÑ´Ù. 
        } 
            num = new String(num) 
            temp="" 
            co=3 
            num_len=num.length 
        while (num_len>0){ 
            num_len=num_len-co 
            if(num_len<0){co=num_len+co;num_len=0} 
            temp=","+num.substr(num_len,co)+temp 
        } 
        var mtmp = fl+temp.substr(1);
        eval(formName+"."+returnName+".value = '" + mtmp + "'" );
    }
} 

// Ãµ´ÜÀ§ ¿ÀÅä ÄÞ¸¶
function comma(formName, returnName) { 
    var num = trim(eval(formName+"."+returnName+".value"));
    if (eval(formName+"."+returnName+".value.length") >= 4) {
        re = /^$|,/g; 
        num = num.replace(re, ""); 
        fl="" 
        if(isNaN(num)) { alert("¹®ÀÚ´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");return 0} 
        if(num==0) return num 
        if(num<0){ 
            num=num*(-1) 
            fl="-" 
        }
        else{ 
            num=num*1 //Ã³À½ ÀÔ·Â°ªÀÌ 0ºÎÅÍ ½ÃÀÛÇÒ¶§ ÀÌ°ÍÀ» Á¦°ÅÇÑ´Ù. 
        } 
            num = new String(num) 
            temp="" 
            co=3 
            num_len=num.length 
        while (num_len>0){ 
            num_len=num_len-co 
            if(num_len<0){co=num_len+co;num_len=0} 
            temp=","+num.substr(num_len,co)+temp 
        } 
        var mtmp = fl+temp.substr(1);
        eval(formName+"."+returnName+".value = '" + mtmp + "'" );
    }
} 

//¼ýÀÚ¸¸ ÀÔ·Â¹Þµµ·Ï.... 
function OnlyNumber() {
    if((event.keyCode<47 &&  event.keyCode !=8)||(event.keyCode>57))
    {
        event.returnValue=false;
    }
}

// ÀÔ·Â ¹®ÀÚ È®ÀÎ(ÀÔ·Â Çß´ÂÁö ¿©ºÎ È®ÀÎ)
function lengthCheck( formName , str , text ){
    var uID;
    uID = trim(eval("document."+formName+"."+str+".value"));
    if(uID.length==0){
      eval("document."+formName+".msg.value='"+trim(text)+" À»(¸¦) ÀÔ·Â ¶Ç´Â ¼±ÅÃÇØ ÁÖ¼¼¿ä.'");
      eval("document."+formName+"."+str+".value=''");
      return true;
    }
    else{
      return false;
    }
}

//ÇÐ»ý±âº»Á¤º¸ ÆË¾÷
function studentViewPop( user, menuCode, ccode ){
	url = "/master/stuviewpopup.do?hakbun="+user+"&menuCode="+menuCode+"&ccode="+ccode;
  open_window(url, "ÇÐ»ý±âº»Á¤º¸", "0", "0", "508", "300", "", "", "", "auto", "");	
}

//ÀÏ¹Ý ¼ö°­»ý±âº»Á¤º¸ ÆË¾÷
function generalViewPop( user, menuCode, ccode ){
	url = "/master/stuviewpopupgeneral.do?hakbun="+user+"&menuCode="+menuCode+"&ccode="+ccode;
  open_window(url, "ÇÐ»ý±âº»Á¤º¸", "0", "0", "508", "280", "", "", "", "auto", "");	
}

//ÇÐ»ý °Ë»ö
function studentSearch( formName, pHakbun, pWebid, pHname, pYundohakgi, yundohakgi, menuCode ){
  url = "/master/stusearchpopup.do?formName="+formName+"&pHakbun="+pHakbun+"&pWebid="+pWebid+"&pHname="+pHname+"&pYundohakgi="+pYundohakgi+"&yundohakgi="+yundohakgi+"&menuCode="+menuCode;
  open_window(url, "ÇÐ»ý°Ë»ö", "0", "0", "508", "400", "", "", "", "auto", ""); 
}



  /** ÀüÃ¼ ¼±ÅÃ. */
  function allcheck(allObj, obj, arrayObj){

    if(obj==null || allObj==null) return;

    if(obj.length==null) {
      if (allObj.checked) {
        obj.checked = true;
      } else {
        obj.checked = false;
      }
    } else {
      for( var i=0; i<obj.length; i++) {
        if (allObj.checked) {
          obj[i].checked = true;
        } else {
          obj[i].checked = false;
        }
      }
    }
  }
  /** Ã¼Å© µÈ Ç×¸ñÀÌ ÀÖ´ÂÁö È®ÀÎ */
  function isCheckedOne(obj) {
      var indexNum = 0;
    if(obj == null) return false;

    if(obj.length==null) {
      if(obj.checked) indexNum++;
    } else {
      for(var i=0; i<obj.length; i++) {
        if(obj[i].checked) indexNum++;
      }
    }
      if(indexNum>0){
          form01.indexnum.value=indexNum;
          return true
      }else{
          return false
      }
  }


	function openMove(val, type){
		var o = document.form01;
		if(!isCheckedOne(o.ckIndex_ar)) {
			alert("ÀÌµ¿ÇÒ °Ô½Ã¹° ´ë»óÀÌ ¾ø½À´Ï´Ù.\n\n(¿ÞÂÊÀÇ Ã¼Å©¹Ú½º¸¦ ¼±ÅÃÇÏ¼¼¿ä.)");
			return false;
		}else{
			var url = "boarddatamove.do?bbsConfigFK="+val+"&type="+type;
			winstyle="left=200, top=200, width=800, height=600,scrollbars=yes";        
			window.open (url,"boardmove",winstyle);    
			return ;
		}
		return false;
	}


	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}


// ³×ÀÌ¹ö_ºí·Î±×_ÆË¾÷Ã¢ ¿­±â popview() 

function popview(url){
  window.open("/front/imageZoom.jsp?url=" + url,"popview","scrollbars=yes,width=100,height=100");
  //window.open("http://blog.naver.com/main/imageZoom.jsp?url=" + url,"mainview","scrollbars=yes,width=100,height=100");
}

// ³×ÀÌ¹ö_ºí·Î±×_ÆË¾÷Ã¢ ¿­±â popview()


function open_window_journal(url)
{	
  if (url != null && url != ""){
   window.open(url,'thewin','height=723,width=1006,left=100,top=100,toolbar=no,scrollbars=no');
  }
	self.close();
}

// ³×ÀÌ¹ö_ºí·Î±×_ÆË¾÷Ã¢ ¿­±â popview() 



function getFileSize(filePath)
    {
        var len = 0;
        
        if ( navigator.appName.indexOf("Netscape") != -1) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
            } catch(e) {
                alert("signed.applets.codebase_principal_support¸¦ ¼³Á¤ÇØÁÖ¼¼¿ä!\n"+e);
                return -1;
            }
            try {
                var file = Components.classes["@mozilla.org/file/local;1"]
                                     .createInstance(Components.interfaces.nsILocalFile);
                file.initWithPath ( filePath );
                
                len = file.fileSize;
            } catch(e) {
                alert("¿¡·¯°¡ ¹ß»ýÇß½À´Ï´Ù.:"+e);
            }
        } else if (navigator.appName.indexOf('Microsoft') != -1) {
            var img = new Image();
            img.dynsrc = filePath;
            len = img.fileSize;
        }
        return len;
    }

/** »ê±â´ë µµ¸ÞÀÎ **/
var Domain_URL = "http://newweb.kpu.ac.kr";
var Domain_Sub_URL = "http://subweb.kpu.ac.kr"; //ÇÐ°ú,ºÎ¼­µµ¸ÞÀÎ