/*
EOEditor by Qingdao ETSOO Network-Tech Co., Ltd. This script may not be used or distributed without license.
Version 4.2.0, http://www.etsoo.com
*/
function ETSOOEditor(){}
if(typeof(ETSOOPreloadImage)=="undefined")ETSOOPreloadImage=false;
ETSOOEditor.PreloadImage=ETSOOPreloadImage;
if(typeof(ETSOOActiveStatus)=="undefined")ETSOOActiveStatus="auto";
var ETSOOEditor_Start=new Date().valueOf();
ETSOOEditor.ActiveStatus=ETSOOActiveStatus;
function _EEGetPath(){
	var arrScripts=document.getElementsByTagName("script");
	var numLen=arrScripts.length;
	var regEditor=/(.*)ETSOOEditor\.js/gi;
	for(var numI=0;numI<numLen;numI++){
		var strSrc=arrScripts[numI].src;
		if(regEditor.test(strSrc)){
			var strPath=RegExp.$1;
			return ETSOOEditor.GetRelativePath(strPath);
		}
	}
}
function ETSOOGetPos(objE){
	var numLeft=0,numTop=0;
	while(objE){
		numLeft+=objE.offsetLeft;
		numTop+=objE.offsetTop;
		objE=objE.offsetParent;
	}
	return new Array(numLeft,numTop);
}
function _EEGetLanguage(strLanguage){
	var arrLanguages=new Array();
	arrLanguages["zh-cn"]="gb2312";
	arrLanguages["en"]="iso8859-1";
	if(strLanguage==null){
		if(ETSOOEditor.Browser>100)strLanguage=window.navigator.userLanguage;
		else strLanguage=window.navigator.language;
		if(strLanguage==null)strLanguage="en";
	}
	strLanguage=strLanguage.toLowerCase();
	if(arrLanguages[strLanguage]==null)
	{
		strLanguage=strLanguage.split("-")[0];
		if(arrLanguages[strLanguage]==null)strLanguage="en";
	}
	return strLanguage;
}
function _EEGetBrowser(){
	var numVersion=0,strApp=navigator.appVersion;
	if(window.navigator.language==null){
		var regApp=/ MSIE (.*);/gi;
		if(regApp.test(strApp))numVersion=100+parseFloat(RegExp.$1);
	}else numVersion=parseFloat(strApp);
	return numVersion;
}
ETSOOEditor.Browser=_EEGetBrowser();
if(ETSOOEditor.Browser<100){
	CMD_ABSOLUTEPOS =             "absoluteposition";
	CMD_BOLD =                    "bold";
	CMD_COPY =                    "copy";
	CMD_CUT =                     "cut";
	CMD_DELETE =                  "Delete";
	CMD_FIND =                    "find";
	CMD_FONT =                    "fontname";
	CMD_GETBACKCOLOR =            "backcolor";
	CMD_GETFONTNAME =             "fontname";
	CMD_GETFONTSIZE =             "fontsize";
	CMD_GETFORECOLOR =            "forecolor";
	CMD_HYPERLINK =               "createlink";
	CMD_ANCHORLINK =              "createbookmark";
	CMD_IMAGE =                   "insertimage";
	CMD_INDENT =                  "indent";
	CMD_HR =                     "inserthorizontalrule";
	CMD_ITALIC =                  "italic";
	CMD_CENTER =                  "justifycenter";
	CMD_LEFT =                    "justifyleft";
	CMD_RIGHT =                   "justifyright";
	CMD_FULL  = 			      "justifyfull";
	CMD_ORDERLIST =               "insertorderedlist";
	CMD_OUTDENT =                 "outdent";
	CMD_PASTE =                   "paste";
	CMD_REDO =                    "redo";
	CMD_REMOVEFORMAT =            "removeformat";
	CMD_SELECTALL =               "selectall";
	CMD_BGCOLOR =                 "backcolor";
	CMD_SETBLOCKFMT =             "formatblock";
	CMD_FONTSET =                 "fontname";
	CMD_FONTSIZE =                "fontsize";
	CMD_FORECOLOR =               "forecolor";
	CMD_STRIKETHROUGH =           "strikethrough";
	CMD_SUBSCRIPT =               "subscript";
	CMD_SUPERSCRIPT =             "superscript";
	CMD_UNDERLINE =               "underline";
	CMD_UNDO =                    "undo";
	CMD_UNLINK =                  "unlink";
	CMD_UNANCHOR =                "unBookmark";
	CMD_UNORDERLIST =             "insertunorderedlist";

	// User Interface
	UI_DEFAULT =                   false;
	UI_YES =                       true;
	UI_NO =                        false;
}else{
	CMD_ABSOLUTEPOS =            "AbsolutePosition";
	CMD_BOLD =                    "Bold";
	CMD_COPY =                    "Copy";
	CMD_CUT =                     "Cut";
	CMD_DELETE =                  "Delete";
	CMD_FIND =                    "Find";
	CMD_FONT =                    "FontName";
	CMD_GETBACKCOLOR =            "BackColor";
	CMD_GETFONTNAME =             "FontName";
	CMD_GETFONTSIZE =             "FontSize";
	CMD_GETFORECOLOR =            "ForeColor";
	CMD_HYPERLINK =               "CreateLink";
	CMD_ANCHORLINK =              "CreateBookmark";
	CMD_IMAGE =                   "InsertImage";
	CMD_INDENT =                  "Indent";
	CMD_HR =                      "InsertHorizontalRule";
	CMD_ITALIC =                   "Italic";
	CMD_CENTER =                   "JustifyCenter";
	CMD_LEFT =                     "JustifyLeft";
	CMD_RIGHT =                    "JustifyRight";
	CMD_FULL =                     "JustifyFull";
	CMD_ORDERLIST =                "InsertOrderedList";
	CMD_OUTDENT =                  "Outdent";
	CMD_PASTE =                    "Paste";
	CMD_REDO =                     "Redo";
	CMD_REMOVEFORMAT =             "RemoveFormat";
	CMD_SELECTALL =                "SelectAll";
	CMD_BGCOLOR =                  "BackColor";
	CMD_SETBLOCKFMT =              "FormatBlock";
	CMD_FONTSET =                  "FontName";
	CMD_FONTSIZE =                 "FontSize";
	CMD_FORECOLOR =                "ForeColor";
	CMD_STRIKETHROUGH =            "StrikeThrough";
	CMD_SUBSCRIPT =                "SubScript";
	CMD_SUPERSCRIPT =              "SuperScript";
	CMD_UNDERLINE =                "Underline";
	CMD_UNDO =                     "Undo";
	CMD_UNLINK =                   "Unlink";
	CMD_UNANCHOR =                 "UnBookmark";
	CMD_UNORDERLIST =              "InsertUnorderedList";

	// User Interface
	UI_DEFAULT =                   false;
	UI_YES =                       true;
	UI_NO =                        false;
}
ETSOOEditor.AutoClearWord=ETSOOEditor.Browser<105.5?false:true;
ETSOOEditor.XMLDom=null;
ETSOOEditor.ActiveField=null;
ETSOOEditor.ActiveTarget=null;
ETSOOEditor.MenuBar=null;
ETSOOEditor.Fields=[];
ETSOOEditor.ReadyState=0;
ETSOOEditor.Version="4.0.0";
ETSOOEditor.SubMenu=[];
ETSOOEditor.GetBasePath=function(){
	var strBase=document.domain;
	var numPort=document.location.port;
	if(numPort!="")strBase+=':'+numPort;
	return strBase;
}
ETSOOEditor.GetRelativePath=function(strPath){
	var strBase=this.GetBasePath();
	strPath=strPath.replace(new RegExp("http://"+strBase,"gi"),"");
	return strPath;
}
var _BasePath=_EEGetPath();
_BasePath=_BasePath.replace(/\/\//gi,"\/");
ETSOOEditor.Path=_BasePath;
ETSOOEditor.Langs=[];
ETSOOEditor.Inco={
	NEW: "new.gif",OPEN: "open.gif",SAVE: "save.gif",FIND: "search.gif",CUT: "cut.gif",CUTDISABLED: "cutdisabled.gif",COPY: "copy.gif",COPYDISABLED: "copydisabled.gif",PASTE: "paste.gif",PASTEDISABLED: "pastedisabled",
	PASTETEXT: "pastetext.gif",PASTEWORD: "pasteword.gif",DELETE: "delete.gif",DELETEDISABLED: "deletedisabled.gif",UNDO: "undo.gif",UNDODISABLED: "undodisabled.gif",REDO: "redo.gif",REDODISABLED: "redodisabled.gif",EMOTION: "emotion.gif",FLASH: "flash.gif",MEDIA: "media.gif",
	MARQUEE: "marquee.gif",SPECIAL: "special.gif",IMAGELINK: "imagelink.gif",IMAGE: "image.gif",LAYER: "layer.gif",TABLE: "table.gif",INSERTROW: "table/insertrow.gif",INSERTCOL: "table/insertcol.gif",DELETEROW: "table/deleterow.gif",DELETECOL: "table/deletecol.gif",
	SPLITCELL: "table/splitcell.gif",MERGECELL: "table/mergecell.gif",CELLPROPERTY: "table/cellproperty.gif",TABLEPROPERTY: "table/property.gif",FORM: "form.gif",FORMPROPERTY: "form/property.gif",FORMTEXT: "form/text.gif",FORMTEXTAREA: "form/textarea.gif",FORMFILE: "form/upload.gif",FORMCHECKBOX: "form/checkbox.gif",
	FORMRADIO: "form/radio.gif",FORMFIELDSET: "form/fieldset.gif",FORMSELECT: "form/select.gif",FORMBUTTON: "form/button.gif",FORMIMAGE: "form/image.gif",FORMLABEL: "form/label.gif",HR: "hr.gif",LINK: "link.gif",LINKDISABLED: "linkdisabled.gif",EMAILLINK: "emaillink.gif",
	ANCHOR: "anchor.gif",TAB: "tab.gif",PAINT: "paint/paint.gif",ART: "paint/art.gif",NORMALPROPERTY: "properties.gif",CONTROLPROPERTY: "controlproperty.gif",CSSPROPERTY: "cssproperty.gif",FULLSCREEN: "fullscreen.gif",HELP: "help.gif",ABOUT: "about.gif",
	BOLD: "bold.gif",ITALIC: "italic.gif",UNDERLINE: "underline.gif",STRIKETHROUGH: "strikethrough.gif",REMOVEFORMAT: "removeformat.gif",LEFT: "justifyleft.gif",RIGHT: "justifyright.gif",CENTER: "justifycenter.gif",FULL: "justifyfull.gif",FORECOLOR: "forecolor.gif",
	BGCOLOR: "backcolor.gif",ORDERLIST: "number.gif",UNORDERLIST: "unnumber.gif",INDENT: "indent.gif",OUTDENT: "outdent.gif",SUPERSCRIPT: "superscript.gif",SUPERSCRIPTDISABLED: "superscriptdisabled.gif",SUBSCRIPT: "subscript.gif",SUBSCRIPTDISABLED: "subscriptdisabled.gif",ABSOLUTEPOS: "abspos.gif",
	ABSOLUTEPOSDISABLED: "absposdisabled.gif",UPLEVEL: "forward.gif",UPLEVELDISABLED: "forwarddisabled.gif",DOWNLEVEL: "backward.gif",DOWNLEVELDISABLED: "backwarddisabled.gif",FIRSTLEVEL: "first.gif",LASTLEVEL: "last.gif",DESIGN: "ViewDesign.gif",CODE: "ViewCode.gif",PREVIEW: "ViewPreview.gif",
	INCREASE: "increase.gif",DECREASE: "decrease.gif",BLANK: "blank.gif",MORE: "more.gif", MOREDISABLED: "moredisabled.gif", CALENDAR: "calendar.gif",TIME: "time.gif", FORMULA: "formula.gif", UNLINK: "unlink.gif", ANCHORLINK: "anchorlink.gif", SELECTALL: "selectall.gif", EOEDITOR: "eoeditor.gif",
	INSERTFILE: "file.gif", CLEARART: "delete.gif"
};
if(ETSOOEditor.PreloadImage)_preLoadImage();
function _preLoadImage(){
	for(strItem in ETSOOEditor.Inco){
		var strImage=ETSOOEditor.Inco[strItem];
		var objImage=new Image();
		objImage.src=_BasePath+"Images/"+strImage;
		ETSOOEditor.Inco[strItem]=objImage;
	}
};
ETSOOEditor.GetImgSrc=function(strName){
	var strSrc;
	with(this){
		if(PreloadImage)strSrc=Inco[strName].src;
		else strSrc=Path+"Images/"+Inco[strName];
	}
	return strSrc;
}
ETSOOEditor.BaseFonts=["Arial","Arial Black","Arial Narrow","Brush ScripMT","Century Gothic","Comic Sans MS","Courier","Courier New","MS Sans Serif","Script","System","Times New Roman","Verdana","Wide Latin","Wingdings","Wingdings 2","Wingdings 3"];
ETSOOEditor.AddFonts=[];
var _BaseLanguage;
if(typeof(ETSOOBaseLanguage)=="undefined")_BaseLanguage=_EEGetLanguage();
else _BaseLanguage=ETSOOBaseLanguage;
ETSOOEditor.BaseLanguage=_BaseLanguage;
ETSOOEditor._GetImgStr=function(strPath,strBgColor,numWidth,numHeight,strName,strLang,strAdd){
	var strImgSrc="blank.gif";
	if(!this.PreloadImage){
		var strIndex=strName;
		if(strIndex.substring(0,2)=="EE")strIndex=strIndex.substr(2);
		strImgSrc=this.Inco[strIndex.toUpperCase()];
	}
	var strImg='<img src="'+strPath+'Images/'+strImgSrc+'" align="absbottom" style="border:1px solid '+strBgColor+'" width="'+numWidth+'" heigh="'+numHeight+'"';
	if(strName=="EEMore")strImg+=' target="'+strAdd+'" menutarget="'+strAdd+'"';
	strImg+=' id="'+strName+'" title="'+strLang+'" basetitle="'+strLang+'"';
	strImg+='>';
	return strImg;
}
ETSOOEditor.History=function(objField){
	this.Field=objField;
	this.Data=[];
	this.BookMark=[];
	this.Position=0;
	this.Add=function(numType){
		if(!ETSOOEditor.ActiveStatus)return;
		if(numType==null)ETSOOEditor._FrameOnBlur();
		var objField=this.Field;
		var numPos=this.Position;
		var numLen=this.Data.length;
		if(objField.Mode!="Preview"){
			var strContent=objField.TextArea.value;
			if(this.Data[numPos]!=strContent){
				numPos++;
				for(var numI=0;numI<numLen-numPos;numI++){
					this.Data.pop();
					this.BookMark.pop();
				}
				this.Data[numPos]=strContent;
				numLen=numPos+1;
				var objSelection=objField.FrameWindow.document.selection;
				if(objSelection.type!="Control")this.BookMark[numPos]=objSelection.createRange().getBookmark();
				else this.BookMark[numPos]=objSelection.createRange()[0];
				this.Position=numPos;
			}
		}
		ETSOOEditor._SetRedoUndo(numLen,numPos);
	}
	this.Go=function(numStep){
		var objField=this.Field;
		var blnValid=false;
		var numLen=this.Data.length;
		var numPos=this.Position;
		numPos+=numStep;
		if(numStep>0){
			if(numPos<=numLen-1)blnValid=true;
		}else{
			if(numPos>=0)blnValid=true;
		}
		if(blnValid){
			this.Position=numPos;
			if(objField.TextArea.style.display=="none")objField.FrameWindow.document.body.innerHTML=this.Data[this.Position];
			else objField.TextArea.value=this.Data[this.Position];
			this.SetCursor();
			
			ETSOOEditor._SetRedoUndo(numLen,numPos);
		}
	}
	this.SetCursor=function(){
		var objRange=this.Field.FrameWindow.document.body.createTextRange();
		var strBM=this.BookMark[this.Position];
		if(strBM!="[object]"&&strBM!=null){
			if(objRange.moveToBookmark(strBM)){
				objRange.collapse(false);
				objRange.select();
			}
		}
	}
}
ETSOOEditor._SetRedoUndo=function(numLen,numPos){
	var numType=-1;
	if(numLen>1&&numPos>0)numType=0;
	ETSOOEditor._SetButton("Undo",numType);
	var numType=-1;
	if(numPos<numLen-1)numType=0;	
	ETSOOEditor._SetButton("Redo",numType);
}
ETSOOEditor.GetObj=function(strId){
	return document.getElementById(strId);
}
ETSOOEditor._doMouseEvent=function(objE,strType){
	var strClassName=objE.className;
	if(strClassName!="Keep"&&strClassName!="Disabled"){
		if(strType=="Over")
		{
			with(objE.style){
				borderLeft="1px solid buttonhighlight";
				borderTop="1px solid buttonhighlight";
				borderRight="1px solid buttonshadow";
				borderBottom="1px solid buttonshadow";
				backgroundColor="";
			}
		}
		else if(strType=="Out")
		{
			var strBgColor;
			var objT=ETSOOEditor.MenuBar;
			if(objT==null||objE.id=="ToolDiv")objT=ETSOOEditor.GetTarget(objE.parentNode,"DIV");
			strBgColor=objT.style.backgroundColor;
			with(objE.style){
				border="1px solid "+strBgColor;
				backgroundColor="";
			}
			objE.setAttribute("Active",0);
		}
		else if(strType=="Down")
		{
			with(objE.style){
				borderLeft="1px solid buttonshadow";
				borderTop="1px solid buttonshadow";
				borderRight="1px solid buttonhighlight";
				borderBottom="1px solid buttonhighlight";
				backgroundColor="#FFFFFF";
			}
			var numKeep=objE.getAttribute("Keep");
			if(numKeep==1)objE.className="Keep";
			objE.setAttribute("Active",1);
		}
	}
}
ETSOOEditor.MouseOver=function(objE){
	ETSOOEditor._doMouseEvent(objE,"Over");
}
ETSOOEditor.MouseOut=function(objE){
	ETSOOEditor._doMouseEvent(objE,"Out");
}
ETSOOEditor.MouseDown=function(objE){
	ETSOOEditor._doMouseEvent(objE,"Down");
}
ETSOOEditor._SetStyle=function(objFrameWin,blnDisabled){
	var objStyle=objFrameWin.document.styleSheets;
	if(objStyle.length>0)objStyle[0].disabled=blnDisabled;
}
ETSOOEditor.MouseClick=function(objE,_Add,objEvent){
	if(objE.className=="Disabled"||(this.ReadyState==0&&_Add==null))return;
	var objActive=this.ActiveField;
	if(objActive==null)return;
	var numBrowser=this.Browser;
	var strId=objE.id;
	if(objActive.Mode=="Preview"&&strId!="ToolDiv")return;
	var objDoc=objActive.FrameWindow.document;
	var strPath=this.Path;
	switch(strId){
		case "ToolDiv":
			var strName=objE.getAttribute("name");
			var strTarget=objE.getAttribute("Target");
			var objFrame=document.getElementById("ETSOOEditorFrame_"+strTarget);
			var objFrameWin=objActive.FrameWindow;
			var objTextArea=objFrame.previousSibling;
			var numHeight=parseInt(objTextArea.style.height);
			switch(strName){
				case "Design":
				case "Code":
				case "Preview":
					var objField=this.Fields[strTarget];
					var strBaseMode=objField.Mode;
					if(_Add==null||_Add==true){
						if(strBaseMode==strName)return;
						this._FrameOnBlur();
						if(strName=="Code"){
							var numWidth=objFrame.clientWidth;
							objFrame.style.display="none";
							with(objTextArea.style){
								display="block";
								width=numWidth;
							}
						}else{
							objTextArea.style.display="none";
							objFrame.style.display="block";
							if(strName=="Design"){
								this._SetStyle(objFrameWin,false);
								this._SetMode(objField.FrameWindow.document,"on");
							}
							else{
								this._SetMode(objField.FrameWindow.document,"off");
								this._SetStyle(objFrameWin,true);
							}
						}
						var arrToolDivs=objField.Div.getElementsByTagName("div");
						var numLen=arrToolDivs.length;
						for(var numI=0;numI<numLen;numI++){
							var objOne=arrToolDivs[numI];
							if(objOne.getAttribute("Active")==1&&objOne.getAttribute("name")!=strName){
								objOne.className="";this.MouseOut(objOne);break;
							}
						}
						objField.Mode=strName;
						this.ActiveField=objField;
					}else this.MouseDown(objE);
					break;
				case "Increase":
				case "Decrease":
					if(strName=="Increase")numHeight+=100;
					else if(numHeight>=200)numHeight-=100;
					objTextArea.style.height=numHeight+"px";
					objFrame.style.height=numHeight+"px";
					break;
			}
			break;
		case "EEMore":
			var numLeft,numTop;
			if(this.Browser<100){
				var arrPos=ETSOOGetPos(objE);
				numLeft=arrPos[0]-22;
				numTop=arrPos[1]+objE.clientHeight+2;
			}else{
				numLeft=objEvent.clientX-objEvent.offsetX+document.body.scrollLeft-23;
				numTop=objEvent.clientY+objE.clientHeight-objEvent.offsetY+document.body.scrollTop+1;
			}
			var strTarget=objE.getAttribute("target");
			var numHeight=0,strContent='';
			if(strTarget!="EEForeColor"&&strTarget!="EEBgColor"){
				var strSubMenuTarget=objE.getAttribute("menutarget");
				var objTarget=this.GetObj(strTarget);
				var arrSubMenu=this.SubMenu[strSubMenuTarget];
				if(strTarget==strSubMenuTarget)arrSubMenu=new Array(strTarget.substr(2),objTarget.title).concat(arrSubMenu);
				else arrSubMenu=new Array(strSubMenuTarget.substr(2),objTarget.getAttribute("basetitle")).concat(arrSubMenu);
				var arrMenus=this.GetSubMenu(arrSubMenu,strTarget);
				strContent=arrMenus[0];
				numHeight=arrMenus[1]*24+arrMenus[2]*6+4;
			}
			var objPopup=new ETSOOPopup(null,null,numHeight,numLeft,numTop,31,22);
			objPopup.BgColor=objActive.BgColor;
			objPopup.Skin=strPath+"Skins/"+objActive.Skin+"/Popup.css";
			objPopup.Content=strContent;
			objPopup.SourceObject=objE;
			if(strContent==''){
				var objNext=objE.previousSibling;
				objPopup.Path=strPath;
				objPopup.DefaultColor=objNext.style.backgroundColor;
				objPopup.DoFunction="ETSOOEditor.SetColor";
				objPopup.SourceId=strTarget;				
				objPopup.ShowColorPallette(this.OtherLangs[1],this.OtherLangs[2]);
			}
			else objPopup.Show();
			break;
		case "EENew":
			if(confirm(this.OtherLangs[0])){
				this.ActiveField.Reset();
			}
			break;
		case "EEOpen":
			break;
		case "EEFind":
			this.InsertObj("FIND");
			break;
		case "EESave":
			break;
		case "EEPasteText":
			if(window.clipboardData){
				strText=window.clipboardData.getData("Text");
				if(strText==null)strText="";
				this.InsertHTML(strText);
			}else objDoc.execCommand(CMD_PASTE,UI_DEFAULT, null);
			break;
		case "EEPasteWord":
			var strHtml=this._GetSavedHTML();
			if(strHtml==null)objDoc.execCommand(CMD_PASTE,UI_DEFAULT, null);
			else this._ClearAndInsertWordHtml(strHtml);
			break;
		case "EEEmotion":
			this.InsertObj("FACE");
			break;
		case "EEFlash":
			var objFlash=this.GetActive("OBJECT|EMBED",objE);
			this.InsertObj("OBJECT",objFlash,"Flash");
			break;
		case "EEImage":
			var objImage=this.GetActive("IMG",objE);
			this.InsertObj("IMG",objImage);
			break;
		case "EEMedia":
			var objMedia=this.GetActive("OBJECT|EMBED",objE);
			this.InsertObj("OBJECT",objMedia,"Media");
			break;
		case "EEMarquee":
			var objMarquee=this.GetActive("MARQUEE",objE);
			this.InsertObj("MARQUEE",objMarquee);
			break;
		case "EESpecial":
			this.InsertObj("SPECIAL");
			break;
		case "EETable":
		case "EETableProperty":
			var objTable=this.GetActive("TABLE",objE);
			this.InsertObj("TABLE",objTable);
			break;
		case "EECellProperty":
			var objTD=this.GetActive("TD",objE);
			this.InsertObj("TD",objTD);
			break;
		case "EESplitCell":
			var objTD=this.GetActive("TD",objE);
			this.InsertObj("SPLITCELL",objTD);
			break;
		case "EEMergeCell":
			EditorTableMergeCell();
			break;
		case "EEInsertRow":
			EditorTableInsertRow();
			break;
		case "EEDeleteRow":
			EditorTableInsertRow(1);
			break;
		case "EEInsertCol":
			EditorTableInsertCol();
			break;
		case "EEDeleteCol":
			EditorTableInsertCol(1);
			break;
		case "EEForm":
		case "EEFormProperty":
			var objForm=this.GetActive("FORM",objE);
			this.InsertObj("FORM",objForm);	
			break;
		case "EEFormFieldset":
			this.InsertHTML('<fieldset style="padding: 2"><legend>'+this.Langs["FormFieldset"]+'</legend>&nbsp;</fieldset>');
			break;
		case "EEFormImage":
		case "EEFormText":
		case "EEFormFile":
		case "EEFormCheckBox":
		case "EEFormRadio":
		case "EEFormButton":
			var objFImage=this.GetActive("INPUT",objE);
			this.InsertObj("INPUT",objFImage,strId);
			break;
		case "EEFormTextArea":
			var objTextArea=this.GetActive("TEXTAREA",objE);
			this.InsertObj("TEXTAREA",objTextArea);
			break;
		case "EEFormSelect":
			var objSelect=this.GetActive("SELECT",objE);
			this.InsertObj("SELECT",objSelect);
			break;
		case "EEFormLabel":
			var objLabel=this.GetActive("LABEL",objE);
			this.InsertObj("LABEL",objLabel);
			break;
		case "EEInsertFile":
			var objIFrame=this.GetActive("IFRAME",objE);
			this.InsertObj("IFRAME",objIFrame);
			break;			
		case "EELayer":
			this.InsertHTML('<div style="border:1px dotted #666666;padding:4px;background-color:#f3f3f3;width:98%;">'+this.OtherLangs[3]+'<br></div>');
			break;
		case "EETab":
			this.InsertHTML("&nbsp;&nbsp;&nbsp; ");
			break;
		case "EEAnchor":
			this.InsertObj("ANCHOR");
			break;
		case "EELink":
		case "EEAnchorLink":
		case "EEEmailLink":
			var objA=this.GetActive("A",objE);
			this.InsertObj("A",objA,strId);
			break;
		case "EEImageLink":
			this.InsertObj("IMAGELINK");
			break;
		case "EEUnlink":
			objActive.FrameWindow.document.execCommand(CMD_UNLINK,UI_DEFAULT,null);
			break;
		case "EECalendar":
			var dat1=new Date();
			var strDate=(numBrowser<=105.5)?dat1.toLocaleString().split(" ")[0]:dat1.toLocaleDateString();
			this.InsertHTML(strDate);
			break;
		case "EETime":
			var dat1=new Date();
			var strTime=(numBrowser<=105.5)?dat1.toLocaleString().split(" ")[1]:dat1.toLocaleTimeString();
			this.InsertHTML(strTime);
			break;
		case "EEUpLevel":
			objDoc.execCommand(CMD_BRING_FORWARD,UI_DEFAULT, null);
			break;
		case "EEDownLevel":
			objDoc.execCommand(CMD_SEND_BACKWARD,UI_DEFAULT, null);
			break;
		case "EEFirstLevel":
			objDoc.execCommand(CMD_BRING_TO_FRONT,UI_DEFAULT, null);
			break;
		case "EELastLevel":
			objDoc.execCommand(CMD_SEND_TO_BACK,UI_DEFAULT, null);
			break;
		case "EEControlProperty":
			this.InsertObj("CONTROL");
			break;
		case "EEArt":
			this.InsertObj("ART");
			break;
		case "EEClearArt":
			var objArt=this.GetWordArt();
			this.ClearArt(objActive,objArt);
			break;
		case "EECssProperty":
			this.InsertObj("CSS");
			break;
		case "EEAbout":
			this.InsertObj("ABOUT");
			break;
		case "EEHelp":
			this.InsertObj("HELP");
			break;
		default:
			this.Command(objActive,objE,objEvent);
	}
	this._DocOnSelectionChange(objEvent);
}
ETSOOEditor.ClearArt=function(objField,objE){
	if(objE)objE.removeNode(true);
	var objDocument=objField.FrameWindow.document;
	var objShapeTypes=objDocument.getElementsByTagName("shapetype");
	var numLen=objShapeTypes.length;
	for(var numI=0;numI<numLen;numI++){
		var objShapeType=objShapeTypes[numI];
		var strId=objShapeType.id;
		if(!this.testShapeType(objDocument,strId,"shape")&&!this.testShapeType(objDocument,strId,"group")){
			var objSpan=objShapeType.parentNode;
			if(objSpan.nodeName=="SPAN")objShapeType=objSpan;
			objShapeType.removeNode(true);
		}
	}
}
ETSOOEditor.testShapeType=function(objDocument,strId,strTagName){
	var objE=objDocument.getElementsByTagName(strTagName);
	var blnHave=false;
	var numLen=objE.length;
	for(var numI=0;numI<numLen;numI++){
		var objOne=objE[numI];
		if(objOne.type=="#"+strId){
			blnHave=true;
		}
	}
	return blnHave;
}
ETSOOEditor.GetActive=function(strTagName,objSource){
	var objE=null;
	var objTarget=this.ActiveTarget;
	if(objTarget){
		if(strTagName=="TD"||strTagName=="TABLE"||strTagName=="FORM"||strTagName=="MARQUEE"||strTagName=="A")objTarget=this.GetTarget(objTarget,strTagName);
		if(objTarget&&strTagName.indexOf(objTarget.nodeName)!=-1){
			var objFirst=objSource.firstChild;
			if(strTagName=="FORM"||(objFirst&&objFirst.id=="SubMenu"))objE=objTarget;
		}
	}
	return objE;
}
ETSOOEditor.GetSubMenu=function(arrSubMenu,strTarget){
	if(strTarget==null)strTarget="";	
	var strContent='';
	var numLine=0;
	var numSub=0
	var numLen=arrSubMenu.length;
	if(strTarget=="EEForm"||strTarget=="EETable"||strTarget=="EELink"){
		var objActive=this.ActiveTarget;
		if(objActive){
			if(strTarget=="EELink"){
				if(objActive.tagName!="IMG"&&numLen>6)numLen-=2;
			}else{
				var strTag=strTarget.substr(2).toUpperCase();
				var objTemp=this.GetTarget(objActive,strTag);
				if(objTemp==null)numLen=2;
			}
		}
	}
	for(var numI=0;numI<numLen;numI+=2){
		var strName=arrSubMenu[numI];
		if(strName=="NewLine"){
			numLine++;
			strContent+='<tr><td style="padding-top:2px;padding-bottom:2px"><table cellspacing="0" cellpadding="0" style="border-collapse: collapse" width="100%"><tr><td id="BreakLine"></td></tr></table></td></tr>';
		}else{
			var strInco=this.GetImgSrc(strName.toUpperCase());
			var strLang=arrSubMenu[numI+1];
			if(strLang==null)continue;
			numSub++;
			strContent+='<tr><td style="padding:2px" id="EE'+strName+'" target="'+strTarget+'" onmouseover="this.className=\'Hover\'" onmouseout="this.className=\'\'" onclick="parent.ETSOOEditor.MenuClick(this,null,event);" onselectstart="return false" title="'+strLang+'"><span id="SubMenu">';
			strContent+='<img src="'+strInco+'" width="20" height="20" align="absmiddle">&nbsp;'+strLang+'</span></td></tr>';
		}
	}
	return [strContent,numSub,numLine];
}
ETSOOEditor.MenuClick=function(objE,_Add,objEvent){
	var strTarget=objE.getAttribute("target");
	if(strTarget!=""&&strTarget!=null){
		var strId=objE.id;
		var objTarget=this.GetObj(strTarget);
		objTarget.id=strId;
		objTarget.title=objE.title;
		objTarget.src=objE.getElementsByTagName("img")[0].src;
		ETSOOPopup.ActiveOne.SourceObject.setAttribute("target",strId);
	}
	ETSOOPopup.HideFrame(1);
	this.MouseClick(objE,_Add,objEvent);
}
ETSOOEditor.GetWordArt=function(){
	var objE=this.ActiveTarget;
	var objArt=this.GetTarget(objE,"SHAPE");
	if(objArt==null)objArt=this.GetTarget(objE,"GROUP");
	if(objArt)if(objArt.textpath.string=="")objArt=null;
	return objArt;
}
ETSOOEditor.InsertObj=function(strTagName,objE,_Add){
	var strPage,numWidth,numHeight,arrAdd=[],blnAdd=false;
	var objLangs=this.Langs;
	if(objE==1){
		blnAdd=true;
		objE=null;
	}else{
		if(objE&&objE.nodeName!=strTagName){
			if((strTagName=="OBJECT"&&objE.nodeName=="EMBED")||strTagName=="SPLITCELL"){}
			else objE=null;
		}else if(strTagName=="CONTROL"||strTagName=="CSS"||strTagName=="IMAGELINK")objE=this.ActiveTarget;
		else if(strTagName=="ART")objE=this.GetWordArt();
	}
	var numType=1,strDAdd;
	switch(strTagName){
		case "IMG":
			if(blnAdd)arrAdd=["Image",objLangs["ImageProperty"]];
			else{
				strPage="Image.htm", numWidth=720, numHeight=400;
			}
			break;
		case "MARQUEE":
			if(blnAdd)arrAdd=["Marquee",objLangs["MarqueeProperty"]];
			else{
				strPage="Marquee.htm", numWidth=420, numHeight=380;
			}
			break;
		case "OBJECT":
		case "EMBED":
			if(_Add=="Flash"||_Add=="application/x-shockwave-flash"){
				if(blnAdd)arrAdd=["Flash",objLangs["FlashProperty"]];
				else{
					strPage="Flash.htm", numWidth=720, numHeight=450;
				}
			}else if(_Add=="Media"){
				if(blnAdd)arrAdd=["Media",objLangs["MediaProperty"]];
				else{
					strPage="Media.htm", numWidth=720, numHeight=450;
				}
			}else if(objE){
				var strSrc;
				if(strNodeName=="EMBED")strSrc=objE.src;
				else strSrc=objE.Movie;
				if(strSrc!=null&&strSrc.toLowerCase().indexOf(".swf")!=-1){
					if(blnAdd)arrAdd=["Flash",objLangs["FlashProperty"]];
					else{
						strPage="Flash.htm", numWidth=720, numHeight=450;
					}
				}else if(objE.URL||objE.Controls){
					if(blnAdd)arrAdd=["Media",objLangs["MediaProperty"]];
					else{
						strPage="Media.htm", numWidth=720, numHeight=450;
					}
				}
			}
			break;
		case "TABLE":
			if(blnAdd)arrAdd=["Table",objLangs["TableProperty"]];
			else{
				strPage="Table.htm", numWidth=500, numHeight=412;
			}
			break;
		case "TD":
			if(blnAdd)arrAdd=["CellProperty",objLangs["CellProperty"],"SplitCell",objLangs["SplitCell"],"InsertRow",objLangs["InsertRow"]];
			else{
				strPage="TableCell.htm", numWidth=420, numHeight=380;
			}
			break;
		case "SPLITCELL":
			if(!blnAdd){
				strPage="TableCellSplit.htm", numWidth=240, numHeight=160;
			}
			break;
		case "FORM":
			if(blnAdd)arrAdd=["Form",objLangs["FormProperty"]];
			else{
				strPage="Form.htm", numWidth=400, numHeight=228;
			}
			break;
		case "INPUT":
			var strType;
			if(blnAdd)strType=_Add;
			else if(_Add)strType=_Add.substr(6).toLowerCase();
			else if(objE)strType=objE.type;
			var strAddId;
			switch(strType){
				case "image":
					strAddId="FormImage";
					if(blnAdd)arrAdd=[strAddId,objLangs[strAddId+"Property"]];
					else{
						strPage="Image.htm", numWidth=720, numHeight=420, strDAdd=2;
					}
					break;
				case "radio":
					strAddId="FormRadio";
				case "checkbox":
					if(strAddId==null)strAddId="CheckBox";
					if(blnAdd)arrAdd=[strAddId,objLangs[strAddId+"Property"]];
					else{
						strPage="FormRadio.htm", numWidth=360, numHeight=200, strDAdd=strType;
					}
					break;
				case "file":
					strAddId="FormFile";
				case "text":
				case "password":
					if(strAddId==null)strAddId="FormText";
					if(blnAdd)arrAdd=[strAddId,objLangs[strAddId+"Property"]];
					else{
						strPage="FormText.htm", numWidth=360, numHeight=190, strDAdd=strType;
					}
					break;
				case "button":
				case "submit":
				case "reset":
					strAddId="FormButton";
					if(blnAdd)arrAdd=[strAddId,objLangs[strAddId+"Property"]];
					else{
						strPage="FormButton.htm", numWidth=360, numHeight=170;
					}
					break;
			}
			break;
		case "TEXTAREA":
			if(blnAdd)arrAdd=["FormTextArea",objLangs["FormTextAreaProperty"]];
			else{
				strPage="FormTextArea.htm", numWidth=360, numHeight=264;
			}
			break;
		case "SELECT":
			if(blnAdd)arrAdd=["FormSelect",objLangs["FormSelectProperty"]];
			else{
				strPage="FormSelect.htm", numWidth=400, numHeight=336;
			}
			break;
		case "LABEL":
			if(blnAdd)arrAdd=["FormLabel",objLangs["FormLabelProperty"]];
			else{
				strPage="FormLabel.htm", numWidth=360, numHeight=170;
			}
			break;
		case "IFRAME":
			if(blnAdd)arrAdd=["InsertFile",objLangs["InsertFileProperty"]];
			else{
				strPage="IFrame.htm", numWidth=500, numHeight=360;
			}
			break;
		case "FACE":
			strPage="Face.htm", numWidth=600, numHeight=420,numType=0;
			break;
		case "FIND":
			strPage="Find.htm", numWidth=412, numHeight=200, numType=0;
			break;
		case "SPECIAL":
			strPage="Special.htm", numWidth=600, numHeight=270,numType=0;
			break;
		case "ANCHOR":
			strPage="Anchor.htm", numWidth=360, numHeight=320;
			break;
		case "A":
			if(blnAdd)arrAdd=["Link",objLangs["LinkProperty"]];
			else{
				strPage="Link.htm", numWidth=420, numHeight=280,strDAdd=_Add;
			}
			break;
		case "IMAGELINK":
			strPage="Area.htm", numWidth=640, numHeight=560;
			break;
		case "CONTROL":
			strPage="Attribute.htm", numWidth=428, numHeight=480;
			break;
		case "CSS":
			strPage="Css.htm", numWidth=640, numHeight=580;
			break;
		case "ART":
			if(blnAdd)arrAdd=["Art",objLangs["ArtProperty"],"ClearArt",this.OtherLangs[6]];
			else{
				strPage="Art.htm", numWidth=600, numHeight=400;
			}
			break;
		case "ABOUT":
			strPage="http://www.etsoo.com/Products/EOEditor/About.asp?l="+ETSOOEditor.BaseLanguage+"&d="+document.domain, numWidth=510, numHeight=260;
			break;
		case "HELP":
			strPage="http://www.etsoo.com/Products/EOEditor/", numWidth=640, numHeight=480, numType=-1;
			break;
	}
	if(blnAdd){
		objE=this.ActiveTarget;
		var objT;
		if(strTagName!="TABLE"){
			objT=this.GetTarget(objE,"TABLE");
			if(objT){
				arrAdd=arrAdd.concat(["TableProperty",objLangs["TableProperty"]]);
			}
		}
		if(strTagName!="TD"){
			objT=this.GetTarget(objE,"TD");
			if(objT){
				arrAdd=arrAdd.concat(["CellProperty",objLangs["CellProperty"]]);
			}
		}
		if(strTagName!="FORM"){
			objT=this.GetTarget(objE,"FORM");
			if(objT){
				arrAdd=arrAdd.concat(["Form",objLangs["FormProperty"]]);
			}
		}
		if(strTagName!="MARQUEE"){
			objT=this.GetTarget(objE,"MARQUEE");
			if(objT){
				arrAdd=arrAdd.concat(["Marquee",objLangs["MarqueeProperty"]]);
			}
		}
		if(strTagName!="A"){
			objT=this.GetTarget(objE,"A");
			if(objT){
				arrAdd=arrAdd.concat(["Link",objLangs["LinkProperty"]]);
			}
		}
		return arrAdd;
	}
	else if(strPage){
		var arrControl=[0,0];
		if(strPage.indexOf("http://")==-1)strPage=this.Path+"Dialogs/"+strPage;
		else arrControl=[1,1];
		var arrArgs=[self,objE,strDAdd];
		window.ETSOOSavedArguments=arrArgs;
		ETSOOPopup.Open(strPage,arrArgs,numWidth,ETSOOGetAdjustHeight(numHeight),numType,arrControl);
	}
	else return false;
}
ETSOOEditor.GetTDs=function(){
	var objField=this.ActiveField;
	var objWindow=objField.FrameWindow;
	var objSelection=objWindow.document.selection;
	var arrTDs=[];
	if(objSelection){
		var objRange=objSelection.createRange();
		var objParent
		var blnAll=false;
		if(objRange.length==null)objParent=objRange.parentElement();
		else{
			objParent=objRange(0);
			if(objParent.nodeName=="TABLE")blnAll=true;
		}
		var objTD=this.GetTarget(objParent,"TD");
		if(objTD){
			arrTDs=[objTD];
		}else{
			var objTable=this.GetTarget(objParent,"TABLE");
			if(objTable){
				var arrTemp=objTable.getElementsByTagName("TD");
				var numLen=arrTemp.length;
				for(var numI=0;numI<numLen;numI++){
					objTemp=arrTemp[numI];
					if(this._GetTDsAdd(objSelection,objRange,objTemp,blnAll)){
						arrTDs=arrTDs.concat(objTemp);
					}
				}
			}
		}
	}
	return arrTDs;
}
ETSOOEditor._GetTDsAdd=function(objSelection,objRange,objTemp,blnAll){
	var blnHave=false;
	if(window.Node){
		blnHave=objSelection.containsNode(objTemp,true);
	}else{
		if(!blnAll){
			var objCellRange=objRange.duplicate();
			objCellRange.moveToElementText(objTemp);
			if(objRange.inRange(objCellRange)||(objRange.compareEndPoints('StartToStart',objCellRange)>= 0&&objRange.compareEndPoints('StartToEnd',objCellRange)<= 0)||(objRange.compareEndPoints('EndToStart',objCellRange)>=0&&objRange.compareEndPoints('EndToEnd',objCellRange)<= 0))blnHave=true;
		}else{
			blnHave=true;
		}
	}
	return blnHave;
}
function EditorTableValid(objTD){
	this.Valid==false;
	this.TR;
	this.Table;
	if(objTD){
		objTR=ETSOOEditor.GetTarget(objTD,"TR");
		if(objTR){
			objTable=ETSOOEditor.GetTarget(objTD,"TABLE");
			if(objTable){
				this.Valid=true;
				this.TR=objTR;
				this.Table=objTable;
			}
		}
	}
}
function EditorTableGetCols(objTD,numMaxCol){
	var numCols=0;
	var objTR=ETSOOEditor.GetTarget(objTD,"TR");
	if(objTR){
		if(numMaxCol==null)numMaxCol=objTR.cells.length;
		for(var numI=0;numI<numMaxCol;numI++){
			numCols+=objTR.cells(numI).colSpan;
		}
	}
	return numCols;
}
function EditorTableGetRows(objTD,numMaxRow){
	var numRows=0;
	var objTable=ETSOOEditor.GetTarget(objTD,"TABLE");
	if(objTable){
		var numCellIndex=objTD.cellIndex;
		if(numMaxRow==null)numMaxRow=objTable.rows.length;
		for(var numI=0;numI<numMaxRow;numI++){
			var objTempRow=objTable.rows(numI);
			var numTempCells=objTempRow.cells.length;
			if(numTempCells>=numCellIndex)numRows+=objTempRow.cells(numCellIndex).rowSpan;
			else numRow++;
		}
	}
	return numRows;
}
function EditorTableInsertRow(numType){
	var objTDs=ETSOOEditor.GetTDs();
	if(objTDs&&objTDs.length>0){
		var objTD=objTDs[0];
		var objValid=new EditorTableValid(objTD);
		if(!objValid.Valid)return false;
		
		var numCellIndex=objTD.cellIndex;
		var objTR=objValid.TR;
		var numRowIndex=objTR.rowIndex;
		var objTable=objValid.Table;
		
		if(numType==1){
			objTR.removeNode(true);
			if(objTable.rows.length==0)objTable.removeNode(true);
		}
		else{
			var numCols=EditorTableGetCols(objTD);
			var numI=0;
			var objNewTR=objTable.insertRow(numRowIndex);
			while(numI<numCols)
			{
				var objTempTD=objTR.cells(numI);
				if(objTempTD==null)break;
				var numColSpan=objTempTD.colSpan;
				var numRowSpan=objTempTD.rowSpan;
				numI+=numColSpan;
				if(numRowSpan>1)objTempTD.rowSpan+=1;
				else
				{
					var objNewTD=objNewTR.insertCell();
					objNewTD.innerHTML="&nbsp;";
					objNewTD.mergeAttributes(objTempTD);
				}
			}
		}
	}
}
function EditorTableInsertCol(numType){
	var objTDs=ETSOOEditor.GetTDs();
	if(objTDs&&objTDs.length>0){
		var objTD=objTDs[0];
		var objValid=new EditorTableValid(objTD);
		if(!objValid.Valid)return false;
		
		var numCellIndex=objTD.cellIndex;
		var objTR=objValid.TR;
		var numRowIndex=objTR.rowIndex;
		var objTable=objValid.Table;
		
		var numNowCols=EditorTableGetCols(objTD,numCellIndex);
		var numRows=objTable.rows.length;
		for(var numI=0;numI<numRows;numI++){
			if(objTable.rows.length==0){
				objTable.removeNode(true);
				break;
			}
			var objTempTR=objTable.rows(numI);
			if(objTempTR==null)break;
			var numTempCols=0;
			for(var numH=0;numH<=numCellIndex;numH++){
				var objTempTD=objTempTR.cells(numH);
				if(objTempTD==null)continue;
				var numTempColsAdd=objTempTD.colSpan;
				numTempCols+=numTempColsAdd;
				if(numType==1){
					if(numTempCols>=numNowCols){
						if(numTempColsAdd>1)objTempTD.colSpan-=1;
						else{
							objTempTD.removeNode(true);
							if(objTempTR.cells.length==0)
							{
								objTempTR.removeNode(true);
								numI--;
							}
						}
					}
				}
				else
				{
					if(numTempCols>numNowCols){
						if(numTempColsAdd>1)objTempTD.colSpan+=1;
						else{
							var objNewTD=objTempTR.insertCell(numI);
							objNewTD.innerHTML="&nbsp;";
							objNewTD.mergeAttributes(objTempTD);
						}
					}
				}
			}
		}
	}
}
function EditorTableMergeCell(numType){
	var objTDs=ETSOOEditor.GetTDs();
	var numLen=objTDs.length;
	if(numLen>1){
		var objBaseTD=objTDs[0];
		var objValid=new EditorTableValid(objBaseTD);
		if(!objValid.Valid)return false;
		
		var numBaseCellIndex=objBaseTD.cellIndex;
		var objBaseTR=objValid.TR;
		var numBaseRowIndex=objBaseTR.rowIndex;
		var objBaseTable=objValid.Table;
		var strText='';
		
		for(var numI=1;numI<numLen;numI++){
			var objTD=objTDs[numI];
			var objValid=new EditorTableValid(objTD);
			if(!objValid.Valid)continue;
			
			var numCellIndex=objTD.cellIndex;
			var objTR=objValid.TR;
			var numRowIndex=objTR.rowIndex;
			var objTable=objBaseTable;
			
			strText+=objTD.innerHTML;
			objTR.deleteCell(numCellIndex);
			if(objTR.cells.length==0)
			{
				objTable.deleteRow(numRowIndex);
			}
		}
		if(numType==1){
			objBaseTR.deleteCell(numBaseCellIndex);
			if(objTR.cells.length==0)
			{
				objTable.deleteRow(numRowIndex);
			}
			if(objTable.rows.length==0)
			{
				objTable.removeNode(true);
			}
		}
		else{
			var numRows=objBaseTable.rows.length;
			objBaseTD.innerHTML+=strText;
			if(numRows==1){
				var objTempTR=objBaseTable.rows(0);
				var numCells=objTempTR.cells.length;
				for(var numH=0;numH<numCells;numH++)
				{
					var objTempTD=objTempTR.cells(numH);
					objTempTD.colSpan=1;
					objTempTD.rowSpan=1;
				}
			}
			else{
				var numColSpan;
				var numRowSpan;
				
				var numCellIndex=objBaseTD.cellIndex;
				var numRowIndex=objBaseTR.rowIndex;
				
				var numRows=objTable.rows.length;
				var numTempRows=0;
				for(var numH=0;numH<numRows;numH++){
					if(numH!=numRowIndex){
						var objTempTR=objBaseTable.rows(numH);
						var numTempCells=objTempTR.cells.length;
						if(numCellIndex<=numTempCells){
							var objTempTD=objTempTR.cells(numCellIndex);
							numTempRows+=objTempTD.rowSpan;
						}
						else numTempRows++;
					}
				}
				numRowSpan=numRows-numTempRows;
				
				var numNewRowIndex;
				if(numRowIndex==numRows-1)numNewRowIndex=numRowIndex-1;
				else numNewRowIndex=numRowIndex+1;
				var objNewTR=objBaseTable.rows(numNewRowIndex);
				var numCols=EditorTableGetCols(objNewTR.cells(0));
				
				var numNowCols=EditorTableGetCols(objBaseTD)-objBaseTD.colSpan;
				
				numColSpan=numCols-numNowCols;
				
				objBaseTD.colSpan=numColSpan;
				objBaseTD.rowSpan=numRowSpan;
			}
		}
	}
}
ETSOOEditor.SetColor=function(strColor,strId){
	var objTarget=this.GetObj(strId);
	if(objTarget){
		objTarget.nextSibling.style.backgroundColor=strColor;
		this.MouseClick(objTarget);
	}
}
ETSOOEditor._GetEventObj=function(objEvent){
	if(objEvent)return (objEvent.srcElement)?objEvent.srcElement:objEvent.target;
}
ETSOOEditor._GetActiveField=function(strId){
	var numPos=strId.indexOf("ETSOOEditorFrame_");
	if(numPos==0)strId=strId.substr(17);
	var objOne=this.Fields[strId];
	if(objOne!=null)this.ActiveField=objOne;
	return objOne;
}
ETSOOEditor._FrameOnFocus=function(objEvent){
	var objTarget=ETSOOEditor._GetEventObj(objEvent);
	var objActive=ETSOOEditor._GetActiveField(objTarget.id);
	if(objActive&&ETSOOEditor.Browser>100)objActive.History.Add();
	ETSOOEditor._DocOnSelectionChange(objEvent);
}
ETSOOEditor._FrameOnBlur=function(numType){
	ETSOOEditor._SaveContent();
	if(ETSOOEditor.Browser>100){
		var objActive=ETSOOEditor.ActiveField;
		if(objActive)objActive.History.Add(1);
	}
}
ETSOOEditor._SaveContent=function(strName,numType){
	var objField;
	if(strName!=null)objField=this.Fields[strName];
	else{
		objField=ETSOOEditor.ActiveField;
		numType=1;
	}
	if(objField&&objField.FrameWindow.document.body){
		if(objField.TextArea.style.display=="none"){
			var strContent=objField.FrameWindow.document.body.innerHTML;
			if(ETSOOEditor.Browser>100)strContent=this.GetRelativePath(strContent);
			objField.TextArea.value=strContent;
		}
		else if(numType==1)objField.FrameWindow.document.body.innerHTML=objField.TextArea.value;
	}
}
ETSOOEditor._FormOnSubmit=function(objEvent){
	var objTextArea=ETSOOEditor._GetEventObj(objEvent).getElementsByTagName("textarea");
	var numLen=objTextArea.length;
	for(var numI=0;numI<numLen;numI++){
		var objOne=objTextArea[numI];
		if(objOne.className=="SaveData"){
			ETSOOEditor._SaveContent(objOne.name);
		}
	}
}
ETSOOEditor._DocOnClick=function(objEvent){
	ETSOOPopup.HideFrame();
}
ETSOOEditor._DocMouseUp=function(objEvent){
	if(ETSOOEditor.Browser==105.5)window.ETSOOEditorSavedRange=document.selection.createRange().duplicate();
	ETSOOEditor._DocOnSelectionChange(objEvent);
	var objField=ETSOOEditor.ActiveField;
	if(objField){
		var objDiv=objField.Div;
		if(ETSOOEditor.MenuBar&&objDiv.getAttribute("ContentType")!=1&&(objDiv.previousSibling==null||objDiv.previousSibling.id!="ETSOOEditor")){
			objDiv.parentNode.insertBefore(ETSOOEditor.MenuBar,objDiv);
			ETSOOEditor._SetShow("EEForeColor");
			ETSOOEditor._SetShow("EEBgColor");
		}
	}
}
ETSOOEditor._DocOnDblClick=function(objEvent){
	if(objEvent==null)return false;
	var objField=ETSOOEditor.ActiveField;
	if(objField.Mode!="Design")return;
	var objE=ETSOOEditor._GetEventObj(objEvent);
	ETSOOEditor.InsertObj(objE.nodeName,objE);
}
ETSOOEditor._DocOnKeyPress=function(objEvent){
	ETSOOPopup.HideFrame();
	if(objEvent==null)return;
	if(objEvent.ctrlKey){
		var numKeyCode=objEvent.keyCode;
		var objActive=ETSOOEditor.ActiveTarget;
		var objField=ETSOOEditor.ActiveField;
		var objDoc=objField.FrameWindow.document;
		var blnSet=true;
		var numBrowser=ETSOOEditor.Browser;
		switch(numKeyCode){
			//F-Find, F-Find, X-Cut, V-Paste, C-Copy, D-Delete
			//M-Image, G-Face, B-Bold, I-Italic, U-Underline, L-Left, E-Center, R-Right
			case 13: //Enter
				var objTextArea=objField.TextArea;
				var objForm=objTextArea.form;
				if(objForm){
					var blnOK=true;
					ETSOOEditor._SaveContent();
					if(objForm.onsubmit)blnOK=objForm.onsubmit();
					if(blnOK)objForm.submit();
				}
				break;
			case 69: //E
				objDoc.execCommand(CMD_CENTER,UI_DEFAULT,null);
				if(numBrowser>100)objField.History.Add();
				break;
			case 71: //G
				ETSOOEditor.InsertObj("FACE");
				break;
			case 75: //K
				var objE;
				if(objActive.tagName=="A")objE=objActive;			
				ETSOOEditor.InsertObj("A",objE);
				break;		
			case 76: //L
				objDoc.execCommand(CMD_LEFT,UI_DEFAULT,null);
				if(numBrowser>100)objField.History.Add();
				break;
			case 77: //M
				var objE;
				if(objActive.tagName=="IMG")objE=objActive;
				ETSOOEditor.InsertObj("IMG",objE);
				break;
			case 82: //R
				objDoc.execCommand(CMD_RIGHT,UI_DEFAULT,null);
				if(numBrowser>100)objField.History.Add();
				break;
			case 89: //Y
				if(numBrowser>100)objField.History.Go(1);
				else objDoc.execCommand(CMD_REDO,UI_DEFAULT, null);
				break;
			case 90: //Z
				if(numBrowser>100)objField.History.Go(-1);
				else objDoc.execCommand(CMD_UNDO,UI_DEFAULT, null);
				break;
			case 189: //-
			case 109:
				if(numBrowser<100)break;
				var objDecrease=ETSOOEditor._GetNamedDiv(objField.Div,"Decrease");
				if(objDecrease)ETSOOEditor.MouseClick(objDecrease);
				break;
			case 187:
			case 107:
				if(numBrowser<100)break;
				var objIncrease=ETSOOEditor._GetNamedDiv(objField.Div,"Increase");
				if(objIncrease)ETSOOEditor.MouseClick(objIncrease);				
				break;
			default:
				blnSet=false;
		}
		if(blnSet){
			ETSOOEditor._FrameOnBlur();
			ETSOOEditor.CancelBubble(objEvent);
			return false;
		}
	}
}
ETSOOEditor._GetNamedDiv=function(objDiv,strName){
	var arrDivs=objDiv.getElementsByTagName("div");
	var numLen=arrDivs.length;
	for(var numI=0;numI<numLen;numI++){
		var objOne=arrDivs[numI];
		if(objOne.getAttribute("name")==strName)return objOne;
	}
}
ETSOOEditor._DocOnContextMenu=function(objEvent){
	if(ETSOOEditor.MenuBar==null)return false;
	ETSOOEditor._DocOnSelectionChange(objEvent);
	if(objEvent==null)return;
	var objField=ETSOOEditor.ActiveField;
	if(objField.Mode!="Design")return;
	var arrPos=ETSOOGetPos(objField.FrameDocument);
	var numLeft=objEvent.clientX+arrPos[0],numTop=objEvent.clientY+arrPos[1];
	var objPopup=new ETSOOPopup();
	var strPath=ETSOOEditor.Path;
	objPopup.BgColor=objField.BgColor;
	objPopup.Skin=strPath+"Skins/"+ETSOOEditor.ActiveField.Skin+"/Popup.css";
	var arrSubMenu=ETSOOEditor._GetMenuItem(objEvent);
	var arrMenus=ETSOOEditor.GetSubMenu(arrSubMenu);
	var strContent=arrMenus[0];
	objPopup.Height=arrMenus[1]*24+arrMenus[2]*6+4;
	if(window.createPopup==null){
		objPopup.URL=strPath+"Dialogs/ContextMenu.htm";
	}
	objPopup.Content=strContent;
	objPopup.Left=numLeft;
	objPopup.Top=numTop;
	objPopup.Show();
	ETSOOEditor.CancelBubble(objEvent);
	return false;
}
ETSOOEditor.CancelBubble=function(objEvent){
	if(ETSOOEditor.Browser>100)objEvent.cancelBubble=true;
	else objEvent.preventDefault();
}
ETSOOEditor._GetMenuItem=function(objEvent){
	var objLangs=this.Langs;
	var arrItems=new Array("SelectAll",objLangs["SelectAll"],"PasteWord",objLangs["Paste"]);
	var objCut=this.GetObj("EECut");
	if(objCut&&objCut.className!="Disabled"){
		arrItems=arrItems.concat("NewLine","","Cut",objLangs["Cut"],"Copy",objLangs["Copy"],"Delete",objLangs["Delete"]);
	}
	var objE=this._GetEventObj(objEvent);
	if(objE.nodeName=="BODY"&&this.Browser>100){
		var objRange=this.ActiveField.FrameWindow.document.selection.createRange();
		if(objRange.length!=null)objE=objRange(0);
	}
	this.ActiveTarget=objE;
	var strNodeName=objE.nodeName;
	var strType=objE.type;
	if(strNodeName=="OBJECT"){
		if(objE.Movie)strType="Flash";
		else strType="Media";
	}
	if(this.GetWordArt())strNodeName="ART";
	var arrAdd=this.InsertObj(strNodeName,1,strType);
	var numLen=arrAdd.length;
	if(numLen>0){
		arrItems=arrItems.concat("NewLine","");
		arrItems=arrItems.concat(arrAdd);
	}
	if(objE.nodeName!="BODY"){
		if(numLen==0)arrItems=arrItems.concat("NewLine","");
		arrItems=arrItems.concat("ControlProperty",this.OtherLangs[4],"CssProperty",this.OtherLangs[5]);
	}
	return arrItems;
}
ETSOOEditor._DocOnPaste=function(){
	if(ETSOOEditor.AutoClearWord){
		var strHtml=ETSOOEditor._GetSavedHTML();
		var regWord=/<\w[^>]* class="?MsoNormal"?/gi;
		if(regWord.test(strHtml)){
			ETSOOEditor._ClearAndInsertWordHtml(strHtml);
			return false;
		}
	}
}
ETSOOEditor._GetSavedHTML=function(){
	var strHtml;
	if(ETSOOEditor.Browser>=105.5){
		var objDiv=document.getElementById("ETSOOEditorTempleData");
		objDiv.innerHTML="";
		var objRange=document.body.createTextRange();
		objRange.moveToElementText(objDiv);
		objRange.execCommand("Paste");
		strHtml=objDiv.innerHTML;
		objDiv.innerHTML="";
	}else if(window.clipboardData){
		strHtml=window.clipboardData.getData("Text");
		if(strHtml==null)strHtml="";
		strHtml=strHtml.replace(/\n\n/gi,"<p>");
		strHtml=strHtml.replace(/\n/gi,"<br>");
		strHtml=strHtml.replace(/(  ){2}/gi,"&nbsp;&nbsp;&nbsp;&nbsp;");
		strHtml=strHtml.replace(/(&nbsp;){5,}/gi," " );
	}
	return strHtml;
}
ETSOOEditor._ClearAndInsertWordHtml=function(strHtml){
	strHtml=strHtml.replace(/<\/?SPAN[^>]*>/gi,"");
	strHtml=strHtml.replace(/<(\w[^>]*)\s+class=([^ |>]*)([^>]*)/gi,"<$1$3");
	strHtml=strHtml.replace(/<(\w[^>]*)\s+style="([^"]*)"([^>]*)/gi,"<$1$3");
	strHtml=strHtml.replace(/<(\w[^>]*)\s+lang=([^ |>]*)([^>]*)/gi,"<$1$3");
	strHtml=strHtml.replace(/<\\?\?xml[^>]*>/gi,"");
	strHtml=strHtml.replace(/<\/?\w+:[^>]*>/gi,"");
	strHtml=strHtml.replace(/(&nbsp;){5,}/gi," " );
	this.InsertHTML(strHtml);
}
ETSOOEditor._DocOnSelectionChange=function(strAction,strAdd){
	if(ETSOOEditor.ReadyState==0)return;
	if(!ETSOOEditor.ActiveStatus)return;
	var arrObj=ETSOOEditor.GetRange();
	if(arrObj==null)return false;
	var objBody=arrObj[1];
	var objSelection=arrObj[2];
	var objRange=arrObj[3];
	var objTarget,numType=0;
	var numAbsPos=0,numCut=0;
	var numBrowser=ETSOOEditor.Browser;
	if(objRange){
		if(objRange.length==null){
			objTarget=objRange.parentElement();
			if(objTarget){
				var numNodeType=objTarget.nodeType;
				var strText=objRange.text;
				if(numNodeType==1||numNodeType==3){
					if(objTarget.nodeName=="BODY"||objTarget.nodeName=="BR")numCut=-1;
					if(objTarget.nodeName=="BODY"&&strText!="")numCut=0;
					if(numNodeType==3||numBrowser>100)numCut=(strText=="")?-1:0;
				}else{
					numCut=-1;
				}
			}
		}else{
			objTarget=objRange(0);
		}
		if(objTarget&&objTarget.style&&objTarget.style.position=="absolute")numAbsPos=1;
	}
	ETSOOEditor.ActiveTarget=objTarget;
	ETSOOEditor._SetButton("AbsolutePos",numAbsPos);
	if(numCut==-1)ETSOOEditor.SetDefault("EELink");
	ETSOOEditor._SetButton("Cut",numCut);
	ETSOOEditor._SetButton("Copy",numCut);
	ETSOOEditor._SetButton("Delete",numCut);
	ETSOOEditor._SetButton("Link",numCut);
	var strFont=ETSOOEditor._GetValue(objTarget,"FONT;","face",null,0);
	if(numBrowser<100&&!strFont)strFont=ETSOOEditor._GetValue(objTarget,"P;DIV;SPAN;","fontFamily",null,1);
	ETSOOEditor._SetButton("FontSet",strFont);
	var strSize=strSize=ETSOOEditor._GetValue(objTarget,"FONT;","size",null,0);
	if(numBrowser<100&&!strSize)strSize=ETSOOEditor._GetValue(objTarget,"P;DIV;SPAN;","fontSize",null,1);
	ETSOOEditor._SetButton("FontSize",strSize);
	if(ETSOOEditor.GetTarget(objTarget,"B")!=null||ETSOOEditor.GetTarget(objTarget,"STRONG")!=null||ETSOOEditor._GetValue(objTarget,"P;DIV;SPAN;","fontWeight","bold",1))numType=1;
	ETSOOEditor._SetButton("Bold",numType);numType=0;
	if(ETSOOEditor.GetTarget(objTarget,"I")!=null||ETSOOEditor.GetTarget(objTarget,"EM")!=null||ETSOOEditor._GetValue(objTarget,"P;DIV;SPAN;","fontStyle","italic",1))numType=1;
	ETSOOEditor._SetButton("Italic",numType);numType=0;
	if(ETSOOEditor.GetTarget(objTarget,"U")!=null||ETSOOEditor._GetValue(objTarget,"P;DIV;SPAN;","textDecoration","underline",1))numType=1;
	ETSOOEditor._SetButton("Underline",numType);numType=0;
	if(ETSOOEditor.GetTarget(objTarget,"STRIKE")!=null||ETSOOEditor._GetValue(objTarget,"P;DIV;SPAN;","textDecoration","line-through",1))numType=1;
	ETSOOEditor._SetButton("StrikeThrough",numType);numType=0;
	if(ETSOOEditor._GetValue(objTarget,"P;","align","left",0)||ETSOOEditor._GetValue(objTarget,"P;DIV;SPAN;","textAlign","left",1))numType=1;
	ETSOOEditor._SetButton("Left",numType);numType=0;
	if(ETSOOEditor._GetValue(objTarget,"P;","align","center",0)||ETSOOEditor._GetValue(objTarget,"P;DIV;SPAN;","textAlign","center",1))numType=1;
	ETSOOEditor._SetButton("Center",numType);numType=0;
	if(ETSOOEditor._GetValue(objTarget,"P;","align","right",0)||ETSOOEditor._GetValue(objTarget,"P;DIV;SPAN;","textAlign","right",1))numType=1;
	ETSOOEditor._SetButton("Right",numType);numType=0;
	if(ETSOOEditor._GetValue(objTarget,"P;","align","justify",0)||ETSOOEditor._GetValue(objTarget,"P;DIV;SPAN;","textAlign","jusfity",1))numType=1;
	ETSOOEditor._SetButton("Full",numType);numType=0;
	if(ETSOOEditor.GetTarget(objTarget,"OL")!=null)numType=1;
	ETSOOEditor._SetButton("OrderList",numType);numType=0;
	if(ETSOOEditor.GetTarget(objTarget,"UL")!=null)numType=1;
	ETSOOEditor._SetButton("UnorderList",numType);numType=0;
	if(ETSOOEditor.GetTarget(objTarget,"SUP")!=null)numType=1;
	ETSOOEditor._SetButton("SuperScript",numType);numType=0;
	if(ETSOOEditor.GetTarget(objTarget,"SUB")!=null)numType=1;
	ETSOOEditor._SetButton("SubScript",numType);numType=0;
	var objTable=ETSOOEditor.GetTarget(this.ActiveTarget,"TABLE");
	if(objTable==null)ETSOOEditor.SetDefault("EETable");
	var objForm=ETSOOEditor.GetTarget(this.ActiveTarget,"FORM");
	if(objForm==null)ETSOOEditor.SetDefault("EEForm");
}
ETSOOEditor.SetDefault=function(strId){
	var objDiv=this.MenuBar;
	if(objDiv==null)return false;
	var arrImages=objDiv.getElementsByTagName("IMG");
	var numLen=arrImages.length;
	for(var numI=0;numI<numLen;numI++){
		var objOne=arrImages[numI];
		if(objOne.id=="EEMore"&&objOne.getAttribute("menutarget")==strId){
			var objNext=objOne.previousSibling;
			if(objNext.id!=strId){
				objNext.id=strId;
				objNext.title=objNext.getAttribute("basetitle");
				objNext.src=this.GetImgSrc(strId.substr(2).toUpperCase());
				objOne.setAttribute("target",strId);
			}
			break;
		}
	}
}
ETSOOEditor._GetValue=function(objTarget,strTagName,strProperty,strValue,numType){
	blnFind=false;
	var strOK='';
	while(objTarget){
		var strNodeName=objTarget.nodeName.toUpperCase();
		if(strNodeName=="BODY")break;
		if(strTagName.indexOf(strNodeName+";")!=-1){
			var strBaseValue;
			strOK+=strValue;
			if(numType==0)strBaseValue=objTarget.getAttribute(strProperty);
			else if(objTarget.style)strBaseValue=eval("objTarget.style."+strProperty);
			if(strBaseValue==null)strBaseValue="";
			strBaseValue=strBaseValue.toLowerCase();
			if(strValue==null){
				if(strBaseValue!=""){
					return strBaseValue;break;
				}
			}else if(strBaseValue.indexOf(strValue)!=-1){
				blnFind=true;break;
			}
		}
		objTarget=objTarget.parentNode;
	}
	return blnFind;
}
ETSOOEditor._SetButton=function(strId,numType){
	var objE=this.GetObj("EE"+strId);
	if(objE){
		if(strId=="FontSet"||strId=="FontSize"){
			var numLen=objE.length,blnSet=false;
			for(var numI=0;numI<numLen;numI++){
				var objOne=objE.options[numI];
				if(objOne.value==numType){
					objOne.selected=true;
					blnSet=true;
					break;
				}
			}
			if(!blnSet)objE.options[0].selected=true;
		}else{
			strId=strId.toUpperCase();
			this._SetButtonAdd(objE,strId,numType);
			var objNext=objE.nextSibling;
			if(objNext!=null&&objNext.id!="EEMore")objNext=null;
			if(objNext)this._SetButtonAdd(objNext,"MORE",numType);
		}
	}
}
ETSOOEditor._SetButtonAdd=function(objE,strId,numType){
	var strSrc=objE.src;
	objE.className="";
	if(numType>=0){
		if(strSrc.indexOf("disabled.gif")!=-1)objE.src=this.GetImgSrc(strId);
		if(numType==0)this.MouseOut(objE);
		else{
			if(strId!="MORE"){
				this.MouseDown(objE);
				objE.className="Keep";
			}
		}
	}else if(numType==-1){
		if(strSrc.indexOf("disabled.gif")==-1)objE.src=this.GetImgSrc(strId+"DISABLED");
		this.MouseOut(objE);
		objE.className="Disabled";
	}
}
ETSOOEditor.GetTarget=function(objE,strTagName){
	while(objE&&(objE.nodeName.toUpperCase()!=strTagName))objE=objE.parentNode;
	return objE;
}
ETSOOEditor._SetMode=function(objDocument,strValue){
	var blnIE5=(objDocument.body.contentEditable==null);
	var blnValue=(strValue=="on")?true:false;
	if(blnIE5)objDocument.designMode=strValue;
	else objDocument.body.contentEditable=blnValue;
	return blnIE5;
}
ETSOOEditor._GetCharset=function(){
	return (this.Browser>100)?document.defaultCharset:document.characterSet;
}
ETSOOEditor._SetShow=function(strId){
	var objShow=this.GetObj(strId+"_Show");
	if(objShow==null)return false;
	var objImg=this.GetObj(strId);
	var arrPos=ETSOOGetPos(objImg);
	var numLeft=arrPos[0]+4;
	var numTop=arrPos[1]+16;
	if(window.Node){
		numLeft-=1;
		numTop-=1;
	}
	var strBgColor=(strId=="EEForeColor")?"#000000":"#FFFFFF";
	with(objShow.style){
		backgroundColor=strBgColor;
		left=numLeft+"px";
		top=numTop+"px";
		display="block";
	}
}
ETSOOEditor._SetFieldContent=function(){
	var blnIE=(this.Browser>100);
	var blnIE5=(this.Browser==105);
	var blnHave=false;
	var blnActiveStatus=this.ActiveStatus;
	for(strField in this.Fields){
		if(!blnHave)blnHave=true;
		var objField=this.Fields[strField];
		if(this.ActiveField==null)this.ActiveField=objField;
		var strBaseContent=objField.Content;
		var objTextArea=objField.TextArea;
		if(objTextArea.value!="")strBaseContent=objTextArea.value;
		else objTextArea.value=strBaseContent;
		var objDiv=objField.Div;
		var numShowMode=objDiv.getAttribute("ShowMode");
		var objDocument=objField.FrameWindow.document;
		var numShowMargin=objField.Div.getAttribute("ShowMargin");
		var strPath=this.Path;
		if(blnIE)
		{
			objField.History=new this.History(objField);
			objField.History.Data[0]=strBaseContent;
			window.attachEvent("onbeforeunload",this._FrameOnBlur);
			objField.FrameDocument.attachEvent("onfocus",this._FrameOnFocus);
			var strCharset=this._GetCharset();
			var strBody='<html><head>';
			strBody+='<meta http-equiv="Content-Type" content="text/html; charset='+strCharset+'">';
			strBody+='<style>TD,OBJECT,EMBED,FORM{border:1px dotted #111111}';
			strBody+='A{padding-left:12px;background-image:url('+strPath+'Images/anchor_show.gif);background-repeat:no-repeat}</style>\n';
			if(!blnIE5){
				objField.FrameDocument.attachEvent("onblur",this._FrameOnBlur);
			}
			else{
				document.attachEvent("onmousedown",this._FrameOnBlur);
				window.attachEvent("onblur",this._FrameOnBlur);
			}
			strBody+='<style>\n';
			strBody+='v\\:* {behavior: url(#default#VML);}\n';
			strBody+='o\\:* {behavior: url(#default#VML);}\n';
			strBody+='.shape{behavior: url(#default#VML);}\n';
			strBody+='body,td{font-size:9pt}\n';
			strBody+='</style>\n';
			strBody+='<XML:NAMESPACE NS="urn:schemas-microsoft-com:vml" PREFIX="v"/>\n';
			strBody+='<base target="_blank"></head>\n';
			strBody+='<body onmousedown="return parent.ETSOOEditor._DocOnClick(event)" onkeydown="return parent.ETSOOEditor._DocOnKeyPress(event)"';
			strBody+=' onpaste="return parent.ETSOOEditor._DocOnPaste(event);" style="margin:'+(numShowMargin==0?0:12)+'px"';
			strBody+=' oncontextmenu="return parent.ETSOOEditor._DocOnContextMenu(event)" ondblclick="return parent.ETSOOEditor._DocOnDblClick(event)"';
			strBody+=' onmouseup="return parent.ETSOOEditor._DocMouseUp(event)"';
			if(blnActiveStatus)strBody+=' onkeyup="return parent.ETSOOEditor._DocOnSelectionChange(event)" onselectionchange="return parent.ETSOOEditor._DocOnSelectionChange(event)"';
			strBody+='>'+strBaseContent+'</body></html>';
			objDocument.open();
			objDocument.write(strBody);
			objDocument.close();
			objDocument.execCommand("LiveResize",false,true);
			objDocument.execCommand("2D-Position",false,true);
			objDocument.execCommand("MultipleSelection",false,true);
			this._SetMode(objDocument,"on");
		}else{
			window.addEventListener('unload',this._FrameOnBlur , true);
			objDocument.addEventListener('blur',this._FrameOnBlur , true);
			objDocument.addEventListener('focus',this._FrameOnFocus , true);
			objDocument.addEventListener('mousedown',this._DocOnClick , true);
			objDocument.addEventListener('keydown',this._DocOnKeyPress , true);
			objDocument.addEventListener('contextmenu',this._DocOnContextMenu , true);
			objDocument.addEventListener('dblclick',this._DocOnDblClick , true);
			objDocument.addEventListener('mouseup',this._DocMouseUp, true);
			if(blnActiveStatus)objDocument.addEventListener('keyup',this._DocOnSelectionChange , true);
			var objBody=objDocument.body;
			var objHead=objDocument.createElement("head");
			objHead=objDocument.documentElement.insertBefore(objHead,objBody);
			var objStyle=objDocument.createElement("style");
			objStyle.innerHTML='TD,OBJECT,EMBED,FORM{border:1px dotted #111111};A{padding-left:12px;background-image:url('+strPath+'Images/anchor_show.gif);background-repeat:no-repeat}';
			objHead.appendChild(objStyle);
			objBody.bgColor="#FFFFFF";
			with(objBody.style){
				margin=(numShowMargin==0?0:12)+"px";
				fontSize="9pt";
			}
			objBody.innerHTML=strBaseContent;
			objDocument.id=objField.FrameDocument.id;
			objDocument.designMode="on";
		}
		if(numShowMode==1||numShowMode==2){
			var objOneDiv=objDiv.getElementsByTagName("div")[0];
			ETSOOEditor.MouseDown(objOneDiv);
			this.MouseClick(objOneDiv,true);
		}
		objDiv.style.visibility="visible";
	}
	this._SetShow("EEForeColor");
	this._SetShow("EEBgColor");
	ETSOOPopup._SetAddEvent(window);
	if(blnIE&&!blnIE5){
		var objDiv=document.createElement("div");
		objDiv.id="ETSOOEditorTempleData";
		with(objDiv.style){
			visibility="hidden";
		}
		objDiv.setAttribute("contentEditable",true);
		document.body.insertAdjacentElement("beforeEnd",objDiv);
	}
	if(blnHave){
		this.ReadyState=1;
		if(blnIE){
			if(blnActiveStatus){
				this._SetButton("Redo",-1);
				this._SetButton("Undo",-1);
			}
			var numLen=document.forms.length;
			for(var numI=0;numI<numLen;numI++){
				var objForm=document.forms[numI];
				if(blnIE)objForm.attachEvent("onsubmit",this._FormOnSubmit);
				else objForm.addEventListener('submit',this._FormOnSubmit, true);
			}
		}
		if(!blnIE5&&blnActiveStatus)this._DocOnSelectionChange();
	}
}
if(ETSOOEditor.Browser>100)window.attachEvent("onload",function(){ETSOOEditor._SetFieldContent()});
else window.addEventListener("load",function(){ETSOOEditor._SetFieldContent()},false);
ETSOOEditor.Command=function(objActive,objE,objEvent){
	var strId=objE.id;
	var objDoc=objActive.FrameWindow.document;
	var blnCode=(objActive.Mode=="Code");
	if(strId.indexOf("EE")==0)strId=strId.substr(2);
	if(objE.className=="Keep"&&(strId=="Center"||strId=="Right"||strId=="Full"))strId="Left";
	var strPath=this.Path;
	var strWord="";
	var blnActiveStatus=this.ActiveStatus;
	switch(strId){
		case "Redo":
			if(this.Browser>100&&blnActiveStatus)objActive.History.Go(1);
			else objDoc.execCommand(CMD_REDO,UI_DEFAULT, null);
			break;
		case "Undo":
			if(this.Browser>100&&blnActiveStatus)objActive.History.Go(-1);
			else objDoc.execCommand(CMD_UNDO,UI_DEFAULT, null);
			break;
		case "FontSet":
			if(blnCode)strWord='<FONT FACE="'+objE.value+'">*</FONT>';
			else{
				var strFont=objE.value;
				if(strFont=="")strFont=null;
				objDoc.execCommand(CMD_FONTSET,UI_DEFAULT, strFont);
			}
			break;
		case "FontSize":
			if(blnCode)strWord='<FONT SIZE="'+objE.value+'">*</FONT>';
			else{
				var numSize=objE.value;
				if(numSize=="")numSize=null;
				objDoc.execCommand(CMD_FONTSIZE,UI_DEFAULT,numSize);
			}
			break;
		case "BgColor":
			var strColor=objE.nextSibling.style.backgroundColor;
			objDoc.execCommand(CMD_BGCOLOR,UI_DEFAULT,strColor);
			break;
		case "ForeColor":
			var strColor=objE.nextSibling.style.backgroundColor;
			objDoc.execCommand(CMD_FORECOLOR,UI_DEFAULT,strColor);
			break;
		default:
			strWord=null;
			if(blnCode){
				switch(strId){
					case "Bold":
						strWord="<STRONG>*</STRONG>";
						break;
					case "Italic":
						strWord="<I>*</I>";
						break;
					case "Underline":
						strWord="<U>*</U>";
						break;
					case "StrikeThrough":
						strWord="<STRIKE>*</STRIKE>";
						break;
					case "Left":
					case "Center":
					case "Right":
					case "Full":
						strWord='<P ALIGN="'+strId.toUpperCase()+'">*</P>';
						break;
					case "SuperScript":
						strWord='<SUP>*</SUP>';
						break;
					case "SubScript":
						strWord='<SUB>*</SUB>';
						break;
				}
			}
			break;
	}
	if(blnCode&&strWord!=null)this.InsertHTML(strWord,1);
	else if(strWord!=""){
		objDoc.execCommand(eval("CMD_"+strId.toUpperCase()),UI_DEFAULT, null);
	}
	if(this.Browser>100&&strId!="Redo"&&strId!="Undo")objActive.History.Add();
}
ETSOOEditor.GetRange=function(){
	var objField=this.ActiveField;
	if(objField==null)return false;
	var strMode=objField.Mode;
	if(strMode=="Preview")return;
	var objWindow,objBody,objSelection,objRange;
	if(strMode=="Code"){
		objWindow=window;
		objBody=objField.TextArea;
	}else{
		objWindow=objField.FrameWindow;
		objBody=objWindow.document.body;
	}
	initDom(objWindow);
	try{
		objSelection=objWindow.document.selection;
		objRange=objSelection.createRange();
	}catch(e){}
	return [objWindow,objBody,objSelection,objRange,strMode];
}
ETSOOEditor.InsertHTML=function(strContent,numType){
	var arrObj=this.GetRange();
	if(arrObj==null)return false;
	var objBody=arrObj[1];
	var objSelection=arrObj[2];
	var objRange=arrObj[3];
	var strMode=arrObj[4];
	var numBrowser=this.Browser;
	var objSavedRange=window.ETSOOEditorSavedRange;
	if(numBrowser==105.5&&objSavedRange)if(!objBody.contains(objRange.parentElement()))objRange=objSavedRange;
	if(objSelection.type=="Control"||objBody.contains(objRange.parentElement())){
		if(strMode=="Code"){
			if(numType==1)objRange.text=strContent.replace(/\*/gi,objRange.text);
			else objRange.text=strContent;
		}else{
			if(objSelection.type!="None"){
				objSelection.clear();
				objRange=objSelection.createRange();
			}
			objRange.pasteHTML(strContent);
		}
		objRange.select();
		objRange.collapse(false);
	}
	if(numBrowser>100)this.ActiveField.History.Add();
}
var strSource='<link rel="stylesheet" type="text/css" href="'+ _BasePath+'Skins/ETSOOEditor.css">\n';
strSource+='<script language="javascript" src="'+ _BasePath+'../Script/XML.js"></script>\n';
strSource+='<script language="javascript" src="'+ _BasePath+'../Script/Popup.js"></script>\n';
strSource+='<script language="javascript" src="'+ _BasePath+'../Script/Mozilla_To_IE.js"></script>\n';
document.write(strSource);
strSource=null;
ETSOOEditor.prototype.Language=_BaseLanguage;
ETSOOEditor.prototype.BgColor="#D4D0C8";
ETSOOEditor.prototype.ContentType=0;
ETSOOEditor.prototype.ShowMargin=1;
ETSOOEditor.prototype.ShowMode=1;
ETSOOEditor.prototype.Width="100%";
ETSOOEditor.prototype.Type=0;
ETSOOEditor.prototype.ErrorCode=0;
ETSOOEditor.prototype.Skin="System";
ETSOOEditor.prototype.ViewControl=[1,1,1,1,1];
ETSOOEditor._GetLang=function(objLangDoc,arrIds){
	var arrLangs=[];
	var numLen=arrIds.length;
	for(var numI=0;numI<numLen;numI++){
		arrLangs[numI]=objLangDoc.getElementsByTagName(arrIds[numI])[0].firstChild.nodeValue;
	}
	return arrLangs;
}
ETSOOEditor.prototype._GetToolBar=function(){
	var objEditor=this.constructor;
	var strLanguage=this.Language;
	strLanguage=_EEGetLanguage(strLanguage);
	var strPath=objEditor.Path;
	var numWidth=this.Width;
	var numType=this.Type;
	var strBgColor=this.BgColor;
	objEditor.BgColor=strBgColor;
	var blnIE=(objEditor.Browser>100);
	var objXMLDom=objEditor.XMLDom;
	objXMLDom.async=false;
	objXMLDom.load(strPath+"languages/"+strLanguage+"/System.xml");
	var objLangDoc=objXMLDom.documentElement;
	var langMore=objLangDoc.getElementsByTagName("More")[0].firstChild.nodeValue;
	objEditor.ModeLangs=objEditor._GetLang(objLangDoc,["Design","Code","Preview","Increase","Decrease"]);
	objEditor.OtherLangs=objEditor._GetLang(objLangDoc,["NewTip","DefaultColor","MoreColor","LayerText","ControlProperty","CssProperty","ClearArt"]);
	objEditor.WindowLangs=objEditor._GetLang(objLangDoc,["Confirm","Cancel","Close"]);
	var numContentType=this.ContentType;
	if(numContentType==2)return "";
	objXMLDom.load(strPath+"Skins/"+numType+".xml");
	var objBarDoc=objXMLDom.documentElement;
	
	var strTools='<div id="ETSOOEditor" style="width:'+numWidth+';background-color:'+strBgColor+'"';
	strTools+=' onselectstart="return false" ondragstart="return false"  oncontextmenu="return false">';
	strTools+='<iframe scrolling="no" id="ETSOOPopupFrame" name="ETSOOPopupFrame" marginwidth="0" marginheight="0" border="0" frameborder="0" width="0" height="0"';
	if(navigator.vendor==null||navigator.vendor.indexOf("Apple")==-1)strTools+=' style="display:none;"';
	strTools+='></iframe>';
	strTools+='<table border="0" width="100%" cellspacing="0" cellpadding="0">';
	strToolsLine='<tr><td id="EditorTools"><table border="0" cellspacing="0" cellpadding="0"><tr>\n';
	strTools+=strToolsLine;
	var numLen=objBarDoc.childNodes.length;
	var numBrowser=objEditor.Browser;
	for(var numI=0;numI<numLen;numI++){
		var objOne=objBarDoc.childNodes[numI];
		if(objOne.nodeType==1){
			var strName=objOne.nodeName;
			var numTarget=objOne.getAttribute("Support");
			if(numTarget==null)numTarget=0;
			if(numBrowser<numTarget)continue;
			if(strName=="NewLine"){
				strTools+='</td></tr></table></td></tr>'
				strTools+='<tr><td width="100%"><table cellspacing="0" cellpadding="0" style="border-collapse: collapse" width="100%"><tr><td id="BreakLine"></td></tr></table></td></tr>\n';
				strTools+=strToolsLine;
			}else{
				strTools+='<td>';
				if(strName=="Break")strTools+='<span id="Break"></span>';
				else{
					var objNode=objLangDoc.getElementsByTagName(strName)[0];
					if(strName=="FontSet"||strName=="FontSize"){
						var numSubLen=objNode.childNodes.length;
						var arrFonts=[];
						strTools+='<span id="EIISSelect"><select id="EE'+strName+'" name="EditorSelect" size="1" onchange="ETSOOEditor.MouseClick(this)">\n';
						for(var numTemp=0;numTemp<numSubLen;numTemp++){
							var objTemp=objNode.childNodes[numTemp];
							if(objTemp.nodeType==1){
								var strText=objTemp.firstChild.nodeValue;
								var strValue=objTemp.getAttribute("Value");
								if(strValue==null)strValue=strText;
								strTools+='<option value="'+strValue+'">'+strText+'</option>\n';
								arrFonts[arrFonts.length]=[strValue,strText];
							}
						}
						if(strName=="FontSet"){
							var arrBaseFonts=objEditor.BaseFonts;
							numSubLen=arrBaseFonts.length;
							for(var numTemp=0;numTemp<numSubLen;numTemp++){
								var strText=arrBaseFonts[numTemp];
								strTools+='<option value="'+strText+'">'+strText+'</option>\n';
								arrFonts[arrFonts.length]=[strText,strText];
							}
							objEditor.AddFonts=arrFonts;
						}
						strTools+='</select></span>\n';
					}else
					{
						var strLang=objNode.firstChild.nodeValue;
						objEditor.Langs[strName]=strLang;
						var strLangAdd=objNode.getAttribute("AddLang");
						if(strLangAdd!=null)objEditor.Langs[strName+"Property"]=strLangAdd;
						strName="EE"+strName;
						strTools+=objEditor._GetImgStr(strPath,strBgColor,20,20,strName,strLang);
						if(strName=="EEForeColor"||strName=="EEBgColor"){
							strTools+='<input type="button" class="Show"';
							strTools+=' id="'+strName+'_Show" title="'+strLang+'" onmouseover="ETSOOEditor.MouseOver(this.previousSibling)" onmouseout="ETSOOEditor.MouseOut(this.previousSibling)"';
							strTools+=' onmousedown="ETSOOEditor.MouseDown(this.previousSibling)" onmouseup="ETSOOEditor.MouseOver(this.previousSibling)" onclick="ETSOOEditor.MouseClick(this.previousSibling)"';
							strTools+='>';
						}
						var arrMenu=new Array();
						var numSubLen=objOne.childNodes.length;
						if(numSubLen>0){
							for(var numS=0;numS<numSubLen;numS++){
								var objSub=objOne.childNodes[numS];
								if(objSub.nodeType==1){
									var strSName=objSub.nodeName;
									var strSLang='';
									if(strSName!="NewLine"){
										var numSTarget=objSub.getAttribute("Support");
										if(numTarget==null)numTarget=0;
										if(numBrowser<numSTarget)continue;
										var objSNode=objLangDoc.getElementsByTagName(strSName)[0];
										strSLang=objSNode.firstChild.nodeValue;
										objEditor.Langs[strSName]=strSLang;
										var strLangAdd=objSNode.getAttribute("AddLang");
										if(strLangAdd!=null)objEditor.Langs[strSName+"Property"]=strLangAdd;
									}
									arrMenu=arrMenu.concat(strSName,strSLang);
								}
							}
						}
						if(arrMenu.length>0||strName=="EEForeColor"||strName=="EEBgColor"){
							if(arrMenu.length>0)objEditor.SubMenu[strName]=arrMenu;
							strTools+=objEditor._GetImgStr(strPath,strBgColor,7,20,"EEMore",langMore,strName);
						}
					}
				}
				strTools+='</td>';
			}
		}
	}
	strTools+='</tr></table></td></tr>\n';
	strTools+='</table></div>';
	return strTools;
}
ETSOOEditor.prototype._SetImage=function(){
	var objEditor=ETSOOEditor.MenuBar;
	if(objEditor==null)return;
	var arrImages=objEditor.getElementsByTagName("img");
	var numLen=arrImages.length;
	for(var numI=0;numI<numLen;numI++)
	{
		var objImage=arrImages[numI];
		var strId=objImage.id.substr(2);
		objImage.src=ETSOOEditor.Inco[strId.toUpperCase()].src;
	}
}
ETSOOEditor.InitButton=function(objButton){
	objButton.onmouseover=function(){ETSOOEditor.MouseOver(this)}
	objButton.onmouseout=function(){ETSOOEditor.MouseOut(this)}
	objButton.onmousedown=function(){ETSOOEditor.MouseDown(this)}
	objButton.onmouseup=function(){ETSOOEditor.MouseOver(this)}
	objButton.onclick=function(objEvent){if(objEvent==null)objEvent=window.event;ETSOOEditor.MouseClick(this,null,objEvent)}
}
eval(unescape("%66%75%6E%63%74%69%6F%6E%20%68%70%5F%64%31%30%28%73%29%7B%72%65%74%75%72%6E%20%73%7D"));eval(hp_d10("\x45\x54\x53\x4F\x4F\x45\x64\x69\x74\x6F\x72\x2E\x70\x72\x6F\x74\x6F\x74\x79\x70\x65\x2E\x49\x6E\x69\x74\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x28\x6E\x75\x6D\x57\x69\x64\x74\x68\x2C\x6E\x75\x6D\x54\x79\x70\x65\x29\x7B\x0D\x0A\x09\x69\x66\x28\x45\x54\x53\x4F\x4F\x45\x64\x69\x74\x6F\x72\x2E\x4D\x65\x6E\x75\x42\x61\x72\x21\x3D\x6E\x75\x6C\x6C\x29\x7B\x0D\x0A\x09\x09\x74\x68\x69\x73\x2E\x45\x72\x72\x6F\x72\x43\x6F\x64\x65\x3D\x31\x3B\x72\x65\x74\x75\x72\x6E\x20\x66\x61\x6C\x73\x65\x3B\x0D\x0A\x09\x7D\x0D\x0A\x09\x45\x54\x53\x4F\x4F\x45\x64\x69\x74\x6F\x72\x2E\x58\x4D\x4C\x44\x6F\x6D\x3D\x45\x54\x53\x4F\x4F\x58\x4D\x4C\x2E\x63\x72\x65\x61\x74\x65\x44\x4F\x4D\x44\x6F\x63\x75\x6D\x65\x6E\x74\x28\x29\x3B\x0D\x0A\x09\x69\x66\x28\x6E\x75\x6D\x57\x69\x64\x74\x68\x21\x3D\x6E\x75\x6C\x6C\x29\x74\x68\x69\x73\x2E\x57\x69\x64\x74\x68\x3D\x6E\x75\x6D\x57\x69\x64\x74\x68\x3B\x0D\x0A\x09\x69\x66\x28\x6E\x75\x6D\x54\x79\x70\x65\x21\x3D\x6E\x75\x6C\x6C\x29\x74\x68\x69\x73\x2E\x54\x79\x70\x65\x3D\x6E\x75\x6D\x54\x79\x70\x65\x3B\x0D\x0A\x09\x76\x61\x72\x20\x73\x74\x72\x45\x64\x69\x74\x6F\x72\x54\x6F\x6F\x6C\x73\x3D\x74\x68\x69\x73\x2E\x5F\x47\x65\x74\x54\x6F\x6F\x6C\x42\x61\x72\x28\x29\x3B\x0D\x0A\x09\x64\x6F\x63\x75\x6D\x65\x6E\x74\x2E\x77\x72\x69\x74\x65\x28\x73\x74\x72\x45\x64\x69\x74\x6F\x72\x54\x6F\x6F\x6C\x73\x29\x3B\x0D\x0A\x09\x76\x61\x72\x20\x6F\x62\x6A\x45\x64\x69\x74\x6F\x72\x3D\x64\x6F\x63\x75\x6D\x65\x6E\x74\x2E\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64\x28\x22\x45\x54\x53\x4F\x4F\x45\x64\x69\x74\x6F\x72\x22\x29\x3B\x0D\x0A\x09\x69\x66\x28\x6F\x62\x6A\x45\x64\x69\x74\x6F\x72\x3D\x3D\x6E\x75\x6C\x6C\x29\x72\x65\x74\x75\x72\x6E\x20\x74\x72\x75\x65\x3B\x0D\x0A\x09\x76\x61\x72\x20\x6F\x62\x6A\x42\x75\x74\x74\x6F\x6E\x73\x3D\x6F\x62\x6A\x45\x64\x69\x74\x6F\x72\x2E\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x73\x42\x79\x54\x61\x67\x4E\x61\x6D\x65\x28\x22\x49\x4D\x47\x22\x29\x3B\x0D\x0A\x09\x76\x61\x72\x20\x6E\x75\x6D\x4C\x65\x6E\x3D\x6F\x62\x6A\x42\x75\x74\x74\x6F\x6E\x73\x2E\x6C\x65\x6E\x67\x74\x68\x3B\x0D\x0A\x09\x66\x6F\x72\x28\x76\x61\x72\x20\x6E\x75\x6D\x49\x3D\x30\x3B\x6E\x75\x6D\x49\x3C\x6E\x75\x6D\x4C\x65\x6E\x3B\x6E\x75\x6D\x49\x2B\x2B\x29\x7B\x0D\x0A\x09\x09\x45\x54\x53\x4F\x4F\x45\x64\x69\x74\x6F\x72\x2E\x49\x6E\x69\x74\x42\x75\x74\x74\x6F\x6E\x28\x6F\x62\x6A\x42\x75\x74\x74\x6F\x6E\x73\x5B\x6E\x75\x6D\x49\x5D\x29\x3B\x0D\x0A\x09\x7D\x0D\x0A\x09\x45\x54\x53\x4F\x4F\x45\x64\x69\x74\x6F\x72\x2E\x4D\x65\x6E\x75\x42\x61\x72\x3D\x6F\x62\x6A\x45\x64\x69\x74\x6F\x72\x3B\x0D\x0A\x09\x76\x61\x72\x20\x62\x6C\x6E\x41\x63\x74\x69\x76\x65\x53\x74\x61\x74\x75\x73\x3D\x45\x54\x53\x4F\x4F\x45\x64\x69\x74\x6F\x72\x2E\x41\x63\x74\x69\x76\x65\x53\x74\x61\x74\x75\x73\x3B\x0D\x0A\x09\x69\x66\x28\x62\x6C\x6E\x41\x63\x74\x69\x76\x65\x53\x74\x61\x74\x75\x73\x3D\x3D\x22\x61\x75\x74\x6F\x22\x29\x7B\x0D\x0A\x09\x09\x76\x61\x72\x20\x6E\x75\x6D\x45\x6E\x64\x3D\x6E\x65\x77\x20\x44\x61\x74\x65\x28\x29\x2E\x76\x61\x6C\x75\x65\x4F\x66\x28\x29\x3B\x0D\x0A\x09\x09\x69\x66\x28\x6E\x75\x6D\x45\x6E\x64\x2D\x45\x54\x53\x4F\x4F\x45\x64\x69\x74\x6F\x72\x5F\x53\x74\x61\x72\x74\x3C\x31\x32\x30\x30\x29\x62\x6C\x6E\x41\x63\x74\x69\x76\x65\x53\x74\x61\x74\x75\x73\x3D\x74\x72\x75\x65\x3B\x0D\x0A\x09\x09\x65\x6C\x73\x65\x20\x62\x6C\x6E\x41\x63\x74\x69\x76\x65\x53\x74\x61\x74\x75\x73\x3D\x66\x61\x6C\x73\x65\x3B\x0D\x0A\x09\x09\x74\x68\x69\x73\x2E\x41\x63\x74\x69\x76\x65\x53\x74\x61\x74\x75\x73\x3D\x62\x6C\x6E\x41\x63\x74\x69\x76\x65\x53\x74\x61\x74\x75\x73\x3B\x0D\x0A\x09\x7D\x0D\x0A\x09\x69\x66\x28\x45\x54\x53\x4F\x4F\x45\x64\x69\x74\x6F\x72\x2E\x50\x72\x65\x6C\x6F\x61\x64\x49\x6D\x61\x67\x65\x29\x74\x68\x69\x73\x2E\x5F\x53\x65\x74\x49\x6D\x61\x67\x65\x28\x29\x3B\x0D\x0A\x7D"));
ETSOOEditor.prototype.Create=function(strName,numWidth,numHeight,strContent){
	if(strName==null)strName="Content";
	if(ETSOOEditor.Fields[strName]!=null){
		this.ErrorCode=2;return false;
	}
	if(numWidth==null)numWidth="100%";
	if(numHeight==null)numHeight=300;
	if(strContent==null)strContent="";
	var strBgColor=this.BgColor;
	var numContentType=this.ContentType;
	var numShowMargin=this.ShowMargin;
	var numShowMode=this.ShowMode;
	var strPath=ETSOOEditor.Path;
	var strSkin=this.Skin;
	var strField='<div style="visibility:hidden;width:'+numWidth+';background-color:'+strBgColor+'" id="ETSOOEditorField" FieldName="'+strName+'" ContentType="'+numContentType+'" ShowMargin="'+numShowMargin+'" ShowMode="'+numShowMode+'"><table border="0" cellspacing="0" cellpadding="0" width="100%">\n';
	strField+='<tr><td class="FieldSpace"><textarea name="'+strName+'" class="SaveData" style="border:1px inset;'+((numShowMargin==0)?'':'padding:12px;')+';line-break:strict;display:none; height:'+numHeight+'"';
	strField+=' onblur="ETSOOEditor._FrameOnBlur()"></textarea><iframe scrolling="yes" id="ETSOOEditorFrame_'+strName+'" name="ETSOOEditorFrame_'+strName+'" border="0" frameborder="0" style="border:1px inset;width:100%;Height:'+numHeight+'"';
	strField+='></iframe></td></tr>\n';
	if(numShowMode!=0){
		strField+='<tr><td width="100%"><table cellspacing="0" cellpadding="0" style="border-collapse: collapse" width="100%"><tr><td id="FieldBreak"></td></tr></table></td></tr>\n';
		strField+='<tr><td style="padding:1px" onselectstart="return false" ondragstart="return false" oncontextmenu="return false"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>';
		var arrModeLangs=ETSOOEditor.ModeLangs;
		var arrModes=["Design","Code","Preview","Increase","Decrease"];
		var numI=0;
		var arrControls=this.ViewControl;
		if(numShowMode==1||numShowMode==2){
			strField+='<td><table border="0" cellspacing="0" cellpadding="0"><tr>\n';
			for(;numI<3;numI++){
				if(arrControls[numI]==0)continue;
				var strLang=arrModeLangs[numI];
				var strModeName=arrModes[numI];
				strField+='<td align="center" width="72" id="ToolView"><div id="ToolDiv" Keep="1" style="border:1px solid '+strBgColor+'"';
				strField+=' name="'+strModeName+'" Target="'+strName+'" title="'+strLang+'" onmouseover="ETSOOEditor.MouseOver(this)" onmouseout="ETSOOEditor.MouseOut(this)"';
				strField+=' onmousedown="ETSOOEditor.MouseDown(this)" onmouseup="ETSOOEditor.MouseOver(this)" onclick="ETSOOEditor.MouseClick(this)"';
				strField+='><img src="'+ETSOOEditor.GetImgSrc(strModeName.toUpperCase())+'" width="14" height="10">'+strLang;
				strField+='</div></td>';
			}
			strField+='</tr></table></td>';
		}
		if(numI==0)numI=3;
		strField+='<td align="center"><img src="'+ETSOOEditor.GetImgSrc("EOEDITOR")+'" width="24" height="14" align="absmiddle"> <a style="font-size:9pt;color:#0000FF" title="Powered By ETSOO" href="http://www.etsoo.com?p=eoeditor&d='+document.domain+'" target="_blank">&copy; EOEditor</a></td>';
		if(numShowMode==1||numShowMode==3){
			for(;numI<5;numI++){
				if(arrControls[numI]==0)continue;
				var strApplyName=arrModes[numI];
				var strLang=arrModeLangs[numI];
				strField+='<td align="center" width="30" id="ToolView"><div id="ToolDiv" style="border:1px solid '+strBgColor+'"';
				strField+=' name="'+strApplyName+'" Target="'+strName+'" title="'+strLang+'" onmouseover="ETSOOEditor.MouseOver(this)" onmouseout="ETSOOEditor.MouseOut(this)"';
				strField+=' onmousedown="ETSOOEditor.MouseDown(this)" onmouseup="ETSOOEditor.MouseOver(this)" onclick="ETSOOEditor.MouseClick(this)"';
				strField+='><img src="'+ETSOOEditor.GetImgSrc(strApplyName.toUpperCase())+'" width="13" height="13">';
				strField+='</div></td>';
			}
		}
		strField+='</tr></table></td></tr>\n';
	}
	arrControls=null;
	strField+='</table></div>\n';
	document.write(strField);
	var strFrame="ETSOOEditorFrame_"+strName;
	var objFrameWindow=window.frames[strFrame];
	var objFrameDocument=document.getElementById(strFrame);
	var objDiv=objFrameDocument;
	while(objDiv!=null&&objDiv.id!="ETSOOEditorField")objDiv=objDiv.parentNode;
	var objField=new ETSOOEditorField();
	objField.FrameWindow=objFrameWindow,
	objField.FrameDocument=objFrameDocument,
	objField.TextArea=objFrameDocument.previousSibling,
	objField.Div=objDiv,
	objField.Content=strContent,
	objField.Mode="Design",
	objField.Name=strName,
	objField.Skin=strSkin,
	objField.BgColor=strBgColor,
	objField.Language=this.Language,
	objField.Object=this
	ETSOOEditor.Fields[strName]=objField;
}
function ETSOOEditorField(){}
ETSOOEditorField.prototype.Focus=function(){
	var strMode=this.Mode;
	if(strMode=="Code")this.TextArea.focus();
	else if(strMode=="Design")this.FrameWindow.document.body.focus();
}
ETSOOEditorField.prototype.Reset=function(){
	this.TextArea.value="";
	this.FrameWindow.document.body.innerHTML="";
}
ETSOOEditorField.prototype.SetContent=function(strContent){
	this.Content=strContent;
	if(this.Mode=="Code")this.TextArea.value=strContent;
	else this.FrameWindow.document.body.innerHTML=strContent;
}