﻿	
	
	// 달력창 윈도우
	function Open_Calendar(strTarget) 
	{
		var tmpWin = window.open ("/cms/common/Inc/PopUp_MiniCalendar.aspx?strTarget="+strTarget, "MiniCalendar", "left=300, top=200, toolbar=0, location=0, directories=0, statusbar=0, scrollbars=no, resizable=0, width=240, height=250");
		tmpWin.focus();
	}
	 				
	//우편번호 팝업창 firTarget:우편번호, secTarget:주소
	function Open_ZipCode(firTarget, secTarget) 
	{
		var zip_window = window.open("/cms/common/inc/Popup_Zipcode.aspx?firTarget="+firTarget+"&secTarget="+secTarget, "Zipcode", "left=150, top=200,width=650,height=250,scrollbars=no,resizable=no,status=0");
		zip_window.focus();
	}
	 
	/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
	/*	
	/*					에디터 관련 스크립트 
	/*
	/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
	
	// 에디터에 hidden 의 값을 설정 
	function fnc_SetEditorContent( hid )
	{			 
		//realEditor.document.body.style.fontFamily = "dotum";
		//realEditor.document.body.style.fontSize = "10pt";	
		
		var hidEditor = eval("document.frm." + hid);		
		var obj = document.getElementById("realEditor");
		
		if(obj!=null){
			realEditor.document.body.innerHTML = hidEditor.value;
		}
	}

	// hidden에 에디터의 값을 설정
	/*
	function fnc_GetEditorContent( hid )
	{ 
		var hidEditor = eval("document.frm." + hid); 		
		var obj = document.getElementById("realEditor");
		
		if(obj!=null){
			// Table 가이드라인 해제
			hideGuideLine();
			
			//현재도메인은 주소에서 없애준다
			//hidEditor.value = realEditor.document.body.innerHTML;
			hidEditor.value = realEditor.document.body.innerHTML.replaceAll("http://203.249.3.224","").replaceAll("http://web.kyonggi.ac.kr","");
		}
	} 
	*/
	function fnc_GetEditorContent( hid, defaultDomain, currentUrl )
	{ 		
		if(defaultDomain == null || currentUrl == null)
		{
			var hidEditor = eval("document.frm." + hid); 		
			var obj = document.getElementById("realEditor");
			
			if(obj!=null){
				// Table 가이드라인 해제
				hideGuideLine();
				
				//현재도메인은 주소에서 없애준다
				//hidEditor.value = realEditor.document.body.innerHTML;
				hidEditor.value = realEditor.document.body.innerHTML.replaceAll("http://203.249.3.224","").replaceAll("http://web.kyonggi.ac.kr","");
			}		
		}
		else
		{
			var hidEditor = eval("document.frm." + hid); 		
			var obj = document.getElementById("realEditor");
			
			if(obj!=null){
				// Table 가이드라인 해제
				hideGuideLine();
				
				//hidEditor.value = realEditor.document.body.innerHTML;
				
				//기본도메인 주소는 없애준다.
				hidEditor.value = realEditor.document.body.innerHTML.replaceAll("http://" + defaultDomain,"");
				hidEditor.value = realEditor.document.body.innerHTML.replaceAll("http://203.249.3.224","").replaceAll("http://web.kyonggi.ac.kr","");
				
				//현재페이지 주소는 없애준다.
				hidEditor.value = realEditor.document.body.innerHTML.replaceAll(currentUrl.replace("http://" + defaultDomain,""),"");
			}		
		}		
	} 
	
	//전체 문자 바꾸기
    String.prototype.trim = function(){
        return this.replace(/(^\s*)|(\s*$)/gi, "");
    }

    String.prototype.replaceAll = function(str1, str2) {
        var temp_str = "";
        if (this.trim() != "" && str1 != str2) {
            temp_str = this.trim();
            while (temp_str.indexOf(str1) > -1){
                temp_str = temp_str.replace(str1, str2);
            }
        }
        return temp_str;
    }


	/*													 */
	/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
	
	
	
	