function delconf(murl)
{
	if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
	{
		window.location = murl;
	}
}

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];}
}

function MM_showHideLayers() { //v3.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; }
}

//----------------------  ¸Þ´º¹Ù --------------------------
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();
}
MM_reloadPage(true);

var isNN = (navigator.appName.indexOf("Netscape")!=-1);


function bluring() { 
	if (event.srcElement.tagName=="A" || event.srcElement.tagName=="IMG") document.body.focus();
}
//document.onfocusin = bluring;


String.prototype.trim = function() {
	return (this.replace(/^\s+|\s+$/g, ""));
}

String.prototype.ltrim = function() {
	return this.replace(/^\s+/, "");
}

String.prototype.rtrim = function() {
	return this.replace(/\s+$/, "");
}

// flash(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, À©µµ¿ì¸ðµå, ¾ÆÀÌµð, ¹è°æ»ö, º¯¼ö)
function flash(url, w, h, win, id, bg, vars)
{
	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr =	"";
	flashStr += '<object width="' + w + '" height="' + h + '" align="middle"';
	if (id) flashStr += ' id="' + id + '"';
	flashStr += ' classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';
	flashStr += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">';
	flashStr += '<param name="allowScriptAccess" value="always" />';
	flashStr += '<param name="movie" value="' + url + '" />';
	flashStr += '<param name="menu" value="false" />';
	flashStr += '<param name="quality" value="high" />';
	if (win) flashStr += '<param name="wmode" value="' + win + '" />';
	if (bg) flashStr += '<param name="bgcolor" value="' + bg + '" />';
	if (vars) flashStr += '<param name="FlashVars" value="' + vars + '" />';
	flashStr += '<embed src="' + url + '" width="' + w + '" height="' + h + '"';
	flashStr += ' menu="false" quality="high" align="middle" allowScriptAccess="always"';
	flashStr += ' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"';
	if (win) flashStr += ' wmode="' + win + '"';
	if (id) flashStr += ' name="' + id + '"';
	if (bg) flashStr += ' bgcolor="' + bg + '"';
	if (vars) flashStr += ' FlashVars="' + vars + '"';
	flashStr += ' />';
	flashStr += '</object>';
	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
}
// embed
function aviPlay(src, w, h) {
	document.write('<embed src="' + src + '" width="' + w + '" height="' + h + '">');
}

// ÆÄÀÏ È®ÀåÀÚ ±¸ÇÏ±â
function getExt(theForm)
{
	var fname = theForm.value;
	sp_arry = fname.split(".");
	sp_einx = sp_arry.length - 1;
	sp_arry[sp_einx] = sp_arry[sp_einx].toLowerCase();

	return sp_arry[sp_einx];
}

function getRealOffsetTop(o) {
	return o ? o.offsetTop + getRealOffsetTop(o.offsetParent) : 0;
}
function getRealOffsetLeft(o) {
	return o ? o.offsetLeft + getRealOffsetLeft(o.offsetParent) : 0;
}

//----------Àü¼Û Ã¼Å© ------------------------
function submit_check() {
	if(document.check_attack.check.value == 1) {
		alert("Áö±Ý Ã³¸®ÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁÖ½Ê½Ã¿À.");
		return true;
	}
	return false;
}
//----------Àü¼Û ¿ÀÄÉÀÌ ------------------------
function submit_ok() {
	document.check_attack.check.value = 1;
}

// ÄÁÆß¸Þ¼¼Áö Ãâ·Â ÈÄ ÀÌµ¿
function conf_url(msg,murl) {
	if(confirm(msg)) window.location = murl;
}

// ¿ìÆí¹øÈ£ Ã£±â
function goZipsearch(zip_gubun, formName) {
	var page = "/zip_search.html?zip_gubun=" + zip_gubun;
	popen(page,'ZipSearch','500','225','yes','center');
}

// º´¿ø Ã£±â
function goHospsearch(hosp_gubun, formName) {
	var page = "/hosp_search.html?hosp_gubun=" + hosp_gubun;
	popen(page,'HospSearch','500','225','yes','center');
}

//----------------- chk***() °¢Á¾ °Ë»ç ÇÔ¼ö ----------------------//

// ·Î±×ÀÎ °Ë»ç
function chkLogin(f) {
	if (chkBlank_msg(f.id,"Enter your ID.")) return false;
	if (chkNull_msg(f.pwd,"Enter your PASSWORD.")) return false;
	return true;
}
// °Ë»ö
function chkSearch(f) {
	//if (chkBlank_msg(f.key,"°Ë»öÁ¶°ÇÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä")) return false;
	if (chkBlank_msg(f.keyword,"°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä")) return false;
	return true;
}

// ºó°ª °Ë»ç (°ø¹éÀ» Á¦¿ÜÇÏ°í ºó°ªÀÌ¸é true ¾Æ´Ï¸é false)
function chkBlank(box) { // box´Â object ex) input, textarea
	var valid = box.value.replace(/\s/gi,"");
	if (valid=="") return true;
	return false;
}

// ºó°ª °Ë»ç (¸Þ¼¼Áö Ãâ·Â / °ø¹éÀ» Á¦¿ÜÇÏ°í ºó°ªÀÌ¸é true ¾Æ´Ï¸é false)
function chkBlank_msg(box, msg) {
	var valid = box.value.replace(/\s/gi,"");
	if (valid=="") {
		if (!msg) msg = "ºó °ªÀÔ´Ï´Ù. °ªÀ» ÀÔ·ÂÇÏ¼¼¿ä.";
		alert(msg); box.focus();
		return true;
	}
	return false;
}

// ºó°ª °Ë»ç (°ø¹éÀ» Á¦¿ÜÇÏÁö ¾Ê°í ºó°ªÀÌ¸é true ¾Æ´Ï¸é false)
function chkNull(box) { // box´Â object ex) input, textarea
	if (box.value=="") return true;
	return false;
}

// ºó°ª °Ë»ç (¸Þ¼¼Áö Ãâ·Â / °ø¹éÀ» Á¦¿ÜÇÏÁö ¾Ê°í ºó°ªÀÌ¸é true ¾Æ´Ï¸é false)
function chkNull_msg(box, msg) {
	if (box.value=="") {
		if (!msg) msg = "ºó °ªÀÔ´Ï´Ù. °ªÀ» ÀÔ·ÂÇÏ¼¼¿ä.";
		alert(msg);
		box.focus();
		return true;
	}
	return false;
}

// ¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏ°Ô
function chkInputNum() {
	if (event != null) {
		var key = event.keyCode;
		if ((key!=13) && (key<48 || key>57)) {
			event.returnValue = false;
			return;
		}
	}
	return;
}

// ¼ýÀÚ°¡ µé¾îÀÖ´ÂÁö °Ë»ç (¼ýÀÚ°¡ µé¾îÀÖÀ¸¸é true ¼ýÀÚ°¡ ¾Èµé¾îÀÖÀ¸¸é false)
function chkNumeric(s) {
	var isNum = /\d/;
	if ( !isNum.test(s) ) return false;
	return true;
}

// ¼ýÀÚÇü½Ä °Ë»ç (ÀüºÎ¼ýÀÚ¸é true ¼ýÀÚ¾Æ´Ñ ¹®ÀÚ°¡ ÀÖÀ» °æ¿ì false)
function chkNum(box) {
	var isNum = /^[\d]+$/;
	if ( box.value.search(isNum) ) return false;
	return true;
}

// ¼ýÀÚ Çü½Ä °Ë»ç (¸Þ¼¼Áö Ãâ·Â / Æ¯¼ö¹®ÀÚ Á¦°Å / type==1 ÀÌ¸é ¾Õ¿¡¿À´Â 0 Á¦°Å : 000012 -> 12)
function chkNum_msg(box,type) {
	var valid = "0123456789";
	if (box.value == '') return;
	var len = box.value.length;

	for (var i=0; i<len; i++) {
		if (valid.indexOf(box.value.charAt(i)) == -1) {
			alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä");
			box.value = box.value.substring(0, i); box.focus();
			if(type==2){
				box.value=1;
			}
			return;
		}
	}
	if (type==1) {
		var result, ch, flag=0;
		if (len == 0 || box.value == "0" || box.value.charAt(0) != "0") return;
		for (var z=0; z<len; z++) {
			ch = box.value.charAt(z);
			if (ch=="0") {continue;} else {flag=1; box.value = box.value.substring(z); break;}
		}
		if (flag==0) box.value=0;
	}

	if (type==2) {
		
		if (box.value==0) box.value=1;
	}
	
}

// °ø¹é(½ºÆäÀÌ½º)°Ë»ç (°ø¹éÀÌ ÀÖÀ¸¸é true ¾øÀ¸¸é false)
function chkSpace(strText) {
	return (strText.search(/\s/) != -1);
}

// Ã¹±ÛÀÚ ¿µ¹® °Ë»ç (Ã¹±ÛÀÚ°¡ ¿µ¹®¼Ò¹®ÀÚÀÌ¸é true ¾Æ´Ï¸é false)
function chkOnechar(strText) {
	var isEng = (/^[a-z]*$/g).test(strText.charAt(0));
	if (!isEng) return false;
	return true;
}

// ¿µ¹® Çü½Ä °Ë»ç (¿µ¹®ÀÌ¸é(°ø¹éÀÎÁ¤) true ¾Æ´Ï¸é false)
function chkEng(strText) {
	var isEng;
	for (var i=0; i<strText.length; i++) {
		isEng = (/^[a-zA-Z\s]*$/g).test(strText.charAt(i));
		if (!isEng) return false;
	}
	return true;
}

// ÇÑ±Û°Ë»ç (ÀüºÎÇÑ±ÛÀÌ¸é true ¾Æ´Ï¸é false)
function chkHangul(strText) {
	for (var i=0; i<strText.length; i++) {
		if (strText.charCodeAt(i)<0xAC00 || strText.charCodeAt(i)>0xD7A3) {
			if ((strText.charCodeAt(i)<12593 || strText.charCodeAt(i)>12643 ) && (strText.charCodeAt(i) != 32)) return false;
		}
	}
	return true;
}

// ¶óµð¿À¹öÆ° Ã¼Å© (¼±ÅÃµÈ °ÍÀÌ true ¾Æ´Ï¸é false)
function chkRadio(box) {
	for (var i=0; i<box.length; i++) { if (box[i].checked) return true; }
	return false;
}

// ¶óµð¿À¹öÆ° Ã¼Å© (¼±ÅÃµÈ °ÍÀÌ ÀÖÀ¸¸é false ¼±ÅÃµÈ °ÍÀÌ ¾øÀ¸¸é true°ª ¸®ÅÏÇÏ°í ¸Þ¼¼Áö Ãâ·Â)
function chkRadio_msg(box, msg) {
	var cnt = 0;
	for (var i=0; i<box.length; i++) {
		if (box[i].checked) return false;
	}
	if (!msg) msg = "Please check payment.";
	alert(msg);
	box[0].focus();
	return true;
}

function Check_radio(ChkName,intChkNum) {
	var f = document.mail_frm;
	var max = eval("f." + ChkName + ".length");
	for (var j=0; j<max; j++) {
		if (intChkNum != j) {
			eval("f." + ChkName + "[" + j + "].checked = false;");
		}
	}
}

// ÀÌ¸ÞÀÏ Çü½Ä °Ë»ç (¸ÂÀ¸¸é true Æ²¸®¸é false)
function chkEmail(box) {
	if (chkBlank_msg(box,"Please enter the E-mail address")) return false;
	if (chkSpace(box.value)) {
		alert("Invalid E-mail address.");
		box.value = box.value.replace(/\s/gi,"");
		box.focus(); box.select(); return false;
	}
	var email_exp = /^[-!#$%&\'*+\\./0-9=?A-Z^_a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_a-z{|}~]+$/;
	if (!email_exp.test(box.value)) {
		alert("Invalid E-mail address.");
		box.focus(); box.select(); return false;
	}
	return true;
}

function chkEmail2(box1,box2) {
	if (chkBlank_msg(box1,"ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä")) return false;
	if (chkBlank_msg(box2,"ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä")) return false;
	if (chkSpace(box1.value)) {
		alert("ÀÌ¸ÞÀÏÀº °ø¹é¾øÀÌ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		box1.value = box1.value.replace(/\s/gi,"");
		box1.focus(); box1.select(); return false;
	}
	if (chkSpace(box2.value)) {
		alert("ÀÌ¸ÞÀÏÀº °ø¹é¾øÀÌ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		box2.value = box2.value.replace(/\s/gi,"");
		box2.focus(); box2.select(); return false;
	}
	var email_exp = /^[-!#$%&\'*+\\./0-9=?A-Z^_a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_a-z{|}~]+$/;
	if (!email_exp.test(box1.value + "@" + box2.value)) {
		alert("ÀÌ¸ÞÀÏ Çü½ÄÀÌ Á¤È®ÇÏÁö ¾Ê½À´Ï´Ù.");
		box1.focus(); box1.select(); return false;
	}
	return true;
}

function chkEmail_select(a, obj) {
	if (obj.value=="Á÷Á¢ÀÔ·Â") {
		a.readOnly = false;
		a.value = "";
		a.focus();
	} else {
		a.readOnly = true;
		a.value = obj.value;
	}
}

// ÆÄÀÏ¸í Ã¼Å©
function chkFileName(obj) {
	var str = obj.value;
	var file_name_ar = str.split("\\");
	var file_name = file_name_ar[file_name_ar.length-1];
	var file_name_len = str.length;

	if (file_name_len>255) {
		alert("ÆÄÀÏ¸íÀÌ ³Ê¹« ±é´Ï´Ù.");
		obj.focus();
		return false;
	}
	var filter = /¢ç|\'|\"|\<|\>|\||\?|\/|:|\+|\&|\*/g; //Æ¯¼ö¹®ÀÚÆÐÅÏ
	if (filter.test(file_name)) {
		alert("ÆÄÀÏ¸í¿¡ Çã¿ëµÇÁö ¾Ê´Â Æ¯¼ö¹®ÀÚ°¡ µé¾îÀÖ½À´Ï´Ù.");
		obj.focus();
		return false;
	} else {
		return true;
	}
}

// ÀüÈ­¹øÈ£(ÇÚµåÆù,ÆÑ½ºÆ÷ÇÔ) Ã¼Å© (ÀüÈ­¹øÈ£°¡ ÀÌ»óÇÏ¸é true ¾ÈÀÌ»óÇÏ¸é false)
function chkTel_msg(a, b, c, target) {
	var tel = new Array("02","031","032","033","041","042","043","051","052","053","054","055","061","062","063","064","010","011","016","017","018","019");
	var pcs = new Array("010","011","016","017","018","019");

	var isNum = /^[\d]+$/;
	var a_len = a.value.length;
	var b_len = b.value.length;
	var c_len = c.value.length;
	var msg1 = target + "¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.";
	var msg2 = target + "¹øÈ£ ÀÚ¸´¼ö¸¦ È®ÀÎÇÏ¼¼¿ä.";
	if (target == "¿¬¶ôÃ³") {
		var msg1 = target + "¸¦ ÀÔ·ÂÇÏ¼¼¿ä.";
		var msg2 = target + " ÀÚ¸´¼ö¸¦ È®ÀÎÇÏ¼¼¿ä.";
	}

	if (chkBlank_msg(a,msg1)) return true;
	if (a.value.search(isNum)) { alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.") ; a.value=""; a.focus() ; return true ; }
	if (a_len<2 || a_len>3) { alert(msg2); a.focus(); return true; }
	if (target=="ÇÚµåÆù") var limit = pcs.length;
	else var limit = tel.length;

	var cnt=0;
	for (var i=0; i<limit; i++) {
		if (target=="ÇÚµåÆù") { if (a.value==pcs[i]) cnt++; }
		else { if (a.value==tel[i]) cnt++; }
	}
	if (cnt==0) { alert("Àß¸øµÈ ¹øÈ£ÀÔ´Ï´Ù."); a.value=""; a.focus(); return true; }

	if (chkBlank_msg(b,msg1)) return true;
	if (b.value.search(isNum)) { alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.") ; b.value=""; b.focus() ; return true ; }
	if (b_len<3 || b_len>4) { alert(msg2); b.focus(); return true; }

	if (chkBlank_msg(c,msg1)) return true;
	if (c.value.search(isNum)) { alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.") ; c.value=""; c.focus() ; return true ; }
	if (c_len!=4) { alert(msg2); c.focus(); return true; }
	return false;
}

// ÆË¾÷Ã¢ ¶ç¿ì±â
function popen(url,name,w,h,scroll,pos,res) { // (°æ·Î,ÀÌ¸§,°¡·Î,¼¼·Î,½ºÅ©·ÑÀ¯¹«,À§Ä¡,¸®»çÀÌÁî)
	if (!scroll) scroll = "yes";
	if (!pos) pos = "center";
	if (!res) res = "no";

	switch (pos) {
		case 'center' :
			LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100;
			TopPosition = (screen.height) ? (screen.height - h - 100) / 2 : 100;
			break;
		case "random" :
			LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width - w)) : 100;
			TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height - h) - 75)) : 100;
			break;
		default :
			LeftPosition=0;
			TopPosition=0;
			break;
	}
	if(name == "report_mail"){
		if(confirm("Would you like to send the e-mail?")){	
		}else{
			return;
		}
	}
	
	var settings = 'width=' + w + ', height=' + h + ', top=' + TopPosition + ', left=' + LeftPosition + ', scrollbars=' + scroll + ', location=no, directories=no, status=no, menubar=no, toolbar=no, resizable=' + res;
	win = window.open(url,name,settings);
	if (win.focus) win.focus();
}

//----------------------- »õÃ¢ ¶ç¿ì±â(½ºÅ©·Ñ¹Ù À¯) ----------------------------
function Win_scroll(theURL,wide,high) {
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	var win = window.open(theURL,"Newwin",'width='+wide+',height='+high+',scrollbars=yes,resizable=no,top=' + window_top + ',left=' + window_left + '');
	win.focus();
}

//----------------------- »õÃ¢ ¶ç¿ì±â(½ºÅ©·Ñ¹Ù ¹«) ----------------------------
function Win_mu(theURL,wide,high) {
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open(theURL,"Newwin",'width='+wide+',height='+high+',scrollbars=no,resizable=no,top=' + window_top + ',left=' + window_left + '');
}


// tagNameÀ¸·Î Parent Object ¾ò±â - 2007-08-25 By Hss
function findParentObjByTagName(o, tag)
{
	tag = tag.toUpperCase();
	if (typeof(o) != "object") return null;
	if (o.parentNode == null) return null;
	if (o.parentNode.tagName == "undefined") return null;
	return (o.parentNode.tagName == tag) ? o.parentNode : findParentObjByTagName(o.parentNode, tag);
}

// °Ô½Ã¹° ÀüÃ¼¼±ÅÃ
function CheckAll(o, tag)
{
	var flag = o.checked;
	var obj = findParentObjByTagName(o, tag);
	if (typeof(obj)=="object")
	{
		if (flag) {
			markAllRows(obj);
		} else {
			unMarkAllRows(obj);
		}
	}
}


var marked_row = new Array;

function tableRowsInit()
{
	var rows = document.getElementsByTagName('tr');
		
	for ( var i = 0; i < rows.length; i++ )
	{
		if ( 'odd' != rows[i].className.substr(0,6) && 'even' != rows[i].className.substr(0,7) && 'delayed' != rows[i].className.substr(0,7) ) {
			continue;
		}
		if ( navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf('MSIE 6') != -1 ) {
			// but only for IE, other browsers are handled by :hover in css
			rows[i].onmouseover = function() {
				this.className += ' hover';
			}
			rows[i].onmouseout = function() {
				this.className = this.className.replace( ' hover', '' );
			}
		}
		
		// ... and to mark the row on click ...
		rows[i].onmousedown = function() {
			var unique_id;
			var checkbox;

			checkbox = this.getElementsByTagName( 'input' )[0];
			if ( checkbox && checkbox.type == 'checkbox' ) {
				 unique_id = checkbox.name + checkbox.value;
			} else if ( this.id.length > 0 ) {
				 unique_id = this.id;
			} else {
				 return;
			}

			if ( typeof(marked_row[unique_id]) == 'undefined' || !marked_row[unique_id] ) {
				 marked_row[unique_id] = true;
			} else {
				 marked_row[unique_id] = false;
			}

			if ( marked_row[unique_id] ) {
				 this.className += ' marked';
			} else {
				 this.className = this.className.replace(' marked', '');
			}

			if ( checkbox && checkbox.disabled == false ) {
				 checkbox.checked = marked_row[unique_id];
			}
		}

		// .. and checkbox clicks
		var checkbox = rows[i].getElementsByTagName('input')[0];
		if ( checkbox && checkbox.type == "checkbox" ) {
			checkbox.onclick = function() {
				 // opera does not recognize return false;
				 this.checked = ! this.checked;
			}
		}
	}
}

/** from phpMyAdmin
 * marks all rows and selects its first checkbox inside the given element
 * the given element is usaly a table or a div containing the table or tables
 *
 * @param    container    DOM element
 */
function markAllRows( obj ) {
	var rows = obj.getElementsByTagName('tr');
	var unique_id;
	var checkbox;
	for ( var i = 1; i < rows.length; i++ )
	{
		checkbox = rows[i].getElementsByTagName( 'input' )[0];
		if ( checkbox && checkbox.type == 'checkbox' )
		{
			unique_id = checkbox.name + checkbox.value;
			if ( checkbox.disabled == false )
			{
				checkbox.checked = true;
				if ( typeof(marked_row[unique_id]) == 'undefined' || !marked_row[unique_id] )
				{
					rows[i].className += ' marked';
					marked_row[unique_id] = true;
				}
			}
		}
	}
}

/** from phpMyAdmin
 * marks all rows and selects its first checkbox inside the given element
 * the given element is usaly a table or a div containing the table or tables
 *  
 * @param    container    DOM element
 */ 
function unMarkAllRows( obj ) {
	var rows = obj.getElementsByTagName('tr');
	var unique_id;
	var checkbox;
	for ( var i = 1; i < rows.length; i++ )
	{
		checkbox = rows[i].getElementsByTagName( 'input' )[0];
		if ( checkbox && checkbox.type == 'checkbox' )
		{
			unique_id = checkbox.name + checkbox.value;
			checkbox.checked = false;
			rows[i].className = rows[i].className.replace(' marked', '');
			marked_row[unique_id] = false;
		}
	}
}


// Ã·ºÎÆÄÀÏ ÇÊµå Ãß°¡
function addFileFields(id, field, lim, imgsrc)
{
	var tbl = document.getElementById(id); // Å×ÀÌºíÁöÁ¤
	var rows = tbl.rows.length; // Çà °¹¼ö
	if (lim && rows >= lim) {
		alert("Ã·ºÎÆÄÀÏÀº ÃÖ´ë " + lim + "°³ ±îÁö ÀÔ´Ï´Ù."); return;
	}
	var newRow = tbl.insertRow(rows); // Å×ÀÌºí¿¡ ÇÑÁÙ Ãß°¡
	var f = document.frmBoard;
	var limObj = eval("f." + field + "_lim");
	limObj.value = parseInt(limObj.value) + 1; // ·À½º Áõ°¡
	var field_name = field + "_" + limObj.value;

	newRow.id = id + "_" + limObj.value;
	var newCell = newRow.insertCell(0);
	newCell.innerHTML = '<input type="file" name="' + field_name + '" class="form_line" size="40" />';
	
	var del_icon = '<span style="color:red">[»èÁ¦]</span>';
	if (imgsrc) {
		del_icon = '<img src="' + imgsrc + '" align="absmiddle" />';		
	}
	newCell.innerHTML += ' <a href="javascript:bbsDelFileFields(\'' + id + '\', \'' + newRow.id + '\')">' + del_icon + '</a>';
}
// Ã·ºÎÆÄÀÏ ÇÊµå »èÁ¦
function delFileFields(id, rid)
{
	var tbl = document.getElementById(id); // Å×ÀÌºíÁöÁ¤
	var this_rows = document.getElementById(rid); // ¿­ÁöÁ¤
	var idx = this_rows.rowIndex;
	tbl.deleteRow(idx);
}

// ÄÚ¸àÆ® Ã¼Å©
function chkComment(f) {
	if (typeof(f.name)=="object") { if (chkBlank_msg(f.name,"ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä")) return false; }
	if (typeof(f.comment)=="object") { if (chkBlank_msg(f.comment,"³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä")) return false; }
	return true;
}

//-----------------------Ã¼Å©¹Ú½º ¶óµð¿À¹öÆ° Ã¼Å© ----------------------------
function Check_radio(ChkName,intChkNum) {
	var f = document.mail_frm;
	var max = eval("f." + ChkName + ".length");
	for (var j=0; j<max; j++) {
		if (intChkNum != j) {
			eval("f." + ChkName + "[" + j + "].checked = false;");
		}
	}
}

function isEmail(str) {
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported)
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  return (!r1.test(str) && r2.test(str));
}

function cbxToRadio(o) {
	if (o.checked) {
		var obj = document.getElementsByName(o.name);
		for (var i=0; i<obj.length; i++) {
			obj[i].checked = false;
		}
		o.checked = true;
	}
}