/*
¼Ò½º¼³¸í : °øÅëÀ¸·Î »ç¿ë ÇÏ´Â ÀÚ¹Ù½ºÅ©¸³Æ® ÇÔ¼ö ¸ðÀ½
ÀÛ¼ºÀÚ : ¾Èº´±Ç
ÀÛ¼ºÀÏ : 2006.10.30 (¿ù)
°³Á¤ÀÏÀÚ : 2006.10.30 (¿ù) ÃÖÃÊ ÀÛ¼º.
*/


/*--------------------------------------------------------------------------*
 * void chk_all(f, checker)
 * ¸ðµç Ç×¸ñÀ» Ã¼Å©ÇÏ´ø°¡ ÇØÁ¦ÇÑ´Ù.
 *--------------------------------------------------------------------------*/
 function chk_all(f, checker){

	var check = checker.checked;
	var cnt = 0;
	for (var i=0; i<f.elements.length; i++) {
		if (f.elements[i].name=='sno') { 
			f.elements[i].checked = check; cnt+=1; 
		}
	}
 }

/*--------------------------------------------------------------------------*
 * int chk_count()
 * Ã¼Å©µÈ Ç×¸ñÀÇ Ä«¿îÅÍ¸¦ ¸®ÅÏÇÑ´Ù.
 *--------------------------------------------------------------------------*/
 function chk_count(f){

	var checkobj  = new Array();

	var checkcnt=0;
	for (var i=0;i<f.elements.length;i++) {
		if ( f.elements[i].name!='sno') continue;
		if ( f.elements[i].checked==true) {
			checkobj[checkcnt]  = f.elements[i];
			checkcnt++;
		}
	}
	return checkcnt;
 }


// È«º¸µ¿¿µ»ó È°¼ºÈ­
//rec_sfname_2 µ¿¿µ»ó °æ·Î  myst  sutostart ÁöÁ¤°ª (true or false)

function active_clip(folder,rec_sfname_2, myst) {
  document.write("<object id='MediaPlayer' style='filter: gray()' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' width='320' height='285'>");
  document.write("<param name='filename' value='"+ folder + rec_sfname_2 + "'>");
  document.write("<param name='displaysize' value='0'>");
  document.write("<param name='autostart' value='" + myst + "'>");
  document.write("<param name='showcaptioning' value='0'>");
  document.write("<param name='showcontrols' value='-1'>");
  document.write("<param name='showdisplay' value='0'>");
  document.write("<param name='showgotobar' value='0'>");
  document.write("<param name='showpositioncontrols' value='-1'>");
  document.write("<param name='showstatusbar' value='true'>");
  document.write("<param name='showtracker' value='-1'>");
  document.write("</object>");
  }


// ÀÚ·á¿¡ °ø¹éÀÌ ÀÖ´ÂÁö Ã¼Å©

function IsEmpty(data) {
  
  for (var i=0; i < data.length; i++) { 
	if (data.substring(i,i+1) != " ") return false;
  }
  
  return true; 
}



// ÀÚ·á°¡ ¼ýÀÚÀÎÁö Ã¼Å©

function checkDigit_s(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 IsSpace(data) {
  
  var str = trim(data);

  for (var i=0; i < str.length; i++) { 
	if (str.substring(i,i+1) == " ") return true;
  }
  
  return false; 
}



// ÇØ´ç ¹®ÀÚ°¡ ÀÖ´ÂÁö Ã¼Å©

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; 
}


// ¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.

function selnumber(f) {

  if (IsEmpty(f.value) == true)  return  false;
	 
  if (!checkDigit(f.value) == true) { 
      alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
	   f.value = '0';
      f.focus();
      return false; 
  }

}



//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  
} 


// ÁÖ¹Î¹øÈ£ Ã¹Â°ÀÚ¸® 6ÀÚ¸® ÀÔ·Â½Ã ´ÙÀ½À¸·Î Æ÷Ä¿½º ÀÌµ¿ ½ÃÅ°±â

function juminNextFocus (f1,f2) {
  
  if (f1.value.length == 6)  f2.focus();

}


// ÁÖ¹Î¹øÈ£ Ã¼Å©

function CheckJuminNo(f1, f2) {

  var strresidentno1 = f1.value;
  var strresidentno2 = f2.value;

  if (strresidentno1.length < 6) {
      alert ("ÁÖ¹Îµî·Ï¹øÈ£ ±æÀÌ°¡ Á¤È® ÇÏÁö ¾Ê½À´Ï´Ù.");
      f1.focus();
      return false; 
  }

  if (strresidentno2.length < 7 ) {
      alert ("ÁÖ¹Îµî·Ï¹øÈ£ ±æÀÌ°¡ Á¤È® ÇÏÁö ¾Ê½À´Ï´Ù.");
      f2.focus();
      return false; 
  } 

  var strresidentno = strresidentno1 + strresidentno2;
  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("»ý³â¿ùÀÏÀÌ ¸ÂÁö ¾Ê½À´Ï´Ù.");
       f1.focus();
       return false; 
  }

  if ((strx == 1 || strx == 3 || strx == 5 || strx == 7 || strx == 8 || strx == 10 || strx == 12) && (stry > 31 || stry <= 0)) {
      alert("»ý³â¿ùÀÏÀÌ ¸ÂÁö ¾Ê½À´Ï´Ù.");
      f1.focus();
      return false; 
  }

  if ((strx == 4 || strx == 6 || strx == 9 || strx == 11) && (stry > 30 || stry <= 0)) {
	  alert("»ý³â¿ùÀÏÀÌ ¸ÂÁö ¾Ê½À´Ï´Ù.");
      f1.focus();
      return false; 
  }

  if (strx == 2 && (stry > yunyear || stry <= 0)) {
      alert(strz + "»ý³â¿ùÀÏÀÌ ¸ÂÁö ¾Ê½À´Ï´Ù." + yunyear);
      f1.focus();
      return false;  
  }

  if (!((strG == 1) || (strG == 2) || (strG == 3) || (strG ==4))) {
	  alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®ÀÇ ½ÃÀÛÀº 1 ~ 4 ÀÌ¿©¾ß ÇÕ´Ï´Ù.");
      f2.focus();
      return false;  
  }

  if (nCalC != strM) { 
	  alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ ±ÔÄ¢¿¡ ¾î±ß ³³´Ï´Ù.");
	  f1.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);
     //setSelect(f1, tyear);
     //setSelect(f2, birth.substring(2,4));
     //setSelect(f3, 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 chspecial_char(mystr) { 
  
  var re, sq, bs, dq;

  mystr = mystr.replace("/cR_/g", "\r\n");		
  mystr = mystr.replace("/sQ_/g", "'");
  mystr = mystr.replace("/bS_/g", "\\");
  mystr = mystr.replace("/dQ_/g", "\"");

  return mystr;

}


// ºê¶ó¿ìÀú ÆÇÁ¤

function chkBrowser () { 

  var ua = navigator.userAgent;
  var isbrowser = new makeArray(9);


  for (i=0; i < 9; i++)  isbrowser[i] = false;

  if (document.all)                  isbrowser[0] = true;
  if (ua.indexOf("Netscape") != -1)  isbrowser[1] = true;
  if (ua.indexOf("Safari") != -1)    isbrowser[2] = true;
  if (ua.indexOf("Firefox") != -1)   isbrowser[3] = true;
  if (ua.indexOf("Konqueror") != -1) isbrowser[4] = true;
  if (ua.indexOf("Galeon") != -1)    isbrowser[5] = true;
  if (ua.indexOf("K-Meleon") != -1)  isbrowser[6] = true;
  if (ua.indexOf("Sylera") != -1)    isbrowser[7] = true;
  if (window.opera != undefined)     isbrowser[8] = true;
  
  if (isbrowser[0] = true)  isbrowser[9] = new RegExp('MSIE ([0-9.]+)','gi').exec(ua)[1];
  else isbrowser[9] = "1";

  return isbrowser;

}




// ¼±ÅÃÇÑ ÆäÀÌÁö ÁÖ¼Ò°¡ ÀÖÀ¸¸é ÇØ´ç ÆäÀÌÁö·Î ÀÌµ¿

function select_onchage_js (myurl) { 
  
  if (IsEmpty(myurl) == false) window.location.href = myurl;

}




 // ´Þ·Â _ text

function openCal(e, obj) {

  var isb = chkBrowser();

  var top = isb[0] ? event.clientY - 120 : e.clientY - 120;
  var left = isb[0] ? event.clientX - 120 : e.clientX - 120;

  calLayer_show('/include/mycalendar.asp?obj='+obj,top,left);
  
}



 // ´Þ·Â _ text

function openCal2(e, obj) {

  var isb = chkBrowser();

  var top = isb[0] ? event.clientY - 120 : e.clientY - 120;
  var left = isb[0] ? event.clientX - 120 : e.clientX - 120;

  calLayer_show('/include/mycalendar.asp?obj='+obj+'&ifcomma=Y',top,left);
  
}



 // ´Þ·Â _ select 

function selCal(f_year,f_mon,f_day) {

  winOpenCenter ('/include/selcalendar.asp?f_year='+f_year+'&f_mon='+f_mon+'&f_day='+f_day, 'selcalendar', '210', '160');
  
}



/*** ´Þ·Â ·¹ÀÌ¾î ÆË¾÷Ã¢ ¶ç¿ì±â ***/

function calLayer_show(url, po_top, po_lef) {
	w = 210;
	h = 160;

	var pixelBorder = 3;
	var titleHeight = 25;
	w += pixelBorder * 2;
	h += pixelBorder * 2 + titleHeight;

	var bodyW = document.body.clientWidth;
	var bodyH = document.body.clientHeight;

	var posX = (bodyW - w) / 2;
	var posY = (bodyH - h) / 2;

	calhiddenselect('hidden');

	// ¹é±×¶ó¿îµå 
	var obj = document.createElement("div");
	with (obj.style){
		position = "absolute";
		left = 0;
		top = 0;
		width = "100%";
		height = document.body.scrollHeight;
		//backgroundColor = "#000000";
		filter = "Alpha(Opacity=50)";
	}
	obj.id = "objPopupLayerBg";
	document.body.appendChild(obj);

	// ³»¿ëÇÁ·¹ÀÓ
	var obj = document.createElement("div");
	with (obj.style){
		position = "absolute";
		left = po_lef;
		top = po_top;
		width = w;
		height = h;
		border = "3px solid #5BB9CE";
	}
	obj.id = "objPopupLayer";
	document.body.appendChild(obj);

	// close ¹Ù ·¹ÀÌ¾î 
	var bottom = document.createElement("div");
	
	with (bottom.style){
		position = "absolute";
		width = w - pixelBorder * 2;
		height = titleHeight + 3;		
		left = 0;
		top = h - titleHeight - pixelBorder * 3;	
		padding = "7px 0 0 0";
		textAlign = "right";
		backgroundColor = "#EBEBEB";
		font = "bold 12px µ¸¿ò";
	}
	
	bottom.innerHTML = "<a href='javascript:calcloselayer()'><font color='#000000'>close</font></a>";
	obj.appendChild(bottom);

	// ¾ÆÀÌÇÁ·¹ÀÓ
	var ifrm = document.createElement("iframe");
	with (ifrm.style){
		width = w - 6;
		height = h - pixelBorder * 2 - titleHeight - 3;		
	}
	ifrm.frameBorder = 0;
	ifrm.marginwidth = 0;
	ifrm.marginheight = 0;
	ifrm.scrolling="no";
	ifrm.src = url;   // ¾ÆÀÌÇÁ·¹ÀÓ °æ·Î
	obj.appendChild(ifrm);
}


function calcloselayer() {
  calhiddenselect('visible');

  var isb = chkBrowser();

  if (isb[0] == true) {
     document.getElementById('objPopupLayer').removeNode(true);
     document.getElementById('objPopupLayerBg').removeNode(true);
  }
  else {
     var obj1 = document.getElementById('objPopupLayer'); 
     var obj2 = document.getElementById('objPopupLayerBg'); 

	 obj1.parentNode.removeChild(obj1);
	 obj2.parentNode.removeChild(obj2);
  }

}


function calhiddenselect(mode) {
	var obj = document.getElementsByTagName('select');
	for (i=0;i<obj.length;i++){
		obj[i].style.visibility = mode;
	}
}



// ¿ÀÇÂÃ¢À¸·Î ÆûÀü¼Û ÀÍ½º 5.0 ÀÌ»ó ¿¡¼­ Àû¿ë

function OpenPost (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 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 cnumNextFocus_a () {
  
  if (bform1.cnum1.value.length == 3)  bform1.cnum2.focus();

}

function cnumNextFocus_b () {
  
  if (bform1.cnum2.value.length == 2)  bform1.cnum3.focus();

}



// »ç¾÷ÀÚ¹øÈ£ Ã¼Å© Çü½Ä

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 ch_radiocount(frm, strval) {
  var cnum = 0;

  for (var i = 0; i < frm.elements.length; i++) {
	if (frm.elements[i].name == strval) {		
        if (frm.elements[i].checked == true)  cnum = cnum + 1;
    }
  }

  return cnum;
}




// ¶óµð¿À,Ã¼Å©¹Ú½º Ã¼Å©°ª


function val_radiocount(frm, strval) {
  var val = '';

  for (var i = 0; i < frm.elements.length; i++) {
	if (frm.elements[i].name == strval) {		
        if (frm.elements[i].checked == true)  val = frm.elements[i].value;
    }
  }

  return val;
}




// ¶óµð¿À ¹öÆ° ¼±ÅÃ È®ÀÎ

function check_radio_cnt (frm, strval) {
  
  var cnt = 0;

  for (var i=0; i < frm.elements.length; i++) {
    if (frm.elements[i].name == strval) {
        if (frm.elements[i].checked == true)  cnt = cnt + 1;
    }
  }

  return cnt;

}



// ¶óµð¿À ¹öÆ° °ª °¡Á®¿À±â

function get_radioValue (frm, strval) {
  
  var myval = '';

  for (var i=0; i < frm.elements.length; i++) {
    if (frm.elements[i].name == strval) {
        if (frm.elements[i].checked == true && frm.elements[i].disabled == false)  myval = frm.elements[i].value;
    }
  }

  return myval;

}




// ¾ÆÀÌµð, ºñ¹Ð¹øÈ£ ºÐ½Ç

function findMem() {

  window.open('/join/find_info.asp', 'find_info', ('scrollbars=no,resizable=yes,width=585,height=283,left=100,top=100'));

} 


// Å¬¸³º¸µå¿¡ º¹»ç Ã³¸®

function copy_clipBoard(str) {
  window.clipboardData.setData('Text', str);
  window.alert("º¹»ç µÇ¾ú½À´Ï´Ù.");
}




// ajax ¿¡¼­ escape ·Î ÀÎÄÚµù½Ã + ¹®ÀÚ ¹®Á¦ÇØ°á

escape: function(value) {
  return escape(value).replace(/\+/g, '%2B');
}








// È¸¿øÀü¿ë ÆäÀÌÁö¸¦ ºñÈ¸¿øÀÌ Å¬¸¯ÇÒ¶§ Ã³¸®

function onlymember() {

  result = confirm('È¸¿øÀü¿ë¸Þ´º ÀÔ´Ï´Ù.\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î ?');

  if (result == true) { 
	  goLoginForm.submit();
  }

}



// ÆË¾÷Ã¢ ¸µÅ© Ã³¸®

function directpopup(mypage) {

  opener.window.location.href=mypage;
  self.close();

}



function directLogOut() {

  new ajax.xhr.Request("/ajax_script/LogOut.asp", null, logOutResult, "POST");

}


function logOutResult(req) {

  if (req.readyState == 4) {
	  if (req.status == 200) {

			var docXML = req.responseXML;
			var code = docXML.getElementsByTagName("code").item(0).firstChild.nodeValue;      // ¿¡·¯ÄÚµå        

         if (code == '99') {
				 top.window.location.href='/';
         }

     }
  }

}




// Ã¼Å©µÈ È¸¿ø¿¡°Ô ¸ÞÀÏ Àü¼Û

function c_semail () {

  var cnum = 0;
  cnum = ch_count();

  if (cnum < 1) {
      alert("¸ÞÀÏÀü¼ÛÇÒ È¸¿øÀ» ÇÑ¸í ÀÌ»ó ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
      return; 
  }
  
  show_wait_show();
  bform2.s_gubun.value = 'b';
  bform2.target = "_self";
  bform2.action = '/manager/member/mail_send.asp';
  bform2.submit();

}


// °Ë»öµÈ È¸¿ø¿¡°Ô ¸ÞÀÏ Àü¼Û

function s_semail() {
 
  show_wait_show();
  bform2.s_gubun.value = 'c';
  bform2.target = "_self";
  bform2.action = '/manager/member/mail_send.asp';
  bform2.submit();

}


// Ã¼Å©µÈ È¸¿ø¿¡°Ô SMS Àü¼Û

function c_sms () {

  var cnum = 0;
  cnum = ch_count();

  if (cnum < 1) {
      alert("¸ÞÀÏÀü¼ÛÇÒ È¸¿øÀ» ÇÑ¸í ÀÌ»ó ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
      return; 
  }
  
  show_wait_show();
  bform2.s_gubun.value = 'b';
  bform2.target = "_self";
  bform2.action = '/manager/member/sms_send.asp';
  bform2.submit();

}


// °Ë»öµÈ È¸¿ø¿¡°Ô SMS Àü¼Û

function s_sms() {
 
  show_wait_show();
  bform2.s_gubun.value = 'c';
  bform2.target = "_self";
  bform2.action = '/manager/member/sms_send.asp';
  bform2.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 winOpenMax (doc, wname) {
  window.open(doc, wname, 'scrollbars=yes,toolbar=yes,location=yes,resizable=yes,status=yes,menubar=yes,resizable=yes,fullscreen=no');
}


// ¿øµµ¿ì Ã¢ ¿ÀÇÂ (ÇØ»óµµ¿¡ µû¶ó °¡¿îµ¥·Î ¿­±â)

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);
}


// ¿øµµ¿ì Ã¢ ¿ÀÇÂ (½ºÅ©·Ñ, ÇØ»óµµ¿¡ µû¶ó °¡¿îµ¥·Î ¿­±â)

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);

}

// ¿ÀÇÂÃ¢À¸·Î ÆûÀü¼Û ÀÍ½º 5.0 ÀÌ»ó ¿¡¼­ Àû¿ë

function OpenPost (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 show_FileSize (fsize) {
  
  var result = 0;

  if (eval(fsize) > 0) {
      if (eval(fsize) > 1024000) {
			 result = parseInt(Math.round((eval(fsize / 1024000) * 1000) / 1000, 2)) + " MB";
      }
		else if (eval(fsize) > 1024) {
			result = parseInt(Math.round((eval(fsize / 1024) * 10) / 10, 2)) + " KB";
      }
		else {
			result = fsize + " Byte";
      }
  }
  else {
      result = "0 Byte";
  }

  return result;

}




function frameResize(obj) {
  
  try {
    
	 parent.document.getElementById(frames.name).style.height = this.document.body.scrollHeight;
    window.scrollTo(0,0);
  }
  catch (e) {}

}



function show_Iframe (posid, myid, width, src) {


  var str = "";

  str += "<iframe id=\"" + myid + "\" name=\"" + myid + "\" frameborder=\"0\" width=\"" + width + "\" height=\"0\" hspace=\"0\" vspace=\"0\" "
  str += "marginheight=\"0\" marginwidth=\"0\" scrolling=\"no\" onload=\"resizeIframe(this, " + myid + ")\" src=\"" + src + "\" allowTransparency='true'></iframe>\n"

  document.getElementById(posid).innerHTML = str;

}



function toggle_Iframe (posid, myid, gu, src) {


    if (document.getElementById(myid) && toggleForm.gu.value == gu) {

        document.getElementById(posid).innerHTML = '';
	
	}
	else {

		 var str = "";

	    str += "<iframe id=\"" + myid + "\" name=\"" + myid + "\" frameborder=\"0\" width=\"570\" height=\"0\" hspace=\"0\" vspace=\"0\" "
	    str += "marginheight=\"0\" marginwidth=\"0\" scrolling=\"no\" onload=\"resizeIframe(this, " + myid + ")\" src=\"" + src + "\"></iframe>\n"

	    document.getElementById(posid).innerHTML = str;

    }

	toggleForm.gu.value = gu;

}



function resizeIframe(ifrm, myid) {
  obj = eval(myid);
  ifrm.setExpression('height', obj.document.body.scrollHeight);
  //ifrm.setExpression('width',myid.document.body.scrollWidth);

  //ifrm.setExpression('height',myid.document.body.scrollHeight + (myid.document.body.offsetHeight - myid.document.body.clientHeight));

}



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 : 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;

}


// radio, checkbox : str°ªÀ» °ªÀ» ¼±ÅÃµÇµµ·Ï ¼³Á¤

function setChecked (input, str) {
  
  for (i=0;i<input.length;i++) {
    if (input[i].value == str) input[i].checked = true;
  }

}


// ÀÚ¹Ù½ºÅ©¸³Æ® Ã¼Å©

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 bbsview(path, bos_no, bbs_no) { 
 
  window.location.href= path +'view.asp?bos_no='+bos_no+'&bbs_no='+bbs_no+'&returnUrl='+path+'list.asp?bos_no='+bos_no;

}


function productview(path, pro_no) { 

  window.location.href= path +'?pro_no='+pro_no;

}




function flashObj2(src,w,h,id,val) { 
  
  html = '';
  html += '<object type="application/x-shockwave-flash"  classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 id="'+id+'" width="'+w+'" align="center" height="'+h+'">';  
  html += '<param name="movie" value="'+src+'" />'; 
  html += '<param name="quality" value="high" />'; 
  html += '<param name="flashvars" value="'+val+'" />'; 
  html += '<param name="bgcolor" value="#ffffff" />';
  html += '<param name="wmode" value="transparent" />';		
  html += '<param name="menu" value="false" />';  
  html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" menu="false" width="'+w+'"  height="'+h+'" swliveconnect="true" id="'+id+'" name="param" align="center" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> <\/embed>'; 
  html += '<\/object>'; 
  
  document.write(html);

}



// ¹è¿­ »ý¼ºÀÚ

function makeArray(n) {
  
  this.length = n;
  for (var i=1; i <= n; i++) this[i] = "";
  return this;

}




// ÀÏ·Ã¹øÈ£ ¸¸µé±â

function serialnm () {

  var today = new Date();
  var year  = today.getFullYear();
  var month = today.getMonth() + 1;
  var date  = today.getDate();
  var time  = today.getTime();

  if (parseInt(month) < 10) month = "0" + month;
 
  return year + "" + month + "" + date + "" + time;

}






// ³¯Â¥°Ë»ö Ã³¸®

function sel_seday(f1, f2, val_a, val_b) {

  f1.value = val_a;
  f2.value = val_b;

}



function toggleMenu(currMenu) {
  
  if (document.getElementById(currMenu)) {

      if (document.getElementById(currMenu).style.display == "block")  document.getElementById(currMenu).style.display = "none";
      else document.getElementById(currMenu).style.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 popup_hide() {
  setCookie('@comfirmpop', 'N', 1);
  self.close();
}




// ½Ã°èÃâ·Â

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;
	else if (document.all) pendule.innerHTML = (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 false;
  } 

}

 

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(frm) {

  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 printDiv () {
  if (document.all && window.print) {
      window.onbeforeprint = beforeDivs;
      window.onafterprint = afterDivs; 
      window.print();
   }
}

function beforeDivs () {
  if (document.all) {
      objContents.style.display = 'none';
      objSelection.innerHTML = document.all['d1'].innerHTML;
  }
}

function afterDivs () {
  if (document.all) {
      objContents.style.display = 'block';
      objSelection.innerHTML = "";
  }
}


// ¼±ÅÃÇÑ °´Ã¼ÀÇ Àý´ëÀ§Ä¡ 
// o Å¬·¡½º ¾ÆÀÌµð

function getRealOffsetLeft(o) { 
  
  return o ? o.offsetLeft + getRealOffsetLeft(o.offsetParent) : 0; 

} 

function getRealOffsetTop(o) { 

  return o ? o.offsetTop + getRealOffsetTop(o.offsetParent) : 0; 

} 



// ¸ÞÀÏ µµ¸ÞÀÎ Ã³¸®¹× ÇÑ¸ÞÀÏ Ã³¸®

function fillaccount(f1, f2) {

  if (f1.value != '') {
      f2.value = f1.value;  
  }

}



function topbtn_layer () { 

  var screenWidth  = screen.availwidth;
  var mypos = 926
  if (screenWidth == 1152)  mypos = 1000
  else if (screenWidth == 1280)  mypos = 1056

  str = '';
  str += '<div id="topslide" style="position:absolute;left:'+mypos+'px;visibility:visible;">';  
  str += '<table width="10" border="0" cellspacing="0" cellpadding="0">';
  str += '<tr><td><a href="#" onFocus="blur();"><img class="PNG24" src="/images/main/btn_top.png"></a></td></tr>'; 
  str += '</table>'; 
  str += '</div>';
  
  document.write(str);

}



// ¿À´Ã³¯Â¥

function getToDay() {
   
  var date = new Date();
   
  var year  = date.getFullYear();
  var month = date.getMonth() + 1; // 1¿ù=0,12¿ù=11ÀÌ¹Ç·Î 1 ´õÇÔ
  var day   = date.getDate();
  var hour  = date.getHours();
    
  if (("" + month).length == 1)  month = "0" + month;
  if (("" + day).length   == 1)  day   = "0" + day;
  if (("" + hour).length  == 1)  hour  = "0" + hour;
        
  return ("" + year + month + day + hour);
    
}



function setPNG24(obj) { 

  obj.width=obj.height=1; 
  obj.className=obj.className.replace(/\bPNG24\b/i,''); 
  obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
  obj.src=''; 

  return ''; 
} 






// ÀÌ¹ÌÁö preloading

function na_restore_img_src(name, nsdoc) {
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}

function na_preload_img() { 
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i]     = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function na_change_img_src(name, nsdoc, rpath, preload) { 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}


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_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_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];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { 
	v = args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; 
  }
}

MM_reloadPage(true);


//FOOTER ·¹ÀÌ¾î À§Ä¡ º¯È¯
function Windowfooter() {

var xMax=document.body.clientWidth;
var yMax=document.body.clientHeight;
var hei=document.body.scrollHeight;
//alert(yMax+"ddd"+hei);

	if(yMax > hei){
		var ysize = yMax-180; 
		var divMenu = document.all['footer'].style;
		divMenu.top = ysize;
		divMenu.left = 0;
	}
	
}

//FOOTER ·¹ÀÌ¾î À§Ä¡ º¯È¯
function iframeWindowfooter() {

var xMax=parent.document.body.clientWidth;
var yMax=parent.document.body.clientHeight;
var hei=parent.document.body.scrollHeight;
//alert(yMax+"sss"+hei);

	if(yMax > hei){
		var ysize = yMax-180; 		
	}
	else{
		var ysize = hei; 
	}
		
		var divMenu = parent.document.all['footer'].style;
		divMenu.top = ysize;
		divMenu.left = 0;
	

}


function setPng24(obj) { 
  obj.width=obj.height=1; 
  obj.className=obj.className.replace(/\bpng24\b/i,''); 
  obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
  obj.src='';  
  return ''; 
}



// ·Î±×ÀÎ ·¹ÀÌ¾î ºÎ¸£±â

function chkDuplicationLogin(e,wid,hei) {

   var top = (parseInt(screen.height, 10)/2) - (parseInt(hei, 10)/2);
   var left = (parseInt(screen.width, 10)/2) - (parseInt(wid, 10)/2);

  //var top = isb[0] ? event.clientY - 200 : e.clientY - 200;
  //var left = isb[0] ? event.clientX + 120 : e.clientX + 120;

  calLayer('/join/login.asp', top, left, wid, hei);

}



//ºñ¹Ð¹øÈ£ Ã£±â ·¹ÀÌ¾îºÎ¸£±â

function chkDuplicationFindPwd(e,wid,hei){

  var top = (parseInt(screen.height, 10)/2) - (parseInt(hei, 10)/2);
  var left = (parseInt(screen.width, 10)/2) - (parseInt(wid, 10)/2);
  
  calLayer('/join/find_pwd.asp', top, left, wid, hei);

}



// È¸¿øÁ¤º¸ º¸±â

function member_view (mbr_no, hei) {

  var top = 50;
  var left = 100;

  calLayer('/manager/member/member_view.asp?mbr_no='+mbr_no,top,left,540,hei);

}


function flashObj(src,w,h,id){ 
html = '';
html += '<object type="application/x-shockwave-flash"  classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 id="'+id+'" width="'+w+'" align="center" height="'+h+'">';  
html += '<param name="movie" value="'+src+'" />'; 
html += '<param name="quality" value="high" />'; 
html += '<param name="bgcolor" value="#ffffff" />';
html += '<param name="wmode" value="transparent" />';		
html += '<param name="menu" value="false" />';  
html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" menu="false" wmode="transparent" width="'+w+'"  height="'+h+'" swliveconnect="true" id="'+id+'" name="param" align="center" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> <\/embed>'; 
html += '<\/object>'; 
document.write(html);
}



//±âº» ·¹ÀÌ¾î ¼³Á¤!!!!!!!!!!!!!!!!!

function calLayer(url, po_top, po_lef, wid, hei) {

  var isb = chkBrowser();
  
  po_top = po_top-80;
  w = parseInt(wid);
  h = parseInt(hei);

  var pixelBorder = 3;
  var titleHeight = 25;
  w += pixelBorder * 2;
  h += pixelBorder * 2 + titleHeight;

  if (isb[0] == true) {
      var bodyW = document.body.clientWidth;
      var bodyH = document.body.clientHeight;
  }
  else {
      var bodyW = parseInt(document.body.innerWidth);
      var bodyH = parseInt(document.body.innerHeight);
  }

  var posX = (bodyW - w) / 2;
  var posY = (bodyH - h) / 2;

  hiddenselect('hidden');

  // ¹é±×¶ó¿îµå 
  var obj = document.createElement("div");
  with (obj.style){
	position = "absolute";
	left = 0;
	top = 0;
	width = document.body.scrollWidth;
    height = document.body.scrollHeight;
	backgroundColor = "#000000";
	filter = "Alpha(Opacity=30)";
  }

  obj.id = "PopupLayerBg";
  document.body.appendChild(obj);

  // ³»¿ëÇÁ·¹ÀÓ
  var obj = document.createElement("div");
  with (obj.style){
	position = "absolute";
	left = po_lef-250;
	top = po_top+50;
	width = w;
	height = h;
	backgroundColor = "#ffffff";
	padding = "0px 0 0 0";
	border = "3px solid #FFCE88";
  }
  
  obj.id = "PopupLayer";
  document.body.appendChild(obj);

  // close ¹Ù ·¹ÀÌ¾î 
  var bottom = document.createElement("div");
	
  with (bottom.style){
	position = "absolute";
	width = w - pixelBorder * 2;
	height = titleHeight + 3;		
	left = 0;
	top = h - titleHeight - pixelBorder * 3;	
	padding = "10px 10px 0 0";
	textAlign = "right";
	backgroundColor = "#ffffff";
	font = "bold 12px µ¸¿ò";
  }

  bottom.innerHTML = "<a href='javascript:closelayer()'><img src='/images/pop/close.gif'></a>";
  obj.appendChild(bottom);

  var ifrm = document.createElement("iframe");
  with (ifrm.style){
	width = parseInt(w - 6);
	height = parseInt(h - pixelBorder * 2 - titleHeight - 3);
  }

  ifrm.frameBorder = 0;
  ifrm.marginwidth = 0;
  ifrm.marginheight = 0;
  ifrm.scrolling="no";
  ifrm.src = url;   
  obj.appendChild(ifrm);
}



//iframe¿¡¼­ ·¹ÀÌ¾î ºÎ¸£±â ¼³Á¤!!!!!!!!!!!!!!!!!

function calLayerIframe(url, po_top, po_lef, wid, hei) {

 var isb = chkBrowser();
 po_top = po_top-80;
  w = parseInt(wid);
  h = parseInt(hei);

  var pixelBorder = 3;
  var titleHeight = 25;
  w += pixelBorder * 2;
  h += pixelBorder * 2 + titleHeight;

  if (isb[0] == true) {
      var bodyW = parent.document.body.clientWidth;
      var bodyH = parent.document.body.clientHeight;
  }
  else {
      var bodyW = parseInt(parent.document.body.innerWidth);
      var bodyH = parseInt(parent.document.body.innerHeight);
  }

  var posX = (bodyW - w) / 2;
  var posY = (bodyH - h) / 2;

  hiddenselect('hidden');

  // ¹é±×¶ó¿îµå 
  var obj = parent.document.createElement("div");
  with (obj.style){
	position = "absolute";
	left = po_lef;
	top = po_top;
	width = 0;
    height = parent.document.body.scrollHeight;
	filter = "Alpha(Opacity=50)";
  }

  obj.id = "iframePopupLayerBg";
  parent.document.body.appendChild(obj);

  // ³»¿ëÇÁ·¹ÀÓ
  var obj = parent.document.createElement("div");
  with (obj.style){
	position = "absolute";
	left = po_lef;
	top = po_top;
	width = w;
	height = h;
	backgroundColor = "#000000";
	padding = "0px 0 0 0";
	border = "3px solid #000000";
  }
  
  obj.id = "iframePopupLayer";
  parent.document.body.appendChild(obj);

  // close ¹Ù ·¹ÀÌ¾î 
  var bottom = parent.document.createElement("div");
	
  with (bottom.style){
	position = "absolute";
	width = w - pixelBorder * 2;
	height = titleHeight + 3;		
	left = 0;
	top = h - titleHeight - pixelBorder * 3;	
	padding = "7px 0 0 0";
	textAlign = "right";
	backgroundColor = "#000000";
	font = "bold 12px µ¸¿ò";
  }

  bottom.innerHTML = "<a href='javascript:iframecloselayer()'><img src='/images/login/login_img_close.gif'>&nbsp;<img src='/images/login/login_bt_close.gif'>&nbsp;</a>";
  obj.appendChild(bottom);

  var ifrm = parent.document.createElement("iframe");
  with (ifrm.style){
	width = parseInt(w - 6);
	height = parseInt(h - pixelBorder * 2 - titleHeight - 3);
  }

  ifrm.frameBorder = 0;
  ifrm.marginwidth = 0;
  ifrm.marginheight = 0;
  ifrm.scrolling="no";
  ifrm.src = url;   
  obj.appendChild(ifrm);
}

function closelayer() {
  calhiddenselect('visible');

  var isb = chkBrowser();

  if (isb[0] == true) {
     document.getElementById('PopupLayer').removeNode(true);
     document.getElementById('PopupLayerBg').removeNode(true);
  }
  else {
     var obj1 = document.getElementById('PopupLayer'); 
     var obj2 = document.getElementById('PopupLayerBg'); 

	 obj1.parentNode.removeChild(obj1);
	 obj2.parentNode.removeChild(obj2);
  }

}

function reloadcloselayer() {
  calhiddenselect('visible');

  var isb = chkBrowser();

  if (isb[0] == true) {
     document.getElementById('PopupLayer').removeNode(true);
     document.getElementById('PopupLayerBg').removeNode(true);
  }
  else {
     var obj1 = document.getElementById('PopupLayer'); 
     var obj2 = document.getElementById('PopupLayerBg'); 

	 obj1.parentNode.removeChild(obj1);
	 obj2.parentNode.removeChild(obj2);
  }
  location.reload();
}

function iframecloselayer() {
  calhiddenselect('visible');

  var isb = chkBrowser();

  if (isb[0] == true) {
     document.getElementById('iframePopupLayer').removeNode(true);
     document.getElementById('iframePopupLayerBg').removeNode(true);
  }
  else {
     var obj1 = document.getElementById('iframePopupLayer'); 
     var obj2 = document.getElementById('iframePopupLayerBg'); 

	 obj1.parentNode.removeChild(obj1);
	 obj2.parentNode.removeChild(obj2);
  }

}


function hiddenselect(mode) {
	var obj = document.getElementsByTagName('select');
	for (i=0;i<obj.length;i++){
		obj[i].style.visibility = mode;
	}
}

function bluring(){ 
  if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
 } 
 document.onfocusin=bluring; 


// ÄíÅ° ±Á±â

function setCookie(name, value, expiredays) {
  
  var todayDate = new Date();
  todayDate.setDate(todayDate.getDate() + expiredays);   
  document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"

}


// Äí±â °Ë»ö

function getCookieVal (offset) {

  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1) endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));

}


// ÄíÅ°ÀÐ±â

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  
  while (i < clen) {	//while open
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg) return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }	//while close
  
  return null;

}

function myLogOut() {

  result = confirm('·Î±×¾Æ¿ô ÇÏ½Ã°Ú½À´Ï±î?');

  if (result == true) {   
      new ajax.xhr.Request("/include/LogOut.asp", null, logOutResult, "POST");
  }

}


function logOutResult(req) {

  if (req.readyState == 4) {
	  if (req.status == 200) {

		  var docXML = req.responseXML;
		  var code = docXML.getElementsByTagName("code").item(0).firstChild.nodeValue;      // ¿¡·¯ÄÚµå        

          if (code == '90') {
			  top.window.location.href='/manager';
          }
		  else {
             alert('·Î±×¾Æ¿ô ½ÇÆÐ.');
		  }

     }
  }

}


// ÄíÅ° »èÁ¦

function deleteCookie(cookieName) {
   
  document.cookie = cookieName+"=; expires=Fri, 31 Dec 1999 23:59:59 GMT;";
}


// °øÅë ---- ·Î±×ÀÎ


function login_send() {

	if (IsEmpty(logForm.cid.value) == true) {
      alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
      logForm.cid.focus();
      return false;  
  }

  if (IsEmpty(logForm.pwd.value) == true) {
      alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
      logForm.pwd.focus();
      return false;  
  }


  var params  = "cid=" + escape(logForm.cid.value) + "&pwd=" + escape(logForm.pwd.value)
  params += "&returnUrl=/manager/main.asp";

  new ajax.xhr.Request("/include/loginProcess.asp", params, loginResult, "POST");

  return false; 


}

function loginResult(req) {

	if (req.readyState == 4) {
	  if (req.status == 200) {
			
		  var docXML = req.responseXML;
		  var code = docXML.getElementsByTagName("code").item(0).firstChild.nodeValue;   // ¿¡·¯ÄÚµå        

          if (code == '10') {
              window.alert('¾ÆÀÌµð/ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
          }
		  else if (code == '20') {
              window.alert('¾ÆÀÌµð/ºñ¹Ð¹øÈ£°¡ ¸ÂÁö ¾Ê½À´Ï´Ù.');
			  logForm.cid.value = '';
			  logForm.pwd.value = '';
			  logForm.cid.focus();
          }
		  else if (code == '30') {
              window.alert('ºñ¹Ð¹øÈ£°¡ ¸ÂÁö ¾Ê½À´Ï´Ù.');
			  logForm.pwd.value = '';
			  logForm.pwd.focus();
          }
		  else if (code == '90') {
			  var returnUrl = docXML.getElementsByTagName("returnUrl").item(0).firstChild.nodeValue;
              window.location.href=returnUrl;             
          }
		  else {
              window.alert('¾Ë¼ö ¾ø´Â ¿¡·¯');
          }
     }
  }


}

//¿øº»ÀÌ¹ÌÁö»çÀÌÁî »õÃ¢
function view(what) {
var imgwin = window.open("",'WIN','scrollbars=no,left=50,top=0,width=5,height=5,status=no');
imgwin.focus();
imgwin.document.open();
imgwin.document.write("<html>\n");
imgwin.document.write("<head>\n");
imgwin.document.write("<title>¢Æ ´ëÇÑÁÙ³Ñ±âÇùÈ¸ ÇÑ±¹ÁÙ³Ñ±â±³À°¿ø www.jumprope.co.kr ¢Æ</title>\n");
imgwin.document.write("<META HTTP-EQUIV='imagetoolbar' CONTENT='no'>\n");

imgwin.document.write("<sc"+"ript>\n");
imgwin.document.write("function resize() {\n");
imgwin.document.write("pic = document.il;\n");
imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n");
imgwin.document.write("  if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 50; myWidth = eval(pic).width + 11;\n");
imgwin.document.write("  } else { myHeight = eval(pic).height + 9; myWidth = eval(pic).width; }\n");
imgwin.document.write("  clearTimeout();\n");
imgwin.document.write("  var height = screen.height;\n");
imgwin.document.write("  var width = screen.width;\n");
imgwin.document.write("  self.resizeTo(myWidth, myHeight);\n");
imgwin.document.write("}else setTimeOut(resize(), 100);}\n");
imgwin.document.write("</sc"+"ript>\n");

imgwin.document.write("</head>\n");
imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n');

imgwin.document.write("<a href='javascript:self.close();'><img border=0 src="+what+" xwidth=100 xheight=9 name=il onload='resize();'></a>\n");
imgwin.document.write("</body>\n");
imgwin.document.close();

}

 /*--------------------------------------------------------------------------*
  * void openPageCenter(url, wname, width, height)
  * »õÃ¢À¸·Î °¡¿îµ¥·Î url ¿­±â 
  * È£È¯ : Firefox(x)
  *--------------------------------------------------------------------------*/
  function openPageCenter (url, wname, width, height) {

	  var screenWidth  = screen.availwidth;
	  var screenHeight = screen.availheight;
	  
	  var intLeft = (screenWidth - width) / 2;
	  var intTop  = (screenHeight - height) / 2;

	  window.open(url, wname, 'scrollbars=no,resizable=no,top='+intTop+',left='+intLeft+',width='+width+',height='+height);
  }

/*main...-------------------- table º¸±â ¹Ù²Ù±â----------------*/
 function change_div(div, tit, a, cnt){

	  for(var i = 1; i <= cnt; i++){
		  if (i == a)
		  {  
			document.getElementById(div+a).style.display = 'block';
			document.getElementById(tit+a).style.fontWeight= 'bold';
		  }else{
			document.getElementById(div+i).style.display = 'none';
			document.getElementById(tit+i).style.fontWeight = '';
		  }

	  }

 }

 /*main...-------------------- table º¸±â ¹Ù²Ù±â----------------*/
 function change_div2(div, a, cnt){

	  for(var i = 1; i <= cnt; i++){
		  if (i == a)
		  {  
			document.getElementById(div+a).style.display = 'block';
		  }else{
			document.getElementById(div+i).style.display = 'none';
		  }

	  }

 }
