var css1 = ('A:link{TEXT-DECORATION: none;COLOR: #336699;}A:visited{TEXT-DECORATION: none;COLOR: #336699;}A:hover{TEXT-DECORATION: underline;COLOR: #666666;}A:active{TEXT-DECORATION: none;COLOR: #336699;}BODY,TD,TH{FONT-FAMILY: 宋体;FONT-SIZE: 14px;COLOR: #000000;}');
var css2 = ('');
function span (){
var tbwidth = new Array (4,23,23,4,23,23,23,4,23,23,4,23,23,23,4,23,23,23,23,2);
var tbaction = new Array ("","Undo","Redo","","bold","italic","underline","","small","big","","justifyleft","justifycenter","justifyright","","insertorderedlist","insertunorderedlist","outdent","indent","");
var tbtip = new Array ("","撤销键入","恢复键入","","加粗","倾斜","下划线","","减小字号","增大字号","","左对齐","居中","右对齐","","编号","项目符号","减少缩进量","增加缩进量","");
var left = 0,s = "";
for (var i=0; i s += " s += "style= \"width: " + tbwidth[i] + "; position: relative; height: 26 \">"
s += " s += "position: absolute;margin:0px;padding:0px;height:26px;top:0px;left:0px;overflow:hidden;\">"
s += " s += "width=344 height=52 onMouseOver=\"this.style.top='-26px'\" onMouseOut=\"this.style.top='0px'\""
s += "onClick=\"format('" + tbaction[i] + "','');this.style.top='0px'\" title=\"" + tbtip[i] + "\">";
left += tbwidth[i];
}
alert(s);
document.write (s);
}
function initEditor () {
EditCtrl.document.designMode="ON";
EditCtrl.document.open();
EditCtrl.document.write(css1);
EditCtrl.document.write(css2);
EditCtrl.document.close();
}
function format (what,opt){
selectRange ();
if (what == "small" || what == "big")
{
var strHTML;
if (RangeType == "Text")
{
edittxt = ""+edit.text+"";
edit.pasteHTML (edittxt);
}
}
else
{
if ( opt == "")
{
EditCtrl.document.execCommand (what);
}
}
if (opt != "" && opt != null && what != "saveas") {
EditCtrl.document.execCommand (what,"",opt);
}
EditCtrl.focus ();
}
function selectRange () {
EditCtrl.focus ();
edit = EditCtrl.document.selection.createRange();
RangeType = EditCtrl.document.selection.type;
}