<!--
	//<p></p> 테그시 <br>처럼 보이게 하기위해..
	var innerHeader = "<style>P {margin-top:2px;margin-bottom:2px;} \nbody {font-size:10pt; font-family:돋움;}</style>\n";

	function ready_edit(Contents){
		//선택 영역 공간들 저장 부분
		//*** 임시적으로 사용 안함 ***
		NowSpace = new Space();

		SenaEditor.document.designMode="On"

		SenaEditor.document.open();
		SenaEditor.document.write(innerHeader+Contents);
		SenaEditor.document.close();
		
		//SenaEditor.document.body.style.fontSize = "9pt";
		//SenaEditor.document.body.style.fontFamily = "돋움";
	}

	function view_contents(Contents){
		//선택 영역 공간들 저장 부분
		//*** 임시적으로 사용 안함 ***
		NowSpace = new Space();

		SenaEditor.document.open();
		SenaEditor.document.write(innerHeader+Contents);
		SenaEditor.document.close();
		
		//SenaEditor.document.body.style.fontSize = "9pt";
		//SenaEditor.document.body.style.fontFamily = "돋움";
	}



//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//	해당 커멘트 입력 부분..
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

	function cmdExec(cmd, opt){
		NowSpace.RestoreSelection();

		var tt = SenaEditor.document.selection.createRange();
				
		if (sector_1.chk == '1'){
			alert('HTML, 미리보기 상태에서는 수정을 하실수가 없습니다.');
		}else{
			NowSpace.RestoreSelection();
		
			if (opt==null){
				SenaEditor.document.execCommand(cmd);
			}else{
				SenaEditor.document.execCommand(cmd,"",opt);
			}
		}
	}

	function EditorChangeColor(cmd, opt){
		EditorColorBox.style.visibility = 'hidden';
		cmdExec(cmd, opt);
	}
	
	function cmdHrInput(){
		if (sector_1.chk == '1'){
			alert('HTML, 미리보기 상태에서는 수정을 하실수가 없습니다.');
		}else{
		
			//--------------------------------------
			//	포커스가 입력창에 없을 때 강제적으로 포커스 이동
			//--------------------------------------
				NowSpace.RestoreSelection();
		
				if(NowSpace.selection){
					var aa = NowSpace.selection.parentElement();
					if(aa.style.topmargin != "12px"){
						SenaEditor.focus();
					}
				}
			//----------------------------------------	
	
			var SenaEditorCtrl = SenaEditor.document.selection.createRange();
				SenaEditorCtrl.pasteHTML("<hr>");
		}
	}

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++





//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//	글자, 그림 등 선택 영역 저장 부분
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	function Space(){
		this.selection    = null;
		this.selection2    = null;
		this.RestoreSelection = Space_RestoreSelection;
		this.SaveSelection  = Space_SaveSelection;
		this.GetSelection  = Space_GetSelection;
	}

	function Space_RestoreSelection() {
		if (this.selection) {
			this.selection.select();
		}
	}

	function Space_GetSelection() {
		var oSelected = this.selection;
		if (!oSelected) {
			oSelelected = SenaEditor.document.selection.createRange();
			oSelelected.type = SenaEditor.document.selection.type;
		}
		return oSelected;
	}

	function Space_SaveSelection() {
		NowSpace.selection = SenaEditor.document.selection.createRange();
		NowSpace.selection.type = SenaEditor.document.selection.type;
	}

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//	글자색, 배경색 선택
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

	function ShowEditorColorBox(posX, posY, cmd){

		if (sector_1.chk == '1'){
			alert('HTML, 미리보기 상태에서는 수정을 하실수가 없습니다.');
		}else{
			PanelHide();

			EditorColorBox.innerHTML = tagColor(cmd);
			EditorColorBox.style.left = (posX + 5 + document.body.scrollLeft);
			EditorColorBox.style.top = (posY + 5 + document.body.scrollTop);
			EditorColorBox.style.visibility = 'visible';
		}
	}
	
	function tagColor(cmd){
		// cmd == "forecolor" -> 폰트 색 
		// cmd == "backcolor" -> 배경 색
		
		//화면에 보이는 색상톤.. 
		var colortone = new Array(15);
			colortone[0] = new Array('#FFFF00','#00FF00','#00FFFF','#0099FF','#CC99FF','#FF3399','#FF99CC','#CC9999','#FFFFCC','#FFCC99');
			colortone[1] = new Array('#ffffff','#e5e4e4','#d9d8d8','#c0bdbd','#a7a4a4','#8e8a8b','#827e7f','#767173','#5c585a','#000000');
			colortone[2] = new Array('#990033','#AB305B','#CC668A','#F0ADC2','#FFCCEB','#FF99E6','#FD51DB','#FF00CC','#EE00BE','#C2009B');
			colortone[3] = new Array('#4D0069','#86519A','#B888CB','#D2AEE0','#F8E5FF','#E190FF','#D053FF','#C834FF','#A300E0','#7D00C8');
			colortone[4] = new Array('#114797','#527AB5','#8CA3C5','#BBC8DB','#E1EDFF','#C0D9FF','#68A4FF','#3C3CFF','#003CFF','#0019D3');
			colortone[5] = new Array('#006063','#3B7B7D','#70A8AA','#ABD9DB','#BCF9FB','#7DE2E6','#00D9E0','#08C1C7','#00A8AE','#006A84');
			colortone[6] = new Array('#355C44','#5D9263','#64B260','#A1DE9E','#CDFFDA','#95FF90','#5BF353','#2ED518','#15BE00','#057400');
			colortone[7] = new Array('#2E5E0B','#61913F','#9DC281','#D2E7C2','#DBFFC0','#DCFF99','#C5FF56','#A7FF00','#9BEC00','#60B200');
			colortone[8] = new Array('#333300','#666633','#999966','#CCCC99','#FFFFCC','#FFFF99','#FFFF6E','#FFFF66','#FFFF00','#CCCC00');
			colortone[9] = new Array('#513A22','#996633','#CC9966','#D7AF88','#FFEAD6','#FFCC99','#FFA477','#FF9933','#FF6600','#CC6600');
			colortone[10] = new Array('#451818','#663333','#996666','#CC9999','#FFCCCC','#FF9999','#FF6666','#FF3333','#FF0000','#CC0000');
			colortone[11] = new Array('#451818','#663333','#996666','#CC9999','#FFCCCC','#FF9999','#FF6666','#FF3333','#FF0000','#CC0000');

		var strHTML = "";
			strHTML += "<table cellpadding=2 cellspacing=0 border=1 style='border-collapse: collapse' bgcolor='#FFFFFF'><tr><td><table cellpadding=0 cellspacing=0 border=0>";

			for (var i=0; i<12; i++){
				strHTML += "<tr>";
				
				for(var j=0; j<11; j++){
					strHTML += "<td onmouseover=this.style.backgroundColor='blue' onmouseout=this.style.backgroundColor='' style='cursor:hand;' title='" + colortone[i][j] + "'><table cellpadding=0 cellspacing=1 border=0><tr><td bgcolor='" + colortone[i][j] + "' onclick='EditorChangeColor(\"" + cmd + "\", \"" + colortone[i][j] + "\");' width=10 height=10></td></tr></table></td>";
				}   
				strHTML += "</tr>";
			}
			strHTML += "</table></td></tr></table>";
			return strHTML;
	}

	
		
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++







//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//	버튼 변화
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	function button_over(btn_obj){
			btn_obj.style.borderBottom = "buttonshadow solid 1px";
			btn_obj.style.borderLeft = "buttonhighlight solid 1px";
			btn_obj.style.borderRight = "buttonshadow solid 1px";
			btn_obj.style.borderTop = "buttonhighlight solid 1px";
	}

	function button_out(btn_obj){
			btn_obj.style.borderColor = "threedface";
			btn_obj.style.border="0px";
	}

	function button_down(btn_obj){
			btn_obj.style.borderBottom = "buttonhighlight solid 1px";
			btn_obj.style.borderLeft = "buttonshadow solid 1px";
			btn_obj.style.borderRight = "buttonhighlight solid 1px";
			btn_obj.style.borderTop = "buttonshadow solid 1px";
	}
	
	function button_up(btn_obj){
			btn_obj.style.borderBottom = "buttonshadow solid 1px";
			btn_obj.style.borderLeft = "buttonhighlight solid 1px";
			btn_obj.style.borderRight = "buttonshadow solid 1px";
			btn_obj.style.borderTop = "buttonhighlight solid 1px";
			btn_obj = null; 
	}
	
	
	function select_btn(obj, order, sector){
		
		var cname;
		var chk = obj.chk;
		
		if (order=='over'){
			if (chk=='0'){
				cname='bt_btn_over';
			}else{
				cname='';
			}
		}else if(order=='out'){
			if (chk=='0'){
				cname='bt_btn_out';
			}else{
				cname='';
			}
		}else if(order=='click'){
			
			obj.chk=1;
			cname='bt_btn_click';
			
			if(sector==1){
					sector_1.style.display = 'block';
					sector_2.style.display = 'none';
				
				if (sector_1.chk != 0){
					sector_1.chk = 0;
					sector_2.chk = 0;
					SenaEditor.document.body.innerHTML = SenaEditor.document.body.innerText;
				}
				
				SenaEditor.focus();
			}else if(sector==2){
					sector_1.style.display = 'block';
					sector_2.style.display = 'none';
				
				if (sector_1.chk != 1){
					SenaEditor.document.body.innerText = SenaEditor.document.body.innerHTML;
					sector_1.chk = 1;
					sector_2.chk = 0;
				}
				
				SenaEditor.focus();
			}else if(sector==3){
				if (sector_2.chk != 1){
					sector_1.style.display = 'none';
					sector_2.style.display = 'block';
				
					if (sector_1.chk==0){
						sector_1.chk = 0;
						preview.document.open();
							preview.document.writeln("\n<html>\n<head>\n"+innerHeader+"</head>\n<body>\n");
							preview.document.writeln(SenaEditor.document.body.innerHTML);
						preview.document.close("</body>\n</html>\n");
					}else{
						sector_1.chk = 1;
						preview.document.open();
							preview.document.writeln("\n<html>\n<head>\n"+innerHeader+"</head>\n<body>\n");
							preview.document.writeln(SenaEditor.document.body.innerText);
							preview.document.writeln("</body>\n</html>\n");
						preview.document.close();
					}
	
					sector_2.chk = 1;
				}
				preview.focus();
			}
		}
		
		if (cname!=''){
			obj.className = cname;
		}
	}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++






//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//	에디터 팝업 관련
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function InsertElement(i){
	if (sector_1.chk == '1'){
		alert('HTML, 미리보기 상태에서는 수정을 하실수가 없습니다.');
		return;
	}

	var StrLocation, StrWinWidth, StrWinHeight;

	switch(i){
		case 1:		//테이블 만들기
			StrLocation="/include/SenaEditor/CreateTable.asp";
			StrWinWidth="385";
			StrWinHeight="230";
			break;

		case 2:		//플래시 삽입
			StrLocation="/include/SenaEditor/InsertFlash.asp";
			StrWinWidth="400";
			StrWinHeight="270";
			break;

		case 3:		//동영상 삽입
			StrLocation="/include/SenaEditor/InsertMovie.asp";
			StrWinWidth="400";
			StrWinHeight="340";
			break;
	}

	SenaEditor.focus();
	var TableStr = showModalDialog(StrLocation, "NewModalDialog", "dialogwidth=" + StrWinWidth + "px;dialogheight=" + StrWinHeight + "px;scroll=no;status=0;help=0");
	if(TableStr != null){
		var obj = document.selection.createRange();
		obj.pasteHTML(TableStr);
		obj.select();
	}
	SenaEditor.focus();
}


function FileUpload(i, EditorFlag){
	if (sector_1.chk == '1'){
		alert('HTML, 미리보기 상태에서는 수정을 하실수가 없습니다.');
		return;
	}
	
	switch(i){
		case 1:	//파일첨부
			StrLocation="/include/SenaEditor/UploadFile.asp?EditorFlag=" + EditorFlag + "&NowFileSize=" + document.WriteFrm.AttachFileSize.value;
			StrWinWidth="400";
			StrWinHeight="200";
			break;

		case 2:	//이미지 업로드
			StrLocation="/include/SenaEditor/UploadImage.asp?EditorFlag=" + EditorFlag + "&NowFileSize=" + document.WriteFrm.AttachFileSize.value;
			StrWinWidth="400";
			StrWinHeight="200";
			break;
	}

	WinTop=(screen.height-parseInt(StrWinHeight))/2;
	WinLeft=(screen.width-parseInt(StrWinWidth))/2;

	NewWin=window.open(StrLocation, "UploadWindow", "width=" + StrWinWidth + ", height=" + StrWinHeight + ", scrollbars=no, status=no,toolbar=no top="+WinTop+", left="+WinLeft);
	NewWin.focus();
}






// 이미지 넣기
	function InsertImage(){
		if (sector_1.chk == '1'){
			alert('HTML, 미리보기 상태에서는 수정을 하실수가 없습니다.');
			return;
		}

		SenaEditor.focus();
		var ImageStr = showModalDialog("/include/SenaEditor/InsertImage.asp", "NewModalDialog", "dialogheight=280px;dialogwidth=400px;scroll=no;status=0;help=0");
		if(ImageStr != null){
			var obj = document.selection.createRange();
			cmdExec("InsertImage", ImageStr)
		}
		SenaEditor.focus();
	}




//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++





document.write("<div id='EditorColorBox' style='position:absolute;visibility:hidden;z-index:10000;'></div>");








//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//	벽지 선택
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


	var WallHTML = "<div id='EditorBgWall' style='position:absolute; display:none; background-color:#ffffff; border :1px solid #eeeeee; z-index:10000;'>";
	WallHTML = WallHTML + "<table width='110' border='0' cellpadding='1' cellspacing='2'>";
	WallHTML = WallHTML + "	<tr bgcolor='DBDBDB'>";																														
	WallHTML = WallHTML + "		<td><img src='/Images/Editor/Wall/list_guest_bg00.gif' width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg00.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "   <td><img src='/Images/Editor/Wall/list_guest_bg01.gif' 	 width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg01.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "   <td><img src='/Images/Editor/Wall/list_guest_bg02.gif' 	 width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg02.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "		<td><img src='/Images/Editor/Wall/list_guest_bg03.gif' width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg03.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "	</tr>";
	WallHTML = WallHTML + "	<tr bgcolor='DBDBDB'>";
	WallHTML = WallHTML + "   <td><img src='/Images/Editor/Wall/list_guest_bg04.gif' width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg04.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "   <td><img src='/Images/Editor/Wall/list_guest_bg05.gif'  width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg05.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "		<td><img src='/Images/Editor/Wall/list_guest_bg06.gif' width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg06.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "   <td><img src='/Images/Editor/Wall/list_guest_bg07.gif' width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg07.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "	</tr>";
	WallHTML = WallHTML + "	<tr bgcolor='DBDBDB'>";
	WallHTML = WallHTML + "   <td><img src='/Images/Editor/Wall/list_guest_bg08.gif'  width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg08.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "		<td><img src='/Images/Editor/Wall/list_guest_bg09.gif' width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg09.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "   <td><img src='/Images/Editor/Wall/list_guest_bg10.gif' width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg10.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "   <td><img src='/Images/Editor/Wall/list_guest_bg11.gif'  width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg11.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "	</tr>";
	WallHTML = WallHTML + "	<tr bgcolor='DBDBDB'>";
	WallHTML = WallHTML + "		<td><img src='/Images/Editor/Wall/list_guest_bg12.gif' width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg12.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "   <td><img src='/Images/Editor/Wall/list_guest_bg13.gif' width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg13.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "   <td><img src='/Images/Editor/Wall/list_guest_bg14.gif'  width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg14.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "		<td><img src='/Images/Editor/Wall/list_guest_bg15.gif' width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg15.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "	</tr>";
	WallHTML = WallHTML + "	<tr bgcolor='DBDBDB'>";
	WallHTML = WallHTML + "		<td><img src='/Images/Editor/Wall/list_guest_bg16.gif' width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg16.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "   <td><img src='/Images/Editor/Wall/list_guest_bg17.gif' width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg17.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "   <td><img src='/Images/Editor/Wall/list_guest_bg18.gif'  width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg18.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "		<td><img src='/Images/Editor/Wall/list_guest_bg19.gif' width='30' height='30' onclick=ChangeEditorWall('/Images/Editor/Wall/guest_bg19.gif') style='cursor:hand'></td>";
	WallHTML = WallHTML + "	</tr>";
	WallHTML = WallHTML + "</table>";
	WallHTML = WallHTML + "</div>";
	document.write(WallHTML)

function ShowEditorWall(posX, posY){
	EditorBgWall.style.pixelLeft=(posX + 5 + document.body.scrollLeft);
	EditorBgWall.style.pixelTop=(posY + 5 + document.body.scrollTop);
	EditorBgWall.style.display="block";
}

function ChangeEditorWall(img){
	SenaEditor.document.body.style.backgroundImage="url("+ img +")";
	PanelHide();
}







//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//	첨부파일 관련
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

	function DelAttachFile(a, b, EditorFlag){
		Frms=document.WriteFrm;
		if(Frms.Lbl_Files.options.selectedIndex==-1){
			alert("삭제하실 파일을 선택하세요.");
			Frms.Lbl_Files.focus();
			return;
		}

		var ChkFlag=confirm("삭제하시겠습니까?");
		if(ChkFlag){
			var StrLocation="/include/SenaEditor/DeleteAttachFile.asp";
			StrLocation+="?EditorFlag=" + EditorFlag + "&Idx=" + a + "&DeleteFile=" + b + "/" + Frms.Lbl_Files.options[Frms.Lbl_Files.options.selectedIndex].value;
			AttachFileFrame.location.href=StrLocation;

		}else{
			return;
		}
	}




	function PanelHide(){
		if(event.srcElement.id!='FontColorBtn' && event.srcElement.id!='BgColorBtn'){
			if(event.srcElement.id!="BGImages"){
				document.all.EditorBgWall.style.display = "none";
			}
			EditorColorBox.style.visibility = 'hidden';
		}
	}



	document.onclick=new Function("PanelHide()");




