/*

var jsload = function(src){
	var src = src;
	return{
		insSrc:function(src){
		var script = document.createElement('script'); 
		script.type = 'text/javascript'; 
		script.src = src;
		document.getElementsByTagName('head')[0].appendChild(script);
		}
	}
}();

//¾Æ·¡¿Í °°Àº½ÄÀ¸·Î ·Îµå°¡ °¡´ÉÇÔ
jsload.insSrc('/include/jquery-1.3.2.min.js');//jQuery load

*/

/*
function bluring(){ 
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring; 
*/


$(document).ready(
	function() {
		
		$("input:checkbox").addClass("checkbox");
		$("input:radio").addClass("radio");
		
		$("input:text, input:password, textarea").focus(function () {
			$(this).addClass("FocusLine");
		});
		$("input:text, input:password, textarea").blur(function () {
			$(this).removeClass("FocusLine");
		});
		//$("input").parent().css("padding-top","2");
		//$("input").parent().css("padding-bottom","2");
		
		$("input:image").css("border", "0");

		$("map area").focus(function () {
			$(this).blur();
		});
		
		$("a, img").focus(function () {
			$(this).blur();
		});

 	}
);


/* alert ¸Þ¼¼Áö ±¸¹® ½ÃÀÛ ************************************/
var MSG_NO_INPUT 			= "(ÀÌ)°¡ ÀÔ·ÂµÇÁö ¾Ê¾Ò½À´Ï´Ù.";
var MSG_INPUT_REPEAT		= "´Ù½Ã ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À.";
/* alert ¸Þ¼¼Áö ±¸¹® ³¡ :  ************************************/

/*
 * ÇÔ¼ö¸í : POST
 * ¼³  ¸í : ¸µÅ©¸¦ POSTÇü½ÄÀ¸·Î ³Ñ±ä´Ù.
 * Çü  ½Ä : ÁÖ¼Ò, °Ù¹æ½ÄÀÇ ÁÖ¼Ò, Å¸°Ù(»èÁ¦°¡´É)
 * ¿¹) <a href="#" onClick="POST('./Link.asp','a=aaa&b=bbb&c=ccc','target')">¸µÅ©~</a>
 */
function POST(page,get,target){

	var obj = document.createElement("div");
	obj.id = "href";
	document.body.appendChild(obj);	
	
	var href = document.getElementById("href");
	var form, hiddenform;

	form = "";
	hiddenform = "";
	
	if (get != ""){
		gettmp = get.split("&");
		for (i=0;i<gettmp.length;i++){
			hidden_name = gettmp[i].split("=")[0];
			hidden_value = gettmp[i].split("=")[1];
			hiddenform = hiddenform + " <input type='hidden' name='"+ hidden_name + "' value='"+ hidden_value +"'> ";
		}
	}
	
	form = form + " <form name='LINKPAGE' method='POST'> ";
	form = form + hiddenform ;
	form = form + " </form> ";

	href.style.display = "none";
	href.innerHTML = form;
	
	if (!target) target = "";

	var frm = document.LINKPAGE;
	frm.action = page;
	frm.target = target;
	frm.submit();
	
}


/* ÇÊ¼ö Ç×¸ñ ÀÔ·Â ¿©ºÎ Ã¼Å©
 * ¿¹) if(requiredField(frm.are_code, "Áö¿ªÄÚµå")) return;
 */
function requiredField(obj, objName){
    if(objName == null || objName == "") objName = obj.name;

    if(obj.value.replace(/[ ]/g, "") == ""){
        alert("[" + objName + "]" + MSG_NO_INPUT + "\n" + MSG_INPUT_REPEAT);
        if(obj.select != null) obj.select();
        obj.focus();
        return true;;
    }
    return false;
}

/* ÇÊ¼ö Ç×¸ñ ÀÔ·Â ¿©ºÎ Ã¼Å©
 * ¿¹) if(requiredFieldRADIO(frm.are_code, "Áö¿ªÄÚµå")) return;
 */
function requiredFieldRADIO(obj, objName){
    if(objName == null || objName == "") objName = obj.name;

    if(getChecked(obj) == ""){
        alert("[" + objName + "](ÀÌ)°¡ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù.\n´Ù½Ã ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿À.");
        obj[0].focus();
        return true;;
    }
    return false;
}



function file_check(obj, check) {
	var count=0;
	
	ext = obj.value;
	ext = ext.substring(ext.lastIndexOf(".")+1);
	ext = ext.toLowerCase(); 
	
	if (check != "" ) {
		checkarr = check.split(",")
	}else{	
		checkarr = ["pdf", "hwp", "doc", "xls", "ppt", "txt", "hul", "htm", "html", "gif", "jpg", "wav", "mp3", "wma", "alz", "zip", "rar", "arj", "swf", "css", ""]
	}
	
	for (var i=0; i <= checkarr.length; i++){
		if (ext == checkarr[i]){
			count = count + 1;
		}
	}
	
	if (count > 0){
		return true;
	}else{
		alert("¡ØÆÄÀÏ ¾÷·Îµå °¡´É ÆÄÀÏ Çü½ÄÀº ¾Æ·¡¿Í °°½À´Ï´Ù.\n -È®ÀåÀÚ("+ checkarr +")");	
		obj.focus();
		obj.select();
		return false;
	}
}


/* ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÏ°Ô ÇÔ
 * onkeypress ÀÌº¥Æ®¿¡ Àû¿ë : ime-mode¸¦ ¹Ýµå½Ã disabled·Î ¼³Á¤ÇØ¾ß ÇÔ.
 * ¿¹) style="ime-mode:disabled" onkeypress="onlyNumber()"
 */
function onlyNumber(plus_keycode)
{
	if (plus_keycode == ""){
		if( window.event.keyCode >= 48 && window.event.keyCode <= 57) {
		} else {
			window.event.keyCode = "";
		}
	}else{
		if( (window.event.keyCode >= 48 && window.event.keyCode <= 57) || window.event.keyCode == plus_keycode ) {
		} else {
			window.event.keyCode = "";
		}
	}
}


/****************************************************************************
 * Check °´Ã¼ Á¦¾î ÇÔ¼ö
 * ÀÛ¼ºÀÏ : 2004-11-10
 ***************************************************************************/
/*
 * ÇÔ¼ö¸í : getChecked
 * ¼³  ¸í : Radio °´Ã¼¿¡¼­ Ã¼Å©µÈ Ç×¸ñÀÇ value ¸¦ ¹ÝÈ¯ÇÑ´Ù.
 * @param _obj (Radio, Ã¼Å©)
 * @return String, Ã¼Å©µÈ Ç×¸ñÀÇ value, ¾øÀ» °æ¿ì ""
 */
function getChecked(_obj){
	if (_obj == null) return "";
	
	//1°Ç ÀÏ °æ¿ì¿¡ ´ëÇÑ Ã³¸®
	if(_obj.length == null){
		_objLen=1;			
	}else{
		_objLen= _obj.length;
	}
	for(var i=0; i<_objLen; i++){
		if(_obj.length == null){
			if(_obj.checked)
				return _obj.value;
		}else{
			if(_obj[i].checked)
				return _obj[i].value;
		}
	}
	return "";
}

/*
 * ÇÔ¼ö¸í : getCheckedCount
 * ¼³  ¸í : Radio °´Ã¼¿¡¼­ Ã¼Å©µÈ Ç×¸ñ ¼ö¸¦ ¹ÝÈ¯ÇÑ´Ù.
 * @param _obj (Radio, Ã¼Å©)
 * @return String, Ã¼Å©µÈ Ç×¸ñ¼ö, ¾øÀ» °æ¿ì 0
 */
function getCheckedCount(_obj){
	var cnt=0;
	var chkLen=0;
	if (_obj == null) return cnt;

//1°Ç ÀÏ °æ¿ì¿¡ ´ëÇÑ Ã³¸®
	if(_obj.length == null){
		_objLen=1;			
	}else{
		_objLen= _obj.length;
	}
	
	for(var i=0; i<_objLen; i++){
		if(_obj.length == null){
			if(_obj.checked)
				cnt++;
		}else{
			if(_obj[i].checked)
				cnt++;
		}
	}
	return cnt;
}

// ¸ðµç Ã¼Å© ¹Ú½ºÀÇ checked ¼Ó¼º ¼¼ÆÃ
function chkAllRows(chkMain, chk){
	if(chk == null){
		return;
	}
	// 2°Ç ÀÌ»óÀÏ °æ¿ì ½ÇÇà µÊ.
	for(i=0; chk.length != null && i<chk.length; i++){
		if(chkMain.checked){
			if (!chk[i].disabled){
				chk[i].checked = true;
			}
		}else{
			chk[i].checked = false;
		}
	}
	// 1°Ç ÀÏ¶§ ½ÇÇàµÊ.
	if(chk.length == null){
		if(chkMain.checked){
			if (!chk.disabled){
				chk.checked = true;
			}
			chk.checked = true;
		}else{
			chk.checked = false;
		}
	}

}


/* ¿£ÅÍÅ° ÀÔ·Â½Ã ¿øÇÏ´Â ÇÔ¼ö È£ÃâÇÏ±â
 * onkeypress ÀÌº¥Æ®¿¡ Àû¿ë
 * ¿¹) onkeypress="key13Check('goSearch1()')"
 */
function key13Check(fnc){
	if(window.event.keyCode == 13){
        eval(fnc);
	}
}


// ÆË¾÷ È­¸é »ý¼º
function popUpWindow(url, popName, width, height, scroll, resizable){
	if( width == null || width == "" ) width = 600;
	if( height == null || height == "" ) height = 500;
	if( resizable == null || resizable == "" ) resizable = "yes";
	
	var left, top;
	top  = (window.screen.height - height) / 2;
	left = (window.screen.width  - width ) / 2;
	sFeatures = "width="+width+",height="+height+",left="+left+",top="+top+",resizable="+resizable;
	if(scroll == "yes") sFeatures += ",scrollbars=yes";
	else sFeatures += ",status=no,toolbar=no,menubar=no,location=no";

	var obj = window.open(url,popName,sFeatures);
	obj.focus();
	return obj;
}
// ÆË¾÷ È­¸é »ý¼º
function popUpWindow_(url, popName, width, height, scroll, resizable){
	if( width == null || width == "" ) width = 600;
	if( height == null || height == "" ) height = 500;
	if( resizable == null || resizable == "" ) resizable = "yes";
	
	var left, top;
	top  = 0//(window.screen.height - height) / 2;
	left = 0//(window.screen.width  - width ) / 2;
	sFeatures = "width="+width+",height="+height+",left="+left+",top="+top+",resizable="+resizable;
	if(scroll == "yes") sFeatures += ",scrollbars=yes";
	else sFeatures += ",status=no,toolbar=no,menubar=no,location=no";

	var obj = window.open(url,popName,sFeatures);
	obj.focus();
	return obj;
}

/*
 * ÇÔ¼ö¸í : ImagePreview
 * ¼³  ¸í : ÀÌ¹ÌÁö ¹Ì¸®º¸±â
 * Çü  ½Ä : onChange="ImagePreview(this,'Photo')"  
 * ¿¹) <input type="file" name="imgfile" onChange="ImagePreview(this,'ÀÌ¹ÌÁöº¸¿©ÁÙÀ§Ä¡ID')">
 */
function ImagePreview(src,key) {
	
	if (navigator.product != "Gecko"){
		if (navigator.appVersion.indexOf("MSIE 8") > -1){
			document.getElementById(key).innerHTML = "<div align='center' style='font-size:11px'>¹Ì¸®º¸±â´Â<br>MS IE 7.0<br>ÀÌÇÏ¿¡¼­¸¸<br>°¡´ÉÇÕ´Ï´Ù.</div>";
			return;
		}
	}else{
		document.getElementById(key).innerHTML = "<div align='center' style='font-size:11px'>¹Ì¸®º¸±â´Â<br>MS IE°è¿­¸¸<br>°¡´ÉÇÕ´Ï´Ù.</div>";
		return;
	}

	if (src.value != ""){
		if(src.value.match(/\.(gif|jpg|jpeg|png)$/i)) {
		
			document.getElementById(key).innerText="";
			document.getElementById(key).style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src.value + "',sizingMethod=scale)";
		
		} else {
		
			document.getElementById(key).style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='',sizingMethod=scale)";
			
			alert("ÀÌ¹ÌÁö ÆÄÀÏ¸¸ ¿Ã·ÁÁÖ¼¼¿ä");
			//src.select();
			//document.selection.clear();
			
		}
	}
	
}


/*µ¦½ºÆ® ÆÄÀÏ¾÷·Îµå ±×·¡ÇÁ*/
function ShowProgress() { 
strAppVersion = navigator.appVersion; 
if (strAppVersion.indexOf('MSIE')!=-1 && 
strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4) {
//winstyle = "dialogWidth=385px; dialogHeight:150px; center:yes"; 
winstyle = "dialogWidth=385px; dialogHeight:150px; center:no"; 
window.showModelessDialog("/_Manager/include/dext/show_progress.asp?nav=ie", null, winstyle); 
}else { 
//winpos = "left=" + ((window.screen.width-380)/2)+",top="+((window.screen.height-110)/2);
winpos = "left=10,top=10";
winstyle="width=380,height=110,status=no,toolbar= no,menubar = no,location=no,resizable=no,scrollbars=no,copyhistory=no," + winpos; 
window.open("/_Manager/include/dext/show_progress.asp",null,winstyle); 
} 

return; 
}

/* ¿µ¿ª ÇÁ¸°Æ® ½ÃÀÛ */
/*
Body ÀüÃ¼¸¦ <DIV ID="objContents"></DIV> ·Î °¨½ÑÈÄ
¸Ç³¡¿¡ <DIV ID="objSelection"></DIV> Ãß°¡..
±×µÚ¿¡ ÇÁ¸°Æ®¿µ¿ª ÁöÁ¤
<DIV id="Print_DIV"></DIV> ¿µ¿ª¸¸ ÇÁ¸°Æ®
*/
function printDiv () { 
	if (document.all && window.print) { 
		window.onbeforeprint = beforeDivs; 
		window.onafterprint = afterDivs; 
		//window.print(); 
		Print(window);
	} 
} 

function beforeDivs () { 
	if (document.all) { 
		objContents.style.display = 'none'; 
		objSelection.innerHTML = document.all['Print_DIV'].innerHTML; 
	} 
} 

function afterDivs () { 
	if (document.all) { 
		objContents.style.display = 'block'; 
		objSelection.innerHTML = ""; 
	} 
} 


function SetPrintSettings() {
	factory.printing.header = "";			// Header¿¡ µé¾î°¥ ¹®Àå 
	factory.printing.footer = "";			// Footer¿¡ µé¾î°¥ ¹®Àå 
	factory.printing.portrait = true;		// true ¸é °¡·ÎÀÎ¼â, false ¸é ¼¼·Î ÀÎ¼â 
	factory.printing.leftMargin = 1.0;		// ¿ÞÂÊ ¿©¹é »çÀÌÁî 
	factory.printing.topMargin = 1.0;		// À§ ¿©¹é »çÀÌÁî 
	factory.printing.rightMargin = 1.0;		// ¿À¸¥ÂÊ ¿©¹é »çÀÌÁî 
	factory.printing.bottomMargin = 1.0;	// ¾Æ·¡ ¿©¹é »çÀÌÁî 
}

function Print(frame) {

	if ( !factory.object ) {
		if(confirm("ActiveX ¼³Ä¡ÈÄ ÀÎ¼âÇÏ½Ã°Ú½À´Ï±î?")){
			alert("ÀÎÅÍ³ÝÃ¢ »ó´ÜÀÇ ActiveX¸¦ ¼³Ä¡ÈÄ ÁøÇàÇÏ¿© ÁÖ½Ê½Ã¿ä.");
		}else{
			window.print();			
		}		
	}else{
		SetPrintSettings();
		if(confirm("¹Ì¸®º¸±âÈÄ ÀÎ¼âÇÏ½Ã°Ú½À´Ï±î?")){
			factory.printing.Preview();     // ÇöÀçÀ©µµ¸¦ ÇÁ¸°Æ®ÇÏ´Â¶æ(window´ë½Å¿¡ frameÀ» ÁöÁ¤ÇØÁÖ¸é ÇØ´ç ÇÁ·¹ÀÓÀ» Ãâ·ÂÇÕ´Ï´Ù.)
		}else{
			factory.printing.Print(true);     // ÇöÀçÀ©µµ¸¦ ÇÁ¸°Æ®ÇÏ´Â¶æ(window´ë½Å¿¡ frameÀ» ÁöÁ¤ÇØÁÖ¸é ÇØ´ç ÇÁ·¹ÀÓÀ» Ãâ·ÂÇÕ´Ï´Ù.)
		}
	}

}
/* ¿µ¿ª ÇÁ¸°Æ® Á¾·á */


function nextFocus(sFormName,sNow,sNext)
{
	var sForm = 'document.'+ sFormName +'.'
	var oNow = eval(sForm + sNow);

	if (typeof oNow == 'object')
	{
		if ( oNow.value.length == oNow.maxLength)
		{
			var oNext = eval(sForm + sNext);

			if ((typeof oNext) == 'object')
				oNext.focus();
		}
	}
}





/* »õ·Î°íÄ§, F1~F12 Â÷´Ü¸·±â*/
/*
document.onkeydown=KeyEventHandle;
document.onkeyup=KeyEventHandle;
*/
function KeyEventHandle() {
	if( 
		(event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82)) 
		|| 
		(event.keyCode >= 112 && event.keyCode <= 123) 
	   )
	 { 

		event.keyCode = 0; 
		event.cancelBubble = true; 
		event.returnValue = false; 

	} 
}


//========= Email Check ½ºÅ©¸³Æ® =========
// »ç¿ë¹ý: return emailCheck(this) ÇüÅÂ·Î ¾²½Ã¸é µË´Ï´Ù.(Email ¿À·ù½Ã Æ÷Ä¿½º ÀÌµ¿)
// ÄÞ¸¶(',')¸¦ ±¸ºÐÀ¸·Î ¿©·¯°³ÀÇ ¸ÞÀÏÁÖ¼Ò¸¦ ÀÔ·ÂÇÒ ¶§´Â emailCheck(this, ',') ÇüÅÂ·Î ¾²½Ã¸é µË´Ï´Ù.
function emailCheck(_email, _delim) {
    var email = _email.value;
    var aidx = -1; // @ À§Ä¡
    var didx = -1; // . À§Ä¡
    var valid = true;
    var arrSpChSet= new Array(" ", "\"", "'", "#", "%"); // Ã¼Å©ÇÒ Æ¯¼ö¹®Á¦ ¼Â

    // ÀÔ·ÂÁ¤º¸°¡ ¾øÀ» °æ¿ì
    if(_email==null || email.length < 1) { return true; }
    if(_delim==null || _delim.length < 1) _delim = " ";

    var emails = email.split(_delim);

    for(var i=0; i < emails.length; i++) {
        email = emails[i];


		if (/^[_0-9a-zA-Z-]+(\.[_0-9a-zA-Z-]+)*@[0-9a-zA-Z-]+(\.)+([0-9a-zA-Z-]+)([\.0-9a-zA-Z-])*$/.test(email) == false){
            valid = false; break;
		}
    }

    // ÁÖ¼Ò°¡ Çü½Ä¿¡ ¸ÂÁö ¾ÊÀ» ¶§
    if(!valid) {
        alert("E-mail ( " + email + " )ÁÖ¼Ò°¡ Á¤È®ÇÏÁö ¾Ê½À´Ï´Ù!");
        _email.focus();
    }

    return valid;
}

//========= ÁÖ¹Îµî·Ï¹øÈ£ Check ½ºÅ©¸³Æ® =========
// »ç¿ë¹ý: Check_Jumin(frm.Jumin1, frm.Jumin2) ÇüÅÂ·Î ¾²½Ã¸é µË´Ï´Ù.
function Check_Jumin(ssn1, ssn2) {

	var chk =0;
	var yy  = ssn1.value.substring(0,2);
	var mm  = ssn1.value.substring(2,4);
	var dd  = ssn2.value.substring(4,6);
	var sex = ssn2.value.substring(0,1);

	// ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÚ¸®¼ö¿¡ ¸Â°Ô ÀÔ·ÂÇß´ÂÁö Ã¼Å©
	if (ssn2.value.split(" ").join("") == "") {
		alert ('ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À.');
		ssn1.focus();
		return false;
	}
	if (ssn1.value.length!=6) {
		alert ('ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À');
		ssn1.focus();
		return false;
	}
	if (ssn2.value.length != 7 ) {
		alert ('ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À.');
		ssn2.focus();
		return false;
	}
	if (isNaN(ssn1.value) || isNaN(ssn2.value)) {
		ssn1.value = ""
		ssn2.value = ""
		alert('ÁÖ¹Îµî·Ï¹øÈ£´Â ¼ýÀÚ¸¸ °¡´ÉÇÕ´Ï´Ù.');
		return false;
	}
	if ((ssn1.value.length!=6)||(mm <1||mm>12||dd<1)){
		alert ('ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®°¡ Àß¸øµÇ¾ú½À´Ï´Ù.');
		ssn1.focus();
		return false;
	}
	if ((sex != 1 && sex !=2 && sex !=3 && sex !=4 )||(ssn2.value.length != 7 )){
		alert ('ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®°¡ Àß¸øµÇ¾ú½À´Ï´Ù.');
		ssn2.focus();
		return false;
	}

	for (var i = 0; i <=5 ; i++) {
		chk = chk + ((i%8+2) * parseInt(ssn1.value.substring(i,i+1)))
	}
	for (var i = 6; i <=11 ; i++) {
		chk = chk + ((i%8+2) * parseInt(ssn2.value.substring(i-6,i-5)))
	}

	chk = 11 - (chk %11)
	chk = chk % 10

	if (chk != ssn2.value.substring(6,7)) {
		alert ('ÁÖ¹Îµî·Ï¹øÈ£°¡ Á¤È®ÇÏÁö ¾Ê½À´Ï´Ù.');
		ssn1.focus();
		return false;
	}
	
	return true;
}

/*°ø¹éÃ¼Å©*/
function checkSpace( str )
{
	if(str.search(/\s/) != -1){
		return 1;
	}else {
		return "";
	}
}
/** 
* string String::cut(int len)
* ±ÛÀÚ¸¦ ¾Õ¿¡¼­ºÎÅÍ ¿øÇÏ´Â ¹ÙÀÌÆ®¸¸Å­ Àß¶ó ¸®ÅÏÇÕ´Ï´Ù.
* ÇÑ±ÛÀÇ °æ¿ì 2¹ÙÀÌÆ®·Î °è»êÇÏ¸ç, ±ÛÀÚ Áß°£¿¡¼­ Àß¸®Áö ¾Ê½À´Ï´Ù.
*/
String.prototype.cut = function(len) {
	var str = this;
	var l = 0;
	for (var i=0; i<str.length; i++) {
		l += (str.charCodeAt(i) > 128) ? 2 : 1;
		if (l > len) return str.substring(0,i);
	}
	return str;
}

/** 
* bool String::bytes(void)
* ÇØ´ç½ºÆ®¸µÀÇ ¹ÙÀÌÆ®´ÜÀ§ ±æÀÌ¸¦ ¸®ÅÏÇÕ´Ï´Ù. (±âÁ¸ÀÇ length ¼Ó¼ºÀº 2¹ÙÀÌÆ® ¹®ÀÚ¸¦ ÇÑ±ÛÀÚ·Î °£ÁÖÇÕ´Ï´Ù)
*/
String.prototype.bytes = function() {
	var str = this;
	var l = 0;
	for (var i=0; i<str.length; i++) l += (str.charCodeAt(i) > 128) ? 2 : 1;
	return l;
}


var is=false;
function ImgResize(str, size){
	
	if(is==false){
		if(document.getElementById(str).width > size){
			document.getElementById(str).width = size;
		}
	}
	is=true;
}




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 _ID(obj){return document.getElementById(obj)}


//ÇÑ±ÛÀÔ·Â Ã¼Å©
//¿¹) if(!checkHangulChar(chk_name)) return;
function checkHangulChar(chk_name){
	if (/^[°¡-Èþ]{0,}$/.test(chk_name.value) == false){
	   alert("ÇÑ±Û·Î¸¸ ÀÔ·ÂÇÏ½Ê½Ã¿ä.\n°ø¹éÀÌ³ª Æ¯¼ö¹®ÀÚ´Â ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
	   chk_name.focus();
	   chk_name.select();
	   return false;
	}
	return true;
}
function isHangul(s) 
{
     var len;
     
     len = s.length;

     for (var i = 0; i < len; i++)  {
         if (s.charCodeAt(i) != 32 && (s.charCodeAt(i) < 44032 || s.charCodeAt(i) > 55203))
             return false;
     }
     return true;
}

function addCashComma(obj)
{
	var isMinus = false;
	if(obj.value.indexOf("-") != -1 ){
		obj.value = obj.value.substring(obj.value.indexOf("-")+1)
		isMinus = true;
	}
	var numValue = ""+delCashComma(obj);
	var cashReturn = "";
	for (var i = numValue.length-1; i >= 0; i--){
		cashReturn = numValue.charAt(i) + cashReturn;
		if (i != 0 && i%3 == numValue.length%3) cashReturn = "," + cashReturn;
	}
	if(isMinus){
		obj.value = "-"+cashReturn;
	}else{
		obj.value = cashReturn;
	}
}

function delCashComma(obj){
	var numValue = obj.value;
	obj.value =  replace(numValue,",","");
	return obj.value;
}


function addCashComma2(obj){

	var isMinus = false;
	obj = obj+"";
	if(obj.indexOf("-") != -1 ){
		obj = obj.substring(obj.indexOf("-")+1)
		isMinus = true;
	}
	var numValue = ""+delCashComma2(obj);
	var cashReturn = "";
	for (var i = numValue.length-1; i >= 0; i--){
		cashReturn = numValue.charAt(i) + cashReturn;
		if (i != 0 && i%3 == numValue.length%3) cashReturn = "," + cashReturn;
	}
	
	if(isMinus){
		obj = "-"+cashReturn;
	}else{
		obj = cashReturn;
	}
	
	return obj;
}

function delCashComma2(obj)
{
	var numValue = obj;
	obj =  replace(numValue,",","");
	return obj;
}

/**
 *  ¹®ÀÚ¿­¿¡ ÀÖ´Â Æ¯Á¤¹®ÀÚÆÐÅÏÀ» ´Ù¸¥ ¹®ÀÚÆÐÅÏÀ¸·Î ¹Ù²Ù´Â ÇÔ¼ö.
 */
function replace(targetStr, searchStr, replaceStr)
{
	var len, i, tmpstr;
	len = targetStr.length;
	tmpstr = "";
	for ( i = 0 ; i < len ; i++ ) {
		if ( targetStr.charAt(i) != searchStr ) {
			tmpstr = tmpstr + targetStr.charAt(i);
		}
		else {
			tmpstr = tmpstr + replaceStr;
		}
	}
	return tmpstr;
}











/*** ÀÌµ¿·¹ÀÌ¾î °ü·Ã : start ***/
var appname = navigator.appName.charAt(0);
var move_type = false;
var divpop_id;

 function Start_move(e,thisID){
	 var event = e || window.event;
	 divpop_id = thisID;
	 //ÀÍ½º
	 if( appname == "M" ){
		 target_Element = event.srcElement;
	}else{ //ÀÍ½º¿Ü
		if (event.which !=1){
			return false;
		}
		else{
			move_type = true;
			target_Element = event.target;
		}
	}

	$("#"+thisID).draggable({handle:"#"+thisID,opacity:"0.5"});

	move_type = true;
	Move_x = event.clientX;
	Move_y = event.clientY;
	if( appname == "M" ) target_Element.onmousemove = Moveing;
	else document.onmousemove = Moveing;
 }


 function Moveing(e){
	var event = e || window.event;

	if(move_type == true){
		var Nowx = event.clientX - Move_x;
		var Nowy = event.clientY - Move_y;
		var targetName = document.getElementById(divpop_id);
		targetName.style.left = int_n(targetName.style.left) + Nowx;
		targetName.style.top = int_n(targetName.style.top) + Nowy;
		Move_x = event.clientX;
		Move_y = event.clientY;
		return false;
	}
 }

 function Moveing_stop(){
	move_type =  false;
}

function int_n(cnt){
	if( isNaN(parseInt(cnt)) == true ) var re_cnt = 0;
	else var re_cnt = parseInt(cnt);
	return re_cnt;
}

document.onmouseup = Moveing_stop;


function controlCookie( name, elemnt ){

	if ( elemnt.checked ){

	    var today = new Date()
	    var expire_date = new Date(today.getTime() + 60*60*6*1000)

		setCookie( name=name, value='true', expires=expire_date, path='/' );
		if (_ID(name) == null) setTimeout( "self.close()" );
		else setTimeout( "_ID('" + name + "').style.display='none'" );
	}
	else clearCookie( name );

	return
}

/*** ÀÌµ¿·¹ÀÌ¾î °ü·Ã : end ***/

/*** Cookie »ý¼º ***/
function setCookie( name, value, expiredays ){ 
    var todayDate = new Date(); 
    todayDate.setDate( todayDate.getDate() + expiredays ); 
    document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 

/*** Cookie Á¦°Å ***/
function clearCookie( name ){
    var today = new Date();
    var expire_date = new Date(today.getTime() - 60*60*24*1000);
    document.cookie = name + "= " + "; expires=" + expire_date.toGMTString();
}

/*** Cookie Ã¼Å© ***/

function GetCookie (name) { 
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		 return getCookieVal (j); 
		i = document.cookie.indexOf(" ", i) + 1; 
		if (i == 0) break;
	} 
	return null;
} 

function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset); 
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
} 
/*** Cookie ÄÁÆ®·Ñ ***/
function PopupLayerClose( name, cookiename, elemnt ){

	//if ( elemnt.checked ){
		setCookie( cookiename, 'true', 1 );
		setTimeout( "_ID('" + name + "').style.display='none'" );
	//}

	return;
}


//========= ¼¼·Î·Ñ¸µ ½ºÅ©¸³Æ® =========
function NvScroll() {

	this.version = "0.2";
	this.name = "NvScroll";
	this.item = new Array();
	this.itemcount = 0;
	this.currentspeed = 0;
	this.scrollspeed = 50;
	this.pausedelay = 1000;
	this.pausemouseover = false;
	this.stop = false;
	this.type = 1;
	this.height = 100;
	this.width = 100;
	this.stopHeight=0;
	this.i=0;
	
	this.add = function () {
		var text = arguments[0];
	
		this.item[this.itemcount] = text;
	//	alert(this.item[this.itemcount]);
		this.itemcount ++;
	};
	
	this.add2 = function () {
		var url = arguments[0];
		var title = arguments[1];
		this.item[this.itemcount] = "<a href=" + url + ">" + title + "</a>";
		this.itemcount = this.itemcount + 1;
	};
	
	this.reset_item = function () {
		this.item = new Array();
		this.itemcount = 0;
	};
	
	this.start = function (layer_name) {
		if ( this.itemcount == 1 ) {
			this.add(this.item[0]);
		}
		if (layer_name != null)
		{
			document.getElementById(layer_name).innerHTML = this.str_ret();
		}
		else 
		{
			this.display();
		}
		this.currentspeed = this.scrollspeed;
		if ( this.type == 1 || this.type == 2 ) {
			this.stop = true;
			setTimeout(this.name+'.scroll()',this.currentspeed);
			window.setTimeout(this.name+".stop = false", this.pausedelay);
		} else if ( this.type == 3 ) {
			this.stop = true;
			setTimeout(this.name+'.rolling()',this.currentspeed);
			window.setTimeout(this.name+".stop = false", this.pausedelay);
		}
	};
	
	this.display = function () {
		document.write('<div id="'+this.name+'" style="height:'+this.height+'px; width:'+this.width+'px; position:relative; overflow:hidden; " OnMouseOver="'+this.name+'.onmouseover(); " OnMouseOut="'+this.name+'.onmouseout(); ">');
		for(var i = 0; i < this.itemcount; i++) {
			if ( this.type == 1 ) {
				document.write('<div id="'+this.name+'item'+i+'"style="left:0px; width:'+this.width+'px; position:absolute; top:'+(this.height*i)+'px; ">');
				document.write(this.item[i]);
				document.write('</div>');
			} else if ( this.type == 2 || this.type == 3 ) {
				document.write('<div id="'+this.name+'item'+i+'"style="left:'+(this.width*i)+'px; width:'+this.width+'px; position:absolute; top:0px; ">');
				document.write(this.item[i]);
				document.write('</div>');
			}
		}
		document.write('</div>');
	};
	// ¹Ù·Î µð½ºÇÃ·¹ÀÌ ¾Ê°í ½ºÆ®¸µ ¸®ÅÏÇÏµµ·Ï Ãß°¡ 2006-03-30
	this.str_ret = function () {
		var str = '<div id="'+this.name+'" style="height:'+this.height+'; width:'+this.width+'; position:relative; overflow:hidden; " OnMouseOver="'+this.name+'.onmouseover(); " OnMouseOut="'+this.name+'.onmouseout(); ">';
		for(var i = 0; i < this.itemcount; i++) {
			if ( this.type == 1 ) {
				str += '<div id="'+this.name+'item'+i+'"style="left:0px; width:'+this.width+'; position:absolute; top:'+(this.height*i)+'px; ">';
				str += this.item[i];
				str += '</div>';
			} else if ( this.type == 2 || this.type == 3 ) {
				str += '<div id="'+this.name+'item'+i+'"style="left:'+(this.width*i)+'px; width:'+this.width+'; position:absolute; top:0px; ">';
				str += this.item[i];
				str += '</div>';
			}
		}
				str += '</div>';
				return str;
	};
	
	this.scroll = function () {
	
		if ( this.pause == true ) {
	
			window.setTimeout(this.name+".scroll()",this.pausedelay);
			this.pause = false;
	
		} else {
	
			this.currentspeed = this.scrollspeed;
			if ( !this.stop ) {
				for (i = 0; i < this.itemcount; i++) {
					obj = document.getElementById(this.name+'item'+i).style;
					if ( this.type == 1 ) {
						obj.top = parseInt(obj.top) - 1;
						if ( parseInt(obj.top) <= this.height * (-1) ) obj.top = this.height * (this.itemcount-1);
						if ( parseInt(obj.top) == 0 ) this.currentspeed = this.pausedelay;
					} else if ( this.type == 2 ) {
						obj.left = parseInt(obj.left) - 1;
						if ( parseInt(obj.left) <= this.width * (-1) ) obj.left = this.width * (this.itemcount-1);
						if ( parseInt(obj.left) == 0 ) this.currentspeed = this.pausedelay;
					}
				}
			}
			window.setTimeout(this.name+".scroll()",this.currentspeed);
		}
	};
	
	this.rolling = function () {
		if ( this.stop == false  ) {
			this.next();
		}
		window.setTimeout(this.name+".rolling()",this.scrollspeed);
	}
	
	this.onmouseover = function () {
		if ( this.pausemouseover ) {
			this.stop = true;
		}
	};
	
	this.onmouseout = function () {
		if ( this.pausemouseover ) {
			this.stop = false;
		}
	};
	
	this.next = function() {
	
		for (i = 0; i < this.itemcount; i++) {
			obj = document.getElementById(this.name+'item'+i).style;
			if ( parseInt(obj.left) < 1 ) { 
				width = this.width + parseInt(obj.left);
				break;
			}
		}
		for (i = 0; i < this.itemcount; i++) {
			obj = document.getElementById(this.name+'item'+i).style;
			if ( parseInt(obj.left) < 1 ) { 
				obj.left = this.width * (this.itemcount-1);
			} else {
				obj.left = parseInt(obj.left) - width;
			}
		}
	
	}
	
	this.prev = function() {
	
		for (i = 0; i < this.itemcount; i++) {
			obj = document.getElementById(this.name+'item'+i).style;
			if ( parseInt(obj.left) < 1 ) { 
				width = parseInt(obj.left) * (-1);
				break;
			}
		}
		if ( width == 0 ) {
			total_width = this.width * (this.itemcount-1);
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) + 1 > total_width ) { 
					obj.left = 0;
				} else {
					obj.left = parseInt(obj.left) + this.width;
				}
			}
		} else {
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) < 1 ) { 
					obj.left = 0;
				} else {
					obj.left = parseInt(obj.left) + width;
				}
			}
		}
	}
	
	this.unext = function () {
		this.onmouseover();
		this.next();
		window.setTimeout(this.name+".onmouseout()",this.pausedelay);
	}
	
	this.uprev = function () {
		this.onmouseover();
		this.prev();
		window.setTimeout(this.name+".onmouseout()",this.pausedelay);
	}
	
}


function POST_POP(POST, ADDRESS){
	
	popUpWindow("/include/Post_POP.asp?POST="+POST+"&ADDRESS="+ADDRESS, "POSTPOP", "425", "400", "yes", "yes");
	
}




function Chk_Num(fo_Field) {		//','¸¦ Á¦¿ÜÇÑ ¼ýÀÚ Ã¼Å©
	if (isNaN(Repl_comma(fo_Field.value))) {
	  if (fo_Field.value != "-") {
		  alert("¼ýÀÚ¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À.");
		  fo_Field.value="";
		  fo_Field.focus();
		  fo_Field.select();
		}
	}
}

function Repl_comma(fs_str) {
	// °ª¿¡¼­ ","¸¦ Á¦°Å
	var s_Ret = ""
	for (n=0; n<fs_str.length; n++) {	if (fs_str.charAt(n) != ",") {	s_Ret += fs_str.charAt(n)	}	}
  return s_Ret
}


//Ã¼Å©µÈ Ç×¸ñ ±¸ºÐÀÚ·Î ÇÕÃÄ¼­ ¸®ÅÏ
//ex) getCheckedValue(frmList.chk,"|")'
function getCheckedValue(chk, diffLetter){
	var rtnValue="";
	
	if (chk == null){ return ""; }
	if (diffLetter == null || diffLetter == ""){
		diffLetter="|";
	}
	
	
	var chkLen = chk.length;
	if (chk.length==null){
		chkLen = 1;
	}
	for (i=0; i< chkLen;i++){
		if(parseInt(chkLen)==1){
			if(chk.checked){
				rtnValue = rtnValue+chk.value;
				rtnValue = rtnValue+diffLetter;
			}
		}else {
			if(chk[i].checked){
				rtnValue = rtnValue+chk[i].value;
				rtnValue = rtnValue+diffLetter;
			}
		}
	}
	//¸Ç¿ìÃø¿¡ ºÙÀº ±¸ºÐÀÚ Á¦°ÅÇÏ±â
	if (rtnValue.length >= 1 ) {
			if (rtnValue.lastIndexOf(diffLetter) != -1){
					rtnValue = rtnValue.substring(0,rtnValue.length-1);
			}
	}
	return rtnValue;
	
}


