/**
* ÀüÃ¼ Àü¿ª JAVASCRIPT
*
* @build 2005-12-10
* @author Heo Kang Hyun
* @copyright Copyright (c)2005 Zeldign Network System , All rights Reserved.
*
1. ¾Æ·¡ ÄÚµåÀÇ ¶óÀÌ¼¾½ºÀÇ ±ÇÇÑÀº Áö¾Ø¿¡½º(ZNS) ¿Í °¢ °³¹ßÀÚµé¿¡°Ô ÀÖ½À´Ï´Ù.
   ÄÚµåÀÇ Ãß°¡µÈÁ¤º¸ ¶ÇÇÑ À§¿Í °°´Ù.
   °³¹ßÀÚ´Â @author Ç×¸ñÀ» Ãß°¡ÇÏ¿© µî·ÏÇÑ´Ù.

2. °³¹ßµÈ ¶óÀÌºê·¯¸®ÀÇ »ç¿ëÀº ¶óÀÌ¼¾½º±ÇÇÑÀÚ¿¡°Ô Çã¶ôÀ» µæÇÑÈÄ¸é »ç¿ëÀ» Çã°¡ÇÕ´Ï´Ù.
3. °³¹ßµÈ ÄÚµåÀÇ ÀÏºÎ¸¸À» º¯°æ(º¯¼ö È¤Àº ÇÔ¼öÀÇ °´Ã¼È­µî)ÇÏ¿© »ç¿ë½Ã¿¡µµ 2Á¶ÀÇ Ç×¸ñÀ» ÃëµæÇØ¾ß ÇÕ´Ï´Ù.
     ´Ü, ¹ü¿ëÀûÀÎ ºÎºÐÀÎ °æ¿ì´Â ¿¹¿Ü·Î Á¤ÇÕ´Ï´Ù. ( ¿¹ :  window.clipboardData.setData ¿Í °°Àº ¹ü¿ëÀûÀÎ ÇÔ¼ö È¤Àº °´Ã¼)

4. À§ÀÇ Á¶Ç×À» °®ÃßÁö ¾ÊÀº »çÇ×¿¡ ´ëÇØ¼± ºÒ¹ý»ç¿ëÀ¸·Î °£ÁÖÇÏ°Ô µÇ¸é ¹Î,Çü»ç»ó ¼ÕÇØ¹è»óÃ»±¸¸¦ ÇÒ¼ö ÀÖ½À´Ï´Ù.
*/



cashflow = function(){this.initialize(arguments[0] , arguments[1] , arguments[2]);};
cashflow.prototype = {
	
		'cash' : 0,
		'point' : 0,
		'mile' : 0,

		initialize : function(){
			var arg = arguments;
			this.cash = parseInt(arg[0]);
			this.point = parseInt(arg[1]);
			this.mile = parseInt(arg[2]);
		},
		valid : function(vls , comp){
			vls = parseFloat(vls);
			var compare = 0;
			switch(comp){
				case 'cash' :
					compare = this.cash;
				break;
				case 'point' :
					compare = this.point;
				break;
				case 'mile' :
					compare = this.mile;
				break;
			}
			return vls > compare ? false : true;
		}
}

/**
* @content µ¥ÀÌÅ¸Ã³¸®
*/
function cal_byte(vls , tbyteobj , tnumobj){

	var tmpStr;
	var temp=0;
	var onechar;
	var tcount;
	tcount = 0;
	 
	tmpStr = new String(vls);
	temp = tmpStr.length;
	var cutmsg="";
	for (k=0 ; k<temp ; k++){

		onechar = tmpStr.charAt(k);
		if (escape(onechar).length > 4) tcount += 2;
		else if (onechar!='\r') ++tcount;
	}
	
	tbyteobj.value = tcount;
	if(parseInt(tcount%78) == 0) tnumobj.value = parseInt(tcount/78);
	else tnumobj.value = parseInt(tcount/78)+1;
}



/*

var needle = "»ç¶÷";
var haystack = Array("ºñ" , "¿°¼Ò" , "¿©ÀÚ" , "»ç¶÷");
var come = in_array(needle , haystack , 2);

alert(come);
*/


function in_array(needle , haystack , zone) {

	/* Javascript in_array */

	var switch_z;
	var flag = 0;
	var stop = haystack.length ? haystack.length : 1;
	zone = zone ? zone : 1;


	for (no = 0; no < stop ; no++) {

		if(typeof haystack[no] == 'string') {

			if (haystack[no] == needle) {

					flag++;
					if(zone == flag) {
						switch_z = true;
						break;
					}

				}

		}
		else {

			if (haystack[no].value == needle) {

					flag++;
					if(zone == flag) {
						switch_z = true;
						break;
					}

				}

		}

	}




	if(zone > 1) {

		if(switch_z == true) return parseInt(flag);
			else return false;
	
	}
	else {

		if(switch_z == true) return true;
			else return false;

	}
	
	return false;
}



/**
* @content %¿¡ ¸Â´Â °¡°Ý±¸ÇÏ±â
*
*/
function percent2price(total , percent){
	if((total == 0 || total == "")){
		alert('ÀüÃ¼±Ý¾×ÀÌ 0À¸·Î µÇ¾î ÀÖ½À´Ï´Ù. Àû¸³±ÝÀº Àû¿ëµÇÁö ¾Ê½À´Ï´Ù.');
		return 0;
	} 
	return parseInt(total * percent / 100);
}
/**
* @content %±¸ÇÏ±â
*
*/
function price2percent(total , perpr){

	if((total == 0 || total == "" || perpr == 0 || perpr == "")){
		alert('ÀüÃ¼±Ý¾× È¤Àº ºÎºÐ±Ý¾×ÀÌ 0À¸·Î µÇ¾î ÀÖ½À´Ï´Ù. Àû¸³±ÝÀº Àû¿ëµÇÁö ¾Ê½À´Ï´Ù.');
		return 0;
	} 
	return  round(perpr / total * 100 , 3);
}

/**
* @content ¼Ò¼öÁ¡ 2ÀÚ¸®¸¸ Ç¥½Ã
*/
function round(val, pos){

	var rtn;
	rtn = Math.round(val * Math.pow(10, Math.abs(pos)-1));
	rtn = rtn / Math.pow(10, Math.abs(pos)-1);
	return rtn;
}


/**
* @content ¹è¿­Å°Á¤º¸¹ÝÈ¯
*
*/
function array_keys(obj){

	var retdata = new Array();
	var i =0;
	for(var objkey in obj){
	
		retdata[i] = objkey;
		++i;
	}
	return retdata;
}


/**
* @content IEÆÐÄ¡¿¡ µû¸¥ OBJECTÈ°¼ºÈ­°´Ã¼ 
* @author Zeldign
*/
function igear_objstart(url , size , id){
	
	this.init(url , size , id);
}

igear_objstart.prototype.init = function( url , size , id){

	this.url = url;
	if(typeof(size) != "undefined"){
		this.size = size.split(",");
		this.setparam('width',this.size[0]);
		this.setparam('height',this.size[1]);
	}else{
		this.size = new Array('','');
	}
	this.param = new Array();
	this.codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0";
	this.classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000";
	this.paramsplit = "->";
	this.setparam('allowScriptAccess','sameDomain');
	this.setparam('quality','high');
	this.setparam('bgcolor','#ffffff');
	this.setparam('autostart','true');
	this.setparam('movie',this.url);
	this.setparam('src',this.url);
	this.tags = new Array();
	this.setobject(id);
}
igear_objstart.prototype.setparam = function(nm , vls , key){

	if(typeof(key) == "undefined") key = this.param.length;
	this.param[key] = nm + this.paramsplit + vls;
}
igear_objstart.prototype.setobject = function(id){

	if(typeof id == "undefined") id = "";
	var embedoption = new Array();
	this.tags[this.tags.length] = "<object id='"+ id +"' classid ='" + this.classid + "' codebase='"+ this.codebase+"' width="+ this.size[0]+" height="+ this.size[1]+">";
	for(var i = 0; i < this.param.length ; ++i){
		this.params = this.param[i].split(this.paramsplit);
		if(this.params[0] != "src") this.tags[this.tags.length] = "<param name='" + this.params[0] + "' value='" + this.params[1] + "'>";
		if(this.params[0] != "movie") embedoption[embedoption.length] = this.params[0] + "='" + this.params[1] + "'";
	}
	this.tags[this.tags.length] = "<embed " + embedoption.join(" ") + " width="+ this.size[0]+" height="+ this.size[1]+">";
	this.tags[this.tags.length] = "</object>";
}
igear_objstart.prototype.write = function(divid){
	
	if(typeof(divid) != "undefined" && typeof(getid(divid)) == "object")	{
		
		getid(divid).innerHTML = this.tags.join("\n");
	}
	else document.write(this.tags.join("\n"));
}


/**
* @content °æ·Îcopy
*/
function pastecopy(vls){
	textcopy(vls);
	alert(" ' " + vls + " ' °¡ º¹»çµÇ¾ú½À´Ï´Ù. \n\n ' Ctrl + V ' ¸¦ »ç¿ëÇÏ¿© ÀÌ¿ëÇÏ½Ê½Ã¿ä.");
}



/**
* @content phpÀÇ stripslashes ¿ªÈ°
*/
function stripslashes(str){

	str = str.replace(/\\/g,'');
	return str;
}



/**
* @content div Ãâ·ÂÁ¤º¸Ã³¸®
*/
function divactive(divnm , divnum){
	if(document.getElementsByName(divnm).length > 0){
		var divobj = document.getElementsByName(divnm);
		for(var i =0; i < divobj.length ; ++i){

			if(i == divnum)
				divobj[i].style.display = divobj[i].style.display == "none" ? "block" : "block";
			else
				divobj[i].style.display = "none";
		}
	}
}


/**
* @content div Ãâ·ÂÁ¤º¸Ã³¸®
*/
function divincfrm(divnm ,cmd){

	if(document.getElementsByName(divnm).length > 0){
		var divobj = document.getElementsByName(divnm);
		for(var i =0; i < divobj.length ; ++i){
			divobj[i].style.display = cmd; // divobj[i].style.display == "none" ? "block" : "none";
		}
	}
}


/**
* @content div Ãâ·ÂÁ¤º¸Ã³¸®
*/
function divprt(divnm , divnum){

	if(document.getElementsByName(divnm).length > 0){
		var divobj = document.getElementsByName(divnm);
			divobj[divnum].style.display = divobj[divnum].style.display == "block" ? "none" : "block";
	}
}



/**
* @content ÁÖ¹Î¹øÈ£ -> »ýÀÏÃßÃâ
*/
function jstr2birth(jumin , tobj){
	var jstr = jumin.split("-");
	var byear = jstr[1].substring(0,1);
	var tobjstr = tobj.split(":");

	var genderchked = jstr[1].substring(0,1) == 2 || jstr[1].substring(0,1) == 4 ? 1 : 0;
	eval(tobjstr[3])[genderchked].checked = true;

	var year = byear == 1 || byear == 2 ? "19" : "20";
	
	eval(tobjstr[0]).value = year + jstr[0].substring(0,2);
	eval(tobjstr[1]).value = jstr[0].substring(2,4);
	eval(tobjstr[2]).value = jstr[0].substring(4,6);
	
}



function calljstr2birth(){
	jstr2birth(doc.resinum1.value + '-' + doc.resinum2.value , "doc['birthday[]'][0]:doc['birthday[]'][1]:doc['birthday[]'][2]:doc['gender']");
}



/**
* @content ÄÚµåÃ¼Å©
*/
function codecheck(divnm,action,param){

	var params = param.split(",");
	var doc_codecheck = document.getElementById(divnm);
	var inn = "";
	inn = '<iframe name="codecheckframe" width="0" height="0"></iframe>';
	inn += "<form method='post' action='" + action + "' target='codecheckframe' name='codecheckfrm'>\n";
	var vls = "";
	for(var i = 0 ; i < params.length ; ++i){
		vls = params[i].split("=");
		inn += "<input type='hidden' name='" + vls[0] + "' value='" + vls[1] + "'>\n";
	}
	inn += "</form>";
	doc_codecheck.innerHTML = inn;
	document.codecheckfrm.submit();
}




/**
* @content  ¹Ú½ºÃ³¸®
*
* @param rootpath->ÀÌ¹ÌÁö°¡ Ãâ·ÂµÇ±â À§ÇÑ rootpath
* @param title->Á¦¸ñ¸í
* @param color->¹è°æ»ö»ó
* @param vcolor->ÆùÆ®»ö»ó
* @param wths->°¡·Î»çÀÌÁî
* @use boxprint(rootpath,title,color,vcolor,wths);
*/
function boxarea (rootpath,title,color,vcolor,wths){
	
	boxrootpath = rootpath;
	boxtitle = title;
	boxcolor = color;
	fontcolor = vcolor;
	if(typeof(wths) == "undefined") wths = "100%";
	wth = wths;
	htmlf = false;
}


/**
* @content iframe ³»ÀÇ document width + height È°¼ºÈ­
*/
function iframeauto(){
	try{ 
		self.resizeTo(document.body.scrollWidth, document.body.scrollHeight);
	}catch(e){ alert('iframeauto() failed')}
}

/**
* @content  ¹Ú½ºÃâ·ÂÃ³¸®
*
* @use boxprint();
*/
function boxprint (notaddtitle){
	var tophtml = "";
	var tmpaddtitle = typeof(boxprint_addtitle) != "undefined" ? boxprint_addtitle : "";
	if(typeof(boxprint_addtitle) == "undefined" || typeof(notaddtitle) != "undefined") tmpaddtitle = "";

	if(htmlf == false){
		htmlf = true;
		tophtml +='<table width="'+ wth +'" align="center" cellpadding="0" cellspacing="0" border="0"><tr>';
		tophtml +='<td width="5" class="moreresultsbox" style="background-color:' + boxcolor + ';border-top:2px #d0d0d0 solid;"></td>';
		tophtml +='	<td class="boxtitle" style="background-color:' + boxcolor + ';color:'+ fontcolor +';font-family: arial,µ¸¿ò;font-size:10px;letter-spacing:-0.5;height:27px;line-height:170%;"> + <b>' + boxtitle + '</b>'+ tmpaddtitle + '</td>';
		tophtml +='	<td width="5" class="moreresultsbox" style="background-color:' + boxcolor + ';border-top:2px #d0d0d0 solid;"></td>';
		tophtml +='	</tr>';
		tophtml +='	<tr>';
		tophtml +='	<td class="moreresultsbox" style="background-color:' + boxcolor + '"></td>';
		tophtml +='	<td class="moreresultsbox" style="background-color:' + boxcolor + '">';
		tophtml +='	<table cellspacing="0" width="100%" cellpadding="0" border="0">';
		tophtml +='	<tr>';
		tophtml +='	<td width="5"><img src="' + boxrootpath + 'common/images/box_topleft_in.gif" width="5" height="5" border="0" /></td>';
		tophtml +='	<td class="bgwhite"></td>';
		tophtml +='	<td width="5"><img src="' + boxrootpath + 'common/images/box_topright_in.gif" width="5" height="5" border="0" /></td>';
		tophtml +='	</tr>';
		tophtml +='	<tr>';
		tophtml +='	<td class="bgwhite"></td>';
		tophtml +='	<td class="bgwhite">';

		tophtml +='	<table cellpadding="5" cellspacing="0" border="0" width="100%">';
		tophtml +='	<tr>';
		tophtml +='	<td width="100%">';
	}
	else{
		
		htmlf = false;
		tophtml +='</td>';
		tophtml +='</tr>';
		tophtml +='</table>';

		tophtml +='</td>';
		tophtml +='<td class="bgwhite"></td>';
		tophtml +='</tr>';
		tophtml +='<tr>';
		tophtml +='<td width="5"><img src="' + boxrootpath + 'common/images/box_bottleft_in.gif" width="5" height="5" border="0" /></td>';
		tophtml +='<td class="bgwhite"></td>';
		tophtml +='<td width="5"><img src="' + boxrootpath + 'common/images/box_bottright_in.gif" width="5" height="5" border="0" /></td>';
		tophtml +='</tr>';
		tophtml +='</table>';
		tophtml +='</td>';
		tophtml +='<td class="moreresultsbox" style="background-color:' + boxcolor + '"></td>';
		tophtml +='</tr>';
		tophtml +='<tr>';
		tophtml +='<td class="moreresultsbox" style="background-color:' + boxcolor + '" height="5"></td>';
		tophtml +='<td class="boxtitle" style="background-color:' + boxcolor + ';"></td>';
		tophtml +='<td  class="moreresultsbox" style="background-color:' + boxcolor + '" height="5"></td>';
		tophtml +='</tr>';
		tophtml +='</table>';
	}

	document.write(tophtml);
}

/**
* @content  ÀüÃ¼ a ÅÂ±×ÀÇ blurÃ³¸®
*
* @use blur_link();
*/
//function blur_link() {;
//	for (var bl = 0; bl < document.links.length; bl++){
//		document.links[bl].onfocus = document.links[bl].blur;
//	}
//}


//function bluring(){
//	try{
//		if(event.srcElement.tagName=="A" || event.srcElement.tagName=="IMG")
//			document.body.focus();
//	}catch(e){}
//}
//document.onfocusin = bluring; 


/**
* @content À©µµ¿ì Å¬¸³º¸µå¿¡ ÇØ´ç³»¿ëº¹»çÃ³¸®
*
* @param clibtext->Å¬¸³º¸µåµÇ¾îÁú ÅØ½ºÆ®
* @use textcopy(obj,cmd);
*/
function textcopy(clibtext){
    window.clipboardData.setData("Text", clibtext);
}


/**
* @content Ã¼Å©¹Ú½ºÀÇ ÀüÃ¼»ç¿ë,¹ÝÀü,Ãë¼Ò¿©ºÎ
*
* @param obj->ÇØ´ç checkbox °´Ã¼
* @param cmd->½ÇÇà¸í·É(object,reflect,disable)
* @param skip -> °Ç³Ê¶Ûµ¥ÀÌÅ¸°ª(,·Î±¸ºÐ)
* @use selbox(obj,cmd);
*/
function selbox(obj,cmd,skip){
	
	if(typeof(skip) != "undefined"){

		var getskip = skip.split(",");
		var theskip = false;
	}

	if(typeof(obj) == "object"){

		for(var i=1; i < obj.length ; ++i){
			
			if(typeof(skip) != "undefined"){
				// skip Ã³¸®
				for(var jj = 0; jj < getskip.length ; ++jj){
					theskip = getskip[jj] == obj[i].value ? true : false;
					if(theskip == true)  break ;
				}
				if(theskip == true) continue;
			}


			switch(cmd){
				case "enable":
					obj[i].checked = true;
				break;
				case "reflect":
					if(obj[i].checked == true) obj[i].checked = false;
					else if(obj[i].checked == false) obj[i].checked = true;
				break;
				case "disable":
					obj[i].checked = false;
				break;
				
				default:
					alert("¸í·ÉÀÌ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.");
				break;
			}
		}
	}
	else alert("¼±ÅÃÇÒ¼ö ÀÖ´Â °´Ã¼°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù. (" + obj.toString() + ")");
}



/**
* @content design »óÇÏ´Ü cmd
*
* @param exceptform->°Ë»çÇØÁ¦ÆûÀÌ¸§ ,·Î ±¸ºÐ
* @use designcmd(cmd);
*/
function designcmd(cmd){
	var cmd_split = "";
	cmd_split = cmd.split(",");
	var stid = new Array();

	stid[0] = "around";
	stid[1] = "around_main_leftmenu";
	stid[2] = "around_main_line";
	stid[3] = "around_topmenu_bottom1";
	stid[4] = "around_topmenu_bottom2";
	stid[5] = "menupath";
	for (var i = 0; i < stid.length ; i++){
		if(cmd_split) cmd = cmd_split[i];
		if(typeof cmd == "undefined") cmd = "none";
		document.getElementById(stid[i]).style.display = cmd;
	}
	
}


/**
* validÃ³¸® ¿¹¿Ü¿©ºÎÈ®ÀÎ
*
* @param exceptcode->ÇöÀçÁøÇàÁßÀÎ ÆûÄÚµå¸í
* @param exceptform->°Ë»çÇØÁ¦ÆûÀÌ¸§ ,·Î ±¸ºÐ
* @use validexcept(formobj,exceptform);
*/
validinfo = true;
function validexcept(exceptcode,exceptform){
	
	var validflag = false;
	if(typeof exceptform != "undefined"){
		var except = exceptform.split(",");
		for( var i = 0; i < except.length; ++i ){
			if(except[i] == exceptcode){
				validflag = true;
				break;
			}
		}
	}
	return validflag
}


/**
* @content valid ÆûÃ³¸®½ÇÇà
* @param formobj->Æû°´Ã¼
* @param exceptform->°Ë»çÇØÁ¦ÆûÀÌ¸§ ,·Î ±¸ºÐ
* @use validform(formobj,exceptform);
*/
function validform(formobj,exceptform){

	for ( var i = 0; i < formobj.elements.length ; ++i ){
		if( (formobj.elements[i].style.display == "block" || formobj.elements[i].style.display == "") && validexcept(formobj[i].name,exceptform) == false){
			formobj.elements[i].focus();
		}
	}
	return false;
}


/**
* @content µ¥ÀÌÅ¸Ã³¸®
*/
function validalert(obj,checkflag,equalcode,alertmsg){

	if(checkflag == equalcode){
		alert(alertmsg);
		obj.focus();
		return false;
	}
}



/**
* @content ´ÙÀ½Æ÷Ä¿½ºÃ³¸®
*/
function nextfd(obj , cnt , nextnm){
	
	if(obj.length >= cnt) nextnm.select();
}


/**
* @content ·ÎµùÃ³¸®
*/
function loading(cmd){
	
	try{
	var loadingsp = document.getElementById("loadingspot"); // ·Îµù¿µ¿ª
	cmd == "hidden" ? loadingsp.style.display = "none" : loadingsp.style.display = "block";
	}catch(e){}
}

/**
* @content ·ÎµùÀÌ¹ÌÁöÃ³¸®
*/
function loadingspot(loadingdata){
	
	try{

		totwidth = parseInt(top.window.document.body.scrollWidth / 3);
		totheight = parseInt(top.window.document.body.scrollHeight / 3);
		var divobj = document.createElement("DIV");
		
		divobj.innerHTML = "<blink>" + loadingdata + "</blink>";
		
		divobj.style.paddingTop = totheight + "px";
		divobj.style.width = top.window.document.body.scrollWidth;
		divobj.style.height = top.window.document.body.scrollHeight;
		divobj.setAttribute("id" , "loadingspot");
		
		document.write(getouterHTML(divobj));

	}catch(e){alert(e.message);}
}


/**
* @content divÅÂ±× none , block Ã³¸®ÇÏ±â
*/
function divcommand(obj , key , cmd){
	
	try{

		if(typeof key == "undefined" || key == "") key = 0;
		if(typeof cmd == "undefined") cmd = "block";

		var tobj = document.getElementsByName(obj);
		tobj[key].style.display = cmd;
		
	}catch(e){}
}


/**
* @content div block & none Ã³¸® 
*/
function divblocknone(obj){
	obj.style.display = obj.style.display == "block" ? "none" : "block";
}


/**
* @content id°ª¿¡ µû¸¥ µ¥ÀÌÅ¸È¹µæ
*/
function getid(objnm , tdoc){

	
	return typeof(tdoc) != "undefined" && tdoc != "" ? eval(tdoc).document.getElementById(objnm) : document.getElementById(objnm);
}



/**
* @content tagname¿¡ µû¸¥ °´Ã¼È¹µæ
*/
function getids(objnm , tdoc){
	return typeof(tdoc) != "undefined" && tdoc != "" ? eval(tdoc).document.getElementsByName(objnm) : document.getElementsByName(objnm);
}


/**
* @content ¼¼¾×°è»ê
*/
function caltax(totprice , tsupprice , ttaxprice){
	
	if(typeof(totprice) == "undefined") return false;

	//var supprice = doc.totsupprice;
	//var taxprice = doc.tottax;

	if(typeof(tsupprice) != "undefined" && typeof(ttaxprice) != "undefined"){
		ttaxprice.value = parseInt(totprice / 11);
		tsupprice.value = totprice - ttaxprice.value;
	}
}


/**
* @content ¿É¼ÇÁ¤º¸º¹»ç
*/
function optcopy(sourceobj , targetobj , adddata , reset){
	
	if(typeof(sourcearray) != "undefined") return false;
	if(typeof(adddata) == "undefined") adddata = "";

	var getdata = explode("^" , mSelected(sourceobj));

	if(typeof(reset) != "undefined" && reset == true){ // ÃÊ±âÈ­¿©ºÎ
		var tmplength = targetobj.options.length;
		for(var i = 0; i < tmplength ; ++i){
			targetobj[0] = null;
		}
		var deflength = 0;
	}else{

		var deflength = targetobj.options.length;
	}
	
	// µ¥ÀÌÅ¸ÀÔ·Â
	var optkey = deflength;
	var getdata_def = 0;
	var vls = "";
	var replacedata = "";
	for(var i = deflength; i < deflength + getdata.length ; ++i){

		replacedata = getdata[getdata_def].replace(/:/g , ' ') + ":" + adddata;
		vls = getdata[getdata_def] + ":" + adddata;
		if(optsearch( targetobj ,  vls) != true){
			targetobj.options[optkey] = new Option(replacedata , vls , false , false);
			++optkey; // ¿É¼ÇÅ°
		}
		++getdata_def;
	}
}

/**
* @content ¿É¼Ç»èÁ¦Ã³¸®
*/
function optdel(targetobj){
	
	// µ¥ÀÌÅ¸ÀÔ·Â
	var tlength = targetobj.options.length - 1;
	for(var i = tlength; i >= 0 ; --i){
		if(targetobj.options[i].selected == true) targetobj.options[i] = null;
	}
}


/**
* @content ¿É¼ÇÁ¤º¸°Ë»ö
*/
function optsearch(optobj , searchtext ){

	if(typeof(optobj) != "object" || typeof(optobj.length) == "undefined") return false;

	for(var i = 0 ;  i < optobj.length ; ++i){ // deselect
		optobj.options[i].selected = false;
	}
	var sel = "";
	var retdata = "";
	for(var i = 0 ;  i < optobj.length ; ++i){
		var rs = new RegExp('' + searchtext + '' , 'ig');
		sel = rs.exec(optobj.options[i].value);
		if(sel != null){
			 optobj.options[i].selected = true;
			 retdata = true;
		}
	}
	return retdata;
}


/**
* @content ¿É¼ÇÀ§¾Æ·¡·Î ÀÌµ¿
* @param obj -> ¼¿·ºÆ®°´Ã¼
* @param cmd -> ÀÌµ¿¸í·É  up , down , direct
* @param indexnum -> ¹Ù·ÎÀÌµ¿ index
*/
function optmove(obj , cmd , indexnum){

	if(obj.options.selectedIndex == -1){
		alert("¿É¼ÇÀ» ¼±ÅÃÇØ ÁÖ½Ê½Ã¿ä.");
		obj.focus();
		return false;
	}

	var selindex = obj.options.selectedIndex;	 		// ¼±ÅÃµÈindex
	var maxindex = obj.options.length-1;				// ÃÖ´ë index
	var tmpdata1 = new Array();
	var tmpdata2 = new Array();
	var moveindex = "";

	if(cmd == "direct" && typeof(indexnum) == "undefined") return false;
	indexnum = parseInt(indexnum) - 1;
	switch(cmd){
		case "direct":	 // Å°¹øÈ£¿¡ µû¶ó

			if(indexnum < 0) indexnum = 0;
			else if(indexnum > maxindex) indexnum = maxindex;
			moveindex = indexnum;
		break;

		case "up":

			moveindex = obj.options.selectedIndex - 1;
			if(moveindex < 0 ) moveindex = 0;
		break;

		case "down":

			moveindex = obj.options.selectedIndex + 1;
			if(moveindex > maxindex) moveindex = maxindex;
		break;
	}

	if(moveindex == selindex) return false;

	tmpdata1['text'] = obj.options[obj.options.selectedIndex].text;
	tmpdata1['value'] = obj.options[obj.options.selectedIndex].value;
	
	tmpdata2['text'] = obj.options[moveindex].text;
	tmpdata2['value'] = obj.options[moveindex].value;

	obj.options[moveindex] = new Option( tmpdata1['text'] , tmpdata1['value'] , true , true);
	obj.options[selindex] = new Option( tmpdata2['text'] , tmpdata2['value'] , false , false);
}



/**
* @content keycode ¿¡ µû¸¥ focusÀÌµ¿
*/
function keycode2move(keycode , moveobj){ // Å°ÄÚµå (,·Î±¸ºÐ) , focus °¡ ÀÌµ¿µÇ¾îÁú obj
	var evtkeycode = event.keyCode;
	var selkeycode = new String(keycode).split(",");

	for(var i = 0 ; i < selkeycode.length ; ++i){
		if(selkeycode[i] == evtkeycode){
			var flag = true;
			break;
		}
	}
	if(flag == true) moveobj.focus();
}



/**
* @content javascript : ÁÖ¼ÒÈ£Ãâ
*/
function callsync4js(url){

	getid('sync4js').src = url;
}


/**
* @content µ¥ÀÌÅ¸Àü¼Û urlencode
*/
function urlencode(params){
	
	if(typeof(params) == "undefined") return;
	var dt = params.split('&');
	var retdata = new Array();
	for(var i = 0 ; i < dt.length ; i++){
		var dta = dt[i].split('=');
		retdata[i] = encodeURIComponent(dta[0]) + '=' + encodeURIComponent(dta[1]);
	}
	return typeof(retdata.join("&")) != "undefined" ? retdata.join("&") : "" ;
}




/**
* @content  ÀÚµ¿µî·Ï¹æÁö°ü·Ã
*
*/
function getdenyautoregistcode(obj , getkey , getkey_index , cryptdata){
	
	var totstrcode = new String(getkey);
	var spanresult = new String(getkey_index);
	var enc_data = cryptdata;
	var retdata = strkey = spanresultdata = "";

	for(var i = 0 ; i < totstrcode.length ; ++i){
		spanresultdata = "";
		for(var j = 0 ; j < spanresult.length ; ++j){
			strkey = spanresult.substr(j , 1);
			if(i == strkey){
				spanresultdata = "<span class=\"denyautoregist bold\">" + totstrcode.substr(i , 1) + "</span>";	// »ö»óÃ³¸®
			}
		}

		retdata += !spanresultdata ? totstrcode.substr(i , 1) : spanresultdata;
	}
	
	obj.innerHTML = "<input type='hidden' name='enc_data' value='" + enc_data + "'> \n" + retdata; //°á°úÃ³¸®
}



/**
* @content checkbox ¸¦ ÇÑ°³¸¸ ¼±ÅÃÇÒ¼ö ÀÖµµ·Ï
*/

function checkbox2radio(obj , vls){
	
	for(var i = 0; i < obj.length; ++i){
		
		obj[i].checked = obj[i].checked == true && obj[i].value == vls ? true : false;
	}
}


/**
* @content checkbox ¸¦ ÇÑ°³¸¸ ¼±ÅÃÇÒ¼ö ÀÖµµ·Ï
*/

function checkbox2radio(obj , vls){
	
	for(var i = 0; i < obj.length; ++i){
		
		obj[i].checked = obj[i].checked == true && obj[i].value == vls ? true : false;
	}
}




/**
* @content Á¤¼öÀý»ç
*/

function int_numberdrop(vls , pos){
	
	var n = parseInt(vls);
	if(typeof n != "number") return false;

	var vlsn = new String(vls);
	var modvlsn = vlsn.substr(0 , vlsn.length - pos);
	var retdata = modvlsn * Math.pow(10 , pos);
	return retdata;
}

