﻿/******************************************************************************************************************/
// 유효성체크 관련

function valRequire(objname, msg)
{
    var obj = document.getElementById(objname);
	if(obj == null)
		return;
		
	if(obj.value == '')
	{
		if(msg != '')
			alert(msg);
		
		if(obj.type != 'hidden')
			obj.focus();
			
		return true;
	}
	return false;
}

//유효성체크 - Radio type
function valRadio(objname, msg)
{
    var obj = document.getElementById(objname);
	if(obj == null)
		return;
		
	var sVal = "";
	for (var i=0 ; i<obj.length ; i++)
	{
		if (obj[i].checked == true)
			sVal = obj[i].value;
	};
	
	if (sVal == "")
	{
		if(msg != '')
			alert(msg);
			
		return false;
	}
		
	return true;
}

//유효성체크 - 값비교
function valCompare(objname, comValue, msg)
{
    var obj = document.getElementById(objname);
	if(obj == null)
		return;
		
	if(obj.value == comValue)
	{
		if(msg != '')
			alert(msg);
		
		return true;
	}
	
	return false;
}

//유효성체크 - 드롭다운리스트 선택
function valSelected(objname, msg)
{	
    var obj = document.getElementById(objname);
	if(obj.selectedIndex == 0)
	 {
		alert(msg + " 선택하세요.");
		obj.focus();
		return false;
	 }
	 return true;
}

//유효성체크 - 숫자만 입력 가능
function valNumber(objname, msg)
{
    var obj = document.getElementById(objname);
	var temp;
	var valid="0123456789"
	for (var i=0; i<obj.value.length; i++) 
	{
		temp = "" + obj.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") 
		{
			alert(msg);
			obj.select();
			obj.focus();
			return false;
			break;
		}
	}
	return true;
}	
	
/*****************************************************************************************************/

function PostPopup_Open( popupURL , popupParam , popupData )
{
    var formHtml = "";
    formHtml += "<form id='postPopupForm' name='postpopup' method='post' >";
    for( var i=0 ; i < popupData.length ; i++ )
    {
        formHtml += "<input type='hidden' id='" + popupData[i][0] + "' name='" + popupData[i][0] + "' value='" + popupData[i][1] + "'>";
    }
    formHtml += "</form>";
   
    document.getElementById( 'postpopup' ).innerHTML = formHtml;
	 
	var win = open( '/exam_application/account.asp' , 'postpopup' , popupParam );
	win.focus();

	document.postPopupForm.action = popupURL;
    document.postPopupForm.target = 'postpopup';
    document.postPopupForm.submit();
}

    function getTwoDimArray( oneDimLength , twoDimLength )
    {
        var twoDimArray = new Array( oneDimLength );
        for( i=0 ; i < oneDimLength ; i++ )
        {
            twoDimArray[i] = new Array( twoDimLength );
        }
        return twoDimArray;
    }

 function MakeNum(num)
	{
		var retVal = "";

		num = num.toString().replace(/[^0-9]/g, "")

		for (var i = 0; i < num.length; i++)
		{
			if (i % 3 == 0 && i != 0)
				retVal = "," + retVal;

			retVal = num.substr(num.length - i - 1, 1) + retVal;
		}

		return retVal
	}

//데이터 색깔
function cellOver(el) {
el.style.backgroundColor="#d8d8d8";
}
function cellOut(el){
el.style.backgroundColor="#FFFFFF";
}


///////////////////////////////////////////////////////////////////////////////
// 전역 함수
//===============================================================================
// Title       : 날짜입력형식                                        
// Description : 날짜입력을 (2004-12-05) 형식으로 받을때 년월 입력후 '-'생성
// Parameter   : value of InpubBox 
// 작성자      : 
// 소  속      : 
// 일  자      : 2007.1.26 최초작성            
//===============================================================================
function CheckDate(arg) {
    var key = window.event.keyCode ;
    CheckNum(arg);
	if (arg.value.length==4 || arg.value.length==7 ) {
	arg.value=arg.value + '-' ;
	}   
}
function CheckPhone(arg) {
    var key = window.event.keyCode ;
    CheckNum(arg);
	if (arg.value.length==3 || arg.value.length==7 ) {
	arg.value=arg.value + '-' ;
	}   
}
function CheckDate3(arg) {
    var key = window.event.keyCode ;
    CheckNum(arg);
	if (arg.value.length==2 || arg.value.length==5 ) {
	arg.value=arg.value + '/' ;
	}   
}
function CheckKeyset(arg) {
    var key = window.event.keyCode ;
    CheckNum(arg);
	if (arg.value.length==4 || arg.value.length==13) {
	arg.value=arg.value + '-' ;
	}   
}
//===============================================================================
// Title       : 입력값체크                                         
// Description : 숫자만 입력받음
// Parameter   : 
// 작성자      : 
// 소  속      : 
// 일  자      : 2007.1.26 최초작성           
//===============================================================================
function CheckNum(arg) {
	var key = window.event.keyCode ;
    
    if (key < 48 || key > 57  ) 
	{
			event.returnValue = false ;
	}
	
	
}
 //===============================================================================
// Title       : 입력값체크                                         
// Description : 숫자만 입력받음,소숫점포함 문자 안됨
// Parameter   : 
// 작성자      : 
// 소  속      : 
// 일  자      : 2007.1.26 최초작성           
//===============================================================================
function CheckFlaot(arg)
{
	var key = window.event.keyCode ;
	
	// 소수점
	
	if((key == 46) || (key == 45))
	{
		event.returnValue = true;
	}
	else if (key < 48 || key > 57 ) 
	{
			event.returnValue = false ;
	}
}	

//===============================================================================
// Title       : 입력값체크                                         
// Description : 숫자만 입력받음(컴마 포함)
// Parameter   : 
// 작성자      : 
// 소  속      : 
// 일  자      : 2007.1.26 최초작성           
//===============================================================================
function CheckFlaotComa(arg)
{
   var key = window.event.keyCode ;
   if (key < 48 || key > 57 ) 
   {
	  event.returnValue = false ;
   }
   
	var  s = parseFloat(arg.value.replace(/\,/g,""));
	var ns = s.toString();
	var dp;
	
	if(isNaN(ns))
		return "";
	
	dp = ns.search(/\./);
	if(dp<0) dp = ns.length;
	dp-=3;
	while(dp>0) 
	{
		ns = ns.substr(0,dp)+","+ns.substr(dp);
		dp-=2;
	}
	arg.value = ns;
	
    return true;

}	

//===============================================================================
// Title       : 입력값체크                                         
// Description : 소수첨 첫째자리만 체크
// Parameter   : 
// 작성자      : 
// 소  속      : 
// 일  자      : 2007.2.12 최초작성           
//===============================================================================
function sosu1(obj)
{
	var zari = 1;
	var dott = obj.value.indexOf(".");
	if(dott > 0)
	{
		var str = obj.value.substring(0, zari+dott +1);
	}
	else
	{
		str = obj.value+'.0';
	}
	return str;
}

///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_isDateString( str )
// 설  명 : 날짜(YYYY-MM-DD) 인지 확인
function comjs_isDateString( str )
{
	var isRight = false;
	var re = /(\d{4})-(\d{2})-(\d{2})/
	
	if( str.match( re ) )
	{
		var value = str.split("-");
		
		if( ( 1 <= eval( value[0] ) && eval( value[0] ) <= 9999 ) 
		 && ( 1 <= eval( value[1] ) && eval( value[1] ) <= 12 ) 
		 && ( 1 <= eval( value[2] ) && eval( value[2] ) <= 31 )
		  )
		{
			isRight = true
		}
	}
	return isRight;
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_checkDate()
// 설  명 : 날짜(YYYYMMDD)인지 확인
function comjs_checkDate( number )
{
	// 초기값 설정
	var re = /^(\d{8})$/;
	var isRight = false;
	
	if( re.test( number ) )
	{
		if( number.substr(0,4) > 0 )
		{
			if( number.substr(4,2) >= 1 && number.substr(4,2) <= 12 )
			{
				if( number.substr(6,2) >= 1 && number.substr(6,2) <= 31 )
				{
					isRight = true;
				}
			}
		}
	}
	
	return isRight;
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_delCheck()
// 설  명 : 삭제전 재확인 메시지
function comjs_delCheck()
{
	var YesNo;
	YesNo = confirm("정말 삭제하시겠습니까?") 
	
	return YesNo;
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_checkEnter()
// 설  명 : 입력 키 값이 Enter인지 확인
function comjs_checkEnter()
{
	var isEnter = false;

	if(event.keyCode == 13)
	{
		isEnter = true;
	}

	return isEnter;
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_validate_textbox( str , len )
// 입력값 : str - 검사를 할 문자열
//          len - 최소 입력 문자
// 설  명 : len 미만으로 입력되었는지 확인 함수
function comjs_validate_textbox( str , len )
{

	var isRight = true;
	var str = comjs_trim( str );
	
	if( str.length < len )
	{
		isRight = false;
	}
	
	return isRight;
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_checkHandPhoneNoForm( phoneNo )
// 설  명 : 핸드폰 형식 확인 함수
function comjs_checkHandPhoneNoForm( phoneNo )
{
	// 초기값 설정
	var re = /^(01[016879])-(\d{3,4})-(\d{4})$/;

	return re.test( phoneNo );
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_checkNumberKey()
// 설  명 : 숫자가 입력되는지 확인
function comjs_checkNumberKey()
{
	var isNumber = false;
	
	if( ( event.keyCode >= 48 && event.keyCode <= 57 ) || event.keyCode == 46 )
	{
		isNumber = true;
	}

	return isNumber;	
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_checkNumber()
// 설  명 : 숫자인지 확인
function comjs_checkNumber( number )
{
	// 초기값 설정
	var re = /^(\d*)$/;

	return re.test( number );
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_clearNonNumericChar( originStr )
// 설  명 : 입력된 스트링 에서 숫자가 아닌 문자를 제거
function comjs_clearNonNumericChar( originStr )
{
	var clearStr = "";
	
	// 문자열의 길이만큼 roop
	for ( var i=0 ; i < originStr.length ; i++ )
	{	
		// 문자열 해당위치의 문자가 numeric character 라면
		if ( comjs_checkNumber( originStr.charAt(i) ) )
		{  
			clearStr += originStr.charAt(i);           // 리턴할 변수에 이어 붙인다. 
		}
	}
	return clearStr;
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_clearNonNumericChar( originStr )
// 설  명 : 입력된 스트링에서 . , / -를 제거
function comjs_clearSpecialChar(originStr)
{
	var clearStr = "";
	var specialChar = ",./-";
	
	// 문자열의 길이만큼 roop
	for ( var i=0 ; i < originStr.length ; i++)
	{	
		if ( specialChar.indexOf( originStr.charAt(i) ) == -1 )
		{ 
			clearStr += originStr.charAt(i);           // 리턴할 변수에 이어 붙인다. 
		}
	}
	return clearStr;
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_validateEmail( email )
// 설  명 : Email 형식 확인 함수
function comjs_validateEmail( email )
{
	// 초기값 설정
	var re = /^\s*[\w\~\-\.]+\@[\w\~\-]+(\.[\w\~\-]+)+\s*$/g;

	return re.test( email );
}



//============================================= Mode변환 함수 ================================================


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_changeMode()
// 설  명 : visible과 nonvisible 변환
function comjs_changeMode(mode1, mode2)
{
	var obj1;
	var obj2;
	
	document.getElementById( mode1 ).style.visibility = 'hidden';
	document.getElementById( mode1 ).style.position = 'absolute';
	document.getElementById( mode2 ).style.visibility = 'visible';
	document.getElementById( mode2 ).style.position = 'static';
}


//////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_changecolor( obj , color )
// 설  명 : 마우스 이동에 따른 TR 색 변경
function comjs_changecolor( obj , color )
{
	obj.style.backgroundColor = color;
}



//======================================== 초기화 및 공백제거 함수 ===========================================


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_trim( str )
// 설  명 : 문자열의 앞뒤 공백제거
function comjs_trim( str )
{
	return str.replace( /^\s*/ , "" ).replace( /\s*$/ , "" );
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_optionclear( obj )
// 설  명 : DropDownList, ListBox 초기화
function comjs_optionclear( obj )
{
	while(true)
	{
		if( obj.length == 0 )
		{
			break;
		}
		else
		{
			obj.remove(0);
		}
	}

}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_fileReset( obj )
// 설  명 : input File의 value 초기화
function comjs_fileReset( obj )
{
	obj.select();
	document.selection.clear();
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_onSelectClear()
// 설  명 : DropDownList, ListBox 초기화
function comjs_onSelectClear(obj)
{
	while(obj.length)
	{		
		obj.options[0] = (null,null);
	}
}



//====================================== 바인딩/값 선택/값 추가,제거 함수 =========================================


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_optionbind( obj, data , isDup )
// 설  명 : text, value배열을 obj객체에 바인딩함
function comjs_optionbind( obj, data , isDup )
{
	for( var i=0 ; i < data.length ; i++ )
	{
		// Option 생성
		var oOption = document.createElement("OPTION");
		
		var dataDetail = data[i].split("|");

		oOption.value = dataDetail[1];
		oOption.text = dataDetail[0];

		// 중복 확인
		var isOverlapped = false;
		
		// 증복을 허용하지 않을때만 검사함
		if( isDup == false )
		{
			for( var x=0 ; x < obj.length ; x++ )
			{
				if( obj.options[x].value == oOption.value )
				{
					isOverlapped = true;
					break;
				}
			}
		}
		
		// ListBox에 입력
		if( !isOverlapped )
		{
			obj.add(oOption);
		}
	}
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_getradiovalue( obj )
// 설  명 : 라이오버튼의 선택된 값을 가져옴
function comjs_getradiovalue( obj ) 
{
	var retVal = null;

	for( var i=0 ; i < obj.length ; i++ )
	{
		if( obj[i].checked == true )
		{
			retVal = obj[i].value;
			break;
		}
	}
	
	return retVal;
}


///////////////////////////////////////////////////////////////////////////////
//함수명  :comjs_selectlist_value( _objID)
//설명    :드랍다운 리스트에서 선택된 값을 가져옴
function comjs_selectlist_value( _objID)
{	
	obj = document.getElementById(_objID);
	
	for( var i=0 ; i < obj.length ; i++ )
	{
		if( obj.options[i].selected )
		{
			return obj.options[i].value;
		}
	}
}

///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_selectdropdownlist( obj )
// 설  명 : 리스트의 특정한 obj를 selected로 설정
function comjs_selectlist( obj, compar_evalue )
{	
	for( var i=0 ; i < obj.length ; i++ )
	{
		if( obj.options[i].value == compar_evalue )
		{
			obj.options[i].selected = true;
		}
	}
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_onSelectItemAdd()
// 설  명 : DropDownList, ListBox item 추가
function comjs_onSelectItemAdd(obj, strText, strValue)
{
	var oOption = document.createElement("OPTION");
	oOption.text = strText;
	oOption.value = strValue;
	obj.add(oOption);
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_onSelectItemRemove()
// 설  명 : DropDownList, ListBox item 제거
function comjs_onSelectItemRemove(obj, startIndex)
{
	for(var i = obj.length-1; i >= startIndex; i--)
	{
		if(obj[i].selected)
		{
			obj.options[i] = (null,null);
		}
	}
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_checkDoubleSelect()
// 설  명 : 중복된 선택이면 True, 최초 선택이면 false
function comjs_checkDoubleSelect( optionObj, targetSelectObj )
{
	if (optionObj != null && targetSelectObj != null)
	{
		var targetOptionArray = targetSelectObj.options;
		
		for (var i=0; i < targetOptionArray.length; i++)
		{
			var targetOption = targetOptionArray[i];
			var targetOptionValue = targetOption.value;
			var targetOptionText = targetOption.text;
			
			if ( targetOptionValue == optionObj.value && targetOptionText == optionObj.text )
			{
				return true;
			}
		}
	}
	
	return false;
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_moveOptions()
// 설  명 : 선택된 옵션을 추가한다.
function comjs_moveOptions( srcSelectObj, targetSelectObj, srcDel )
{
	if ( srcSelectObj != null && targetSelectObj != null )
	{
		if (srcSelectObj.selectedIndex < 0)
		{
			alert("목록에서 검색키를 선택하세요.");
			return false;
		}

		var soptCount = srcSelectObj.options.length;
		var selectOption;

		for ( var i=0 ; i < soptCount ; i++ )
		{
			if ( srcSelectObj.options[i].selected )
			{
				selectOption = srcSelectObj.options[i];
				
				// 중복체크
				if ( comjs_checkDoubleSelect( selectOption, targetSelectObj ) )
				{
					continue;
				}
				
				var newOption = new Option();
				newOption.value = selectOption.value;
				newOption.text = selectOption.text;
				targetSelectObj.add( newOption );
			}
		}

		// 선택된 src를 삭제
		if ( srcDel == true )
		{
			comjs_onSelectItemRemove( srcSelectObj, 0 );
		}

		return true;
	}
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_moveAllOptions()
// 설  명 : 모든 항목을 타겟 리스트로 옮긴다.
function comjs_moveAllOptions( srcObj, targetObj, srcDel )
{
	if ( srcObj != null && targetObj != null )
	{
		for ( var i=0 ; i < srcObj.options.length ; i++)
		{
			// 중복체크
			if ( comjs_checkDoubleSelect( selectOption, targetSelectObj ) )
			{
				continue;
			}
			
			var newOption = new Option();
			newOption.value = srcObj.options[i].value;
			newOption.text = srcObj.options[i].text;
			targetObj.add(newOption);
		}
		
		// src를 모두 삭제
		if ( srcDel == true )
		{
			for ( var i = srcObj.options.length - 1 ; i >= 0 ; i--)
			{
				srcObj.remove(i);
			}
		}
	}
}



//================================================ 팝업 함수 ===================================================


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_openlayerpopup( width, height, url )
// 설  명 : 레이어팝업 불러오기
function comjs_openlayerpopup( width, height, url )
{
	uc_layerpopup_open( width, height, url );
	return false;
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_popup( url, name , width , height , scrollyn )
// 설  명 : 팝업 띄우기
function comjs_popup( url, name , width , height , scrollyn )
{
	// 팝업위치 산출
	var liTop		=	screen.height / 2 - height / 2 - 50;
	var liLeft		=	screen.width / 2 - width / 2 ;
	
	// Scroll 여부
	if ( typeof(scrollyn) == "undefinded") scrollyn='no';
	
	// 팝업
	var win;
	win = open( url, name, 'width='+width+',height='+height+',top='+liTop+',left='+liLeft+',resize=no,status=no,toolbar=no,menubar=no,scrollbars='+scrollyn);
	win.focus();

}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_calendar( objName )
// 설  명 : 달력 팝업
function comjs_calendar( objName ) 
{	
	URL = WebAppRoot + "common/Calendar/calendar.html";   
	var sFeatures;
	var sDate;

	sFeatures = "dialogWidth:176px; dialogHeight:201px; dialogTop:200px; dialogLeft:400px; help:no; status:no ";
	sDate = window.showModalDialog( URL, "달력", sFeatures );

	if ( sDate != undefined )
	{
		document.getElementById( objName ).value = sDate;
		document.getElementById( objName ).focus();
	}
	
	return false;
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_dialog( url , title , width , height , top , left )
// 설  명 : 다이얼로그
function comjs_dialog( url , title , width , height , top , left ) 
{	

	var sFeatures;

	sFeatures = "dialogWidth:" + width + "px; dialogHeight:" + height + "px; dialogTop:" + top + "px; dialogLeft:" + left + "px; help:no; status:no; scroll:no ";

	return window.showModalDialog( url, title , sFeatures );

}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_dialog( url , title , width , height , top , left , scrollyn)
// 설  명 : 다이얼로그
function comjs_dialog( url , title , width , height , top , left, scrollyn ) 
{	

	var sFeatures;

	sFeatures = "dialogWidth:" + width + "px; dialogHeight:" + height + "px; dialogTop:" + top + "px; dialogLeft:" + left + "px; help:no; status:no; scroll:"+ scrollyn;

	return window.showModalDialog( url, title , sFeatures );

}



//========================================== Replace/Redirect/Reload =============================================


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_windowReplace( url )
// 설  명 : url로 현재화면을 대체함 (history 남지않음)
function comjs_windowReplace( url )
{
	location.replace( url );
}

///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_windowRedirect( url )
// 설  명 : url로 화면전환시킴(history 남음)
function comjs_windowRedirect( url )
{
	location.href = url;
}

///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_windowReload()
// 설  명 : 현재화면을 새로고침
function comjs_windowReload( url )
{
	location.reload();
}



//========================================== 기타 페이지이벤트 처리 =============================================


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_Delegate()
// 설  명 : 이벤트 실행
function comjs_Delegate(strEventName)
{
	eval(strEventName+"()");
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_addpara( condStr , parastr )
// 설  명 : 파라미터 합치기
function comjs_addpara( condStr , parastr )
{
	if( condStr == "" )
	{
		condStr = parastr;
	}
	else
	{
		condStr = condStr + "&" + parastr;
	}
	
	return condStr;
}


///////////////////////////////////////////////////////////////////////////////
// 함수명 : comjs_strlengthb( str )
// 설  명 : string 길이구하기(byte)
function comjs_strlengthb( str )
{
	// 초기값 설정
	var length_UniCode = str.length;
	var length_Byte = 0;
	
	for( var inx=0 ; inx < length_UniCode ; inx++ )
	{
		if( str.charCodeAt( inx ) > 255 )
		{
			// 한글(2bytes)
			length_Byte = length_Byte + 2;
		}
		else
		{
			// 영문(1bytes)
			length_Byte = length_Byte + 1;
		}
	}
	return length_Byte;
}


// trim 함수 
String.prototype.trim = function()
{
	return this.replace(/(^\s*)|(\s*$)/gi, "");
} 


// 이미지 새창으로 보기
function fncOpenImage(url) {
	window.open(url,'showImage','');
}

// 이미지 미리보기
function fncPrevImage(objTxt, objImg) {
	objImg.src = objTxt.value;
	objImg.height = '100px';
}


document.onreadystatechange = checkReadyState;

function checkReadyState() {
	if (document.readyState == "complete") {
		obj = document.getElementById('divLoading');
	if (obj != null) {
		obj.style.display = "none";
	}
	}
}

function showLoadingDisplay() {
	obj = document.getElementById('divLoading');
	if (obj != null) {
		obj.style.display = "";
	}
}

function window::onload() {
	var oDiv;
	oDiv = document.createElement("<INPUT TYPE=BUTTON id=divLoading value=로딩중... style='DISPLAY:none; Z-INDEX:100; POSITION:absolute; width=200; height=30' class=button_default2>");
	document.body.insertBefore(oDiv);
  
    var _x = document.body.clientWidth/2 + document.body.scrollLeft - 100;
	var _y = document.body.clientHeight/2 + document.body.scrollTop - 30;
	oDiv.style.posLeft=_x;
	oDiv.style.posTop=_y;
	
}
function CheckBoxCheck() { 
	var form=document.Form1.all['rptList1']; 
	if(form !=undefined){
		if(document.getElementById('CheckAll').checked==true ){
		    document.getElementById('CheckAll').checked=true;
			for(var i=0; i<(form.rows.length/2); i++){
			  	var CheckB="rptList1_ctl0"+i+"_CheckB";
			    document.getElementById(CheckB).checked=true;
			}
		}
		else {
			document.getElementById('CheckAll').checked=false;
			for(var i=0; i<(form.rows.length/2); i++) {
				var CheckB="rptList1_ctl0"+i+"_CheckB";
				document.getElementById(CheckB).checked=false;
			}
		} 
	}
}
function ConfirmCheck(s){
    CheckBoxCount();
    if(count > 0){   
        var result=confirm( s+' 하시겠습니까?');
        if(result)return true;
        else return false;
    }else{
        alert('삭제할 데이터가 없습니다.');
    }
}
function CheckBoxCount(){
    var form=document.Form1.all['rptList1']; 
    if(form !=undefined){
       for(var i=0; i<(form.rows.length/2); i++){
	  	    var CheckB="rptList1_ctl0"+i+"_CheckB";
	        if(document.getElementById(CheckB).checked==true){
	          count = count + i;
	        }
	    }
    }
}	
function copy(URL) {       
			window.clipboardData.setData("Text",URL);
			alert("주소가 클립보드에 복사되었습니다.");
	  return;
}