<?php
include ("menu.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>代码编辑器</title>
<link rel="STYLESHEET" type="text/css" href="css.css">
<script language=javascript>

 var sInitColor;

 function callColorDlg(src){
  if(sInitColor == null)
   var sColor = dlgHelper.ChooseColorDlg();
  else
   var sColor = dlgHelper.ChooseColorDlg(sInitColor);

  sColor = sColor.toString(16);
  if (sColor.length < 6) {
   var sTempString = "000000".substring(0,6-sColor.length);
   sColor = sTempString.concat(sColor);
  }
	
  //document.all[src].style.backgroundColor = '#' + sColor;
clor='#' + sColor;
doFormat(src,clor);
  sInitColor = sColor;
 }
 


</script>
<script  language="JScript">
document.onmouseover = doOver;
document.onmouseout  = doOut;
document.onmousedown = doDown;
document.onmouseup   = doUp;
var loaded = 0;



function doOver() {
	var toEl = getReal(window.event.toElement, "className", "coolButton");
	var fromEl = getReal(window.event.fromElement, "className", "coolButton");
	if (toEl == fromEl) return;
	var el = toEl;
	var cDisabled = el.cDisabled;
	cDisabled = (cDisabled != null); 
	if (el.className == "coolButton")
		el.onselectstart = new Function("return false");
	if ((el.className == "coolButton") && !cDisabled) {
		makeRaised(el);
		makeGray(el,false);
	}
}
function doOut() {
	var toEl = getReal(window.event.toElement, "className", "coolButton");
	var fromEl = getReal(window.event.fromElement, "className", "coolButton");
	if (toEl == fromEl) return;
	var el = fromEl;
	var cDisabled = el.cDisabled;
	cDisabled = (cDisabled != null);
	var cToggle = el.cToggle;
	toggle_disabled = (cToggle != null);
	if (cToggle && el.value) {
		makePressed(el);
		makeGray(el,true);
	}
	else if ((el.className == "coolButton") && !cDisabled) {
		makeFlat(el);
		makeGray(el,true);
	}
}
function doUp() {
	el = getReal(window.event.srcElement, "className", "coolButton");
	
	var cDisabled = el.cDisabled;
	cDisabled = (cDisabled != null);
	
	if ((el.className == "coolButton") && !cDisabled) {
		makeRaised(el);
	}
}
function getReal(el, type, value) {
	temp = el;
	while ((temp != null) && (temp.tagName != "BODY")) {
		if (eval("temp." + type) == value) {
			el = temp;
			return el;
		}
		temp = temp.parentElement;
	}
	return el;
}
function findChildren(el, type, value) {
	var children = el.children;
	var tmp = new Array();
	var j=0;	
	for (var i=0; i<children.length; i++) {
		if (eval("children[i]." + type + "==\"" + value + "\"")) {
			tmp[tmp.length] = children[i];
		}
		tmp = tmp.concat(findChildren(children[i], type, value));
	}	
	return tmp;
}
function disable(el) {
	if (document.readyState != "complete") {
		window.setTimeout("disable(" + el.id + ")", 100);
		return;
	}	
	var cDisabled = el.cDisabled;	
	cDisabled = (cDisabled != null);
	if (!cDisabled) {
		el.cDisabled = true;
		el.innerHTML = '<span style="background: buttonshadow; width: 100%; height: 100%; text-align: center;">' +
						'<span style="filter:Mask(Color=buttonface) DropShadow(Color=buttonhighlight, OffX=1, OffY=1, Positive=0); height: 100%; width: 100%%; text-align: center;">' +
						el.innerHTML + '</span>' + '</span>';
		if (el.onclick != null) {
			el.cDisabled_onclick = el.onclick;
			el.onclick = null;
		}
	}
}
function enable(el) {
	var cDisabled = el.cDisabled;	
	cDisabled = (cDisabled != null);	
	if (cDisabled) {
		el.cDisabled = null;
		el.innerHTML = el.children[0].children[0].innerHTML;
		if (el.cDisabled_onclick != null) {
			el.onclick = el.cDisabled_onclick;
			el.cDisabled_onclick = null;
		}
	}
}
function addToggle(el) {
	var cDisabled = el.cDisabled;	
	cDisabled = (cDisabled != null);	
	var cToggle = el.cToggle;	
	cToggle = (cToggle != null);
	if (!cToggle && !cDisabled) {
		el.cToggle = true;		
		if (el.value == null)
			el.value = 0;		
		if (el.onclick != null)
			el.cToggle_onclick = el.onclick;
		else 
			el.cToggle_onclick = "";
		el.onclick = new Function("toggle(" + el.id +"); " + el.id + ".cToggle_onclick();");
	}
}
function removeToggle(el) {
	var cDisabled = el.cDisabled;	
	cDisabled = (cDisabled != null);	
	var cToggle = el.cToggle;	
	cToggle = (cToggle != null);	
	if (cToggle && !cDisabled) {
		el.cToggle = null;
		if (el.value) {
			toggle(el);
		}
		makeFlat(el);		
		if (el.cToggle_onclick != null) {
			el.onclick = el.cToggle_onclick;
			el.cToggle_onclick = null;
		}
	}
}
function toggle(el) {
	el.value = !el.value;	
	if (el.value)
		el.style.background = "URL(/images/tileback.gif)";
	else
		el.style.backgroundImage = "";
}
function makeFlat(el) {
	with (el.style) {
		background = "";
		border = "1px solid buttonface";
		if ((el.id != "more") && (el.id != "fore"))
			padding      = "1px";
	}
}
function makeRaised(el) {
	with (el.style) {
		borderLeft   = "1px solid buttonhighlight";
		borderRight  = "1px solid buttonshadow";
		borderTop    = "1px solid buttonhighlight";
		borderBottom = "1px solid buttonshadow";
		if ((el.id != "more") && (el.id != "fore"))
			padding      = "1px";
	}
}
function makePressed(el) {
	with (el.style) {
		borderLeft   = "1px solid buttonshadow";
		borderRight  = "1px solid buttonhighlight";
		borderTop    = "1px solid buttonshadow";
		borderBottom = "1px solid buttonhighlight";
		if ((el.id != "more") && (el.id != "fore")){
			paddingTop    = "2px";
			paddingLeft   = "2px";
			paddingBottom = "0px";
			paddingRight  = "0px";
		}
	}
}
function makeGray(el,b) {
}
document.write("<style>");
document.write(".coolBar	{background: buttonface;border-top: 1px solid buttonhighlight;	border-left: 1px solid buttonhighlight;	border-bottom: 1px solid buttonshadow; border-right: 1px solid buttonshadow; padding: 2px; font: menu;}");
document.write(".coolButton {border: 1px solid buttonface; padding: 1px; text-align: center; cursor: default;}");
document.write("</style>");
var activeCSS			= "border: 1 solid buttonface; color: windowtext; cursor: text;";
var inactiveCSS			= "border: 1 solid window; cursor: hand; color: red;";
var validTextColor		= "windowtext";
var invalidTextColor	= "buttonshadow";

// 调用格式命令
function doFormat(what) {
	var eb = document.all.editbar;
	eb._editor.execCommand(what, arguments[1]);
}

function Format1(what,opt,which) {
	var eb = document.all.editbar;
	eb._editor.addpic(what,opt,which);
}

function doMark(str,tiaojian) {

	document.all.editbar._editor.specialtype(str,tiaojian);

}
function MTable() {

	document.all.editbar._editor.ModifyTable();

}
function MCell() {

	document.all.editbar._editor.ModifyCell();

}

//表格修改功能
 function insrowabove(){
	document.all.editbar._editor.insrowabove();
 }

 function insrowbelow(){
	document.all.editbar._editor.insrowbelow();
 }

 function deleterow(){
	document.all.editbar._editor.deleterow();
 }

 function deletecol(){
	document.all.editbar._editor.deletecol();
 }

 function inscolafter(){
	document.all.editbar._editor.inscolafter();
 }

 function inscolbefore(){
	document.all.editbar._editor.inscolbefore();
 }
 function sNewImg(){
	document.all.editbar._editor.sNewImg();
 }
 function sImgProps(){
	document.all.editbar._editor.sImgProps();
 }
 // 007
 function sFlashProps(){
	document.all.editbar._editor.sFlashProps();
 }
 
 function findreplace() {
	document.all.editbar._editor.findreplace();
 }
 //
function doGuide() {

	document.all.editbar._editor.sBorders();

}
function doSelectClick(str, el) {
	var Index = el.selectedIndex;
	if (Index != 0){
		el.selectedIndex = 0;
		if (el.id == "specialtype")
			document.all.editbar._editor.specialtype(el.options[Index].value);
		else
			doFormat(str,el.options[Index].value);
	}
}
function doDown() {
	if (window.event.button == 1 && (Layer1.style.visibility == "visible" || Layer2.style.visibility == "visible" || Layer5.style.visibility == "visible" || Layer4.style.visibility == "visible" || Layer3.style.visibility == "visible" || select_Layer6.style.visibility == "visible")) {
		Layer1.style.visibility = "hidden";
		Layer2.style.visibility = "hidden";
		Layer3.style.visibility = "hidden";
		Layer5.style.visibility = "hidden";
		Layer4.style.visibility = "hidden";
		select_Layer6.style.visibility = "hidden";
	}
	if (window.event.button > 1)
		alert("欢迎使用在线编辑器");
	document.frames.myEditor.selectRange();
	el = getReal(window.event.srcElement, "className", "coolButton");
	var cDisabled = el.cDisabled;
	cDisabled = (cDisabled != null);
	if ((el.className == "coolButton") && !cDisabled) {
		makePressed(el)
	}
}
function palette(el) {
	var return_value = showModalDialog("palette.html","","dialogWidth:18;dialogHeight:16;dialogTop:50;dialogLeft:500;status:no;");
	if (return_value != ""){		
		el.style.backgroundColor = return_value;
	}
}

function showmore(){
	editbar.style.display = "none";
	editbar1.style.display = "block";
	more.style.display = "none";
	fore.style.display = "block";
}
function showfore(){
	editbar.style.display = "block";
	editbar1.style.display = "none";
	more.style.display = "block";
	fore.style.display = "none";
}
function nowinstatus(){
	window.status=''
}
function fixSize() {
	document.all.edit1.style.height = Math.max(document.body.clientHeight - document.all.edit1.offsetTop, 0);
}
function init() {
	fixSize();	
	if (loaded){
		parent.document.all.editor.style.display = "block";
		parent.status = "";		
	}
	else
		loaded = 1;	
}
function AddImg(){	
	document.all.UploadImg.style.display = "block";
}
function CancelAddImg(){
	document.all.UploadImg.style.display = "none";
}
function UploadComplete(URL){
	if ((URL != null) && (URL != ""))
		if (URL.indexOf(":") == -1)
			doFormat("InsertImage",URL);
		else			
			doFormat("InsertImage", URL);
	document.all.UploadImg.style.display = "none";
	document.forms["upload"].reset();
}
function savefile(){
	if (edit1.format == "ABC")
		parent.document.forms[1].body.value = myEditor.textEdit.document.body.innerText;
	else
		parent.document.forms[1].body.value = myEditor.textEdit.document.body.innerHTML;
}
</script>
<script>
var aaaa;
function showLayer (id) {
	if (edit1.RangeType == "None") {
		switch (id) {
			case "1" : ifram_Layer1.cutimg.src = "images/cutd.gif";
						ifram_Layer1.copyimg.src = "images/copyd.gif";
						ifram_Layer1.deleteimg.src = "images/deleted.gif";
			break;
			case "2" : 	ifram_Layer2.boldimg.src = "images/boldd.gif";
						ifram_Layer2.italicimg.src = "images/italicd.gif";
						ifram_Layer2.underlineimg.src = "images/underlined.gif";
						ifram_Layer2.strikethroughimg.src = "images/deld.gif";
						ifram_Layer2.superscriptimg.src = "images/upd.gif";
						ifram_Layer2.subscriptimg.src = "images/downd.gif";
			break;
		}
	} else {
		switch (id) {
			case "1" : ifram_Layer1.cutimg.src = "images/cut.gif";
						ifram_Layer1.copyimg.src = "images/copy.gif";
						ifram_Layer1.deleteimg.src = "images/delete.gif";
			break;
			case "2" : 	ifram_Layer2.boldimg.src = "images/bold.gif";
						ifram_Layer2.italicimg.src = "images/italic.gif";
						ifram_Layer2.underlineimg.src = "images/underline.gif";
						ifram_Layer2.strikethroughimg.src = "images/del.gif";
						ifram_Layer2.superscriptimg.src = "images/up.gif";
						ifram_Layer2.subscriptimg.src = "images/down.gif";
			break;
		}
	}
}

function mouseovercolor(src,clrOver){ 
		src.style.cursor = 'default';
		src.style.color = "#ffffff";
		src.bgColor = clrOver; 
}

function mouseoutcolor(src,clrIn)  { 
		src.style.cursor = 'default'; 
		src.style.color = "#000000";
		src.bgColor = clrIn; 
}

function showimage (type) {
	if (edit1.RangeType != "None") {
		switch (type) {
			case "bold" : ifram_Layer2.boldimg.src = "images/boldw.gif"; 
			break;
			case "italic" : ifram_Layer2.italicimg.src = "images/italicw.gif"; 
			break;
			case "underline" : ifram_Layer2.underlineimg.src = "images/underlinew.gif";
			break;
			case "strikethrough" : ifram_Layer2.strikethroughimg.src = "images/delw.gif";
			break;
			case "superscript" : ifram_Layer2.superscriptimg.src = "images/upw.gif";
			break;
			case "subscript" : ifram_Layer2.subscriptimg.src = "images/downw.gif";
			break;
			case "cut" : ifram_Layer1.cutimg.src = "images/cutw.gif";
			break;
			case "copy" : ifram_Layer1.copyimg.src = "images/copyw.gif";
			break;
			case "delete" : ifram_Layer1.deleteimg.src = "images/deletew.gif";
			break;
		}
	}
	if (type == "paste") ifram_Layer1.pasteimg.src = "images/pastew.gif";
	if (type == "forecolor") ifram_Layer2.forecolorimg.src = "images/fgcolorw.gif";
	if (type == "backcolor") ifram_Layer2.backcolorimg.src = "images/backcolorw.gif";
	if (type == "undo") ifram_Layer1.undoimg.src = "images/undow.gif";
	if (type == "redo") ifram_Layer1.redoimg.src = "images/redow.gif";
	if (type == "none") ifram_Layer3.noneimg.src = "images/defaultw.gif";
	if (type == "left") ifram_Layer3.leftimg.src = "images/jleftw.gif";
	if (type == "center") ifram_Layer3.centerimg.src = "images/jcenterw.gif";
	if (type == "right") ifram_Layer3.rightimg.src = "images/jrightw.gif";
	if (type == "ol") ifram_Layer3.olimg.src = "images/olw.gif";
	if (type == "ul") ifram_Layer3.ulimg.src = "images/ulw.gif";
	if (type == "outdent") ifram_Layer3.outdentimg.src = "images/outdentw.gif";
	if (type == "indent") ifram_Layer3.indentimg.src = "images/indentw.gif";
	if (type == "table") ifram_Layer5.tableimg.src = "images/tablew.gif";
	if (type == "tablep") ifram_Layer5.tablepimg.src = "images/tbprow.gif";
	if (type == "cellpro") ifram_Layer5.cellproimg.src = "images/cellprow.gif";
	if (type == "rowabove") ifram_Layer5.rowaboveimg.src = "images/rowabovew.gif";
	if (type == "rowbellow") ifram_Layer5.rowbellowimg.src = "images/rowbelloww.gif";
	if (type == "colafter") ifram_Layer5.colafterimg.src = "images/colafterw.gif";
	if (type == "colbefore") ifram_Layer5.colbeforeimg.src = "images/colbeforew.gif";
	if (type == "delcol") ifram_Layer5.delcolimg.src = "images/delcolw.gif";
	if (type == "delrow") ifram_Layer5.delrowimg.src = "images/delroww.gif";
	if (type == "guide") ifram_Layer5.guideimg.src = "images/guidew.gif";
	if (type == "rel") ifram_Layer4.relimg.src = "images/relw.gif";
	if (type == "mid") ifram_Layer4.midimg.src = "images/midw.gif";
	if (type == "font_0") ifram_Layer6.font_0img.src = "images/0w.gif";
	if (type == "font_1") ifram_Layer6.font_1img.src = "images/1w.gif";
	if (type == "font_2") ifram_Layer6.font_2img.src = "images/2w.gif";
	if (type == "font_3") ifram_Layer6.font_3img.src = "images/3w.gif";
	if (type == "font_4") ifram_Layer6.font_4img.src = "images/4w.gif";
	if (type == "font_5") ifram_Layer6.font_5img.src = "images/5w.gif";
	if (type == "font_6") ifram_Layer6.font_6img.src = "images/6w.gif";
	if (type == "font_7") ifram_Layer6.font_7img.src = "images/7w.gif";
}

function hiddenimage (type) {
	if (edit1.RangeType != "None") {
	switch (type) {
		case "bold" : ifram_Layer2.boldimg.src = "images/bold.gif"; 
		break;
		case "italic" : ifram_Layer2.italicimg.src = "images/italic.gif"; 
		break;
		case "underline" : ifram_Layer2.underlineimg.src = "images/underline.gif";
		break;
		case "strikethrough" : ifram_Layer2.strikethroughimg.src = "images/del.gif";
		break;
		case "superscript" : ifram_Layer2.superscriptimg.src = "images/up.gif";
		break;
		case "subscript" : ifram_Layer2.subscriptimg.src = "images/down.gif";
		break;
		case "cut" : ifram_Layer1.cutimg.src = "images/cut.gif";
		break;
		case "copy" : ifram_Layer1.copyimg.src = "images/copy.gif";
		break;
		case "delete" : ifram_Layer1.deleteimg.src = "images/delete.gif";
		break;
		case "imagep" : ifram_Layer4.imagepimg.src = "images/image2.gif";
		break;
		case "flashp" : ifram_Layer4.flashpimg.src = "images/flashp.gif";
		break;
	}
	}
	if (type == "undo") ifram_Layer1.undoimg.src = "images/undo.gif";
	if (type == "redo") ifram_Layer1.redoimg.src = "images/redo.gif";
	if (type == "paste") ifram_Layer1.pasteimg.src = "images/paste.gif";
	if (type == "forecolor") ifram_Layer2.forecolorimg.src = "images/fgcolor.gif";
	if (type == "backcolor") ifram_Layer2.backcolorimg.src = "images/backcolor.gif";
	if (type == "none") ifram_Layer3.noneimg.src = "images/default.gif";
	if (type == "left") ifram_Layer3.leftimg.src = "images/jleft.gif";
	if (type == "center") ifram_Layer3.centerimg.src = "images/jcenter.gif";
	if (type == "right") ifram_Layer3.rightimg.src = "images/jright.gif";
	if (type == "ol") ifram_Layer3.olimg.src = "images/ol.gif";
	if (type == "ul") ifram_Layer3.ulimg.src = "images/ul.gif";
	if (type == "outdent") ifram_Layer3.outdentimg.src = "images/outdent.gif";
	if (type == "indent") ifram_Layer3.indentimg.src = "images/indent.gif";
	if (type == "table") ifram_Layer5.tableimg.src = "images/table.gif";
	if (type == "tablep") ifram_Layer5.tablepimg.src = "images/tbpro.gif";
	if (type == "cellpro") ifram_Layer5.cellproimg.src = "images/cellpro.gif";
	if (type == "rowabove") ifram_Layer5.rowaboveimg.src = "images/rowabove.gif";
	if (type == "rowbellow") ifram_Layer5.rowbellowimg.src = "images/rowbellow.gif";
	if (type == "colafter") ifram_Layer5.colafterimg.src = "images/colafter.gif";
	if (type == "colbefore") ifram_Layer5.colbeforeimg.src = "images/colbefore.gif";
	if (type == "delcol") ifram_Layer5.delcolimg.src = "images/delcol.gif";
	if (type == "delrow") ifram_Layer5.delrowimg.src = "images/delrow.gif";
	if (type == "rel") ifram_Layer4.relimg.src = "images/rel.gif";
	if (type == "mid") ifram_Layer4.midimg.src = "images/mid.gif";
	if (type == "guide") ifram_Layer5.guideimg.src = "images/guide.gif";
	if (type == "font_0") ifram_Layer6.font_0img.src = "images/0.gif";
	if (type == "font_1") ifram_Layer6.font_1img.src = "images/1.gif";
	if (type == "font_2") ifram_Layer6.font_2img.src = "images/2.gif";
	if (type == "font_3") ifram_Layer6.font_3img.src = "images/3.gif";
	if (type == "font_4") ifram_Layer6.font_4img.src = "images/4.gif";
	if (type == "font_5") ifram_Layer6.font_5img.src = "images/5.gif";
	if (type == "font_6") ifram_Layer6.font_6img.src = "images/6.gif";
	if (type == "font_7") ifram_Layer6.font_7img.src = "images/7.gif";
}

</script>
</head>

<body SCROLL="no" STYLE="border: 0pt" bgcolor="white">
<fieldset>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>

    <td align="left"><object id=dlgHelper classid="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px">
        <embed width="0px" height="0px">
        </embed> 
      </object>
      <table border="0" cellpadding="0" cellspacing="0" id="editbar">
        <tr> 
          <td style="width:3px;cursor:move;" width="3"><img SRC="images/head.gif" WIDTH="3" HEIGHT="16"></td>
          <td width="80" height="22" id="formatSelect" style="padding: 0;" title="段落格式" > 
            <select onChange="doSelectClick('FormatBlock',this);this.returnValue=false;" style=" width: 80px;" id="select3" name="select1">
              <option>段落格式</option>
              <option value="&lt;P&gt;">普通 
              <option value="&lt;PRE&gt;">已编排格式 
              <option value="&lt;H1&gt;">标题一 
              <option value="&lt;H2&gt;">标题二 
              <option value="&lt;H3&gt;">标题三 
              <option value="&lt;H4&gt;">标题四 
              <option value="&lt;H5&gt;">标题五 
              <option value="&lt;H6&gt;">标题六 
              <option value="&lt;H7&gt;">标题七 </select> </td>
          <td width="30" height="22" id="fontSelect" style="padding: 0;" title="字体"> 
            <?php echo SelectFont ("Layer6", 30, "宋体,楷体,隶书,黑体,仿宋,Arial,Times New Roman,图形字体","宋体,楷体_GB2312,隶书,黑体,仿宋_GB2312,arial,Times New Roman,Webdings","FontName");?></td>
          <td width="75" height="22" id="sizeSelect" style="padding: 0;" title="字体大小"> 
            <select name="select" style="width: 75px;" onChange="doSelectClick('FontSize',this);">
              <option>字体大小</option>
              <option value="1">1 
              <option value="2">2 
              <option value="3">3 
              <option value="4">4 
              <option value="5">5 
              <option value="6">6 
              <option value="7">7 </select> </td>
          <td width="8" height="22" align="center" title="编辑"><img src="images/separator.gif" width="2" height="16"></td>
          <td width="22" height="22" align="center" class="coolButton" title="编辑" onclick="showLayer('1')"><?php echo Select("Layer1", 130, 128, "edit.gif", "edit");?></td>
          <td width="22" height="22" align="center" class="coolButton" title="字体" onclick="showLayer('2')"><?php echo Select("Layer2", 130, 171, "edit_font.gif", "font");?></td>
          <td width="21" align="center" class="coolButton"><?php echo Select("Layer3", 130, 172, "p.gif", "p");?></td>
          <td width="21" align="center" class="coolButton" onClick="showLayer('5')"><?php echo Select("Layer5", 130, 191, "tablemenu.gif", "tablemenu");?></td>
          <td width="22" height="22" align="center" class="coolButton" onClick="showLayer('4')"><?php echo Select("Layer4", 130, 42, "media.gif", "media");?></td>
          <td width="6" height="22" align="center"><img src="images/separator.gif" width="2" height="16"></td>
          <td width="21" align="center" class="coolButton" onClick="sNewImg();" title="插入图片"><img src="images/image1.gif"></td>
          <td width="21" align="center" class="coolButton" onClick="sImgProps()" title="修改图片"><img src="images/image2.gif"></td>
          <td width="21" align="center" class="coolButton" onClick="Flash('flash','')" title="插入Flash"><img src="images/Flash.gif"></td>
          <td width="21" align="center" class="coolButton" onClick="sFlashProps()" title="修改Flash"><img src="images/Flashp.gif" width="18" height="18"></td>
          <td width="21" align="center" class="coolButton" onClick="marquee('marquee','')" title="插入移动字幕"><img src="images/marquee.gif" width="16" height="16"></td>
          <td width="21" align="center" class="coolButton" onClick="doFormat('CreateLink')" title="插入链接"><img src="images/link.gif" width="16" height="16"></td>
          <td width="21" align="center" class="coolButton" onClick="doFormat('Unlink')" title="删除链接"><img src="images/dellink.gif" width="16" height="16"></td>
          <td width="21" align="center" class="coolButton" onClick="doFormat('InsertHorizontalRule')" title="删除水平线"><img src="images/hr.gif" width="16" height="16"></td>
          <td width="21" align="center" class="coolButton" onClick="showLayer('4')">&nbsp;</td>
          <td width="6" align="center"><img src="images/separator.gif" width="2" height="16"></td>
          <td width="21" align="center" class="coolButton" onClick="doGuide()" title="表格辅助线"><img src="images/guide.gif" width="16" height="16"></td>
        </tr>
      </table>
      <iframe height=1 width=0 style="visibility: hidden" id=uploadback name=uploadback></iframe>
    </td>
<td align="right">&nbsp; </td>
</tr></table>
</fieldset>
<iframe ID="edit1" SRC="editor.html" NAME="myEditor" onfocus="document.all.editbar._editor = window.frames[this.id];" style="width: 100%; height: 90%;"></iframe>
<iframe id="uploadback" name="uploadback" style="display:none"></iframe>
<script language="javascript">
if((window.navigator.userAgent.indexOf("IE 5") < 1) && (window.navigator.userAgent.indexOf("IE 6") < 1)) {
	alert("请使用Microsoft Internet Explorer 5.0\n或更高版本的浏览器！");
	window.close();
}
window.onload = init;
window.onresize = fixSize;
document.all.editbar._editor = window.frames[document.all.edit1.id];
</script>
</body>
</html>
<script language="javascript">

function format (what,opt) {
//EditCtrl.focus ();
//selectRange ();

var tablevar = showModalDialog ("table.html", "", "dialogWidth:356PX; dialogHeight:164PX; status:0");
//var tablevar=receiveVal9(val)

	if (tablevar != null) {
	tablevar = tablevar.split("*");
	var rows_v = tablevar[0];
	var columns_v = tablevar[1];
	var width_v = tablevar[2];
	var widthtype_v;
	if (tablevar[3]) var widthtype_v = "%";
		var border_v = tablevar[4];
		var cellspacing_v = tablevar[5];
		var cellpadding_v = tablevar[6];
		string = "<table border=\""+border_v+"\"   width=\""+width_v+""+widthtype_v+"\" cellspacing=\""+cellspacing_v+"\" cellpadding=\""+cellpadding_v+"\">";

		for (var i=1; i<=rows_v; i++){
			string = string+"<tr>";
			for (var i1=1; i1<=columns_v; i1++){
				string = string+"<td>&nbsp;</td>";
			}
			string = string+"</tr>";
			}
			string = string+"</table>";
	//edit.pasteHTML (string);
	myEditor.pasteHTML(string);

	}
}

//007 flash
function Flash (what,opt) {
//EditCtrl.focus ();
//selectRange ();
	var flashvar = showModalDialog ("upload_Flash.php", "", "dialogWidth:383PX; dialogHeight:395PX; status:0");
//var tablevar=receiveVal9(val)

	if (flashvar != null) {
		flashvar = flashvar.split("*");
		var flash_path = flashvar[0];
		var flash_name = flashvar[1];
		var flash_border = flashvar[2];
		var flash_title = flashvar[3];
		var flash_width = flashvar[4];
		var flash_width_unit = flashvar[5];
		var flash_height = flashvar[6];
		var flash_height_unit = flashvar[7];
		var flash_hspace = flashvar[8];
		var flash_vspace = flashvar[9];
		var flash_autoplay = flashvar[10];
		var flash_menu = flashvar[11];
		var flash_loop = flashvar[12];
		var flash_font = flashvar[13];
		var flash_align = flashvar[14];
		var flash_quality = flashvar[15];
		var flash_scale = flashvar[16];
		if (flash_width_unit == "px") {
			flash_width_unit = "";
		}
		if (flash_height_unit == "px") {
			flash_height_unit = "";
		}
		
		var string = "<object codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" height=\"" + flash_height + flash_height_unit + "\" width=\"" + flash_width + flash_width_unit + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" name=\"" + flash_name + "\" hspace=\"" + flash_hspace + "\" vspace=\"" + flash_hspace + "\" title=\"" + flash_title + "\" border=\"" + flash_border + "\">";
			string += "<param name=\"_cx\" value=\"12700\">";
			string += "<param name=\"_cy\" value=\"8467\">";
			string += "<param name=\"FlashVars\" value=\"\">";
			string += "<param name=\"Movie\" value=\"" + flash_path + "\">";
			string += "<param name=\"Src\" value=\"" + flash_path + "\">";
			string += "<param name=\"WMode\" value=\"Window\">";
			string += "<param name=\"Play\" value=\"" + flash_autoplay +"\">";
			string += "<param name=\"Loop\" value=\"" + flash_loop +"\">";
			string += "<param name=\"Quality\" value=\"" + flash_quality + "\">";
			string += "<param name=\"SAlign\" value=\"" + flash_align + "\">";
			string += "<param name=\"Menu\" value=\"" + flash_menu + "\">";
			string += "<param name=\"Base\" value=\"\">";
			string += "<param name=\"AllowScriptAccess\" value=\"always\">";
			string += "<param name=\"Scale\" value=\"" + flash_scale + "\">";
			string += "<param name=\"DeviceFont\" value=\"" + flash_font  + "\">";
			string += "<param name=\"EmbedMovie\" value=\"0\">";
			string += "<param name=\"BGColor\" value=\"#efefef\">";
			string += "<param name=\"SWRemote\" value=\"\">";
			string += "<param name=\"MovieData\" value=\"\">";
			string += "<embed src=\"" + flash_path + "\" quality=\"" + flash_quality + "\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + flash_width + flash_width_unit + "\" height=\"" + flash_height + flash_height_unit + "\"></embed>";
			string += "</object>";
		//edit.pasteHTML (string);
		myEditor.pasteHTML(string);
	}
}
// end

// 007 realplayer
function RealPlayer (what,opt) {
	var controls;
	var controls_height;
	var realplayervar = showModalDialog ("real_player.php", "", "dialogWidth:380PX; dialogHeight:415PX; status:0");
	if (realplayervar != null) {
		realplayervar = realplayervar.split("*");
		var media_url = realplayervar[0];
		var media_name = realplayervar[1];
		var media_border = realplayervar[2];
		var media_title = realplayervar[3];
		var media_width = realplayervar[4];
		var media_width_unit = realplayervar[5];
		var media_height = realplayervar[6];
		var media_height_unit = realplayervar[7];
		var media_hspace = realplayervar[8];
		var media_vspace = realplayervar[9];
		var media_autoplay = realplayervar[10];
		var media_control = realplayervar[11];
		var media_loop = realplayervar[12];
		var media_status = realplayervar[13];
		var media_positionslider = realplayervar[14];
		var media_align = realplayervar[15];
		var media_introduce = realplayervar[16];
		if (media_width_unit == "px") {
			media_width_unit = "";
		}
		if (media_height_unit == "px") {
			media_height_unit = "";
		}
	
		if (media_control != "" && media_status != "" && media_positionslider != "") {
			controls = "";
			controls_height = 71;
		} else {
			controls = media_control + "," + media_status + "," + media_positionslider;
			if (media_control != "") {
				var height_control = 21;
			} else {
				var height_control = 0;
			}
			if (media_status != "") {
				var height_status = 21;
			} else {
				var height_status = 0;
			}
			if (media_positionslider != "") {
				var height_status = 21;
			} else {
				var height_status = 0;
			}
			controls_height = height_control + height_status + height_status;
		}

		var string = "<OBJECT width=\"" + media_width + media_width_unit + "\" height=\"" + media_height + media_height_unit + "\" classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA id=\"" + media_name + "\" hspace=\"" + media_hspace + "\" vspace=\"" + media_hspace + "\" title=\"" + media_title + "\" border=\"" + media_border + "\">";
			string += "<PARAM NAME=\"_ExtentX\" VALUE=\"12700\">";
			string += "<PARAM NAME=\"_ExtentY\" VALUE=\"9525\">";
			string += "<PARAM NAME=\"AUTOSTART\" VALUE=\"" + media_autoplay + "\">";
			string += "<PARAM NAME=\"SHUFFLE\" VALUE=\"0\">";
			string += "<PARAM NAME=\"PREFETCH\" VALUE=\"0\">";
			string += "<PARAM NAME=\"NOLABELS\" VALUE=\"0\">";
			string += "<PARAM NAME=\"SRC\" VALUE=\"" + media_url + "\">";
			string += "<PARAM NAME=\"CONTROLS\" VALUE=\"ImageWindow\">";
			string += "<PARAM NAME=\"CONSOLE\" VALUE=\"Clip\">";
			string += "<PARAM NAME=\"NUMLOOP\" VALUE=\"0\">";
			string += "<PARAM NAME=\"CENTER\" VALUE=\"0\">";
			string += "<PARAM NAME=\"MAINTAINASPECT\" VALUE=\"0\">";
			string += "</OBJECT><br>";
			string += "<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA width=\"" + media_width + media_width_unit + "\" height=\"" + controls_height + "\" hspace=\"" + media_hspace + "\" vspace=\"" + media_hspace + "\" title=\"" + media_title + "\" border=\"" + media_border + "\">";
			string += "<PARAM NAME=\"_ExtentX\" VALUE=\"12700\">";
			string += "<PARAM NAME=\"_ExtentY\" VALUE=\"847\">";
			string += "<PARAM NAME=\"AUTOSTART\" VALUE=\"" + media_autoplay + "\">";
			string += "<PARAM NAME=\"SHUFFLE\" VALUE=\"0\">";
			string += "<PARAM NAME=\"PREFETCH\" VALUE=\"0\">";
			string += "<PARAM NAME=\"NOLABELS\" VALUE=\"0\">";
			string += "<PARAM NAME=\"CONTROLS\" VALUE=\"" + controls + "\">";
			string += "<PARAM NAME=\"CONSOLE\" VALUE=\"Clip\">";
			string += "<PARAM NAME=\"LOOP\" VALUE=\"" + media_loop + "\">";
			string += "<PARAM NAME=\"NUMLOOP\" VALUE=\"0\">";
			string += "<PARAM NAME=\"CENTER\" VALUE=\"0\">";
			string += "<PARAM NAME=\"MAINTAINASPECT\" VALUE=\"0\">";
			string += "<PARAM NAME=\"BACKGROUNDCOLOR\" VALUE=\"#000000\">";
			string += "</OBJECT><br>";
			string += "媒体说明：" + media_introduce;
		
		//edit.pasteHTML (string);
		myEditor.pasteHTML(string);
	}
}
//end
// 007 mediaplayer
function MediaPlayer (waht,opt) {
	var mediaplayervar = showModalDialog ("media_player.php", "", "dialogWidth:380PX; dialogHeight:395PX; status:0");
	if (mediaplayervar != null) {
		mediaplayervar = mediaplayervar.split("*");
		var media_url = mediaplayervar[0];
		var media_name = mediaplayervar[1];
		var media_border = mediaplayervar[2];
		var media_title = mediaplayervar[3];
		var media_width = mediaplayervar[4];
		var media_width_unit = mediaplayervar[5];
		var media_height = mediaplayervar[6];
		var media_height_unit = mediaplayervar[7];
		var media_hspace = mediaplayervar[8];
		var media_vspace = mediaplayervar[9];
		var media_autoplay = mediaplayervar[10];
		var media_control = mediaplayervar[11];
		var media_loop = mediaplayervar[12];
		var media_status = mediaplayervar[13];
		var media_align = mediaplayervar[14];
		var media_introduce = mediaplayervar[15];
		if (media_width_unit == "px") {
			media_width_unit = "";
		}
		if (media_height_unit == "px") {
			media_height_unit = "";
		}
		
		var string = "<OBJECT classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95 width=\"" + media_width + media_width_unit + "\" height=\"" + media_height + media_height_unit + "\" hspace=\"" + media_hspace + "\" vspace=\"" + media_vspace + "\" align=\"" + media_align + "\" title=\"" + media_title + "\" border=\"" + media_border + "\" id=\"" + media_name + "\" VIEWASTEXT>";
			string += "<PARAM NAME=\"SRC\" VALUE=\"" + media_url + "\">";
			string += "<PARAM NAME=\"AUTOSTART\" VALUE=\"" + media_autoplay + "\">";
			string += "<PARAM NAME=\"PlayCount\" VALUE=\"1\">";
			string += "<PARAM NAME=\"loop\" VALUE=\"" + media_loop + "\">";
			string += "<PARAM NAME=\"showCONTROLS\" VALUE=\"" + media_control + "\">";
			string += "<PARAM NAME=\"showStatusBar\" VALUE=\"" + media_status + "\">";
			string += "<PARAM NAME=\"volume\" VALUE=\"50\">";
			//string += "<embed src=\"" + media_url + "\" width=\"" + media_width + media_width_unit + "\" height=\"" + media_height + media_height_unit + "\" autostart=\"" + media_autoplay + "\" url=\"" + media_url + "\" rate=\"1\" balance=\"0\" currentposition=\"0\" defaultframe=\"\" playcount=\"1\" currentmarker=\"0\" invokeurls=\"-1\" baseurl=\"\" volume=\"50\" mute=\"0\" uimode=\"none\" stretchtofit=\"0\" windowlessvideo=\"0\" enabled=\"0\" enablecontextmenu=\"0\" fullscreen=\"0\" samistyle=\"\" samilang=\"\" samifilename=\"\" captioningid=\"\" enableerrordialogs=\"0\" _cx=\"13150\" _cy=\"7673\"></embed>";
			string += "</OBJECT>";
		//prompt("因为HTML编辑器的内部原因，当插入MediaPlayer播放器时出现一点小问题。现在请将下面的代码拷贝，然后到HTML模式把原来的<object></ojbect>替换掉！",string);
		//edit.pasteHTML (string);
		myEditor.pasteHTML(string);
	}
} // end

// 007 marquee
function marquee () {
	var marqueevar = showModalDialog ("marquee.php", "", "dialogWidth:336PX; dialogHeight:381PX; status:0");
	if (marqueevar != null) {
		marqueevar = marqueevar.split("*");
		var name = marqueevar[0];
		var direction = marqueevar[1];
		var height = marqueevar[2];
		var height_unit = marqueevar[3];
		var width = marqueevar[4];
		var width_unit = marqueevar[5];
		var hsplace = marqueevar[6];
		var vsplace = marqueevar[7];
		var align = marqueevar[8];
		var behavior = marqueevar[9];
		var loop = marqueevar[10];
		var bgcolor = marqueevar[11]
		var content = marqueevar[12];
		var scrollamount = marqueevar[13];
		
		var string = "<marquee align=\"" + align + "\" direction=\"" + direction + "\" width=\"" + width + height_unit + "\" height=\"" + height + height_unit + "\" hspace=\"" + hsplace + "\" vspace=\"" + vsplace + "\" id=\"" + name + "\" bgcolor=\"" + bgcolor + "\" loop=\"" + loop + "\" behavior=\"" + behavior + "\" scrollamount=\"" + scrollamount + "\">";
			string += content;
			string += "</marquee>"
			//alert (string);
		myEditor.pasteHTML(string);
	}
} // end
function forcolor (what,opt) {
		//myEditor.document.execCommand (what,"",opt);

		var arr = showModalDialog("selcolor.html", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0");
  if (arr != null) format('forecolor', arr);
  else
		myEditor.focus ();
		//opt = prompt("hy_lan_04025","");
}

</script>