b3vv.com Open in urlscan Pro
59.15.11.49  Public Scan

Submitted URL: http://b3vv.com/acromate/js/mcr_common.js
Effective URL: https://b3vv.com/acromate/js/mcr_common.js
Submission: On October 23 via api from US — Scanned from CA

Form analysis 0 forms found in the DOM

Text Content

/**
 * 
 */
var toJsonText4SpcChr = function(script_json){
	if( script_json ){
		script_json = script_json.trim();
		script_json = script_json.replace(/\\n/gi, '|___n___|');
		script_json = script_json.replace(/\n/gi, '|___n___|');
		script_json = script_json.replace(/\\r/gi, '|___r___|');
		script_json = script_json.replace(/\r/gi, '|___r___|');
		script_json = script_json.replace(/\\t/gi, '|___t___|');
		script_json = script_json.replace(/\t/gi, '|___t___|');
		script_json = script_json.replace(/\\\"/gi, '|___`___|');
		script_json = script_json.replace(/\\"/gi, '|___`___|');
		script_json = script_json.replace(/\"/gi, '|___`___|');
		script_json = script_json.replace(/"/gi, '|___`___|');
		script_json = script_json.replace(/\\\"/gi, '|___``___|');
	}
	return script_json;
};
var getJsonTextFilter = function(desc_json){
	if( desc_json&& desc_json.indexOf('|___') !=-1 ){
		desc_json = desc_json.replace(/\|___n___\|/gi, '\n');
		desc_json = desc_json.replace(/\|___r___\|/gi, '\r');
		desc_json = desc_json.replace(/\|___t___\|/gi, '\t');
		desc_json = desc_json.replace(/\|___`___\|/gi, '"');
		desc_json = desc_json.replace(/\|___``___\|/gi, '"');
		desc_json = desc_json.replace(/\\\\/gi, '');
		desc_json = desc_json.replace(/\\/gi, '');
	}
	return desc_json;
};
	
/**
 * get position fo the tag (Only PC View)
 * 
 * ex) onkeyup="onKeyRemoveForPass(this, parent.strNoti_InvalidInputValue, function(self){ onKeyInputDisplayLastWord(self, self.value, 30, -2); } );"
 */
function getPosX(obj){
	var left = 0;
	if( obj.offsetParent ){
	   while(1){
	      left += obj.offsetLeft;
	      if(!obj.offsetParent) break;
	      obj = obj.offsetParent;
	   }
	}else if(obj.x){
	   left += obj.x;
	}
	return left;
}
function getPosY(obj){
	var top = 0;
	if( obj.offsetParent ){
	   while(1){
	      top += obj.offsetTop;
	      if(!obj.offsetParent) break;
	      obj = obj.offsetParent;
	   }
	}else if(obj.y){
	   top += obj.y;
	}
	return top;
}
function doGetCaretPosition (oField) {
	/*
	* Returns the caret (cursor) position of the specified text field (oField).
	* Return value range is 0-oField.value.length.
	*/
	// Initialize
	var iCaretPos = 0;
	// IE Support
  	if (document.selection) {
    	// Set focus on the element
    	oField.focus();
    	// To get cursor position, get empty selection range
    	var oSel = document.selection.createRange();
    	// Move selection start to 0 position
    	oSel.moveStart('character', -oField.value.length);
    	// The caret position is selection length
    	iCaretPos = oSel.text.length;
  	}
  	// Firefox support
  	//else if (oField.selectionStart || oField.selectionStart == '0')
  	else if (typeof oField.selectionStart==='number')
    	iCaretPos = oField.selectionDirection=='backward' ? oField.selectionStart : oField.selectionEnd;

  	// Return results
  	return iCaretPos;
}
var onKeyInputDisplayLastWord = function(inputObj, text, posX, posY, width, height, plusGap, color, posMaxX){
	if(!inputObj) return;
	var lastword = inputObj.value.length==0? "" : inputObj.value.substring(inputObj.value.length-1);
	if(text){
		lastword = text.length==0? "" : text.substring(text.length-1);
	}
	if(lastword.length==0) return;

	var labId = "lab_"+ inputObj.id;
	var ex_obj = document.getElementById(labId);
	if( !ex_obj ){
		ex_obj = document.createElement("div");
		ex_obj.id = labId;
	}else{
		ex_obj.innerHTML = '';
	}
	var curserIdx = doGetCaretPosition(inputObj);
	//posX='70'; posY='-35';
	if(!posX) posX=30; 
	if(!posY) posY=-1 ;
	if(!plusGap) plusGap = 5;
	if(!color) color='#ececec' ;
	if(!posMaxX) posMaxX = inputObj.offsetWidth;
	
	if( posMaxX >= posX + (plusGap*curserIdx) ){
		posMaxX = posX + (plusGap*curserIdx);
	}
    ex_obj.style.left = posMaxX +"px";
    ex_obj.style.top = posY +"px";
    ex_obj.style.width = '20px';
    ex_obj.style.height = '20px';
    ex_obj.style.backgroundColor = color;
    ex_obj.style.border = '1px solid #bbbbbb';
    ex_obj.style.zIndex = '5';
    ex_obj.style.position = 'absolute';
    //ex_obj.style.display = ex_obj.style.display=='none'?'block':'none';
    ex_obj.style.display = 'block';
    ex_obj.style.textAlign = 'center';
    
    var txtObj = document.createTextNode( lastword );
    //ex_obj.innerHTML = ""+ lastword +"";
    ex_obj.appendChild(txtObj);
    inputObj.parentNode.appendChild(ex_obj);
    //document.appendChild(ex_obj);
    if( timeoutDisplayLastWord 
    	&& ( !labidOfLastWord || labidOfLastWord == labId )
    		) clearTimeout( timeoutDisplayLastWord );
    timeoutDisplayLastWord = setTimeout(function(){
    		ex_obj.style.display = 'none';
	    }, 800);
    labidOfLastWord = labId;
    //alert( ex_obj.style.left +' : '+ ex_obj.style.top );
};
var timeoutDisplayLastWord;
var labidOfLastWord;

/**
 * # Only AlphaNumeric
 * 	onkeydown="onKeyOnlyAlphaNumeric(this, event, parent.strNoti_OnlyAlphanumeric)"
	onkeypress="onKeyOnlyAlphaNumeric(this, event, parent.strNoti_OnlyAlphanumeric, this.onkeydown)"
	onblur="onKeyOnlyAlphaNumeric(this, event, parent.strNoti_OnlyAlphanumeric, this.onkeydown)"
	onkeyup="onKeyRemoveCharKor(this)"
 */
function onKeyOnlyAlphaNumeric(obj, ee, str_noti, funckey) {
	var event = ee || window.event;
	var keyID = (event.which) ? event.which : event.keyCode;
    var keyCode = keyID == 0 ? event.charCode : event.keyCode;
    
    // 예외키 규정
    var specialKeys = new Array();
    specialKeys.push(8); //Backspace
    specialKeys.push(9); //Tab
    specialKeys.push(46); //Delete
    specialKeys.push(36); //Home
    specialKeys.push(35); //End
    specialKeys.push(37); //Left
    specialKeys.push(39); //Right
    specialKeys.push(16); //Shift
    specialKeys.push(189); //Underbar
    var ret = ((keyCode >= 48 && keyCode <= 57) || (keyCode >= 65 && keyCode <= 90) || (keyCode >= 97 && keyCode <= 122)
    		|| keyCode == 229 /* for Mobile */
    		|| (specialKeys.indexOf(ee.keyCode) != -1 && ee.charCode != ee.keyCode) );

    // error message
    if(!ret){
    	event.target.value += '';
    	event.returnValue = false;
    	if(11==1|| !funckey && str_noti) alert(str_noti +' ('+keyCode+')' );
    	//event.target.focus();
    	if(11==1&& !funckey)
    		event.target.value = event.target.value.replace(/[^(a-zA-Z0-9-_)]/gi, '');
    	
    	obj.value = event.target.value.replace(/[^(a-zA-Z0-9-_)]/gi, '');
    	return false;
    }//else event.returnValue = true;
    
    /*if(!funckey && keyCode == 229){
    	//obj.value = event.target.value.replace(/[^(a-zA-Z0-9)]/gi, '');
    	return false;
    }*/
    if(funckey)
    	return false;
    
    //if (!ret) { alert("only alphanumeric can be allowed to input."); }    
    /*
     * <input type="text"​ 
      	onKeyPress="javascript:return isFilterAlphaNumeric(event);" ondrop="javascript:return false;" style="ime-mode:disabled;"
    	 onkeyup="this.value=this.value.replace(/[^A-Za-z0-9]/gi, '')" 
    	/>
     */
    /*
     *	48~57:일반 숫자키 코드, 96~105:숫자키패드 숫자키 코드 
    	event = event || window.event;
		var keyID = (event.which) ? event.which : event.keyCode;
		if( ( keyID >=48 && keyID <= 57 ) || ( keyID >=96 && keyID <= 105 ) ) { 숫자  }
			
		편집키 서용 (delete, backspace, ...)
		if( ( keyID >=48 && keyID <= 57 ) || ( keyID >=96 && keyID <= 105 ) || keyID == 8 || keyID == 46 || keyID == 37 || keyID == 39 )
		
		onkeyup="event.target.value = event.target.value.replace(/[^0-9]/g, '');"
			
    	<input type="text"​ 
      		onkeydown="javascript:return onKeyOnlyAlphaNumeric(this, event, '');" 
      		onKeyPress="javascript:return onKeyOnlyAlphaNumeric(this, event, '');" 
      		ondrop="javascript:return false;" style="ime-mode:disabled;"
    	 	onkeyup="onKeyRemoveCharKor(this)" 
    	/>
     */
    return ret;
}
function onKeyOnlyNumeric(event) {
	var inputChar = String.fromCharCode(event.keyCode);
	//var keyID = (event.which) ? event.which : event.keyCode;
	var ret = false;
	if (inputChar == "" && inputChar == null) { 
      ret = false; 
	} else { 
		if (inputChar.search(/[0-9]+$/gi) >= 0) { ret = true; } else { ret = false; } 
	}
	// error message
	if (11==1&& !ret) { 
		alert("영어와 숫자만 입력 가능. \n char:" + String.fromCharCode(event.keyCode) + ", keycode: " + event.keyCode); 
	}
    return ret;
}
function onKeyRemoveCharKor(obj){
	var pattern = /[^(.a-zA-Z0-9-_)]/;
	//alert( event.keyCode );
	if( pattern.test(obj.value) ){
		obj.value = obj.value.replace(/[^.A-Za-z0-9-_]/gi, '');
		//obj.focus();
		//return false;
	}
}

/**
 * # Only Number
 * onkeydown="onKeyOnlyNumber(event, parent.strNoti_OnlyNumber)" 
   onkeypress="onKeyOnlyNumber(event, parent.strNoti_OnlyNumber, this.onkeydown)"  
   onblur="onKeyOnlyNumber(event, parent.strNoti_OnlyNumber, this.onkeydown)" 
   onkeyup="onKeyRemoveChar(event)" 
 */
function onKeyOnlyNumber(obj, event, str_noti, funckey){
	if(1==1) return;
	event = event || window.event;
	var keyID = (event.which) ? event.which : event.keyCode;
	if ( (keyID >= 48 && keyID <= 57) || (keyID >= 96 && keyID <= 105) 
			|| keyID == 8 || keyID == 46 || keyID == 37 || keyID == 39
			){ 
		return;
	}else{
    	//event.target.value += '';
		event.returnValue = false;
    	if(11==1|| !funckey && str_noti){
    		alert(str_noti +''+ keyID);
    	}
    	//event.target.focus();
    	//alert( event.target.value +'='+ (/(?=.*[^0-9])/).test( event.target.value ) );
    	
    	if( /(?=.*[^0-9])/.test( event.target.value ) ){
    		//alert('ev: '+event.target.value + ', obj: '+obj.value);
    		event.target.value = event.target.value.replace(/[^0-9]/gi, '');
        	return false;
    	}else{
    		//alert('obj: '+ obj.value);
    		return false;
    	}
	}
}
function onKeyRemoveNotNumber(obj, str_noti, returnFunc ) {// onKeyRemoveChar
	var pattern = /[^0-9]/;
	if( pattern.test(obj.value) ){
		obj.value = obj.value.replace(/[^0-9]/gi, '');
		if(str_noti) alert(str_noti);
	}
	if(returnFunc) returnFunc();
}

/**
 * # Just Number with Dot
 * onkeydown="onKeyOnlyNumberWithDot(this, event, parent.strNoti_OnlyNumber)" 
   onkeypress="onKeyOnlyNumberWithDot(this, event, parent.strNoti_OnlyNumber, this.onkeydown)"  
   onblur="onKeyOnlyNumberWithDot(this, event, parent.strNoti_OnlyNumber, this.onkeydown)" 
   onkeyup="onKeyRemoveNotNumberWithDot(this, parent.strNoti_OnlyNumber)" 
 */
function IsAllNumWithDot(str)
{
	for (var i=0; i<str.length; i++) {
		if ((str.charAt(i) >= '0' && str.charAt(i) <= '9') || (str.charAt(i) == '.' ))
			continue;
		return 0;
	}
	return 1;
}
function onKeyOnlyNumberWithDot(obj, event, str_noti, funckey){
	if(1==1) return;
	event = event || window.event;
	var keyID = (event.which) ? event.which : event.keyCode;
	if ( (keyID >= 48 && keyID <= 57) || (keyID >= 96 && keyID <= 105) 
			|| keyID == 8 || keyID == 46 || keyID == 37 || keyID == 39
			){ 
		return;
	}else{
    	//event.target.value += '';
		event.returnValue = false;
    	if(11==1|| !funckey && str_noti){
    		alert(str_noti +''+ keyID);
    	}
    	//event.target.focus();
    	//alert( event.target.value +'='+ (/(?=.*[^0-9^.])/).test( event.target.value ) );
    	
    	if( /(?=.*[^0-9^.])/.test( event.target.value ) ){
    		//alert('ev: '+event.target.value + ', obj: '+obj.value);
    		event.target.value = event.target.value.replace(/[^0-9^.]/gi, '');
        	return false;
    	}else{
    		//alert('obj: '+ obj.value);
    		return false;
    	}
	}
}
function onKeyRemoveNotNumberWithDot(obj, str_noti, returnFunc ) {// onKeyRemoveChar
	if( ! IsAllNumWithDot(obj.value) ){
		obj.value = obj.value.replace(/[^0-9^.]/gi, '');
		if(str_noti) alert(str_noti);
	}
	if(returnFunc) returnFunc();
}

/**
 * # Just Mac address
   onkeyup="onKeyRemoveForMac(this, parent.strNoti_InvalidInputValue)" 
 */
function onKeyRemoveForMac(obj, str_noti, returnFunc ) {
	var regexp = /[^(a-zA-Z0-9-:)]/;
	if( regexp.test(obj.value) ){// !isMacAddress(obj.value)
		obj.value = obj.value.replace(/[^A-Za-z0-9-:]/gi, '');
		//obj.value = obj.value.replace(/[^0-9^.]/gi, '');// /^\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}$/
		if(str_noti) alert(str_noti);
	}
	if(returnFunc) returnFunc();
}

function onKeyRemoveForPass(obj, str_noti, checkFunc, returnFunc) {
	var funcCheck = function(){
		//var pattern = /[^A-Za-z\d./~!@#$%&*_=\-+\:\^\\]/;
		//var pattern = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{6,}$/;
		//var pattern = /[^A-Za-z\d$@$!%*#?&]/;
		var pattern = /[^A-Za-z\d./~!@#$%&*_=\-+\:]/;
		if( pattern.test(obj.value) ){
			obj.value = obj.value.replace(/[^A-Za-z\d./~!@#$%&*_=\-+\:]/gi, '');
			/* 
			 obj.value = obj.value.replace('i', '');
			 */
			if(str_noti) alert(str_noti);
		}
		if(returnFunc) returnFunc(obj);
	};
	
	if(checkFunc){
		checkFunc(obj);
		setTimeout(funcCheck, 80);
	}else funcCheck();
}

/** 
 * hc-add : 190314
 * String.format()
 */
function toStringFormat() {
    var a, b, c;
    a = arguments[0];
    b = [];
    for(c = 1; c < arguments.length; c++){
        b.push(arguments[c]);
    }
    for (c in b) {
        a = a.replace(/%[a-z]/, b[c]);
    }
    return a;
    //toStringFormat('%d ducks, 55 %s', 12, 'cats'); // 12 ducks, 55 cats
}

/** 
 * hc-add : 190308
 * onfocus for mobile 
 */
function onInputFocus(obj/*input*/, targetName/*tagName*/, dpdevice/*mobile|pc*/){

	var focusFunc = function(){ 
		self.location.hash = targetName; 
		obj.focus(); 
	};
	if( dpdevice == 'mobile' ){
		setTimeout(focusFunc, 1000);
		return;
	}
	setTimeout(focusFunc, 500);
}
function onInputFocusOut(){
	self.location.hash = ''; 
}
function onInputFocusPopup(obj/*input*/, targetName/*tagName*/, dpdevice/*mobile|pc*/){
	if(11==1) return onInputFocus(obj, targetName, dpdevice);

	var focusFunc = function(){ 
		var nTop = obj.getBoundingClientRect().top*1;
		var popview = document.getElementById('popup_view');
		if(nTop) popview.scrollTop = nTop;

		obj.focus(); 
	};
	if( dpdevice == 'mobile' ){
		setTimeout(focusFunc, 1000);
		return;
	}
	setTimeout(focusFunc, 500);
}

/** 
 * hc-add : 180711
 * get valid size by totalsize 
 */
function getValidVolumeSize(totalSize, arrUsedSize){
	var degree = 'MB';
	totalSize = totalSize.indexOf(degree)!=-1
				? totalSize.substring(0, totalSize.length-2) *1
				: totalSize *1 ;
	for (var i = 0; i < arrUsedSize.length; i++) {
		arrUsedSize[i] = arrUsedSize[i].indexOf(degree)!=-1
					? arrUsedSize[i].substring(0, arrUsedSize[i].length-2) *1
					: arrUsedSize[i] *1 ;
		totalSize -= (arrUsedSize[i] *1);
	}
	return totalSize<=0 ? 0 : totalSize ;
}

/**
 * get blank index of Volume number ;
 */
function getIndexVolBlankMark(size){
	var idx = size.indexOf(" ");
	if(idx==-1) idx = size.indexOf("&nbsp;");
	return idx;
} 

/** 
 * hc-add : 180711
 * using size convert 
 * var value = parseFloat(value).toFixed( 0 );
 */
function toDisplayUsedSize(size){
	var markdegree = 1024;
	size = (size+'').trim();
	var resultSize = size;
	var roundIdx = 1;
	var nRound = 0 ;
	//var degree = size.substring(size.length-2);
	if( !isNaN(size) ){
		size = size +"MB";
		//alert('not NaN :'+ resultSize);
	}else 
		size = size.toUpperCase();
	
	if(size.indexOf("K")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1)	idx = size.indexOf("K");
		resultSize = size.substring( 0, idx).trim() * 1 ;
		for(var i=1; i<6; i++){
			nRound = resultSize/Math.pow(markdegree, i);
			if( nRound < 1 ){
				roundIdx = ((resultSize/Math.pow(markdegree, i-1))+'').indexOf('.')!=-1? 1:0;
				if(markdegree==1000)
					resultSize = ( i==1? (resultSize).toFixed( 0 )+"&nbsp;KB"
							: i==2? (resultSize/Math.pow(markdegree, 1)).toFixed( 0 )+"&nbsp;MB"
							: i==3? (resultSize/Math.pow(markdegree, 2)).toFixed( 0 )+"&nbsp;GB"
							: i==4? (resultSize/Math.pow(markdegree, 3)).toFixed( 0 )+"&nbsp;TB"
							: (resultSize/Math.pow(markdegree, 4)).toFixed( 0 )+"&nbsp;HB" ); 
				else if(1==1)
					resultSize = ( i==1? Math.floor(resultSize)+"&nbsp;KB"
							: i==2? Math.floor(resultSize/Math.pow(markdegree, 1))+"&nbsp;MB"
							: i==3? Math.floor(resultSize/Math.pow(markdegree, 2))+"&nbsp;GB"
							: i==4? Math.floor(resultSize/Math.pow(markdegree, 3))+"&nbsp;TB"
							: Math.floor(resultSize/Math.pow(markdegree, 4))+"&nbsp;HB" );
				else
					resultSize = ( i==1? (resultSize).toFixed( roundIdx )+"&nbsp;KB"
							: i==2? (resultSize/Math.pow(markdegree, 1)).toFixed( roundIdx )+"&nbsp;MB"
							: i==3? (resultSize/Math.pow(markdegree, 2)).toFixed( roundIdx )+"&nbsp;GB"
							: i==4? (resultSize/Math.pow(markdegree, 3)).toFixed( roundIdx )+"&nbsp;TB"
							: (resultSize/Math.pow(markdegree, 4)).toFixed( roundIdx )+"&nbsp;HB" ); 
				break;
			}
		}//for
	}else if(size.indexOf("M")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("M");
		resultSize = size.substring( 0, idx).trim() * 1 ;
		for(var i=1; i<5; i++){
			nRound = resultSize/Math.pow(markdegree, i);
			if( nRound < 1 ){
				roundIdx = ((resultSize/Math.pow(markdegree, i-1))+'').indexOf('.')!=-1? 1:0;
				if(markdegree==1000)
					resultSize = ( i==1? (resultSize).toFixed( 0 )+"&nbsp;MB"
							: i==2? (resultSize/Math.pow(markdegree, 1)).toFixed( 0 )+"&nbsp;GB"
							: i==3? (resultSize/Math.pow(markdegree, 2)).toFixed( 0 )+"&nbsp;TB"
							: (resultSize/Math.pow(markdegree, 3)).toFixed( 0 )+"&nbsp;HB" ); 
				else if(1==1)
					resultSize = ( i==1? Math.floor(resultSize)+"&nbsp;MB"
							: i==2? Math.floor(resultSize/Math.pow(markdegree, 1))+"&nbsp;GB"
							: i==3? Math.floor(resultSize/Math.pow(markdegree, 2))+"&nbsp;TB"
							: Math.floor(resultSize/Math.pow(markdegree, 3))+"&nbsp;HB" );
				else
					resultSize = ( i==1? (resultSize).toFixed( roundIdx )+"&nbsp;MB"
							: i==2? (resultSize/Math.pow(markdegree, 1)).toFixed( roundIdx )+"&nbsp;GB"
							: i==3? (resultSize/Math.pow(markdegree, 2)).toFixed( roundIdx )+"&nbsp;TB"
							: (resultSize/Math.pow(markdegree, 3)).toFixed( roundIdx )+"&nbsp;HB" );
				break;
			}
		}//for
	}else if(size.indexOf("G")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("G");
		resultSize = size.substring( 0, idx).trim() * 1 ;
		for(var i=1; i<4; i++){
			nRound = resultSize/Math.pow(markdegree, i);
			if( nRound < 1 ){
				roundIdx = ((resultSize/Math.pow(markdegree, i-1))+'').indexOf('.')!=-1? 1:0;
				if(markdegree==1000)
					resultSize = ( i==1? (resultSize).toFixed( 0 )+"&nbsp;GB"
							: i==2? (resultSize/Math.pow(markdegree, 1)).toFixed( 0 )+"&nbsp;TB"
							: (resultSize/Math.pow(markdegree, 2)).toFixed( 0 )+"&nbsp;HB" ); 
				else if(1==1)
					resultSize = ( i==1? Math.floor(resultSize)+"&nbsp;GB"
							: i==2? Math.floor(resultSize/Math.pow(markdegree, 1))+"&nbsp;TB"
							: Math.floor(resultSize/Math.pow(markdegree, 2))+"&nbsp;HB" ); 
				else
					resultSize = ( i==1? (resultSize).toFixed( roundIdx )+"&nbsp;GB"
							: i==2? (resultSize/Math.pow(markdegree, 1)).toFixed( roundIdx )+"&nbsp;TB"
							: (resultSize/Math.pow(markdegree, 2)).toFixed( roundIdx )+"&nbsp;HB" ); 
				break;
			}
		}//for
	}else if(size.indexOf("T")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("T");
		resultSize = size.substring( 0, idx).trim() * 1 ;
		for(var i=1; i<3; i++){
			nRound = resultSize/Math.pow(markdegree, i);
			if( nRound < 1 ){
				roundIdx = ((resultSize/Math.pow(markdegree, i-1))+'').indexOf('.')!=-1? 1:0;
				if(markdegree==1000)
					resultSize = ( i==1? (resultSize).toFixed( 0 )+"&nbsp;TB"
							: (resultSize/Math.pow(markdegree, 1)).toFixed( 0 )+"&nbsp;HB" ); 
				else if(1==1)
					resultSize = ( i==1? Math.floor(resultSize)+"&nbsp;TB"
							: Math.floor(resultSize/Math.pow(markdegree, 1))+"&nbsp;HB" );
				else
					resultSize = ( i==1? (resultSize).toFixed( roundIdx )+"&nbsp;TB"
							: (resultSize/Math.pow(markdegree, 1)).toFixed( roundIdx )+"&nbsp;HB" );
				break;
			}
		}//for
	}else if(size.indexOf("H")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("H");
		resultSize = size.substring( 0, idx).trim() +"&nbsp;HB" ;
	}
	else if(size.indexOf("B")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1)	idx = size.indexOf("B");
		resultSize = size.substring( 0, idx).trim() * 1 ;
		for(var i=1; i<7; i++){
			nRound = resultSize/Math.pow(markdegree, i);
			if( nRound < 1 ){
				roundIdx = ((resultSize/Math.pow(markdegree, i-1))+'').indexOf('.')!=-1? 1:0;
				if(markdegree==1000)
					resultSize = ( i==1? (resultSize).toFixed( 0 )+"&nbsp;byte"
							: i==2? (resultSize/Math.pow(markdegree, 1)).toFixed( 0 )+"&nbsp;KB"
							: i==3? (resultSize/Math.pow(markdegree, 2)).toFixed( 0 )+"&nbsp;MB"
							: i==4? (resultSize/Math.pow(markdegree, 3)).toFixed( 0 )+"&nbsp;GB"
							: i==5? (resultSize/Math.pow(markdegree, 4)).toFixed( 0 )+"&nbsp;TB"
							: (resultSize/Math.pow(markdegree, 5)).toFixed( 0 )+"&nbsp;HB" ); 
				else if(1==1)
					resultSize = ( i==1? Math.floor(resultSize)+"&nbsp;byte"
							: i==2? Math.floor(resultSize/Math.pow(markdegree, 1))+"&nbsp;KB"
							: i==3? Math.floor(resultSize/Math.pow(markdegree, 2))+"&nbsp;MB"
							: i==4? Math.floor(resultSize/Math.pow(markdegree, 3))+"&nbsp;GB"
							: i==5? Math.floor(resultSize/Math.pow(markdegree, 4))+"&nbsp;TB"
							: Math.floor(resultSize/Math.pow(markdegree, 5))+"&nbsp;HB" ); 
				else
					resultSize = ( i==1? (resultSize).toFixed( roundIdx )+"&nbsp;byte"
							: i==2? (resultSize/Math.pow(markdegree, 1)).toFixed( roundIdx )+"&nbsp;KB"
							: i==3? (resultSize/Math.pow(markdegree, 2)).toFixed( roundIdx )+"&nbsp;MB"
							: i==4? (resultSize/Math.pow(markdegree, 3)).toFixed( roundIdx )+"&nbsp;GB"
							: i==5? (resultSize/Math.pow(markdegree, 4)).toFixed( roundIdx )+"&nbsp;TB"
							: (resultSize/Math.pow(markdegree, 5)).toFixed( roundIdx )+"&nbsp;HB" ); 
				break;
			}
		}//for
	}
	
	if( (resultSize+'').indexOf(".0")!=-1 ){
		var result = (resultSize+'').trim();
		var idx = getIndexVolBlankMark(result);
		if(idx==-1) idx = result.indexOf("M");
		if(idx==-1) idx = result.indexOf("G");
		if(idx==-1) idx = result.indexOf("T");
		if(idx==-1) idx = result.indexOf("H");
		if(idx!=-1){
			var value = result.substring( 0, idx);
			var mark = result.substring(idx);
			resultSize = value.replace(".0", "") +mark;
		}else
			resultSize = (resultSize+'').replace(".0", "") *1;
	}
	return resultSize;
}

/**
 * convert to Bite number
 */
function toBiteSize(size){
	var markdegree = 1024;
	size = (size+'').trim();
	size = size.replace(/&nbsp;/gi, ' ').trim();
	var resultSize = size;
	size = size.toUpperCase();
	if(size.toUpperCase().indexOf("K")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("K");
		resultSize = size.substring( 0, idx).trim() * 1 ;
		resultSize = resultSize * markdegree;
	}else if(size.toUpperCase().indexOf("M")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("M");
		resultSize = size.substring( 0, idx).trim() * 1 ;
		resultSize = resultSize * markdegree* markdegree;
	}else if(size.toUpperCase().indexOf("G")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("G");
		resultSize = size.substring( 0, idx).trim() * 1 ;
		resultSize = resultSize * markdegree* markdegree* markdegree;
	}else if(size.toUpperCase().indexOf("T")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("T");
		resultSize = size.substring( 0, idx).trim() * 1 ;
		resultSize = resultSize * markdegree* markdegree* markdegree* markdegree;
	}else if(size.toUpperCase().indexOf("H")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("H");
		resultSize = size.substring( 0, idx).trim() * 1 ;
		resultSize = resultSize * markdegree* markdegree* markdegree* markdegree* markdegree;
	}else if(size.toUpperCase().indexOf("B")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("B");
		resultSize = size.substring( 0, idx).trim() * 1 ;
	}else{//MB to Bite
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.length;
		resultSize = size.substring( 0, idx).trim() * 1 ;
		resultSize = resultSize * markdegree* markdegree;
	}
	
	return resultSize;//out byte
}

/**
 * convert to MB number
 */
function toBaseSize(size){
	var markdegree = 1024;
	size = (size+'').trim();
	size = size.replace(/&nbsp;/gi, ' ').trim();
	var resultSize = size;
	size = size.toUpperCase();
	var roundIdx = 1;
	if(size.toUpperCase().indexOf("K")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("K");
		resultSize = size.substring( 0, idx).trim() * 1 ;
		roundIdx = ((resultSize/Math.pow(markdegree, 1))+'').indexOf('.')!=-1? 1:0;
		if(markdegree==1000)
			 resultSize = (resultSize/Math.pow(markdegree, 1)).toFixed( 0 );//MB
		else if(1==1) resultSize = Math.floor(resultSize/Math.pow(markdegree, 1));//MB
		else resultSize = (resultSize/Math.pow(markdegree, 1)).toFixed( roundIdx );//MB
	}else if(size.toUpperCase().indexOf("M")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("M");
		resultSize = size.substring( 0, idx).trim() * 1 ;
	}else if(size.toUpperCase().indexOf("G")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("G");
		resultSize = size.substring( 0, idx).trim() * 1 ;
		resultSize = resultSize * markdegree;
	}else if(size.toUpperCase().indexOf("T")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("T");
		resultSize = size.substring( 0, idx).trim() * 1 ;
		resultSize = resultSize * markdegree*markdegree;
	}else if(size.toUpperCase().indexOf("H")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("H");
		resultSize = size.substring( 0, idx).trim() * 1 ;
		resultSize = resultSize * markdegree*markdegree*markdegree;
	}else if(size.toUpperCase().indexOf("B")!=-1){
		var idx = getIndexVolBlankMark(size);
		if(idx==-1) idx = size.indexOf("B");
		resultSize = size.substring( 0, idx).trim() * 1 ;
		roundIdx = ((resultSize/Math.pow(markdegree, 2))+'').indexOf('.')!=-1? 1:0;
		if(markdegree==1000)
			 resultSize = (resultSize/Math.pow(markdegree, 2)).toFixed( 0 );//MB
		else if(1==1) resultSize = Math.floor(resultSize/Math.pow(markdegree, 2));//MB
		else resultSize = (resultSize/Math.pow(markdegree, 2)).toFixed( roundIdx );//MB
	}
	if( (resultSize+'').indexOf(".")!=-1 ){
		//resultSize = (resultSize+'').replace(".0", "") *1;
		resultSize = (resultSize+'').substring(0, (resultSize+'').lastIndexOf('.') ) *1;
	}
	return resultSize;//out MB
}

/* Language convert */
function translateLabelHTML(strElementID, strTransName){
	var e = document.getElementById(strElementID);
	if( e!= null )
		e.innerHTML = _(strTransName);
}

function translateLabelValue(strElementID, strTransName){
	var e = document.getElementById(strElementID);
	if( e!= null )
		e.value = _(strTransName);
}

/*
 *	IE6 등에서 innerHTML에 form 또는 복잡한 Tag가 들어갈때 오류가 발생하므로
 *	이를 회피하기 위한 code
 *  (= the code is the exception for 'innerHTML' method at IE6 browser or etc.)
 */
function mcr_setInnerHTML(containerId, setHtml) {
	var newdiv = document.createElement("div");
	newdiv.innerHTML = setHtml;
	var container = document.getElementById(containerId);
	if( container != null ){
		container.appendChild(newdiv);
	}
}

/* ==================================================
	Form 제어 (= the method for the values of Form )
   ================================================== */

/* init combo */
function initCombo(e, initValue){
	if( e!= null ){
		for (var i = 0; i < e.length; i++) {
			if ( e.options[i].value == initValue ) {
				e.options[i].selected=true;
			}
		}
	}
}

/* init checkbox */
function initCheckbox(e, initValue){
	if( e!= null ){
		if( initValue == "1" ){
			e.checked = true;
		}else{
			e.checked = false;
		}
	}
}
/* init radiobutton */
function initRadio(e, initValue){
	if( e!= null ){
		for (var i = 0; i < e.length; i++) {
			if ( e[i].value == initValue ) {
				e[i].checked=true;
			}
		}
	}
}
/* init textbox */
function initText(e, initValue){
	if( e!= null ){
		if( initValue != null && initValue.length > 0 ){
			e.value = initValue;
		}else{
			e.value = "";
		}
	}
}

/*
 * div, span, table, tr 등에서 동작됨
 */
function objectShow(obj, bShow){
	if( obj == null ) return;
	if (bShow){
		obj.style.display = "";
	}else{
		obj.style.display = "none";
	}
}

/*
 * form data element(input, ... )
 */
function objectDisable(obj, bDisable){
	if( obj == null ) return;
	obj.disabled = bDisable;
}

function comboSetArray(targetCombo, srcArray, defaultValue){
	targetCombo.options.length = srcArray.length;
	for( var i = 0; i < targetCombo.options.length; i++ ){
		targetCombo.options[i] = new Option(srcArray[i], i);
	}
	if( defaultValue != -1 ){
		initCombo( targetCombo, defaultValue );
	}
}

function getRadioSelectedValue(field){
	if( field == null ) return -1;
	for( var i = 0; i < field.length; i++ ){
		if( field[i].checked == true ){
			return field[i].value;
		}
	}
	return -1;
}

/* init combo */
function initComboById(strElementID, initValue){
	return initCombo(document.getElementById(strElementID), initValue);
}
/* init checkbox */
function initCheckboxById(strElementID, initValue){
	return initCheckbox(document.getElementById(strElementID), initValue);
}

/* init radiobutton */
function initRadioByName(strElementID, initValue){
	/* radio는 동일 name에 여러개가 묶이므로 Name으로 조회, id는 unique하니 사용불가 
	(= the radio value is searched by 'NAME' field
	     cauze several are tied to the same name
	     , but not used the 'ID' field. )
	*/
	return initRadio(document.getElementsByName(strElementID), initValue);
}

/* init textbox */
function initTextById(strElementID, initValue){
	return initText(document.getElementById(strElementID), initValue);
} 

function setFocusById(strElementID){
	var e = document.getElementById(strElementID);
	if( e != null ){
		e.focus();
	}
}

function objectShowById(strElementID, bShow){
	objectShow(document.getElementById(strElementID), bShow);
}

function objectDisableById(strElementID, bDisable){
	objectDisable(document.getElementById(strElementID), bDisable);
}

function getComboSelectedValue(field){
	if( field != null ){
		return field[field.selectedIndex].value;
	}else{
		return "";
	}
}

function getComboSelectedValueById(strElementID){
	var e = document.getElementById(strElementID);
	return getComboSelectedValue( e );
}

function getRadioSelectedValueByName(strElementName){
	var e = document.getElementsByName(strElementName);
	return getRadioSelectedValue( e );
}

/* ==================================================
    IPv4/IPv6 validation and ����
   ================================================== */

var	inet6_addrstrlen = 46;	// INET_ADDRSTRLEN
var	inet_addrstrlen = 16;	// INET6_ADDRSTRLEN

function checkIpv4Addr(str) {
    var len = str.length;
    var parts;
    var i, j;

    if (len < 7 || len >= inet_addrstrlen) return false;

    //parts = field.value.split('.');
    parts = str.split('.');
    if (parts.length != 4) return false;

    for (i = 0; i < 4; i++) {
        if (parts[i].length < 1 || parts[i].length > 3) return false;
        for (j = 0; j < str.length; j++) {
            if (parts[i].charAt(j) < '0' && parts[i].charAt(j) > '9') return false;
        }
        val = parseInt(parts[i], 10);
        if (val < 0 || val > 255) return false;
    }

    return true;
};

function checkIpv6Addr(str) {
    var len = str.length;
    var total_colon = 0;
    var double_colon = 0;
    var colon_repeat = 0;
    var number_count = 0;
    var last_colon;
    var i;

    if (len < 2 || len >= inet6_addrstrlen) return false;

    if (len == 2) {
        if (str == "::")    return true;
        else                return false;
    }

    if (str.charAt(0) == ':') {
        if (str.charAt(1) != ':') return false;     // �ϳ��� �ݷ����� �����ϴ� ���
    }
    if (str.charAt(len-1) == ':') {
        if (str.charAt(len-2) != ':') return false; // �ϳ��� �ݷ����� ������ ���
    }

    for (i = 0; i < len; i++) {
        if (str.charAt(i) == ':') {
            total_colon++;
            if (total_colon > 7) return false;  // �ݷ��� 7���� �Ѵ� ���
            colon_repeat++;
            if (colon_repeat > 2) return false; // �ݷ��� �������� 3�� �̻��� ���
            else if (colon_repeat == 2) {
                double_colon++;
                if (double_colon > 1) return false; // "::"�� �ѹ��� �־�� �Ѵ�.
            }
            if (number_count > 4) return false; // �ݷ� ������ ���ڰ� 4�ڸ� �Ѵ� ���
            number_count = 0;
            last_colon = i;
        }
        else if ((str.charAt(i) >= '0' && str.charAt(i) <= '9') || (str.charAt(i) >= 'A' && str.charAt(i) <= 'F') || (str.charAt(i) >= 'a' && str.charAt(i) <= 'f')) {
            colon_repeat = 0;
            number_count++;
            if (number_count > 4) return false; // �ݷ� ������ ���ڰ� 4�ڸ� �Ѵ� ���
        }
        else if (str.charAt(i) == '.') {
            //  ������ ���� IPv4 mapping �ּ� ���¸� Ȯ���Ѵ�.
            //      "fff1:fff2:fff3:fff4:fff5:fff6:255.255.255.255"
            if (total_colon < 2 || total_colon > 6) return false;   // �ּ��� �ݷ� 2 ~ 6���̾�� �Ѵ�.
            if (total_colon < 6 && double_colon != 1) return false;  // �ݷ��� 6�� �̸��� ��� ���� �ݷ��� �־�� �Ѵ�.
            return checkIpv4Addr(str.substr((last_colon + 1), (len - i)));
        }
        else {
            return false;   // �߸��� ���ڰ� ���� �ִ� ���
        }
    }

    if (double_colon == 0 && total_colon != 7) return false;    // "::"�� �ִ� ��츦 �����ϸ� ':'�� �ݵ�� 7������ �Ѵ�.

    return true;
}

function getWindowLocationHost(loc){
    var hostname = loc.hostname;
    var port = loc.port;
    // IPv6 url address format
    if( hostname.charAt(0) == '[' && hostname.charAt(hostname.length-1) == ']') {
        if( port.length == 0 ) {
            return loc.hostname;
        } else {
            return loc.hostname+":"+loc.port;
        }
    }
    // IPv6 format but '[' + ']' removed -> Internet Explore
    if( this.checkIpv6Addr(hostname) == true ) {
        if( port.length == 0 ) {
            return "["+loc.hostname+"]";
        } else {
            return "["+loc.hostname+"]"+":"+loc.port;
        }
    }
    // IPv4 or the others
    if( port.length == 0 ) {
        return loc.hostname;
    } else {
        return loc.hostname+":"+loc.port;
    }
}

/* ==================================================
	Data ���� 
   ================================================== */
/* data : value type */   
function isEmpty( data ){
	if( data == null || data == "" ) return true;
	return false;
}

function isDigit(data) {
	var string = "1234567890.";
	for( var i=0;i<data.length;i++){
		if (string.indexOf(data.charAt(i))==-1){
			return false;
		}
	}
	return true;
}


/* data : value type */   
function isHex( data ){
	var string = "0123456789ABCDEF";
	for( var i=0;i<data.length;i++){
		if( string.indexOf( data.charAt(i).toUpperCase() ) == -1 ){
			return false;
		}
	}
	return true;
}

/* data : value type */ 
function isIpAddress(ipaddr){
	// 0~3 : ipaddress, 4 - netmask (optional)
	var re = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}[/\d{1,2}]?/;
    
	if(re.test(ipaddr) == true){
		var parts = ipaddr.split(/\.|\//);
		if( parts.length > 4 ){
			return false;
		}
		/* check part range */
		for(var i=0; i<parts.length; i++){
			if (parseInt((parts[i]),10) > 255){
				return false;
			}
		}
		return true;
	} else {
		return false;
	}
} 

/* data : value type */ 
function isMacAddress(mac){
    var re = /^\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}$/;
    
    if(re.test(mac) == true){  
		var string = "0123456789ABCDEF:";
        for( var i=0;i<mac.length;i++){
			if( string.indexOf( mac.charAt(i).toUpperCase() ) == -1 ){
				return false;
			}
		}
	}else{
		return false;
	}
	return true;
}

function isKorean(str){
	//var regexp = /[ㄱ-ㅎ|ㅏ-ㅣ|가-힝]/;
	var regexp = /[ㄱ-힣]/g;
	return regexp.test( str );
}

function checkKoreanTextFormArray(arrTextForm){
	var ret = true;
	var e;
	var arrSize = arrTextForm.length;
	for( var i = 0; i < arrSize; i++ ){
		e = document.getElementById(arrTextForm[i]);
		if( e != null ){
			if( isKorean( e.value ) ){
				e.focus();
				ret = false;
				break;
			}
		}
	}
	return ret;
}


/*
 * range check
 *	1 	: success
 *	0 	: obj is null
 *	-1	: empty
 *	-2	: failed
 */
function validateRange(obj, base, min, max, bFocus){
	var nRet = 0;
	var nValue = 0;
	
	if( obj == null )	nRet = 0;
	else if( isEmpty(obj.value) == true )	nRet = -1;
	else{
		nValue = parseInt(obj.value, base);
		if( min <= nValue && nValue <= max ){
			nRet = 1;
		}else{
			nRet = -2;
		}
	}
	
	if( bFocus && nRet <= -1 ){
		obj.focus();
	}
	return nRet;
}

function validateRangeById(strElementID, base, min, max, bFocus){
	var ret = validateRange(document.getElementById(strElementID), base, min, max, bFocus);
	return ret;
}

// �ѱ� length check
function getByteLength(str){
	return(str.length+(escape(str)+"%u").match(/%u/g).length-1);
}

/* 
	HTTP Request Define
*/
function httpRequest(url, content, handler, handlerError, ntimeout, handlerTimeout, isIgnoreTag){
	var xmlHttpRequest;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		xmlHttpRequest = new XMLHttpRequest();
		if (1!=1&& xmlHttpRequest.overrideMimeType) {
			xmlHttpRequest.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	
	if (!xmlHttpRequest) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	if( xmlHttpRequest ){
		xmlHttpRequest.onreadystatechange = function(){
			//alert("requestHandler:" + xmlHttpRequest);
			if( xmlHttpRequest != null ){
				if( xmlHttpRequest.readyState == 4 ){
					if( 1==1|| xmlHttpRequest.status == 200 ){
						var strResponse = xmlHttpRequest.responseText+'';
						if(isIgnoreTag){
							handler(strResponse, xmlHttpRequest.status);
						}else{
							var idx = strResponse.lastIndexOf('<br />');
			                handler( 1==1&&idx!=-1? strResponse.substring(idx+6) : strResponse, xmlHttpRequest.status);
						}
					} else {
						if( handlerError != null ){
							handlerError(xmlHttpRequest.status, xmlHttpRequest.responseText);
						}else{
							alert('There was a problem with the request.');
						}
					}
				}
			}else{
				alert('XMLHttpRequest is not created');
			}
		}
		
		if( url.indexOf("?")!=-1 ){
			url += "\&time="+(new Date()).getTime();
		}else{
			url += "\?time="+(new Date()).getTime();
		}
		xmlHttpRequest.open('GET', url, true);
		if(ntimeout){
			setTimeout(function () {     /* vs. a.timeout */
		        if (xmlHttpRequest.readyState < 4) {
		        	xmlHttpRequest.abort();
		        	handlerTimeout();
		        }
		    }, ntimeout);
			/*
			xmlHttpRequest.ontimeout = function (e) {
				handlerTimeout();
			};
			xmlHttpRequest.timeout = ntimeout; //time in milliseconds
			*/
		}
		//xmlHttpRequest.setRequestHeader('Content-Type','text/html;charset=utf-8');
		xmlHttpRequest.send(null);
	}
	
	return true;
}

async function fetchWithTimeout(url, options = {}) {
	var timeoutid;
	if (options.timeout) {
		/*const { timeout = 8000 } = options;*/
		const controller = new AbortController();
		timeoutid = setTimeout(() => controller.abort(), options.timeout);
		options.signal = controller.signal;
	}
	const response = await fetch(url, options);
	if(timeoutid) clearTimeout(timeoutid);
	return response;
}
async function httpRequestPost(url, params, handler, handlerError
									, ntimeout, handlerTimeout, isIgnoreTag){
	
	/*var formBody = [];
	for (var property in details) {
	  var encodedKey = encodeURIComponent(property);
	  var encodedValue = encodeURIComponent(details[property]);
	  formBody.push(encodedKey + "=" + encodedValue);
	}*/
	var formBody = params;
	if(formBody) {
		formBody.push("time=" + (new Date()).getTime());
		formBody = formBody.join("&");
	}
	
	var options = {
		method: 'POST',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
		},
		body: formBody,
		timeout: ntimeout,
	}
	
	try{
		var response = await fetchWithTimeout(url, options);
		if (response.status && response.status == 200) {
		    /* Get and show the message */
		    let result = await response.text();
		    if(handler) handler(result);
		    return true;
		}
	}catch(err){
		/*console.log(err.name === 'AbortError');*/
		if(err.name === 'AbortError'){
			if(handlerTimeout) handlerTimeout();
			return false;
		}
	}
	if(handlerError) handlerError();
	return false;
}

/* 
HTTP Request Define
*/
function httpRequestByPost(url, content, handler, handlerError
		, ntimeout, handlerTimeout, isIgnoreTag){
	
	var xmlHttpRequest;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		xmlHttpRequest = new XMLHttpRequest();
		if (xmlHttpRequest.overrideMimeType) {
			xmlHttpRequest.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	
	if (!xmlHttpRequest) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	if( xmlHttpRequest ){
		xmlHttpRequest.onreadystatechange = function(){
			//alert("requestHandler:" + xmlHttpRequest);
			if( xmlHttpRequest != null ){
				if( xmlHttpRequest.readyState == 4 ){
					if( xmlHttpRequest.status == 200 ){
						//사용자 데이터 처리
						var strResponse = xmlHttpRequest.responseText+'';
						if(isIgnoreTag){
							handler(strResponse);
						}else{
							var idx = strResponse.lastIndexOf('<br />');
			                handler( 1==1&&idx!=-1? strResponse.substring(idx+6) : strResponse );
						}
					} else {
						if( handlerError != null ){
							handlerError(xmlHttpRequest.status);
						}else{
							alert('There was a problem with the request.');
						}
					}
				}
			}else{
				alert('XMLHttpRequest is not created');
			}
		}
		
		if( url.indexOf("?")!=-1 ){
			url += "\&time="+(new Date()).getTime();
		}else{
			url += "\?time="+(new Date()).getTime();
		}
		xmlHttpRequest.open('POST', url, true);
		if(ntimeout){
			setTimeout(function () {     /* vs. a.timeout */
		        if (xmlHttpRequest.readyState < 4) {
		        	xmlHttpRequest.abort();
		        	handlerTimeout();
		        }
		    }, ntimeout);
			/*
			xmlHttpRequest.ontimeout = function (e) {
				handlerTimeout();
			};
			xmlHttpRequest.timeout = ntimeout; //time in milliseconds
			*/
		}
		//xmlHttpRequest.setRequestHeader('Content-Type','text/html;charset=utf-8');
		xmlHttpRequest.send(content);
	}
	
	return true;
}

/* 
HTTP Request Define for Wan
*/
function httpRequestByPostForWan(url, content, handler, handlerError
		, ntimeout, handlerTimeout, isIgnoreTag){
	
	var xmlHttpRequest;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		xmlHttpRequest = new XMLHttpRequest();
		if (xmlHttpRequest.overrideMimeType) {
			xmlHttpRequest.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	
	if (!xmlHttpRequest) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	if( xmlHttpRequest ){
		xmlHttpRequest.onreadystatechange = function(){
			//alert("requestHandler:" + xmlHttpRequest);
			if( xmlHttpRequest != null ){
				if( xmlHttpRequest.readyState == 4 ){
					if( xmlHttpRequest.status == 200 ){
						//사용자 데이터 처리
						var strResponse = xmlHttpRequest.responseText+'';
						if(isIgnoreTag){
							handler(strResponse);
						}else{
							var idx = strResponse.lastIndexOf('<br />');
			                handler( 1==1&&idx!=-1? strResponse.substring(idx+6) : strResponse );
						}
					} else {
						if( handlerError != null ){
							handlerError(xmlHttpRequest.status);
						}else{
							alert('There was a problem with the request.');
						}
					}
				}
			}else{
				alert('XMLHttpRequest is not created');
			}
		}
		
		if( url.indexOf("?")!=-1 ){
			url += "\&time="+(new Date()).getTime();
		}else{
			url += "\?time="+(new Date()).getTime();
		}
		xmlHttpRequest.open('POST', url, true);
		if(ntimeout){
			setTimeout(function () {     /* vs. a.timeout */
		        if (xmlHttpRequest.readyState < 4) {
		        	xmlHttpRequest.abort();
		        	handlerTimeout();
		        }
		    }, ntimeout);
			/*
			xmlHttpRequest.ontimeout = function (e) {
				handlerTimeout();
			};
			xmlHttpRequest.timeout = ntimeout; //time in milliseconds
			*/
		}
		//xmlHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8');
		xmlHttpRequest.setRequestHeader('Upgrade-Insecure-Requests', 1);
		xmlHttpRequest.send(content);
	}
	
	return true;
}

/* 
HTTP Request Define
*/
function httpRequestByPostWithFile(url, content, handler, handlerError
		, ntimeout, handlerTimeout, isIgnoreTag){
	
	var xmlHttpRequest;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		xmlHttpRequest = new XMLHttpRequest();
		if (11==1&& xmlHttpRequest.overrideMimeType) {
			xmlHttpRequest.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	
	if (!xmlHttpRequest) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	if( xmlHttpRequest ){
		xmlHttpRequest.onreadystatechange = function(){
			//alert("requestHandler:" + xmlHttpRequest);
			if( xmlHttpRequest != null ){
				if( xmlHttpRequest.readyState == 4 ){
					if( xmlHttpRequest.status == 200 ){
						//사용자 데이터 처리
						var strResponse = xmlHttpRequest.responseText+'';
						if(isIgnoreTag){
							handler(strResponse);
						}else{
							var idx = strResponse.lastIndexOf('<br />');
			                handler( 1==1&&idx!=-1? strResponse.substring(idx+6) : strResponse );
						}
					} else {
						if( handlerError != null ){
							handlerError(xmlHttpRequest.status);
						}else{
							alert('There was a problem with the request.');
						}
					}
				}
			}else{
				alert('XMLHttpRequest is not created');
			}
		}
		
		if( url.indexOf("?")!=-1 ){
			url += "\&time="+(new Date()).getTime();
		}else{
			url += "\?time="+(new Date()).getTime();
		}
		xmlHttpRequest.open('POST', url, true);
		if(ntimeout){
			setTimeout(function () {     /* vs. a.timeout */
		        if (xmlHttpRequest.readyState < 4) {
		        	xmlHttpRequest.abort();
		        	handlerTimeout();
		        }
		    }, ntimeout);
			/*
			xmlHttpRequest.ontimeout = function (e) {
				handlerTimeout();
			};
			xmlHttpRequest.timeout = ntimeout; //time in milliseconds
			*/
		}
		//xmlHttpRequest.setRequestHeaders('accept-encoding','*');
		//xmlHttpRequest.setRequestHeader("Content-type", "multipart/form-data");
		xmlHttpRequest.send(content);
	}
	
	return true;
}

/* 
	HTTP Request Define
*/
/*
function xmlhttpRequest(reqMethod, url, content, handler, user, password, arrReqHeader, splitter){
	var xmlHttpRequest;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		xmlHttpRequest = new XMLHttpRequest();
		if (xmlHttpRequest.overrideMimeType) {
			xmlHttpRequest.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	
	if (!xmlHttpRequest) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	if( xmlHttpRequest ){
		xmlHttpRequest.onreadystatechange = function(){
			//alert("requestHandler:" + xmlHttpRequest);
			if( xmlHttpRequest != null ){
				if( xmlHttpRequest.readyState == 4 ){
					if( xmlHttpRequest.status == 200 ){
						//����� ������ ó��
						handler(1, xmlHttpRequest.responseText, xmlHttpRequest.status);
					} else {
						handler(0, "", xmlHttpRequest.status);
					}
				}
			}else{
				alert('XMLHttpRequest is not created');
			}
		}
		
		xmlHttpRequest.open(reqMethod, url, true, user, password);
		if( arrReqHeader != null ){
			for( var i = 0; i < arrReqHeader.length; i++ ){
				var pair = arrReqHeader[i].split(splitter);
				if( pair.length == 2 ){
					xmlHttpRequest.setRequestHeader(pair[0], pair[1]);
				}
			}
		}
		xmlHttpRequest.send(content);
	}
	return true;
}
*/

/* 
	Cookie
*/
function setCookie(name, value, maxage, path, domain, secure){
	//IE�� max-age �������� ����
	var strExpire ="" ;
	if( maxage ){
		var expires = maxage * 1000;
		
		var today = new Date();
		var expires_date = new Date( today.getTime() + (expires) );
		strExpire = ";expires=" + expires_date.toGMTString();
	}
	var strCookie = name + "=" + escape(value) +
//		( (maxage) ? ";max-age="+maxage : "" ) +
		( (strExpire) ? strExpire : ";expires=Thu, 01-Jan-1970 00:00:01 GMT" ) +
		( ( path ) ? ";path=" + path : "" ) +
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
	
	document.cookie = strCookie;
}

function getCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function removeCookie(name) {
	setCookie(name,"", 0, "", "", "");
}

//login session cookie : "MCRSESSIONID"
//cookie format : userIndex_privilege_randomKey_userID
function isMcrPrivilege(privilege) {
	if ( privilege == '15' ) {
		return true;
	}
	return false;
}

function isRootPrivilege(privilege) {
	if ( privilege == '7' || privilege == '15' ) {
		return true;
	}
	return false;
}

function getUserPrivilege(){
	var cookieSessionID = getCookie("MCRSESSIONID");
	var privilege = 0;

	if( cookieSessionID != null ){
		var part = cookieSessionID.split('_');
		if( part.length == 4 ){
			var strPrivilege = part[1];
			privilege = parseInt(strPrivilege, 10);
		}
	}

	return privilege;
}

//cookie format : userIndex_privilege_randomKey_userID
function getUserID(){
	var cookieSessionID = getCookie("MCRSESSIONID");
	var strID = "";

	if( cookieSessionID != null ){
		var part = cookieSessionID.split('_');
		if( part.length == 4 ){
			strID = part[3];
		}
	}

	return strID;
}

/* ==================================================
	����ں� �䱸����ó��
   ================================================== */
/* Vendor�� �䱸����
	���Ѻ��� SSID ������ ���� �����ϴ� ��� 
*/
/*
	deprecated : isShow_WlanSSIDSecurityByUser ����� ��
function isShow_WlanSSIDByUser(projectCode, userPrivilege, ssidName){
	var ret = 1;
	
	if( projectCode == '0' && userPrivilege != '7' ){	// skbb 11n & no super user
		if( ssidName == 'SK_VoIP' || ssidName == 'anyway' ){
			ret = 0;
		}
	}
	
	return ret;
}
*/

function isShow_WlanSSIDByWPS(projectCode, userPrivilege, ssidName){
/*
	var ret = 1;
	if( projectCode == '32' ){	// KTHHP
		if( userPrivilege == '7' ){	//superuser
			if( ssidName == 'NESPOT' || ssidName == 'QOOKnSHOW' ){
				ret = 0;
			}
		}else{	
			if( ssidName == 'NESPOT' || ssidName == 'QOOKnSHOW' || ssidName == 'KT_SoIP' ){
				ret = 0;
			}
		}
	}else if( projectCode == '2' ){		// KTAP
		if( userPrivilege == '7' ){	//superuser
			if( ssidName == 'NESPOT' || ssidName == 'QOOKnSHOW' ){
				ret = 0;
			}
		}else{	
			if( ssidName == 'NESPOT' || ssidName == 'QOOKnSHOW' || ssidName == 'KT_SoIP' ){
				ret = 0;
			}
		}
	}
	return ret;
*/
	var ret = 0;

	// mcr user
	if ( userPrivilege == '15' ) {
		ret = 1;
	}
	// root user
	else if ( userPrivilege == '7' ) {
		if( ssidName != 'SK_VoIP' && ssidName != 'SK_VoIP_5GHz' ){
			ret = 1;
		}
	}
	// admin user
	else {
		if ( ssidName != 'SK_VoIP' && ssidName != 'SK_VoIP_5GHz' &&
			 ssidName != 'T wifi home' && ssidName != 'T wifi home_5GHz' && 
			 ssidName != 'anyway' && ssidName != 'anyway_5GHz') 
		{
			ret = 1;
		}
	}
	return ret;
}

function isShow_WlanSSIDSecurityByUser(projectCode, userPrivilege, userID, ssidName){
	/*
	var ret = 1;
	if( projectCode == '0' ){		// skbb 11n
		if( userPrivilege != '7' ){	// no super user
			if( ssidName == 'SK_VoIP' || ssidName == 'anyway' || ssidName == 'SK_SMART' ){
				ret = 0;
			}
		}else{
			//super user�� root�϶� �߰�����
			if( userID == 'root' ){
				if( ssidName == 'SK_VoIP' ){
					ret = 0;
				}
			}
		}
	}
	return ret;
	*/
	var ret = 0;

	// mcr user
	if ( userPrivilege == '15' ) {
		ret = 1;
	}
	// root user
	else if ( userPrivilege == '7' ) {
		if( ssidName != 'SK_VoIP' && ssidName != 'SK_VoIP_5G' && ssidName != 'SK_WiFi_5G'){
			ret = 1;
		}
	}
	// admin user
	else {
		if ( ssidName != 'SK_VoIP' && ssidName != 'SK_VoIP_5G' &&
			 ssidName != 'T wifi home' && ssidName != 'T wifi home_5G' && 
			 ssidName != 'anyway' && ssidName != 'anyway_5G' && ssidName != 'SK_WiFi_5G') 
		{
			ret = 1;
		}
	}
	return ret;
}

/*
 * HJKIM 2010.09.27
 *  SSID, KEY ������ HTML Code�� ��½� Space���� ���Ե� ��� �״�� ��µ��� �����Ƿ�
 *  escape charter�� ��ȯ��.
 */
function convertSpaceToEscape(string){
    var strConv = "";
/*
    for( var i = 0; i < string.length; i++ ){
        if( string[i] == ' ' ){
            strConv += "&nbsp;";
        }else{
            strConv += (""+string[i]);
        }
    }
*/
    strConv = string;
    return strConv.replace(" ", "&nbsp;");
}

/* ==================================================
	for new web 
   ================================================== */

//	page refresh
function refreshPageSize(){
	changeTable();
}

// button append
// ���� : div, span�� <div id="div_btn_apply" class="mcr_href_btn"></div> ������ ��.
//			<div id="div_btn_apply" class="mcr_href_btn"/> ���·� ����
//			���� button ó���� �̻�����.
function setHREFBtn(strDivId, strBtnType, strFormName, strBtnName, strUserFunc){
	var strName = "";
	var e = document.getElementById(strDivId);
	if( e!= null ){
		if( strBtnType == "SUBMIT" ){
			strName = "<a href='#' onclick='if("+strUserFunc+" == true) document."+strFormName+".submit();return false;'><span id='"+strBtnName+"'>"+strBtnName+"</span></a>";
		}else if( strBtnType == "RESET" ){
			strName = "<a href='#' onclick='window.location.reload();'><span id='"+strBtnName+"'>"+strBtnName+"</span></a>";
		}else{
			strName = "<a href='#' onclick='"+strUserFunc+"'><span id='"+strBtnName+"'></span></a>";
		}
		
		e.innerHTML = strName;
	}
}

/* ==================================================
	for Multiple Wlan
   ================================================== */
   
function generateMultiWlanURL(loc, wanIfIndex, bRedirect, newURL){
	var string;
	if( bRedirect ){
		if( isEmpty(newURL) ){
			string = "/goform/mcr_getWirelessFormRedirect?redirect-url="+ loc.pathname + "&wlanIfIndex="+wanIfIndex;
		}else{
			string = "/goform/mcr_getWirelessFormRedirect?redirect-url="+ newURL + "&wlanIfIndex="+wanIfIndex;
		}
	}else{
		string = newURL + "&wlanIfIndex="+wanIfIndex;
	}
	return string;
}   

/*
 * form POST�� Multiple Wlan �������� ���� ������ ���� parameter ����
 *	WlanIfIndex - ���� ���õ� Wlan Interface (physical)
 *	wlanRedirectPage - redirect �� Page
 *	�� �� �Ķ���ʹ� �� page�� hidden type�� form element�� ���ǵǾ� �־�� �Ѵ�.
 *
 *	form�� ���� �����ϹǷ� body onload�� �Ǵ� �� ���Ŀ� ȣ��Ǿ�� ��.
 *	optional parameter
 *		newURL - loc.pathname�� �״�� ������� �ʰ� �ٸ� page�� redirect �ʿ��� ���
 *		form - object, �� page�� ���� form�� �־ wlanIfIndex, wlanRedirectPage �� id�� ������ �� ���� ���
 */   
function setMultiWlanInfo(loc, wlanIfIndex, newURL, form){
	if( isEmpty(form) ){
		initTextById("wlanIfIndex", ''+wlanIfIndex);
		initTextById("wlanRedirectPage", generateMultiWlanURL( loc, wlanIfIndex, true, newURL ) );
	}else{
		form.wlanIfIndex.value = ''+wlanIfIndex;
		form.wlanRedirectPage.value = generateMultiWlanURL( loc, wlanIfIndex, true, newURL );
	}
}

/* 
 * Multi Interface - SSID index ü�踦 Array Index ü��� �����Ѵ�.
 *		Array Index			SSIDIndex		
 *			0				0
 *			1				1
 *			...
 *			maxSSID-1		maxSSID-1
 *			maxSSID			100
 *			maxSSID+1		101
 */
function convertMultiSSIDIdxToArrayIndex(nMaxSSIDCount, nSSIDIdx){
	var nMappingIdx = 0;
	if( nSSIDIdx >= 100 ){
		nMappingIdx = (nSSIDIdx - 100) + nMaxSSIDCount;
	}else{
		nMappingIdx = nSSIDIdx;
	}
	return nMappingIdx;
}

function mcr_getWlanIfIndex(nPhyIndex, nVapIndex){
	if( nVapIndex < 0 ) nVapIndex = 0;
	return nPhyIndex*100 + nVapIndex;
}

/* ==================================================
	for Progress bar (upgrade)
   ================================================== */

function getRefToDivNest(divID, oDoc)
{
  if( !oDoc ) { oDoc = document; }
  if( document.layers ) {
    if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
    for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
        y = getRefToDivNest(divID,oDoc.layers[x].document); }
    return y; } }
  if( document.getElementById ) { return document.getElementById(divID); }
  if( document.all ) { return document.all[divID]; }
  return document[divID];
}

function progressBar( oBt, oBc, oBg, oBa, oWi, oHi, oDr )
{
  MWJ_progBar++; this.id = 'MWJ_progBar' + MWJ_progBar; this.dir = oDr; this.width = oWi; this.height = oHi; this.amt = 0;
  //write the bar as a layer in an ilayer in two tables giving the border
  document.write( '<span id = "progress_div" class = "off" > <table border="0" cellspacing="0" cellpadding="'+oBt+'">'+
    '<tr><td> </td></tr><tr><td>'+
        '<table border="1" cellspacing="0" cellpadding="0"><tr><td height="'+oHi+'" width="'+oWi+'" bgcolor="'+oBg+'">' );

  if( document.layers ) {
    document.write( '<ilayer height="'+oHi+'" width="'+oWi+'"><layer bgcolor="'+oBa+'" name="MWJ_progBar'+MWJ_progBar+'"></layer></ilayer>' );
  } else {
    document.write( '<div style="position:relative;top:0px;left:0px;height:'+oHi+'px;width:'+oWi+';">'+
            '<div style="position:absolute;top:0px;left:0px;height:0px;width:0;font-size:1px;background-color:'+oBa+';" id="MWJ_progBar'+MWJ_progBar+'"></div></div>' );
  }
  document.write( '</td></tr></table></td></tr></table></span>\n' );
  this.setBar = resetBar; //doing this inline causes unexpected bugs in early NS4
  this.setCol = setColour;
}
function resetBar( a, b )
{
  //work out the required size and use various methods to enforce it
  this.amt = ( typeof( b ) == 'undefined' ) ? a : b ? ( this.amt + a ) : ( this.amt - a );
  if( isNaN( this.amt ) ) { this.amt = 0; } if( this.amt > 1 ) { this.amt = 1; } if( this.amt < 0 ) { this.amt = 0; }
  var theWidth = Math.round( this.width * ( ( this.dir % 2 ) ? this.amt : 1 ) );
  var theHeight = Math.round( this.height * ( ( this.dir % 2 ) ? 1 : this.amt ) );
  var theDiv = getRefToDivNest( this.id ); if( !theDiv ) { window.status = 'Progress: ' + Math.round( 100 * this.amt ) + '%'; return; }
  if( theDiv.style ) { theDiv = theDiv.style; theDiv.clip = 'rect(0px '+theWidth+'px '+theHeight+'px 0px)'; }
  var oPix = document.childNodes ? 'px' : 0;
  theDiv.width = theWidth + oPix; theDiv.pixelWidth = theWidth; theDiv.height = theHeight + oPix; theDiv.pixelHeight = theHeight;
  if( theDiv.resizeTo ) { theDiv.resizeTo( theWidth, theHeight ); }
  theDiv.left = ( ( this.dir != 3 ) ? 0 : this.width - theWidth ) + oPix; theDiv.top = ( ( this.dir != 4 ) ? 0 : this.height - theHeight )+   oPix;
}

function setColour( a )
{
  //change all the different colour styles
  var theDiv = getRefToDivNest( this.id ); if( theDiv.style ) { theDiv = theDiv.style; }
  theDiv.bgColor = a; theDiv.backgroundColor = a; theDiv.background = a;
}

function checkIOS(){
	//for IOS 6.0.1 WebKit bug - iframe style height �� ȭ��Ⱥ��̴� ���� ����
	if( navigator.userAgent.indexOf('iPhone') == -1 && navigator.userAgent.indexOf('iPad') == -1 ){
		return 0;
	}
	
	return 1;
}

/*  2011.1.3 whsong add Source*/
function changeTable() {
	if( document.body.scrollHeight == '0' ){
		return;
	}

	var clientHeight = (parent.document.documentElement.clientHeight-110);
	var scrollHeight = document.body.scrollHeight;//(document.body.scrollHeight+58); 
	//alert("changeTable:"+clientHeight+", "+scrollHeight);	
	if( checkIOS() == 0 ){
		if( parent.document.getElementById("detailFrame") != null ){
			parent.document.getElementById("detailFrame").style.height = clientHeight>scrollHeight? clientHeight+"px":scrollHeight+"px";
		}
		//parent.document.getElementById("menu").style.height=(document.body.scrollHeight+58)+"px";
	}

	/*
	parent.document.getElementById("detailFrame").style.height=(document.body.scrollHeight+58)+"px";
	*/
	//parent.document.getElementById("main1").style.height = (document.body.scrollHeight+58)+"px";
}

/*******************************************************************************
                     Domain Name Vaidation 
*******************************************************************************/    
function CheckDomain(nname)
{
var arr = new Array(
'.com','.net','.org','.biz','.coop','.info','.museum','.name',
'.pro','.edu','.gov','.int','.mil','.ac','.ad','.ae','.af','.ag',
'.ai','.al','.am','.an','.ao','.aq','.ar','.as','.at','.au','.aw',
'.az','.ba','.bb','.bd','.be','.bf','.bg','.bh','.bi','.bj','.bm',
'.bn','.bo','.br','.bs','.bt','.bv','.bw','.by','.bz','.ca','.cc',
'.cd','.cf','.cg','.ch','.ci','.ck','.cl','.cm','.cn','.co','.cr',
'.cu','.cv','.cx','.cy','.cz','.de','.dj','.dk','.dm','.do','.dz',
'.ec','.ee','.eg','.eh','.er','.es','.et','.fi','.fj','.fk','.fm',
'.fo','.fr','.ga','.gd','.ge','.gf','.gg','.gh','.gi','.gl','.gm',
'.gn','.gp','.gq','.gr','.gs','.gt','.gu','.gv','.gy','.hk','.hm',
'.hn','.hr','.ht','.hu','.id','.ie','.il','.im','.in','.io','.iq',
'.ir','.is','.it','.je','.jm','.jo','.jp','.ke','.kg','.kh','.ki',
'.km','.kn','.kp','.kr','.kw','.ky','.kz','.la','.lb','.lc','.li',
'.lk','.lr','.ls','.lt','.lu','.lv','.ly','.ma','.mc','.md','.mg',
'.mh','.mk','.ml','.mm','.mn','.mo','.mp','.mq','.mr','.ms','.mt',
'.mu','.mv','.mw','.mx','.my','.mz','.na','.nc','.ne','.nf','.ng',
'.ni','.nl','.no','.np','.nr','.nu','.nz','.om','.pa','.pe','.pf',
'.pg','.ph','.pk','.pl','.pm','.pn','.pr','.ps','.pt','.pw','.py',
'.qa','.re','.ro','.rw','.ru','.sa','.sb','.sc','.sd','.se','.sg',
'.sh','.si','.sj','.sk','.sl','.sm','.sn','.so','.sr','.st','.sv',
'.sy','.sz','.tc','.td','.tf','.tg','.th','.tj','.tk','.tm','.tn',
'.to','.tp','.tr','.tt','.tv','.tw','.tz','.ua','.ug','.uk','.um',
'.us','.uy','.uz','.va','.vc','.ve','.vg','.vi','.vn','.vu','.ws',
'.wf','.ye','.yt','.yu','.za','.zm','.zw');

var mai = nname;
var val = true;

var dot = mai.lastIndexOf(".");
var dname = mai.substring(0,dot);
var ext = mai.substring(dot,mai.length);
var check = /\.\./;

	if ( check.test(dname) ) { 
	   //alert("domain�� ..�� �ü� �����ϴ�.");
	   return false;
	}

	if(dot>2 && dot<57)
	{
		for(var i=0; i<arr.length; i++)
		{
			if(ext == arr[i]) {
				val = true;
				break;
			}
			else {
				val = false;
			}
		}

		if(val == false) {
			//alert("domain�� Ȯ���� "+ext+" �� �߸��Ǿ����ϴ�");
			return false;
		}
		else {
			for(var j=0; j<dname.length; j++)
			{
				var dh = dname.charAt(j);
				var hh = dh.charCodeAt(0);

				if((hh > 47 && hh<59) || (hh > 64 && hh<91) || (hh > 96 && hh<123) || hh==45 || hh==46)
				{
					if((j==0 || j==dname.length-1) && (hh == 45 || hh == 46) ){
						//alert("�����θ��� ���� ������ '-', '.'�� �ü��� �����ϴ�");
						return false;
					}
				}
				else {
					//alert("�����θ� Ư�����ڰ� ���ԵǾ� �ֽ��ϴ�");
					return false;
				}
			}
		}
	}
	else {
		//alert("�����θ��� �ʹ� ª�ų� ��ϴ�");
		return false;
	}

	return true;
}

function CheckFormPassword(obj)
{
	var i, en, num, sc;
	var password = obj.value;

    en  = 0;
    num = 0;
    sc  = 0;

	for(i=0; i<password.length; i++) {
		var dh = password.charAt(i);
		var hh = dh.charCodeAt(0);

		if(hh >= 48 && hh <= 57) {
			num = 1;
		}
		else if(hh >= 65 && hh <= 90) {
			en = 1;
		}
		else if(hh >= 97 && hh <= 122) {
			en = 1;
		}
		else if(hh >= 33 && hh <= 126) {
			sc = 1;
		}
	}

	if(num == 1 && en == 1 && sc == 1) {
		return true;
	}

	return false;
}

function CheckFormPassword2(obj)
{
	var i, en, num, sc;
	var password = obj.value;

    en  = 0;
    num = 0;
    sc  = 0;

	for(i=0; i<password.length; i++) {
		var dh = password.charAt(i);
		var hh = dh.charCodeAt(0);

		if(hh >= 48 && hh <= 57) {
			num = 1;
		}
		else if(hh >= 65 && hh <= 90) {
			en = 1;
		}
		else if(hh >= 97 && hh <= 122) {
			en = 1;
		}
		else if(hh >= 33 && hh <= 126) {
			sc = 1;
		}
	}

	if(num + en + sc >= 2) {
		return true;
	}

	return false;
}

function CheckInternetAddress(obj, checkHangul)
{
	var addr = obj.value;

	if ( addr.lenth == 0 ) {
		return false;
	}

	if ( checkHangul == 1 && isKorean(obj.value) == true ) {
		return false;
	}

	if ( isIpAddress(addr) == false && CheckDomain(addr)== false ) {
		return false;
	}

	return true;
} 

function CheckIpAddress(obj, checkHangul)
{
	var addr = obj.value;

	if ( addr.lenth == 0 ) {
		return false;
	}

	if ( checkHangul == 1 && isKorean(obj.value) == true ) {
		return false;
	}

	if ( checkIpv4Addr(addr) == false && CheckDomain(addr)== false ) {
		return false;
	}

	return true;
}

function ipToNumbert(obj_ip)
{
	var d = obj_ip.value.split('.');
	var n = 0;

	d[0] = d[0] * 1;
	d[1] = d[1] * 1;
	d[2] = d[2] * 1;
	d[3] = d[3] * 1;

	n += d[0] * Math.pow(256,3);
	n += d[1] * Math.pow(256,2);
	n += d[2] * 256;
	n += d[3];
	return n;
}

function checkmask(obj_mask)
{
	var i;
	var tmp_mask = 0xffffffff;
	var input_mask = ipToNumbert(obj_mask);

	input_mask = input_mask * 1;

	for(i=0; i<31; i++) {
		tmp_mask = tmp_mask - Math.pow(2,i);
		if(tmp_mask == input_mask) {
			return true;
		}
	}
	return false;
}

function checksubnet(obj_ip, obj_subnetmask, obj_gateway)
{
	var input_ip = ipToNumbert(obj_ip);
	var input_subnetmask = ipToNumbert(obj_subnetmask);
	var input_gateway = ipToNumbert(obj_gateway);

	if((input_ip & input_subnetmask) == (input_gateway & input_subnetmask)) {
		return true;
	} else {
		return false;
	}
}

function openWindow(url, windowName, wide, high) {
	if (document.all)
		var xMax = screen.width, yMax = screen.height;
	else if (document.layers)
		var xMax = window.outerWidth, yMax = window.outerHeight;
	else
		var xMax = 640, yMax=500;

	var xOffset = (xMax - wide)/2;
	var yOffset = (yMax - high)/3;

	var settings = 'width='+wide+',height='+high+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+', resizable=yes, toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes';
	window.open( url, windowName, settings );
}

function mcr_dhcpTblClick(url, type1, obj1, type2, obj2) {
	var open_url = url + "?" + "type=" + type1 + "&obj=" + obj1 + "&type=" + type2 + "&obj=" + obj2;
	openWindow(open_url, 'DHCPTbl',734, 593 );
}

function ConvCommaSecond( val ){

	var d_initial;

	if ( val > 1000000000000 ){
		d_grade = 1000000000000; d_initial = 'T';
	} else if ( val > 1000000000 ){
		d_grade = 1000000000; d_initial = 'G';
	} else if ( val > 1000000 ){
		d_grade = 1000000; d_initial = 'M';
	} else if ( val > 1000 ){
		d_grade = 1000; d_initial = 'K';
	} else {
		d_grade = 1; d_initial = '';
	}
	if (val)
		n = String(val / d_grade);
	else
		n = '0';

	var buf = n.split(".");
	if (buf.length == 2) {
		r_val =  buf[0]+'.'+(buf[1]).charAt(0)+(buf[1]).charAt(1) + d_initial;
	}  else r_val = val;
	return r_val;
}

document.oncontextmenu = function (e) {return false;}