	// 공백제거 object.trim() 사용가능
	var TRIM_PATTERN = /(^\s*)|(\s*$)/g; // 내용의 값을 빈공백을 trim하기 위한것(앞/뒤) 
	String.prototype.trim = function() {
	 	return this.replace(TRIM_PATTERN, "");
	}
	
	function jsIsNumber(val)
	{
		var numberVal = val.value;
	    var re = /^[0-9]+(.[0-9]+)?$/; 	    
	    if (re.test(numberVal)){
	    	return true;
	    }
	    else{
	    	alert("숫자만 입력가능합니다.");
	    	document.getElementById(val.name).value = "";
	    	document.getElementById(val.name).focus();
	    	return false;
	    }
	}
	
	/**
	 * 숫자만 입력 받도록 * IE, Firefox에서도 작동
	 * numbersonly(event, this)로 호출한다.
	 * @param e			
	 * @param decimal
	 * @return
	 */
	function numbersonly(e, decimal) {

	    var key;
	    var keychar;
		if (window.event) {
	        key = window.event.keyCode;
	    } else if (e) {
	        key = e.which;
	    } else {
	        return true;
	    }
	    keychar = String.fromCharCode(key);

	    if ((key == null) || (key == 0) || (key == 8) || (key == 9) || (key == 13) || (key == 27)) {
	        return true;
	    } else if ((("0123456789").indexOf(keychar) > -1)) {
	        return true;
	    } else if (decimal && (keychar == ".")) {
	        return true;
	    } else {	    	
	    	alert("숫자만 입력가능합니다.");
	    	document.getElementById(decimal.name).value = "";
	    	document.getElementById(decimal.name).focus();
	        return false;
	    }
	}
	 
	//	쿠키저장
	function setCookie( name, value, expiredays )
	{		
	 	var todayDate = new Date();
	 	todayDate.setDate( todayDate.getDate() + expiredays );
	 	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";";
	 	//document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + "; httpOnly;";
	}

	var brower_name = navigator.appName;
	var brower_version = navigator.userAgent;

	//	메인팝업창 
	function showPopup(bPopup_P, bPopup_P2) 
	{	
		//alert("bPopup_P2::"+bPopup_P2);
		try{
			if( bPopup_P == 'false' ){
				//popWindow = window.open('/jsp/popup/new_year.jsp','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=431,top=0,left=0');
				//popWindow = window.open('/jsp/popup/invatation.jsp','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=431,top=0,left=0'); 
				//popWindow = window.open('/jsp/popup/news_one.jsp','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=470,top=0,left=0');
				//popWindow = window.open('/jsp/popup/news_two.jsp','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=470,top=0,left=0');
				//popWindow = window.open('/jsp/popup/event.jsp','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=500,top=0,left=0'); 
				popWindow = window.open('/jsp/popup/event.jsp','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=420,top=0,left=0'); 
				popWindow.opener = self; 
				/*
				if( IE_check() == "6.0"){
					popWindow = window.open('/jsp/popup/event.jsp','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=500,top=0,left=0'); 
				}else { 
					popWindow = window.open('/jsp/popup/event.jsp','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=500,top=0,left=0'); 
				}*/				

			} 

			//if( bPopup_P2 == 'false' ){
			//	popWindow2 = window.open('/jsp/popup/global.jsp','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=285,height=405,top=0,left=370');
			//}
		}catch(e){
		}	
	}	

	//	브라우저 버전 체크
	function IE_check()
	{
		var version = "";
		if( brower_name == 'Microsoft Internet Explorer' ){
			var brower_index = brower_version.indexOf("MSIE");
			var brower_info  = brower_version.substr(brower_index, 8);
			version = brower_info.substr(5,3);
		}else{
			version = "";
		}		
		return version;
	}
	//	설문조사 페이지 분기
	function doSurveyPageRefresh(code, bPopup_P, bPopup_P2)
	{
		
		if( code.indexOf("M460") != -1 )
		{
			var url = "/kor/communication/comSurveyView.do?seq="+code.substring(5);
			document.location.replace(url);
		}
		else
		{
			showPopup(bPopup_P,bPopup_P2);
		}
	}