// ÀÚ·á¿¡ °ø¹éÀÌ ÀÖ´ÂÁö Ã¼Å©
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);  

}


//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) {
  
  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);
     tmon = birth.substring(2,4);
     tday = birth.substring(4,6)
     setSelect (f1, tyear);
     setSelect (f2, tmon);
     setSelect (f3, tday);
  }

}


// ÁÖ¹Î¹øÈ£ µÎÂ°ÀÚ¸® ÀÔ·Â½Ã ¼ºº° Ã¤¿ì±â
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 != '') {
      if (f2.value.toLowerCase() == "hanmail.net") {
			 alert('ÇÑ¸ÞÀÏÀº ¿Â¶óÀÎ ¿ìÇ¥Á¦ ½ÃÇàÀ¸·Î »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.');
			 f2.value = '';
			 f2.focus();
      }

      f2.value = f1.value;  
  }
  else {
  }

}


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;

}




//¿ÀÇÂÃ¢À¸·Î ÆûÀü¼Û ÀÍ½º 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 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('/post_list.asp?gubun='+gubun, '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 winOpen (doc, wname, top, left, width, height) {
  window.open(doc, wname, 'scrollbars=no,resizable=no,top='+top+',left='+left+',width='+width+',height='+height);
}



// Â÷°èºÎ »èÁ¦Ã³¸®

function autoBooKdelete(no, gubun) {

  result = confirm('È®ÀÎÀ» Å¬¸¯ ÇÏ½Ã¸é ¼±ÅÃÇÑ Ç×¸ñÀ» »èÁ¦ Ã³¸® ÇÕ´Ï´Ù.');

  if (result == true) {   
      show_wait_show();
	  window.location.href='allItem_del.asp?no='+no+'&gubun='+gubun;
  }

}





// ÀÌ¹ÌÁö ¹Ì¸®º¸±â  -------------------------------------------------------------------------------------

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) {}
}


function init_iframeB(height) {
  reSizeB(height);
  setTimeout('init_iframeB('+height+')', 200)
}

function reSizeB(height) {
  try {
    var objBody = ifrmB.document.body;
    var objFrame = document.all["ifrmB"];
    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 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 allblur() {
  for (i = 0; i < document.links.length; i++) document.links[i].onfocus = document.links[i].blur;
}



function secession(tb) {
  
  result = confirm('¼Ò¸ðÀÓ¿¡¼­ Å»Åð ÇÏ½Ã °Ú½À´Ï±î ? Å»Åð½Ã È®ÀÎ ¹öÆ°À» Å¬¸¯ÇØ ÁÖ¼¼¿ä.');

  if (result == true) {   
	   window.location.href='study_join_out.asp?tb='+tb;
  }

}


function goMystudy() {

  if (IsEmpty(meForm.goUrl.value) == false) {
 	  window.location.href='/study/studyRoom.asp?tb='+meForm.goUrl.value;
  }

}
