爱上海

爱上海

"; var editmode=true; var SourceMode=false; var PreviewMode=false; var CurrentMode=0; function document.onreadystatechange(){ if (YInitialized) return; YInitialized = true; var i, s, curr; for (i=0; i TotalLen) TotalLen = TB.TBWidth; } var PrevTB; var LastStart = 0; var RelTop = 0; var LastWid, CurrWid; var TB = yToolbars[0]; TB.style.posTop = 0; TB.style.posLeft = 0; var Start = TB.TBWidth; for (i = 1 ; i < yToolbars.length ; i++) { PrevTB = TB; TB = yToolbars[i]; CurrWid = TB.TBWidth; if ((Start + CurrWid) > ScrWid) { Start = 0; LastWid = TotalLen - LastStart; } else { LastWid = PrevTB.TBWidth; RelTop -= TB.offsetHeight; } TB.style.posTop = RelTop; TB.style.posLeft = Start; PrevTB.style.width = LastWid; LastStart = Start; Start += CurrWid; } TB.style.width = TotalLen - LastStart; i--; TB = yToolbars[i]; var TBInd = TB.sourceIndex; var A = TB.document.all; var item; for (i in A) { item = A.item(i); if (! item) continue; if (! item.style) continue; if (item.sourceIndex <= TBInd) continue; if (item.style.position == "absolute") continue; item.style.posTop = RelTop; } } function DoLayout() { LayoutTBs(); } function BtnMouseOver() { if (event.srcElement.tagName != "IMG") return false; var image = event.srcElement; var element = image.parentElement; if (image.className == "Ico") element.className = "BtnMouseOverUp"; else if (image.className == "IcoDown") element.className = "BtnMouseOverDown"; event.cancelBubble = true; } function BtnMouseOut() { if (event.srcElement.tagName != "IMG") { event.cancelBubble = true; return false; } var image = event.srcElement; var element = image.parentElement; yRaisedElement = null; element.className = "Btn"; image.className = "Ico"; event.cancelBubble = true; } function BtnMouseDown() { if (event.srcElement.tagName != "IMG") { event.cancelBubble = true; event.returnValue=false; return false; } var image = event.srcElement; var element = image.parentElement; element.className = "BtnMouseOverDown"; image.className = "IcoDown"; event.cancelBubble = true; event.returnValue=false; return false; } function BtnMouseUp() { if (event.srcElement.tagName != "IMG") { event.cancelBubble = true; return false; } var image = event.srcElement; var element = image.parentElement; if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous()"); element.className = "BtnMouseOverUp"; image.className = "Ico"; event.cancelBubble = true; return false; } function BtnMenuMouseOver() { if (event.srcElement.tagName != "IMG") return false; var image = event.srcElement; var element = image.parentElement; if (image.className == "Ico") element.className = "BtnMenuMouseOverUp"; else if (image.className == "IcoDown") element.className = "BtnMenuMouseOverDown"; event.cancelBubble = true; } function BtnMenuMouseOut() { if (event.srcElement.tagName != "IMG") { event.cancelBubble = true; return false; } var image = event.srcElement; var element = image.parentElement; yRaisedElement = null; element.className = "BtnMenu"; image.className = "Ico"; event.cancelBubble = true; } function BtnMenuMouseDown() { if (event.srcElement.tagName != "IMG") { event.cancelBubble = true; event.returnValue=false; return false; } var image = event.srcElement; var element = image.parentElement; element.className = "BtnMenuMouseOverDown"; image.className = "IcoDown"; event.cancelBubble = true; event.returnValue=false; return false; } function BtnMenuMouseUp() { if (event.srcElement.tagName != "IMG") { event.cancelBubble = true; return false; } var image = event.srcElement; var element = image.parentElement; if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous()"); element.className = "BtnMenuMouseOverUp"; image.className = "Ico"; event.cancelBubble = true; return false; } function cleanHtml() { var fonts = HtmlEdit.document.body.all.tags("FONT"); var curr; for (var i = fonts.length - 1; i >= 0; i--) { curr = fonts[i]; if (curr.style.backgroundColor == "#ffffff") curr.outerHTML = curr.innerHTML; } } function validateMode() { if (editmode) return true; alert("请先点编辑器下方的“编辑”按钮,进入“编辑”状态,然后再使用系统编辑功能!"); HtmlEdit.focus(); return false; } function UserDialog(what) { if (!validateMode()) return; HtmlEdit.document.execCommand(what, true); pureText = false; HtmlEdit.focus(); } function format(what,opt) { if (!validateMode()) return; if (opt=="removeFormat") { what=opt; opt=null; } if (opt==null) HtmlEdit.document.execCommand(what); else HtmlEdit.document.execCommand(what,"",opt); pureText = false; HtmlEdit.focus(); } function setMode(newMode) { var cont; if (CurrentMode==newMode){ return false; } if (newMode==0) { setMode0.src="images/Editor2.gif"; setMode1.src="images/html.gif"; setMode2.src="images/browse.gif"; if (PreviewMode){ document.all.HtmlEdit.style.display=""; document.all.HtmlPreview.style.display="none"; } if(SourceMode){ cont=HtmlEdit.document.body.innerText; HtmlEdit.document.body.innerHTML=cont; } editmode=true; SourceMode=false; PreviewMode=false; } else if (newMode==1) { setMode0.src="images/Editor.gif"; setMode1.src="images/html2.gif"; setMode2.src="images/browse.gif"; if (PreviewMode){ document.all.HtmlEdit.style.display=""; document.all.HtmlPreview.style.display="none"; } if(editmode){ cleanHtml(); cleanHtml(); cont=HtmlEdit.document.body.innerHTML; HtmlEdit.document.body.innerText=cont; } editmode=false; SourceMode=true; PreviewMode=false; } else if (newMode==2) { setMode0.src="images/Editor.gif"; setMode1.src="images/html.gif"; setMode2.src="images/browse2.gif"; var str1="

爱上海

"; if(CurrentMode==0){ str1=str1+HtmlEdit.document.body.innerHTML; } else{ str1=str1+HtmlEdit.document.body.innerText; } HtmlPreview.document.open(); HtmlPreview.document.write(str1); HtmlPreview.document.close(); document.all.HtmlEdit.style.display="none"; document.all.HtmlPreview.style.display=""; PreviewMode=true; } CurrentMode=newMode; HtmlEdit.focus(); } function foreColor() { if (! validateMode()) return; HtmlEdit.focus(); var range = HtmlEdit.document.selection.createRange(); var RangeType = HtmlEdit.document.selection.type; if (RangeType != "Text"){ alert("请先选择一段文字!"); return; } var arr = showModalDialog("editor_selcolor.htm", "", "dialogWidth:18.5em; dialogHeight:17.5em; help: no; scroll: no; status: no"); if (arr != null) format('forecolor', arr); else HtmlEdit.focus(); } function backColor() { if (! validateMode()) return; HtmlEdit.focus(); var range = HtmlEdit.document.selection.createRange(); var RangeType = HtmlEdit.document.selection.type; if (RangeType != "Text"){ alert("请先选择一段文字!"); return; } var arr = showModalDialog("editor_selcolor.htm", "", "dialogWidth:18.5em; dialogHeight:17.5em; help: no; scroll: no; status: no"); if (arr != null){ range.pasteHTML(""+range.text+" "); range.select(); } HtmlEdit.focus(); } function page() { HtmlEdit.focus(); var range = HtmlEdit.document.selection.createRange(); if(range.text!=""){ alert("请不要选择任何文本"); } else{ range.text="\n\n[NextPage]\n\n"; parent.selectPaginationType() } } function InsertTable() { if (! validateMode()) return; HtmlEdit.focus(); var range = HtmlEdit.document.selection.createRange(); var arr = showModalDialog("editor_inserttable.htm", "", "dialogWidth:450px;dialogHeight:200px;help: no; scroll: no; status: no"); if (arr != null){ range.pasteHTML(arr); } HtmlEdit.focus(); } function FIELDSET() { if (! validateMode()) return; HtmlEdit.focus(); var range = HtmlEdit.document.selection.createRange(); var arr = showModalDialog("editor_fieldset.htm", "", "dialogWidth:25em; dialogHeight:12.5em; help: no; scroll: no; status: no"); if (arr != null){ range.pasteHTML(arr); } HtmlEdit.focus(); } function iframe() { if (! validateMode()) return; HtmlEdit.focus(); var range = HtmlEdit.document.selection.createRange(); var arr = showModalDialog("editor_insertiframe.htm", "", "dialogWidth:30em; dialogHeight:12em; help: no; scroll: no; status: no"); if (arr != null){ range.pasteHTML(arr); } HtmlEdit.focus(); } function hr() { if (! validateMode()) return; HtmlEdit.focus(); var range = HtmlEdit.document.selection.createRange(); var arr = showModalDialog("editor_inserthr.htm", "", "dialogWidth:30em; dialogHeight:12em; help: no; scroll: no; status: no"); if (arr != null){ range.pasteHTML(arr); } HtmlEdit.focus(); } function pic() { if (! validateMode()) return; HtmlEdit.focus(); var range = HtmlEdit.document.selection.createRange(); var arr = showModalDialog("editor_insertpic.asp", "", "dialogWidth:32em; dialogHeight:15em; help: no; scroll: no; status: no"); if (arr != null){ var ss=arr.split("$$$"); range.pasteHTML(ss[0]); parent.myform.IncludePic.checked=true; if (ss[1]!="None") { parent.AddItem(ss[1]); } } HtmlEdit.focus(); } function emote() { if (! validateMode()) return; HtmlEdit.focus(); var range = HtmlEdit.document.selection.createRange(); var arr = showModalDialog("editor_insertemote.asp", "", "dialogWidth:28em; dialogHeight:25em; help: no; scroll: no; status: no"); if (arr != null){ var ss=arr.split("$$$"); range.pasteHTML(ss[0]); parent.myform.IncludePic.checked=true; if (ss[1]!="None") { parent.AddItem(ss[1]); } } HtmlEdit.focus(); } function swf() { if (! validateMode()) return; HtmlEdit.focus(); var range = HtmlEdit.document.selection.createRange(); var arr = showModalDialog("editor_insertflash.htm", "", "dialogWidth:31em; dialogHeight:8em; help: no; scroll: no; status: no"); if (arr != null){ var ss=arr.split("$$$"); range.pasteHTML(ss[0]); parent.myform.IncludePic.checked=true; if (ss[1]!="None") { parent.AddItem(ss[1]); } } HtmlEdit.focus(); } function wmv() { if (! validateMode()) return; HtmlEdit.focus(); var range = HtmlEdit.document.selection.createRange(); var arr = showModalDialog("editor_insertmedia.htm", "", "dialogWidth:31em; dialogHeight:8em; help: no; scroll: no; status: no"); if (arr != null){ var ss=arr.split("$$$"); range.pasteHTML(ss[0]); parent.myform.IncludePic.checked=true; if (ss[1]!="None") { parent.AddItem(ss[1]); } } HtmlEdit.focus(); } function mp3() { if (! validateMode()) return; HtmlEdit.focus(); var range = HtmlEdit.document.selection.createRange(); var arr = showModalDialog("editor_insertmp3.htm", "", "dialogWidth:31em; dialogHeight:8em; help: no; scroll: no; status: no"); if (arr != null){ var ss=arr.split("$$$"); range.pasteHTML(ss[0]); parent.myform.IncludePic.checked=true; if (ss[1]!="None") { parent.AddItem(ss[1]); } } HtmlEdit.focus(); } function rm() { if (! validateMode()) return; HtmlEdit.focus(); var range = HtmlEdit.document.selection.createRange(); var arr = showModalDialog("editor_insertrm.htm", "", "dialogWidth:31em; dialogHeight:8em; help: no; scroll: no; status: no"); if (arr != null){ var ss=arr.split("$$$"); range.pasteHTML(ss[0]); parent.myform.IncludePic.checked=true; if (ss[1]!="None") { parent.AddItem(ss[1]); } } HtmlEdit.focus(); } function excel() { if (! validateMode()) return; HtmlEdit.focus(); var range =HtmlEdit.document.selection.createRange(); var str1=""; range.pasteHTML(str1); HtmlEdit.focus(); } function nowdate() { if (! validateMode()) return; HtmlEdit.focus(); var range =HtmlEdit.document.selection.createRange(); var d = new Date(); var str1=d.getYear()+"年"+(d.getMonth() + 1)+"月"+d.getDate() +"日"; range.pasteHTML(str1); HtmlEdit.focus(); } function nowtime() { if (! validateMode()) return; HtmlEdit.focus(); var range =HtmlEdit.document.selection.createRange(); var d = new Date(); var str1=d.getHours() +":"+d.getMinutes()+":"+d.getSeconds(); range.pasteHTML(str1); HtmlEdit.focus(); } function findstr() { if (! validateMode()) return; var arr = showModalDialog("editor_find.htm", window, "dialogWidth:420px; dialogHeight:125px; help: no; scroll: no; status: no"); } function help() { var arr = showModalDialog("editor_help.htm", "", "dialogWidth:580px; dialogHeight:460px; help: no; scroll: no; status: no"); } function save() { if (CurrentMode==0){ //编辑器嵌入其他网页时使用下面这一句(请将form1改成相应表单名) parent.HappyFm.Content.value=HtmlEdit.document.body.innerHTML; //单独打开编辑器时使用下面这一句(请将form1改成相应表单名) // self.opener.form1.content.value+=HtmlEdit.document.body.innerHTML; } else if(CurrentMode==1){ //编辑器嵌入其他网页时使用下面这一句(请将form1改成相应表单名) parent.HappyFm.Content.value=HtmlEdit.document.body.innerText; //单独打开编辑器时使用下面这一句(请将form1改成相应表单名) // self.opener.form1.content.value+=HtmlEdit.document.body.innerText; } else { alert("预览状态不能保存!请先回到编辑状态后再保存"); } HtmlEdit.focus(); } function tablecommand(command) { var cellflag=false; var rowflag=false; var tableflag=false; var cellindex,rowindex,tableref; HtmlEdit.focus(); var xsel=HtmlEdit.document.selection; var xobj=HtmlEdit.document.selection.createRange(); if(xsel.type=="None"||xsel.type=="Text"){ xsel=xobj.parentElement(); while(xsel.tagName!="BODY"&&cellflag==false){ if(xsel.tagName=="TD"){cellindex=xsel.cellIndex;cellflag=true;} if(cellflag==false){xsel=xsel.parentElement;} } }else if(xsel.type=="Control"){ xsel=xobj.item(0); if(xsel.tagName=="TD"){ cellindex=xsel.cellIndex; cellflag=true; }else{ while(xsel.tagName!="BODY"&&cellflag==false){ if(xsel.tagName=="TD"){cellindex=xsel.cellIndex;cellflag=true;} if(cellflag==false){xsel=xsel.parentElement;} } } } if(cellflag==true){ xsel=HtmlEdit.document.selection; xobj=HtmlEdit.document.selection.createRange(); if(xsel.type=="None"||xsel.type=="Text"){ xsel=xobj.parentElement(); while(xsel.tagName!="BODY"&&rowflag==false){ if(xsel.tagName=="TR"){ rowindex=xsel.rowIndex; rowflag=true; } if(rowflag==false){xsel=xsel.parentElement;} } }else if(xsel.type=="Control"){ xsel=xobj.item(0); if(xsel.tagName=="TR"){ rowindex=xsel.rowIndex; rowflag=true; }else{ while(xsel.tagName!="BODY"&&rowflag==false){ if(xsel.tagName=="TR"){ rowindex=xsel.rowIndex; rowflag=true; } if(rowflag==false){ xsel=xsel.parentElement; } } } } xsel=HtmlEdit.document.selection; xobj=HtmlEdit.document.selection.createRange(); if(xsel.type=="None"||xsel.type=="Text"){ xsel=xobj.parentElement(); while(xsel.tagName!="BODY"&&tableflag==false){ if(xsel.tagName=="TABLE"){tableflag=true;} if(tableflag==false){xsel=xsel.parentElement;} } }else if(xsel.type=="Control"){ xsel=xobj.item(0); if(xsel.tagName=="TABLE"){ tableflag=true; }else{ while(xsel.tagName!="BODY"&&tableflag==false){ if(xsel.tagName=="TABLE"){tableflag=true;} if(tableflag==false){xsel=xsel.parentElement;} } } } if(command==3){ var temprowcount=xsel.rows.length; var tempcell; var tempspancount=0; var tempspanholder; var tempcellwidth=xsel.rows[rowindex].cells[cellindex].width; var xpositequiv=-1; var xposcount=0; while(xposcount<=cellindex){ xpositequiv+=parseInt(xsel.rows[rowindex].cells[xposcount].colSpan); xposcount++; } var ypositequiv=-1; var yposcount=0; var ymax=xsel.rows[rowindex].cells.length; while(yposcount<=ymax-1){ ypositequiv+=parseInt(xsel.rows[rowindex].cells[yposcount].colSpan); yposcount++; } var idealinsert=xpositequiv+1; var zi2=0; var zirowtouse=0; var zirowtot=xsel.rows.length; var rowarray=new Array(zirowtot); var rowarray2=new Array(zirowtot); for(init1=0;init1<=zirowtot-1;init1++){ rowarray[init1]=0; rowarray2[init1]=0; } for(zi1=0;zi1<=zirowtot-1;zi1++){ zi2=0; while(zi2zthemax){zthemax=zi3b;} if(zi3a!=zi3b){allequal=false;} } if(allequal==false){ var zi4=0; var allequal2=true; while(zthemax<=ypositequiv&&allequal==false){ for(zi5=0;zi5<=zirowtot-1;zi5++){ rowarray[zi5]+=parseInt(xsel.rows[zi5].cells[rowarray2[zi5]].colSpan); } for(zi3=0;zi3<=zirowtot-1;zi3++){ zi3a=rowarray[0]; zi3b=rowarray[zi3]; if(zi3b>zthemax){zthemax=zi3b;} if(zi3a!=zi3b){allequal2=false;} } if(allequal2==true){allequal=true;} for(zi8=0;zi8<=zirowtot-1;zi8++){rowarray2[zi8]++;} } } var zi9; for(zi7=0;zi7<=zirowtot-1;zi7++){ zi9=xsel.rows[zi7].insertCell(rowarray2[zi7]); zi9.width=tempcellwidth; } }else if(command==4){ var temprowcount=xsel.rows.length; for(iccount=0;iccount<=temprowcount-1;iccount++){ xsel.rows[iccount].deleteCell(cellindex); } }else if(command==1){ var tempcell; var tempcellb; var tempcellcount=xsel.rows[rowindex].cells.length; var cellcolarray=new Array(tempcellcount); var cellrowarray=new Array(tempcellcount); for(cacount=0;cacount<=tempcellcount-1;cacount++){ cellcolarray[cacount]=xsel.rows[rowindex].cells(cacount).colSpan; cellrowarray[cacount]=xsel.rows[rowindex].cells(cacount).rowSpan; } tempcell=xsel.insertRow(rowindex); for(cbcount=0;cbcount<=tempcellcount-1;cbcount++){ tempcellb=tempcell.insertCell(); if(cellcolarray[cbcount]!=1){tempcellb.colSpan=cellcolarray[cbcount];} } }else if(command==2){ var temprowcount=xsel.rows.length;tempcell=xsel.deleteRow(rowindex); }else if(command==5){ if(xsel.rows[rowindex].cells[cellindex+1]){ var x=parseInt(xsel.rows[rowindex].cells[cellindex].colSpan)+parseInt(xsel.rows[rowindex].cells[cellindex+1].colSpan); var y=xsel.rows[rowindex].cells[cellindex].innerHTML+" "+xsel.rows[rowindex].cells[cellindex+1].innerHTML; xsel.rows[rowindex].deleteCell(cellindex+1); xsel.rows[rowindex].cells[cellindex].colSpan=x; xsel.rows[rowindex].cells[cellindex].innerHTML=y; } }else if(command==6){ var yatemprow=xsel.rows.length; var yamax=0; for(ya1=0;ya1<=yatemprow-1;ya1++){ var ypositequiv=-1; var yposcount=0; var ymax=xsel.rows[ya1].cells.length; while(yposcount<=ymax-1){ ypositequiv+=parseInt(xsel.rows[ya1].cells[yposcount].colSpan); yposcount++; } if(ypositequiv>yamax){yamax=ypositequiv;} } var rowarray=new Array(); var rowarray2=new Array(); var myrowcount=xsel.rows.length; for(ra1=0;ra1<=myrowcount-1;ra1++){ rowarray[ra1]=new Array(); rowarray2[ra1]=0; for(cr1=0;cr1<=yamax;cr1++){rowarray[ra1][cr1]=777;} } var tempra; var ra2=0; for(ra3=0;ra3<=yamax;ra3++){ ra2=0; while(ra2<=myrowcount-1){ if(xsel.rows[ra2].cells[ra3]){ tempra=parseInt(xsel.rows[ra2].cells[ra3].rowSpan); if(tempra>1){ rowarray[ra2][ra3]=ra3+rowarray2[ra2]; for(zoo=1;zoo<=tempra-1;zoo++){rowarray2[ra2+zoo]--;} } } if(rowarray[ra2][ra3-1]!=ra3+rowarray2[ra2]){ rowarray[ra2][ra3]=ra3+rowarray2[ra2]; }else{ rowarray[ra2][ra3]=555; } ra2++; } } var samx=""; var samcount=0; for(rx1=0;rx1<=myrowcount-1;rx1++){ samcount=rowarray[rx1].length; for(rx2=0;rx2<=samcount-1;rx2++){ samx+="-"+rowarray[rx1][rx2]; } samx+="\n"; } var j=parseInt(xsel.rows[rowindex].cells[cellindex].rowSpan); var jcount=rowarray[rowindex].length; var jval=0; for(jc1=0;jc1<=jcount-1;jc1++){ if(rowarray[rowindex][jc1]==cellindex){jval=jc1;} } if(xsel.rows[rowindex+j]){ var cellindex2=rowarray[rowindex+j][jval]; var x=parseInt(xsel.rows[rowindex].cells[cellindex].rowSpan)+parseInt(xsel.rows[rowindex+j].cells[cellindex2].rowSpan); var y=xsel.rows[rowindex].cells[cellindex].innerHTML+" "+xsel.rows[rowindex+j].cells[cellindex2].innerHTML; xsel.rows[rowindex+j].deleteCell(cellindex2); xsel.rows[rowindex].cells[cellindex].rowSpan=x; xsel.rows[rowindex].cells[cellindex].innerHTML=y; } }else if(command==7){ var getrowspan=parseInt(xsel.rows[rowindex].cells[cellindex].rowSpan); var getcolspan=parseInt(xsel.rows[rowindex].cells[cellindex].colSpan); if(getrowspan>1){ var xr1=getrowspan-1; var xrposit=rowindex; var xrcposit=cellindex; var xrholder;xsel.rows[rowindex].cells[cellindex].rowSpan=1; for(xr2=1;xr2<=xr1;xr2++){ xrholder=xsel.rows[xrposit+xr2].insertCell(xrcposit); xrholder.colSpan=xsel.rows[rowindex].cells[cellindex].colSpan; } } if(getcolspan>1){ var yr1=getcolspan-1; var yrposit=rowindex; var yrcposit=cellindex; var yrholder;xsel.rows[rowindex].cells[cellindex].colSpan=1; for(yr2=1;yr2<=yr1;yr2++){ yrholder=xsel.rows[yrposit].insertCell(yrcposit); yrholder.rowSpan=xsel.rows[rowindex].cells[cellindex].rowSpan; } } } } } function tableProp(){ var tableflag=false; HtmlEdit.focus(); var xsel=HtmlEdit.document.selection; var xobj=HtmlEdit.document.selection.createRange(); if(xsel.type=="None"||xsel.type=="Text"){ xsel=xobj.parentElement(); while(xsel.tagName!="BODY"&&tableflag==false){ if(xsel.tagName=="TABLE"){tableflag=true;} if(tableflag==false){xsel=xsel.parentElement;} } }else if(xsel.type=="Control"){ xsel=xobj.item(0); if(xsel.tagName=="TABLE"){ tableflag=true; }else{ while(xsel.tagName!="BODY"&&tableflag==false){ if(xsel.tagName=="TABLE"){tableflag=true;} if(tableflag==false){xsel=xsel.parentElement;} } } } if(tableflag==true){ if(xsel.className!=""&&xsel.className!=null){tableclass=xsel.className;}else{tableclass="";} if(xsel.width!=""&&xsel.width!=null){tablewidthspecified="yes";tablewidth=xsel.width;}else{tablewidthspecified="no";tablewith="";} if(xsel.align!=""&&xsel.align!=null){tablealign=xsel.align;}else{tablealign="";} if(xsel.border!=""&&xsel.border!=null){tablebordersize=xsel.border;}else{tablebordersize="";} if(xsel.cellPadding!=""&&xsel.cellPadding!=null){tablecellpadding=xsel.cellPadding;}else{tablecellpadding="";} if(xsel.cellSpacing!=""&&xsel.cellSpacing!=null){tablecellspacing=xsel.cellSpacing;}else{tablecellspacing="";} if(xsel.borderColor!=""&&xsel.borderColor!=null){tablebordercolor=xsel.borderColor;}else{tablebordercolor="";} if(xsel.bgColor!=""&&xsel.bgColor!=null){tablebackgroundcolor=xsel.bgColor;}else{tablebackgroundcolor="";} tableiscancel=""; window.showModalDialog("editor_tableprops.htm",window," dialogWidth: 350px; dialogHeight: 300px; help: no;scroll: no; status: no"); if(tableiscancel=="no"){ if(tablewidthspecified=="yes"){ var tw1=""; if(tablewidthtype=="percentage"){ tw1=tablewidth+"%"; }else{ tw1=tablewidth; } xsel.width=tw1; }else{ xsel.removeAttribute("width",0); } if(tablealign!=""&&tablealign!="Default"){xsel.align=tablealign;}else{xsel.removeAttribute("align",0);} if(tableclass!=""&&tableclass!="Default"){xsel.className=tableclass;}else{xsel.removeAttribute("className",0);} if(tablebordersize!=""&&tablebordersize!=null){xsel.border=tablebordersize;}else{xsel.removeAttribute("border",0);} if(tablecellpadding!=""&&tablecellpadding!=null){xsel.cellPadding=tablecellpadding;}else{xsel.removeAttribute("cellPadding",0);} if(tablecellspacing!=""&&tablecellspacing!=null){xsel.cellSpacing=tablecellspacing;}else{xsel.removeAttribute("cellSpacing",0);} if(tablebordercolor!=""&&tablebordercolor!="Default"){xsel.borderColor=tablebordercolor;}else{xsel.removeAttribute("borderColor",0);} if(tablebackgroundcolor!=""&&tablebackgroundcolor!="Default"){xsel.bgColor=tablebackgroundcolor;}else{xsel.removeAttribute("bgColor",0);} } } } function cellProp(){ var cellflag=false; HtmlEdit.focus(); var xsel=HtmlEdit.document.selection; var xobj=HtmlEdit.document.selection.createRange(); if(xsel.type=="None"||xsel.type=="Text"){ xsel=xobj.parentElement(); while(xsel.tagName!="BODY"&&cellflag==false){ if(xsel.tagName=="TD"){cellflag=true;} if(cellflag==false){xsel=xsel.parentElement;} } }else if(xsel.type=="Control"){ xsel=xobj.item(0); if(xsel.tagName=="TD"){ cellflag=true; }else{ while(xsel.tagName!="BODY"&&cellflag==false){ if(xsel.tagName=="TD"){cellflag=true;} if(cellflag==false){xsel=xsel.parentElement;} } } } if(cellflag==true){ if(xsel.width!=""&&xsel.width!=null){tablewidthspecified="yes";tablewidth=xsel.width;}else{tablewidthspecified="no";tablewith="";} if(xsel.align!=""&&xsel.align!=null){tablealign=xsel.align;}else{tablealign="";} if(xsel.className!=""&&xsel.className!=null){tablecellclass=xsel.className;}else{tablecellclass="";} if(xsel.vAlign!=""&&xsel.vAlign!=null){tablevalign=xsel.vAlign;}else{tablevalign="";} if(xsel.borderColor!=""&&xsel.borderColor!=null){tablebordercolor=xsel.borderColor;}else{tablebordercolor="";} if(xsel.bgColor!=""&&xsel.bgColor!=null){tablebackgroundcolor=xsel.bgColor;}else{tablebackgroundcolor="";} tableiscancel=""; window.showModalDialog("editor_cellprops.htm",window,"dialogWidth: 400px; dialogHeight: 230px;help: no;scroll: no; status: no"); if(tableiscancel=="no"){ if(tablewidthspecified=="yes"){ var tw1=""; if(tablewidthtype=="percentage"){tw1=tablewidth+"%";}else{tw1=tablewidth;} xsel.width=tw1; }else{ xsel.removeAttribute("width",0); } if(tablealign!=""&&tablealign!="Default"){xsel.align=tablealign;}else{xsel.removeAttribute("align",0);} if(tablevalign!=""&&tablevalign!="Default"){xsel.vAlign=tablevalign;}else{xsel.removeAttribute("vAlign",0);} if(tablecellclass!=""&&tablecellclass!="Default"){xsel.className=tablecellclass;}else{xsel.removeAttribute("className",0);} if(tablebordercolor!=""&&tablebordercolor!="Default"){xsel.borderColor=tablebordercolor;}else{xsel.removeAttribute("borderColor",0);} if(tablebackgroundcolor!=""&&tablebackgroundcolor!="Default"){xsel.bgColor=tablebackgroundcolor;}else{xsel.removeAttribute("bgColor",0);} } } } function table_ir() { tablecommand("ir"); } function table_dr() { tablecommand("dr"); } function table_ic() { tablecommand("ic"); } function table_dc() { tablecommand("dc"); } function table_mc() { tablecommand("mc"); } function table_md() { tablecommand("md"); } function table_sc() { tablecommand("sc"); } function word() { HtmlEdit.document.execCommand("Paste",false); var editBody=HtmlEdit.document.body; for(var intLoop=0;intLoop <\/o:p>/g,""); html=html.replace(/o:/g,""); html=html.replace(//g, ""); html=html.replace(//g, ""); html=html.replace(//g, ""); html=html.replace(//g, ""); html=html.replace(//g, ""); html=html.replace(/

/g, ""); html=html.replace(/<\/P>/g, ""); html=html.replace(/<\/SPAN>/g, ""); HtmlEdit.document.body.innerHTML = html; format('selectall'); format('RemoveFormat'); } function InsertChars(CharIndex) { if (! validateMode()) return; HtmlEdit.focus(); var range =HtmlEdit.document.selection.createRange(); var Chars=new Array("
","©","®","™","•","…","—","–"); range.pasteHTML(Chars[CharIndex]); HtmlEdit.focus(); } function InsertEQ() { HtmlEdit.focus(); var range =HtmlEdit.document.selection.createRange(); var arr = showModalDialog("editor_inserteq.htm", "", "dialogWidth:40em; dialogHeight:20em; status:0;help:0"); if (arr != null){ var ss; ss=arr.split("*") a=ss[0]; b=ss[1]; var str1; str1="" str1=str1+"" str1=str1+"" range.pasteHTML(str1); } HtmlEdit.focus(); } function InstallEQ() { window.open ("editor_inserteq.asp?editmode=Install", "", "height=200, width=300,left="+(screen.AvailWidth-300)/2+",top="+(screen.AvailHeight-200)/2+", toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no") } function calculator() { HtmlEdit.focus(); var range =HtmlEdit.document.selection.createRange(); var arr = showModalDialog("editor_calculator.htm", "", "dialogWidth:205px; dialogHeight:210px; status:0;help:0"); if (arr != null){ var ss; ss=arr.split("*") a=ss[0]; b=ss[1]; var str1; str1=""+a+"" range.pasteHTML(str1); } HtmlEdit.focus(); }