//ÀÚ·á¿¡ °ø¹éÀÌ ÀÖ´ÂÁö Ã¼Å©
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) != "." ) ) {
            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);  

}


//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  
} 


//ÁÖ¹Î¹øÈ£ Ã¼Å©
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("ÁÖ¹Îµî·Ï¹øÈ£°¡ ±ÔÄ¢¿¡ ¾î±ß³³´Ï´Ù.");
	  return false;
  }
  
  return true;
}


//ÁÖ¹Î¹øÈ£ Ã¹Â°ÀÚ¸® ÀÔ·Â½Ã »ý³â¿ùÀÏ Ã¤¿ì±â
function fillBirth(birth, f1,f2,f3) {
  
  if (birth.length == 6) {
	  if (birth.substring(0,2) > "10")  f1.value = "19" + birth.substring(0,2);
	  else  f1.value = "20" + birth.substring(0,2);
      f2.value = birth.substring(2,4);
      f3.value = birth.substring(4,6)
  }

}


//¿ÀÇÂÃ¢À¸·Î ÆûÀü¼Û ÀÍ½º 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 openPostExcel (url, wname, top, left, width, height) {
  var winopts = "scrollbars=no,resizable=yes,top="+top+",left="+left+",width="+width+",height="+height;
  window.open("", wname, winopts);
  document.bform1.action = url;
  document.bform1.target = wname;
  document.bform1.submit(); 
}



//¾ÆÀÌµð Áßº¹Ã¼Å©
function chkDuplicationId() {

  if (IsEmpty(bform1.cid.value) == true) {
      alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
      bform1.cid.focus();
	  return false; 
  }

  if (bform1.cid.value.length < 4 || bform1.cid.value.length > 10 || IsAlphaNumeric(bform1.cid.value) == false) {
      alert("¾ÆÀÌµð´Â ¿µ¹®°ú ¼ýÀÚÀÇ Á¶ÇÕÀ¸·Î 4 ~ 12 ÀÚ¸®³»¿¡¼­ ÀÔ·ÂÇÏ½Ê½Ã¿À. \nÇÑ±Û, Æ¯¼ö¹®ÀÚ, ¶ç¾î¾²±â´Â ¾ÈµË´Ï´Ù. \n¶ÇÇÑ ´ë¼Ò¹®ÀÚ´Â ±¸º°µÇÁö ¾Ê½À´Ï´Ù.");
   	  bform1.cid.value = "";
  	  bform1.cid.focus();
	  return false;	
  }
 
  if (bform1.cid.value == "admin" || bform1.cid.value == "root" || bform1.cid.value == "email" || bform1.cid.value == "master" || bform1.cid.value == "webmaster" || bform1.cid.value == "guest") {
      alert("¼±ÅÃÇÏ½Å ¾ÆÀÌµð´Â »ç¿ëÇÒ ¼ö ¾ø´Â ¾ÆÀÌµð ÀÔ´Ï´Ù.");
      bform1.cid.value = "";
      bform1.cid.focus();
      return false;  
  }

  var winopts="width=360,height=200,left=100,top=100,scrollbars=no";
  var winurl = "/join/chkDuplicationId.php?cid="+bform1.cid.value;
  var win = window.open(winurl, "¾ÆÀÌµðÁßº¹È®ÀÎ", winopts); 
  self.name = "chkDuplicationId";
  win.opener = self;
  win.focus();

}



//ÀüÀÚ¿ìÆí Ã¼Å©
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() {
  window.open('/post_list.php', 'post_list', ('scrollbars=no,resizable=yes,width=480,height=283,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 fDownload(fname) {
  
  if (fname == "") {
	  window.alert('´Ù¿î·Îµå¿¡ ÇÊ¿äÇÑ ÆÄÀÏ¸íÀÌ ¾ø½À´Ï´Ù.');
	  return false;
  }

  window.open(fname, 'fDownload', ('scrollbars=no,resizable=yes,top=80,left=80,width=200,height=200'));  
}


//¿øµµ¿ì Ã¢ ¿ÀÇÂ
function winOpen (doc, wname, top, left, width, height) {
  window.open(doc, wname, 'scrollbars=no,resizable=yes,top='+top+',left='+left+',width='+width+',height='+height);
}

function winOpen1 (doc, wname, top, left, width, height) {
  window.open(doc, wname, 'scrollbars=no,resizable=no, status=yes,top='+top+',left='+left+',width='+width+',height='+height);
}

//ÀÌ¹ÌÁö ¹Ì¸®º¸±â  -------------------------------------------------------------------------

function r_show_pic(url, num) {
  document.images["pic"+num].style.display = "block";
  document.images["pic"+num].src = url;
}


function show_pic(f, num) {
  document.images["pic"+num].style.display = "block";
  document.images["pic"+num].src = f.value;
}


function show_pic2(pic, pname) {
  window.open('../show_pic.php?pic='+pic+'&pname='+pname, 'show_pic', ('scrollbars=no, resizable=no, top=80,left=80,width=1,height=1'));
}


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) {

  if (bform1.term[0].checked == true || bform1.term[1].checked == true)  {

	  setSelect(bform1.sday1, tyear);   //³âµµ¼³Á¤
	  setSelect(bform1.sday2, tmon);    //¿ù¼³Á¤
	  setSelect(bform1.sday3, tday);    //ÀÏ¼³Á¤

	  setSelect(bform1.eday1, '');      //³âµµ¼³Á¤
	  setSelect(bform1.eday2, '');      //¿ù¼³Á¤
	  setSelect(bform1.eday3, '');      //ÀÏ¼³Á¤
  
  }

}


//ÀÌ¹øÁÖ, Áö³­ÁÖº°·Î select ¹Ù ¼³Á¤
function tweekSetChk(sday1, sday2, sday3, eday1, eday2, eday3) {

  if (bform1.term[2].checked == true || bform1.term[3].checked == true)  {

      setSelect(bform1.sday1, sday1);   //³âµµ¼³Á¤
      setSelect(bform1.sday2, sday2);   //¿ù¼³Á¤
      setSelect(bform1.sday3, sday3);   //ÀÏ¼³Á¤

      setSelect(bform1.eday1, eday1);   //³âµµ¼³Á¤
      setSelect(bform1.eday2, eday2);   //¿ù¼³Á¤
      setSelect(bform1.eday3, eday3);   //ÀÏ¼³Á¤

  }

}



//¿ùº°·Î select ¹Ù ¼³Á¤
function tmonSetChk(sday1, sday2) {

  if (bform1.term[4].checked == true)  {

      setSelect(bform1.sday1, sday1);   //³âµµ¼³Á¤
      setSelect(bform1.sday2, sday2);   //¿ù¼³Á¤
      setSelect(bform1.sday3, '');      //ÀÏ¼³Á¤

	  setSelect(bform1.eday1, '');      //³âµµ¼³Á¤
	  setSelect(bform1.eday2, '');      //¿ù¼³Á¤
	  setSelect(bform1.eday3, '');      //ÀÏ¼³Á¤

  }

}


//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 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];}
}

//°Ë»ö½Ã enterÅ° »ç¿ë(bform1)
function enterSearch() {
	if(event.keyCode==13) {
		event.cancelBubble = true;
		fnSearch();
	}
}

function fnSearch() {
	bform1.submit();
}

//°Ë»ö½Ã enterÅ° »ç¿ë(bform2)
function enterSearch2() {
	if(event.keyCode==13) {
		event.cancelBubble = true;
		fnSearch2();
	}
}

function fnSearch2() {
	bform2.submit();
}