
// ÀÚ·á¿¡ °ø¹éÀÌ ÀÖ´ÂÁö Ã¼Å©

function IsEmpty(data) {
  for (var i=0;i<data.length;i++) { if (data.substring(i,i+1) != " ") return false;  }   
  return true; 
}


function chk_string(str, word) {
  var chk = str.indexOf(word);
  if (chk > -1) return true;              
  else  return false; 
}


// ÀÚ·á°¡ ¿µ¹®,¼ýÀÚ·Î¸¸ ÀÌ·ç¾î Á³´ÂÁö Ã¼Å©

function IsAlphaNumeric(checkStr) {
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789";
  for (i = 0; i < checkStr.length; i++ ) {
	ch = checkStr.charAt(i);
	for (j = 0; j < checkOK.length; j++)  if (ch == checkOK.charAt(j)) break;
 	if (j == checkOK.length) { 
	    return false;
		break;
	}
  }
  return true; 
}


//ÀÚ·á°¡ ¿µ¹® ·Î¸¸ ÀÌ·ç¾î Á³´ÂÁö Ã¼Å©

function IsAlpha(checkStr) {
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  for (i = 0; i < checkStr.length; i++ ) {
	ch = checkStr.charAt(i);
	for (j = 0; j < checkOK.length; j++)  if (ch == checkOK.charAt(j)) break;
 	if (j == checkOK.length) { 
	    return false;
		break;
	}
  }
  return true; 
}



// ÀÚ·á°¡ ¿µ¹®,ÇÑ±Û ·Î¸¸ ÀÌ·ç¾î Á³´ÂÁö Ã¼Å©
function IsAlphaHangul(checkStr) {
  
  for (i=0; i < checkStr.length; i++) {
	
	ch = checkStr.charAt(i);    
	if ( (ch >= '0' && ch <= '9') || !((ch >= 'a' && ch <='z') || (ch == '_') || (ch < 255) || (ch > 0) || (ch >= '°¡' && ch <= 'ÆR')) ) {
	    return false;
		break;     
    }
  }
  
  return true;
}



// ÀÚ·á°¡ ¼ýÀÚÀÎÁö Ã¼Å©
function checkDigit(tocheck) {
  var isnum = true;
  if ((tocheck ==null) || (tocheck == "")) {
       isnum = false;
       return isnum; 
  }

  for (var j= 0 ; j< tocheck.length; j++ ) {
       if ( ( tocheck.substring(j,j+1) != "0" ) &&
            ( tocheck.substring(j,j+1) != "1" ) &&
            ( tocheck.substring(j,j+1) != "2" ) &&
            ( tocheck.substring(j,j+1) != "3" ) &&
            ( tocheck.substring(j,j+1) != "4" ) &&
            ( tocheck.substring(j,j+1) != "5" ) &&
            ( tocheck.substring(j,j+1) != "6" ) &&
            ( tocheck.substring(j,j+1) != "7" ) &&
            ( tocheck.substring(j,j+1) != "8" ) &&
            ( tocheck.substring(j,j+1) != "9" ) ) {
            isnum = false; }  
   }
   return isnum; 
}


// ÀÚ·á°¡ ¼ýÀÚ, ¼Ò¼öÁ¡ - ÀÎÁö Ã¼Å©

function checkDigit_point(tocheck) {
  var isnum = true;
  if ((tocheck ==null) || (tocheck == "")) {
       isnum = false;
       return isnum; 
  }

  for (var j= 0 ; j< tocheck.length; j++ ) {
       if ( ( tocheck.substring(j,j+1) != "0" ) &&
            ( tocheck.substring(j,j+1) != "1" ) &&
            ( tocheck.substring(j,j+1) != "2" ) &&
            ( tocheck.substring(j,j+1) != "3" ) &&
            ( tocheck.substring(j,j+1) != "4" ) &&
            ( tocheck.substring(j,j+1) != "5" ) &&
            ( tocheck.substring(j,j+1) != "6" ) &&
            ( tocheck.substring(j,j+1) != "7" ) &&
            ( tocheck.substring(j,j+1) != "8" ) &&
            ( tocheck.substring(j,j+1) != "9" ) &&
            ( tocheck.substring(j,j+1) != "-" ) &&
            ( tocheck.substring(j,j+1) != "." ) ) {
            isnum = false; }  
   }
   return isnum; 
}


// ÀÚ·á°¡ ¼ýÀÚ, ÄÞ¸¶ ÀÎÁö Ã¼Å©

function checkDigit_comma(tocheck) {
  var isnum = true;
  if ((tocheck ==null) || (tocheck == "")) {
       isnum = false;
       return isnum; 
  }

  for (var j= 0 ; j< tocheck.length; j++ ) {
       if ( ( tocheck.substring(j,j+1) != "0" ) &&
            ( tocheck.substring(j,j+1) != "1" ) &&
            ( tocheck.substring(j,j+1) != "2" ) &&
            ( tocheck.substring(j,j+1) != "3" ) &&
            ( tocheck.substring(j,j+1) != "4" ) &&
            ( tocheck.substring(j,j+1) != "5" ) &&
            ( tocheck.substring(j,j+1) != "6" ) &&
            ( tocheck.substring(j,j+1) != "7" ) &&
            ( tocheck.substring(j,j+1) != "8" ) &&
            ( tocheck.substring(j,j+1) != "9" ) &&
            ( tocheck.substring(j,j+1) != "," ) ) {
            isnum = false; }  
   }
   return isnum; 
}


// ÀÚ·á°¡ ¼ýÀÚ, ¼Ò¼öÁ¡, ÄÞ¸¶ ÀÎÁö Ã¼Å©

function checkDigit_point_comma(tocheck) {
  var isnum = true;
  if ((tocheck ==null) || (tocheck == "")) {
       isnum = false;
       return isnum; 
  }

  for (var j= 0 ; j< tocheck.length; j++ ) {
       if ( ( tocheck.substring(j,j+1) != "0" ) &&
            ( tocheck.substring(j,j+1) != "1" ) &&
            ( tocheck.substring(j,j+1) != "2" ) &&
            ( tocheck.substring(j,j+1) != "3" ) &&
            ( tocheck.substring(j,j+1) != "4" ) &&
            ( tocheck.substring(j,j+1) != "5" ) &&
            ( tocheck.substring(j,j+1) != "6" ) &&
            ( tocheck.substring(j,j+1) != "7" ) &&
            ( tocheck.substring(j,j+1) != "8" ) &&
            ( tocheck.substring(j,j+1) != "9" ) &&
            ( tocheck.substring(j,j+1) != "." ) &&
            ( tocheck.substring(j,j+1) != "," ) ) {
            isnum = false; }  
   }
   return isnum; 
}



// 3ÀÚ¸® ´ÜÀ§·Î ÄÞ¸¶ »ðÀÔÇÏ±âÀü Æû°ª Ã¼Å©
// onblur="comma(ÆûÀÌ¸§.ÆûÇÊµå)" ½ÄÀ¸·Î input Çü½Ä¿¡ »ðÀÔ

function comma(f) {

  if (IsEmpty(f.value) == true)  return  false;
	 
  if (!checkDigit_comma(f.value) == true) { 
      alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
	  f.value = '';
      f.focus();
      return false; 
  }

  var price, tmp;
  price = f.value;
  tmp = price.replace(/,/g, "");
  f.value = commaNum(tmp);  

}



function inputnum(f) {

  if (IsEmpty(f.value) == true)  return  false;
	 
  if (!checkDigit(f.value) == true) { 
      alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
	  f.value = '';
      f.focus();
      return false; 
  }

}



// 3ÀÚ¸® ´ÜÀ§·Î ÄÞ¸¶ »ðÀÔÇÏ±â

function commaNum(num) {  
  if (num < 0) { num *= -1; var minus = true} 
  else var minus = false 
         
  var dotPos = (num+"").split(".") 
  var dotU = dotPos[0] 
  var dotD = dotPos[1] 
  var commaFlag = dotU.length%3 

  if (commaFlag) { 
      var out = dotU.substring(0, commaFlag)  
      if (dotU.length > 3) out += "," 
  } 
  else var out = "" 

  for (var i=commaFlag; i < dotU.length; i+=3) { 
       out += dotU.substring(i, i+3)  
       if( i < dotU.length-3) out += "," 
  } 

  if (minus) out = "-" + out 
  if (dotD) return out + "." + dotD 
  else return out  
} 


// ÁÖ¹Î¹øÈ£ Ã¹Â°ÀÚ¸® 6ÀÚ¸® ÀÔ·Â½Ã ´ÙÀ½À¸·Î Æ÷Ä¿½º ÀÌµ¿ ½ÃÅ°±â

function juminNextFocus (f1,f2) {
  
  if (f1.value.length == 6)  f2.focus();

}



// ÁÖ¹Î¹øÈ£ Ã¼Å©

function CheckJuminNo() {

  var strresidentno1 = bform1.jumin1.value;
  var strresidentno2 = bform1.jumin2.value;

  if (strresidentno1.length < 6) {
      alert ("ÁÖ¹Î¹øÈ£ ±æÀÌ°¡ Á¤È® ÇÏÁö ¾Ê½À´Ï´Ù.");
      bform1.jumin1.focus();
      return false; 
  }

  if (strresidentno2.length < 7 ) {
      alert ("ÁÖ¹Î¹øÈ£ ±æÀÌ°¡ Á¤È® ÇÏÁö ¾Ê½À´Ï´Ù.");
      bform1.jumin2.focus();
      return false; 
  } 

  var strresidentno = bform1.jumin1.value + bform1.jumin2.value;
  var strA, strB, strC, strD, strE, strF, strG, strH, strI, strJ, strK, strL, strM, strN, strO;
  var nCalA, nCalB, nCalC; 

  strA = strresidentno.substr(0, 1);
  strB = strresidentno.substr(1, 1);
  strC = strresidentno.substr(2, 1);
  strD = strresidentno.substr(3, 1);
  strE = strresidentno.substr(4, 1);
  strF = strresidentno.substr(5, 1);
  strG = strresidentno.substr(6, 1);
  strH = strresidentno.substr(7, 1);
  strI = strresidentno.substr(8, 1);
  strJ = strresidentno.substr(9, 1); 
  strK = strresidentno.substr(10, 1);
  strL = strresidentno.substr(11, 1);
  strM = strresidentno.substr(12, 1);            

  strO = strA*2 + strB*3 + strC*4 + strD*5 + strE*6 + strF*7 + strG*8 + strH*9 + strI*2 + strJ*3 + strK*4 + strL*5;

  nCalA = eval(strO);
  nCalB = nCalA % 11;
  nCalC = 11 - nCalB;
  nCalC = nCalC % 10; 

  strv = '19';
  strw = strresidentno.substr(0, 2);
  strx = strresidentno.substr(2, 2);
  stry = strresidentno.substr(4, 2);      	

  strz = strv + strw;

  if ((strz % 4 == 0) && (strz % 100 != 0) || (strz % 400 == 0)) {	yunyear = 29;  }
  else yunyear = 28;       	

  if ((strx <= 0) || (strx > 12)) {
       alert("»ý³â¿ùÀÏÀÌ ¸ÂÁö ¾Ê½À´Ï´Ù.");
       bform1.jumin1.focus();
       return false; 
  }

  if ((strx == 1 || strx == 3 || strx == 5 || strx == 7 || strx == 8 || strx == 10 || strx == 12) && (stry > 31 || stry <= 0)) {
      alert("»ý³â¿ùÀÏÀÌ ¸ÂÁö ¾Ê½À´Ï´Ù.");
      bform1.jumin1.focus();
      return false; 
  }

  if ((strx == 4 || strx == 6 || strx == 9 || strx == 11) && (stry > 30 || stry <= 0)) {
	   alert("»ý³â¿ùÀÏÀÌ ¸ÂÁö ¾Ê½À´Ï´Ù.");
      bform1.jumin1.focus();
      return false; 
  }

  if (strx == 2 && (stry > yunyear || stry <= 0)) {
      alert(strz + "»ý³â¿ùÀÏÀÌ ¸ÂÁö ¾Ê½À´Ï´Ù." + yunyear);
      bform1.jumin1.focus();
      return false;  
  }

  if (!((strG == 1) || (strG == 2) || (strG == 3) || (strG ==4))) {
	  alert("ÁÖ¹Î¹øÈ£ µÞÀÚ¸®ÀÇ ½ÃÀÛÀº 1 ~ 4 ÀÌ¿©¾ß ÇÕ´Ï´Ù.");
      bform1.jumin2.focus();
      return false;  
  }

  if (nCalC != strM) { 
	  alert("ÁÖ¹Î¹øÈ£°¡ ±ÔÄ¢¿¡ ¾î±ß ³³´Ï´Ù.");
	  bform1.jumin1.value = "";
	  bform1.jumin2.value = "";
	  bform1.jumin1.focus();
	  return false;
  }
  
  return true;
}



// ÁÖ¹Î¹øÈ£ Ã¹Â°ÀÚ¸® ÀÔ·Â½Ã »ý³â¿ùÀÏ ¸ÂÃß±â

function fillBirth(birth,f1,f2,f3) {
  
  var tyear = '';
  var tmon = '';
  var tday = '';

  if (birth.length == 6) {
	  if (birth.substring(0,2) > "10")  tyear = "19" + birth.substring(0,2);
	  else  tyear = "20" + birth.substring(0,2);
     f1.value = tyear;
     f2.value = birth.substring(2,4);
     f3.value = birth.substring(4,6)
  }

}


// ÁÖ¹Î¹øÈ£ µÎÂ°ÀÚ¸® ÀÔ·Â½Ã ¼ºº° Ã¤¿ì±â

function fillSex(jumin2, sexF) {

  if (jumin2.substring(0,1) == '1' || jumin2.substring(0,1) == '3')      sexF[0].checked = true;
  else if (jumin2.substring(0,1) == '2' || jumin2.substring(0,1) == '4') sexF[1].checked = true;

}



// ¸ÞÀÏ µµ¸ÞÀÎ Ã³¸®

function fillaccount(f1, f2) {

  if (f1.value == '')  {
	   f2.readOnly = false;
		f2.style.backgroundColor = '#FFFFFF';
  }
  else {
	   f2.readOnly = true;
	   f2.style.backgroundColor = '#F4F4F4';
	   f2.value = f1.value;  
  }

}



// ÇÑ¸ÞÀÏ Ã³¸®

function verify_hanmail (f2) {

  var result = true;
  
  if (f2.value != '' && f2.value.toLowerCase() == "hanmail.net") {
      alert('ÇÑ¸ÞÀÏÀº ¿Â¶óÀÎ ¿ìÇ¥Á¦ ½ÃÇàÀ¸·Î »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.');
      f2.value = '';
	   f2.focus();
	   result = false;
  }

  return result;

}



// Æ¯¼ö¹®ÀÚ Ã³¸®

function chspecial_char(mystr) { 
  
  var re, sq, bs, dq;

  re = /cR_/g;
  sq = /sQ_/g;
  bs = /bS_/g;
  dq = /dQ_/g;

  mystr = mystr.replace(re, "\r\n");		
  mystr = mystr.replace(sq, "'");
  mystr = mystr.replace(bs, "\\");
  mystr = mystr.replace(dq, "\"");

  return mystr;

}



// ÀüÀÚ¿ìÆí Ã¼Å©

function emailcheck(str) {

  var i;
  var strEmail = str;
  var strCheck1 = false;
  var strCheck2 = false;
  var result = true;

  for (i=0; i < strEmail.length; i++) {
    if ((strEmail.substring(i,i+1) == "~") || (strEmail.substring(i,i+1) == ".") ||
        (strEmail.substring(i,i+1) == "_") || (strEmail.substring(i,i+1) == "-") ||
        ((strEmail.substring(i,i+1) >= "0") && (strEmail.substring(i,i+1) <= "9")) ||
        ((strEmail.substring(i,i+1) >= "@") && (strEmail.substring(i,i+1) <= "Z")) ||
        ((strEmail.substring(i,i+1) >= "a") && (strEmail.substring(i,i+1) <= "z"))) {
        if (strEmail.substring(i,i+1) == ".")  strCheck1 = true;
	    if (strEmail.substring(i,i+1) == "@")  strCheck2 = true;  
    }
    else {
        result = false;  
	    break;
    }
  }

  if ((strCheck1 == false) || (strCheck2 == false)) {
        result = false;  
  }

  return result;
}


// »ç¾÷ÀÚ¹øÈ£ Ã¼Å© Çü½Ä

function cnum_check(ThisVal1, ThisVal2, ThisVal3){
  var chkRule = "137137135";

  var strCorpNum = ThisVal1 + ThisVal2 + ThisVal3; // »ç¾÷ÀÚ¹øÈ£ 10ÀÚ¸®
  var step1, step2, step3, step4, step5, step6, step7;

  step1 = 0;			// ÃÊ±âÈ­

  for (i=0; i<7; i++) {
    step1 = step1 + (strCorpNum.substring(i, i+1) * chkRule.substring(i, i+1));
  }

  step2 = step1 % 10;
  step3 = (strCorpNum.substring(7, 8) * chkRule.substring(7, 8))% 10;
  step4 = strCorpNum.substring(8, 9) * chkRule.substring(8, 9);
  step5 = Math.round(step4 / 10 - 0.5);
  step6 = step4 - (step5 * 10);
  step7 = (10 - ((step2 + step3 + step5 + step6) % 10)) % 10;

  if (strCorpNum.substring(9, 10) != step7) return false;
  else return true;
}



// ¿ìÆí¹øÈ£ ¼±ÅÃÃ¢

function findPost(gubun) {
  window.open('/honeywell/join/member_adress_find.asp?gubun='+gubun, 'post_list', ('scrollbars=no,resizable=no,width=480,height=280,left=100,top=100'));
} 


// ¿ìÆí¹øÈ£ ¼±ÅÃÃ¢ 2

function findPostGubun() {
  window.open('/post_gubn.php', 'post_gubn', ('scrollbars=no,resizable=no,width=467,height=280,left=100,top=100'));
} 


// ¾ÆÀÌµð, ºñ¹Ð¹øÈ£ ºÐ½Ç

function findMem() {
  window.open('/join/find_info.php', 'find_info', ('scrollbars=no,resizable=yes,width=585,height=283,left=100,top=100'));
} 



// ³¯Â¥°Ë»öÀÌ ÀÖ´Â °Ë»ö¹®

function day_jsend() {
  var syear = document.all.sday1.value;
  var smon  = document.all.sday2.value;
  var sday  = document.all.sday3.value;
  var eyear = document.all.eday1.value;
  var emon  = document.all.eday2.value;
  var eday  = document.all.eday3.value;

  if (syear == '' && smon == '' && sday == '' && eyear == '' && emon == '' && eday == '')       {  }
  else if (syear != '' && smon == '' && sday == '' && eyear == '' && emon == '' && eday == '')  {  }
  else if (syear == '' && smon != '' && sday == '' && eyear == '' && emon == '' && eday == '')  {  }
  else if (syear == '' && smon == '' && sday != '' && eyear == '' && emon == '' && eday == '')  {  }
  else if (syear != '' && smon != '' && sday == '' && eyear == '' && emon == '' && eday == '')  {  }
  else if (syear == '' && smon != '' && sday != '' && eyear == '' && emon == '' && eday == '')  {  }
  else if (syear != '' && smon != '' && sday != '' && eyear == '' && emon == '' && eday == '')  {  }
  else if (syear != '' && smon == '' && sday == '' && eyear != '' && emon == '' && eday == '')  {  }
  else if (syear != '' && smon != '' && sday == '' && eyear != '' && emon != '' && eday == '')  {  }
  else if (syear == '' && smon != '' && sday != '' && eyear == '' && emon != '' && eday != '')  {  }  
  else if (syear != '' && smon != '' && sday != '' && eyear != '' && emon != '' && eday != '')  {  }
  else {
	alert('³¯Â¥°Ë»ö ÁöÁ¤ÀÌ Àß¸øµÇ¾î ÀÖ½À´Ï´Ù.\n³¯Â¥ °Ë»ö¹æ¹ýÀ» Âü°í ÇÏ¼Å¿ä.');
    return false;
  } 
    
  bform1.submit();
}



// ¿øµµ¿ì Ã¢ ¿ÀÇÂ

function winOpen (doc, wname, top, left, width, height) {
  window.open(doc, wname, 'scrollbars=no,resizable=no,top='+top+',left='+left+',width='+width+',height='+height);
}


// ¿ÀÇÂÃ¢À¸·Î ÆûÀü¼Û ÀÍ½º 5.0 ÀÌ»ó ¿¡¼­ Àû¿ë

function OpenPost (obj, url, wname, top, left, width, height) {
  var winopts = "scrollbars=no,resizable=no,top="+top+",left="+left+",width="+width+",height="+height;
  window.open("", wname, winopts);
  obj.action = url;
  obj.target = wname;
  obj.submit(); 
}



// ¿øµµ¿ì Ã¢ ¿ÀÇÂ (ÇØ»óµµ¿¡ µû¶ó °¡¿îµ¥·Î ¿­±â)

function winOpenCenter (doc, wname, width, height) {

  var screenWidth  = screen.availwidth;
  var screenHeight = screen.availheight;

  var intLeft = (screenWidth - width) / 2;
  var intTop  = (screenHeight - height) / 2

  window.open(doc, wname, 'scrollbars=no,resizable=no,top='+intTop+',left='+intLeft+',width='+width+',height='+height);
}



// ¿ÀÇÂÃ¢À¸·Î ÆûÀü¼Û ÀÍ½º 5.0 ÀÌ»ó ¿¡¼­ Àû¿ë

function OpenPostCenter (obj, url, wname, width, height) {

  var screenWidth  = screen.availwidth;
  var screenHeight = screen.availheight;

  var intLeft = (screenWidth - width) / 2;
  var intTop  = (screenHeight - height) / 2

  var winopts = 'scrollbars=no,resizable=no,top='+intTop+',left='+intLeft+',width='+width+',height='+height;
  window.open("", wname, winopts);
  obj.action = url;
  obj.target = wname;
  obj.submit(); 
}



// ¿øµµ¿ì Ã¢ ¿ÀÇÂ (½ºÅ©·Ñ, ÇØ»óµµ¿¡ µû¶ó °¡¿îµ¥·Î ¿­±â)

function winOpenCenterB (doc, wname, width, height) {

  var screenWidth  = screen.availwidth;
  var screenHeight = screen.availheight;

  var intLeft = (screenWidth - width) / 2;
  var intTop  = (screenHeight - height) / 2

  window.open(doc, wname, 'scrollbars=yes,resizable=no,top='+intTop+',left='+intLeft+',width='+width+',height='+height);
}



function init_iframe(height) {
  reSize(height);
  setTimeout('init_iframe('+height+')', 200)
}


function reSize(height) {
  try {
    var objBody = ifrm.document.body;
    var objFrame = document.all["ifrm"];
    ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);

    if (ifrmHeight > height)  ifrmHeight = height;
		
    if (ifrmHeight > 0)  objFrame.style.height = ifrmHeight
    else  objFrame.style.height = 0;
    objFrame.style.width = '100%';
  }
  catch(e) {}
}



// ³¯Â¥º° select ¹Ù ¼³Á¤

function tdaySetChk(tyear, tmon, tday) {

  setSelect(bform1.sDay_a, tyear);   //³âµµ¼³Á¤
  setSelect(bform1.sDay_b, tmon);    //¿ù¼³Á¤
  setSelect(bform1.sDay_c, tday);    //ÀÏ¼³Á¤

  setSelect(bform1.sDay_e, '');      //³âµµ¼³Á¤
  setSelect(bform1.sDay_f, '');      //¿ù¼³Á¤
  setSelect(bform1.sDay_g, '');      //ÀÏ¼³Á¤
  
}


// ÀÌ¹øÁÖ, Áö³­ÁÖº°·Î select ¹Ù ¼³Á¤

function tweekSetChk(sday1, sday2, sday3, eday1, eday2, eday3) {

  setSelect(bform1.sDay_a, sday1);   // ³âµµ¼³Á¤
  setSelect(bform1.sDay_b, sday2);   // ¿ù¼³Á¤
  setSelect(bform1.sDay_c, sday3);   // ÀÏ¼³Á¤

  setSelect(bform1.sDay_e, eday1);   // ³âµµ¼³Á¤
  setSelect(bform1.sDay_f, eday2);   // ¿ù¼³Á¤
  setSelect(bform1.sDay_g, eday3);   // ÀÏ¼³Á¤

}


// ¿ùº°·Î select ¹Ù ¼³Á¤

function tmonSetChk(sday1, sday2) {

  setSelect(bform1.sDay_a, sday1);   // ³âµµ¼³Á¤
  setSelect(bform1.sDay_b, sday2);   // ¿ù¼³Á¤
  setSelect(bform1.sDay_c, '');      // ÀÏ¼³Á¤

  setSelect(bform1.sDay_e, '');      // ³âµµ¼³Á¤
  setSelect(bform1.sDay_f, '');      // ¿ù¼³Á¤
  setSelect(bform1.sDay_g, '');      // ÀÏ¼³Á¤

}



// ¿ùº°·Î select ¹Ù ¼³Á¤

function tmonSetChk_b (sday1, sday2) {

  setSelect(bform1.sDay_a, sday1);   // ³âµµ¼³Á¤
  setSelect(bform1.sDay_b, sday2);   // ¿ù¼³Á¤

  setSelect(bform1.sDay_e, '');      // ³âµµ¼³Á¤
  setSelect(bform1.sDay_f, '');      // ¿ù¼³Á¤

}



// ÀüÃ¼ ³¯Â¥

function tAllDaySetChk() {

  setSelect(bform1.sDay_a, '');   // ³âµµ¼³Á¤
  setSelect(bform1.sDay_b, '');   // ¿ù¼³Á¤
  setSelect(bform1.sDay_c, '');   // ÀÏ¼³Á¤

  setSelect(bform1.sDay_e, '');   // ³âµµ¼³Á¤
  setSelect(bform1.sDay_f, '');   // ¿ù¼³Á¤
  setSelect(bform1.sDay_g, '');   // ÀÏ¼³Á¤

}



// ¿ùº°·Î select ¹Ù ¼³Á¤

function tmonSetChkOne(sday1, sday2) {

  setSelect(bform1.sDay_a, sday1);   //³âµµ¼³Á¤
  setSelect(bform1.sDay_b, sday2);   //¿ù¼³Á¤

}




//select : select¿¡¼­ str°ªÀ» °¡Áø optionÀ» ¼±ÅÃµÇµµ·Ï ¼³Á¤

function setSelect(input,str) {
  
  for (i=0;i<input.options.length;i++) {
    if (input.options[i].value == str) input.options[i].selected=true;
  }

}


//select : selectÀÇ optionsµé ´Ù »èÁ¦ÇÏ´Â ¸Þ¼Òµå
function dropOptions(input)  {

  var len = input.length;
  for (var i=0; i<len; i++) input.options[0]=null;

}


//select : select¿¡¼­ ¼±ÅÃµÈ °ª ¸®ÅÏ
function getSelectedOption(obj) {
  
  var idx = obj.selectedIndex;
  var v_sel = obj.options[idx].value;
  return v_sel;

}



//ÀÚ¹Ù½ºÅ©¸³Æ® Ã¼Å©
function chkjava(str) {
  var chk = str.indexOf("<javascript");
  if (chk > -1) return true;              
  else  return false; 
}



// È®ÀåÀÚ Ã¼Å©
function chkExpansin(str) {
  var chk = str.indexOf(".");
  if (chk > -1) return true;              
  else  return false; 
}


// ¹è¿­ »ý¼ºÀÚ

function makeArray(n) {
  
  this.length = n;
  for(var i=1; i <= n; i++) this[i] = "";
  return this;

}


function toggleMenu(currMenu) {
  
  if (document.all) {
      thisMenu = eval("document.all." + currMenu + ".style");
      if (thisMenu.display == "block")  thisMenu.display = "none";
      else                              thisMenu.display = "block";
      return false;
  }
  else{ 
	   return true; 
  }

}


// ÄíÅ° ±Á±â

function setCookie(name, value, expiredays) {
  var todayDate = new Date();
  todayDate.setDate(todayDate.getDate() + expiredays);   
  document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}



// ¸µÅ©ÀÚ±¹ Áö¿ì±â

function allblur() {
  for (i=0; i < document.links.length; i++) document.links[i].onfocus = document.links[i].blur;
}



// ½Ã°èÃâ·Â

function clock() {

	if (!document.layers && !document.all) return;
	
	var digital = new Date();
	var years = digital.getYear();
	var hours = digital.getHours();
	var minutes = digital.getMinutes();
	var seconds = digital.getSeconds();
	var amOrPm = "AM";
	
	if (hours > 11) amOrPm = "PM";
	if (hours > 12) hours = hours - 12;
	if (hours == 0) hours = 12;
	if (minutes <= 9) minutes = "0" + minutes;
	if (seconds <= 9) seconds = "0" + seconds;

	dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;
	
	if (document.layers) {
		 document.layers.pendule.document.write(dispTime);
		 document.layers.pendule.document.close();
	}
	else if (document.all) pendule.innerHTML = (digital.getYear()) + "³â" + (digital.getMonth() + 1) + "¿ù" + digital.getDate() + "ÀÏ " + dispTime;

	setTimeout("clock()", 1000);
}



function cal_byte(aquery, f1, f2, maxStr) {
  var tmpStr;
  var temp=0;
  var onechar;
  var tcount;
  tcount = 0;
   
  if (aquery == '')  aquery = f1.value;

  tmpStr = new String(aquery);
  temp = tmpStr.length;

  for (k=0; k < temp; k++) {
    onechar = tmpStr.charAt(k);
    if (escape(onechar).length > 4) tcount += 2;
    else if (onechar != '\r')       tcount++;
  }

  f2.value = tcount;
  if (tcount > maxStr) {
      reserve = tcount - maxStr;
      alert("¸Þ½ÃÁö ³»¿ëÀº "+maxStr+" ¹ÙÀÌÆ® ÀÌ»óÀº Àü¼ÛÇÏ½Ç¼ö ¾ø½À´Ï´Ù.\r\n ¾²½Å ¸Þ¼¼Áö´Â "+reserve+"¹ÙÀÌÆ®°¡ ÃÊ°úµÇ¾ú½À´Ï´Ù.\r\n ÃÊ°úµÈ ºÎºÐÀº ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù."); 
      nets_check(f1, f2, maxStr);
      return;
  } 
}

 

function nets_check(f1, f2, maxStr) {
  var tmpStr;
  var temp = 0;
  var onechar;
  var tcount;
  tcount = 0;
    
  tmpStr = new String(f1.value);
  temp = tmpStr.length;

  for (k=0;k<temp;k++) {
    onechar = tmpStr.charAt(k);
        
    if (escape(onechar).length > 4)  tcount += 2;
    else if (onechar != '\r')        tcount++;

  if (tcount > maxStr) {
        tmpStr = tmpStr.substring(0, k); 
        break;
    }
  }
    
  f1.value = tmpStr;
  cal_byte(tmpStr, f1, f2, maxStr);
 
  return tmpStr;
}



// trim ÇÔ¼ö 

function trim(str){
  
  // Á¤±Ô Ç¥Çö½ÄÀ» »ç¿ëÇÏ¿© È­ÀÌÆ®½ºÆäÀÌ½º¸¦ ºó¹®ÀÚ·Î ÀüÈ¯
  str = str.replace(/^\s*/,'').replace(/\s*$/, ''); 
  return str;

} 



// ÆûÀü¼ÛÀü °ø¹éÁ¦°Å 

function all_textForm_trim() {
  var frm = document.bform1;

  for (var i = 0; i < frm.elements.length; i++) {
    if (frm.elements[i].type == "text") {
        frm.elements[i].value = trim(frm.elements[i].value);
	 }
  }

}


function all_textForm_trimB() {
  var frm = document.bform2;

  for (var i = 0; i < frm.elements.length; i++) {
    if (frm.elements[i].type == "text") {
        frm.elements[i].value = trim(frm.elements[i].value);
	 }
  }

}


function all_textForm_trimC() {
  var frm = document.bform3;

  for (var i = 0; i < frm.elements.length; i++) {
    if (frm.elements[i].type == "text") {
        frm.elements[i].value = trim(frm.elements[i].value);
	 }
  }

}

// È®ÀåÀÚ ¸®ÅÏ

function findExtension(fname) {
  
  //var s = fname.lastIndexOf("\\");
  var m = fname.lastIndexOf(".");
  var e = fname.length;
  //var filename = fname.substring(s+1,m);
  var extname = fname.substring(m+1, e);
  
  return extname;

} 



// ¿Â¶óÀÎ ÅõÇ¥

function vote_in(no, duplicate, gubun) {
  
  var flag = 1;

  for (var i=0; i < document.vote.sel.length; i++) {	

	 if (document.vote.sel[i].checked == true) {    
        window.open("/onLine/vote_result.php?no="+no+"&sel="+document.vote.sel[i].value+"&duplicate="+duplicate+"&gubun="+gubun,"poll","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,top=80,left=80,width=440,height=420");
	     flag = 0;
    }
  }

  if (flag == 1) {
      alert("Ç×¸ñÀ» ¼±ÅÃÇØ ÁÖ¼Å¿ä.");
      return;
  }
  
}



// ¿Â¶óÀÎ ÅõÇ¥ °á°ú º¸±â

function vote_view(no, gubun) {
  window.open("/onLine/vote_result.php?no="+no+"&gubun="+gubun,"poll","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,top=80,left=80,width=440,height=420");
}



// ÆË¾÷Ã¢ ¿ÀÇÂ  no ÇØ´ç ·¹ÄÚµå

function show_popup (no, left, top, width, height, property) {

  var win = window.open('/honeywell/show_popup.asp?no='+no, '', 'top='+top+',left='+left+',width='+width+',height='+height+","+property);
  self.name = "show_popup_"+no;
  win.opener = self;
  win.focus();

}



// ·Î±×¾Æ¿ô 

function logOut() {

  result = confirm('È®ÀÎÀ» Å¬¸¯ ÇÏ½Ã¸é ·Î±×¾Æ¿ôÀÌ ¿Ï·á µË´Ï´Ù.');

  if (result == true)  {
      window.location.href='/join/logOut.asp';
  }

}



// ´Þ·Â

function openCal(obj,top,left) {
  window.open('/honeywell/search/sear_cale.asp?obj='+obj, 'sear_cale', 'scrollbars=no,resizable=no,top='+top+',left='+left+',width=210,height=175');
}


function openNumpad(obj,top,left,strtype) {
	window.open('/honeywell/as/manager/include/number.asp?obj='+obj+'&strtype='+strtype, 'number', 'width=210,height=215,top='+top+',left='+left);
}



function fnChkNum() { //¼ýÀÚ¸¸ Çã¿ë
	if (!((event.keyCode>47)&(event.keyCode<58)||event.keyCode==13)){   
			event.returnValue=false;
			alert("¼ýÀÚ¸¸ ÀÔ·Â °¡´É ÇÕ´Ï´Ù.");
	}
}

function fnChkNum2() { //¼ýÀÚ, - Çã¿ë
	if (!((event.keyCode>47)&(event.keyCode<58)||event.keyCode==45||event.keyCode==13)){   
			event.returnValue=false;
			alert("¼ýÀÚ¿Í -¸¸ ÀÔ·Â °¡´É ÇÕ´Ï´Ù.");
	}
}

function fnChkNum3() { //¼ýÀÚ, - Çã¿ë
	if (!((event.keyCode>47)&(event.keyCode<58)||event.keyCode==45||event.keyCode==13)){   
			event.returnValue=false;
			alert("¼ýÀÚ¿Í -¸¸ ÀÔ·Â °¡´É ÇÕ´Ï´Ù.");
	}
}

function fnChkNum4() { //¼ýÀÚ, * Çã¿ë
	
	if (!((event.keyCode>47)&(event.keyCode<58)||event.keyCode==42||event.keyCode==13)){   
			event.returnValue=false;
			alert("¼ýÀÚ¿Í *¸¸ ÀÔ·Â °¡´É ÇÕ´Ï´Ù.");
	}
}


function fnChkNum5() { //¼ýÀÚ Çã¿ë
	
	if (!((event.keyCode > 47 & event.keyCode < 58) || (event.keyCode == 13))) {   
			event.returnValue=false;
			alert("¼ýÀÚ¸¸ ÀÔ·Â °¡´É ÇÕ´Ï´Ù.");
	}
}
