//==============This WebCode Is Written By York 2005.3======================
//==============ASP&JavaScript程序代码编写由York(周浩)完成,联系QQ:31741622====

	var divHeight = 308;
	var myMode = 0;		
	var theHtml = "";

	function showHideMe(me){
		if(me.style.display == 'none'){
			me.style.display = '';
			return "on";
		}else{
			me.style.display = 'none';
			return "off";
		}
	}

	function isIE6(){
		if(navigator.userAgent.indexOf("MSIE 5.") != -1){
			return false;
		}
		return true;
	/*	
		document.write(navigator.appName);
		document.write(navigator.appVersion);
		document.write(navigator.appCodeName);
		document.write(navigator.userAgent);
	*/	
	}

	function showHtmlEditor(){
		if(isIE6() == true){
			document.write("<div id='Menu'>");
			var Button = new Array(
				new Array('清除Word源码','word','pasteWord();'),
				new Array('撤消','undo','doIt("undo");'),
				new Array('恢复','redo','doIt("redo");'),
				new Array('减少缩进量','outdent','doIt("outdent");'),
				new Array('增加缩进量','indent','doIt("indent");'),
				new Array('字体颜色','forecolor','showColor(\"forecolor\");'),
				new Array('文字背景颜色','backColor','showColor(\"backColor\");'),
				new Array('编号','insertorderedlist','doIt("insertorderedlist");'),
				new Array('项目符号','insertunorderedlist','doIt("insertunorderedlist");'),
				new Array('插入超级连接','CreateLink','doIt("CreateLink");'),
				new Array('取消超级链接','unLink','doIt("unLink");'),
				new Array('插入图片','image','injoItImage();'),
				new Array('插入动画','flash','injoItFlash();'),
				new Array('插入媒体文件','mp','injoItMp();'),
				new Array('插入网页','htm','injoItIframe();'),
				new Array('插入当前日期与时间','time','doAdd(doTime())'),
				new Array('换行','br','doAdd("<br>");')
			);
			for(var i = 0;i < Button.length; i++){
				document.write("<button style='border:\"0px\"' class='ToolsBarButton' "
					+ "title='" + Button[i][0] + "' "
					+ "onClick='" + Button[i][2] + ";' "
					+ "onMouseover='this.style.border=\"1px outset buttonhighlight\"' "
					+ "onMousedown='this.style.border=\"1px inset buttonhighlight\"' "
					+ "onMouseout='this.style.border=\"0px none buttonface\"' "
					+ "onMouseup='this.style.border=\"0px none buttonface\"' "
					+ "onFocus='this.blur()' "
					+ "style='cursor: hand;'>"
					+ "<img src='images/Editor/" + Button[i][1] + ".gif'></button>"
					);
			}
			document.write("<select id='add' onchange='doAdd(this[this.selectedIndex].value);this.selectedIndex=0'>"
				+ "<option selected>符　号</option>"
				+ "<option value='<br>'>换行符</option>"
				+ "<option value='<p>{nextPage}</p>'>换页符</option>"
				+ "<option value='<hr>'>灰直线</option>"
				+ "<option value='&nbsp;'>空格</option>"
				+ "<option value='&#8212;'>&#8212;</option>"
				+ "<option value='&pound;'>&pound;</option>"
				+ "<option value='&#8364;'>&#8364;</option>"
				+ "<option value='&copy;'>&copy;</option>"
				+ "<option value='&reg;'>&reg;</option>"
				+ "<option value='&#8482;'>&#8482;</option>"
				+ "<option value='&#8240;'>&#8240;</option>"
				+ "</select>");
			document.write("</div><div id='Menu'>");
	
			document.write("<select ID='formatSelect' class='TBGen' onchange='selectDoIt(\"FormatBlock\",this[this.selectedIndex].value);this.selectedIndex=0'>"
				+ "<option selected>格　式</option>"
				+ "<option VALUE='&lt;P&gt;'>普　通</option>"
				+ "<option VALUE='&lt;PRE&gt;'>已编排</option>"
				+ "<option VALUE='&lt;H1&gt;'>标题一</option>"
				+ "<option VALUE='&lt;H2&gt;'>标题二</option>"
				+ "<option VALUE='&lt;H3&gt;'>标题三</option>"
				+ "<option VALUE='&lt;H4&gt;'>标题四</option>"
				+ "<option VALUE='&lt;H5&gt;'>标题五</option>"
				+ "<option VALUE='&lt;H6&gt;'>标题六</option>"
				+ "</select>");
			document.write("<select id='FontName' onchange='selectDoIt(\"fontname\",this[this.selectedIndex].value);this.selectedIndex=0'>"
				+ "<option selected>　　字　　体</option>"
				+ "<option value='宋体'>宋体</option>"
				+ "<option value='黑体'>黑体</option>"
				+ "<option value='楷体_GB2312'>楷体</option>"
				+ "<option value='仿宋_GB2312'>仿宋</option>"
				+ "<option value='隶书'>隶书</option>"
				+ "<option value='幼圆'>幼圆</option>"
				+ "<option value='Arial'>Arial</option>"
				+ "<option value='Arial Black'>Arial Black</option>"
				+ "<option value='Arial Narrow'>Arial Narrow</option>"
				+ "<option value='Brush Script	MT'>Brush Script MT</option>"
				+ "<option value='Century Gothic'>Century Gothic</option>"
				+ "<option value='Comic Sans MS'>Comic Sans MS</option>"
				+ "<option value='Courier'>Courier</option>"
				+ "<option value='Courier New'>Courier New</option>"
				+ "<option value='MS Sans Serif'>MS Sans Serif</option>"
				+ "<option value='Script'>Script</option>"
				+ "<option value='System'>System</option>"
				+ "<option value='Times New Roman'>Times New Roman</option>"
				+ "<option value='Verdana'>Verdana</option>"
				+ "<option value='Wide	Latin'>Wide Latin</option>"
				+ "<option value='Wingdings'>Wingdings</option>"
				+ "<option value='Wingdings 2'>Wingdings 2</option>"
				+ "</select><select id='FontSize' onchange='selectDoIt(\"fontsize\",this[this.selectedIndex].value);this.selectedIndex=0'>"
				+ "<option selected>字号</option>"
				+ "<option value='7'>一号</option>"
				+ "<option value='6'>二号</option>"
				+ "<option value='5'>三号</option>"
				+ "<option value='4'>四号</option>"
				+ "<option value='3'>五号</option>"
				+ "<option value='2'>六号</option>"
				+ "<option value='1'>七号</option>"
				+ "</select>");
			var Button = new Array(
				new Array('上标','superscript','doIt("superscript");'),
				new Array('下标','subscript','doIt("subscript");'),
				new Array('加粗','bold','doIt("bold")'),
				new Array('斜体','italic','doIt("italic")'),
				new Array('下划线','underline','doIt("underline")'),
				new Array('删除线','strikethrough','doIt("strikethrough")'),
				new Array('靠左','justifyleft','doIt("Justifyleft")'),
				new Array('居中','justifycenter','doIt("justifycenter")'),
				new Array('靠右','justifyright','doIt("justifyright")'),
				new Array('删除文字格式','RemoveFormat','doIt("RemoveFormat")')
			);
			for(var i = 0;i < Button.length; i++){
				document.write("<button style='border:\"0px\"' class='ToolsBarButton' "
					+ "title='" + Button[i][0] + "' "
					+ "onClick='" + Button[i][2] + ";' "
					+ "onMouseover='this.style.border=\"1px outset buttonhighlight\"' "
					+ "onMousedown='this.style.border=\"1px inset buttonhighlight\"' "
					+ "onMouseout='this.style.border=\"0px none buttonface\"' "
					+ "onMouseup='this.style.border=\"0px none buttonface\"' "
					+ "onFocus='this.blur()' "
					+ "style='cursor: hand;'>"
					+ "<img src='images/Editor/" + Button[i][1] + ".gif'></button>"
					);
			}
			
/*			document.write("<span style='width:2px;height:20px;border:1px inset buttonhighlight;'></span><button style='border:\"0px\";width:100px;' class='ToolsBarButton' title='' onClick='window.open(\"Plus_EduInvestEditor.html\");' "
				+ "onMouseover='this.style.border=\"1px outset buttonhighlight\"' "
				+ "onMousedown='this.style.border=\"1px inset buttonhighlight\"' "
				+ "onMouseout='this.style.border=\"0px none buttonface\"' "
				+ "onMouseup='this.style.border=\"0px none buttonface\"' "
				+ "onFocus='this.blur()' "
				+ "style='cursor: hand;'>"
				+ "教研活动编辑器</button>"
				);*/

	//		document.write("</div><div id='Menu'>");
	
			document.write("</div>");
			document.write("<div id=contDiv onkeypress=onkeyboard(); contentEditable class=div0 style='padding: 3px;word-break:break-all;'></div>");
			picEdit("html");
		}
	}

	function showUBBEditor(){
		document.write("<div id=bottom>");
		var Button = new Array(
			new Array('上标','superscript','ubb(0, "sup");'),
			new Array('下标','subscript','ubb(0, "sub");'),
			new Array('加粗','bold','ubb(0, "b")'),
			new Array('斜体','italic','ubb(0, "i")'),
			new Array('下划线','underline','ubb(0, "u")'),
			new Array('删除线','strikethrough','ubb(0, "strike")'),
			new Array('靠左','justifyleft','ubb("align", "left")'),
			new Array('居中','justifycenter','ubb("align", "center")'),
			new Array('靠右','justifyright','ubb("align", "right")')
		);
		for(var i = 0;i < Button.length; i++){
			document.write("<button style='border:\"0px\"' class='ToolsBarButton' "
				+ "title='" + Button[i][0] + "' "
				+ "onClick='" + Button[i][2] + ";' "
				+ "onMouseover='this.style.border=\"1px outset buttonhighlight\"' "
				+ "onMousedown='this.style.border=\"1px inset buttonhighlight\"' "
				+ "onMouseout='this.style.border=\"0px none buttonface\"' "
				+ "onMouseup='this.style.border=\"0px none buttonface\"' "
				+ "onFocus='this.blur()' "
				+ "style='cursor: hand;'>"
				+ "<img src='images/Editor/" + Button[i][1] + ".gif'></button>"
				);
		}
		document.write("<select id='FontName' onchange='ubb(\"face\", this.value);this.selectedIndex=0'>"
			+ "<option selected>　　字　　体</option>"
			+ "<option value='宋体'>宋体</option>"
			+ "<option value='黑体'>黑体</option>"
			+ "<option value='楷体_GB2312'>楷体</option>"
			+ "<option value='仿宋_GB2312'>仿宋</option>"
			+ "<option value='隶书'>隶书</option>"
			+ "<option value='幼圆'>幼圆</option>"
			+ "<option value='Arial'>Arial</option>"
			+ "<option value='Arial Black'>Arial Black</option>"
			+ "<option value='Arial Narrow'>Arial Narrow</option>"
			+ "<option value='Brush Script	MT'>Brush Script MT</option>"
			+ "<option value='Century Gothic'>Century Gothic</option>"
			+ "<option value='Comic Sans MS'>Comic Sans MS</option>"
			+ "<option value='Courier'>Courier</option>"
			+ "<option value='Courier New'>Courier New</option>"
			+ "<option value='MS Sans Serif'>MS Sans Serif</option>"
			+ "<option value='Script'>Script</option>"
			+ "<option value='System'>System</option>"
			+ "<option value='Times New Roman'>Times New Roman</option>"
			+ "<option value='Verdana'>Verdana</option>"
			+ "<option value='Wide	Latin'>Wide Latin</option>"
			+ "<option value='Wingdings'>Wingdings</option>"
			+ "<option value='Wingdings 2'>Wingdings 2</option>"
			+ "</select><select id='FontSize' onchange='ubb(\"size\", this.value);this.selectedIndex=0'>"
			+ "<option selected>字号</option>"
			+ "<option value='7'>一号</option>"
			+ "<option value='6'>二号</option>"
			+ "<option value='5'>三号</option>"
			+ "<option value='4'>四号</option>"
			+ "<option value='3'>五号</option>"
			+ "<option value='2'>六号</option>"
			+ "<option value='1'>七号</option>"
			+ "</select>");
		document.write("</div>");
	}
	
	function picEdit(cmd){
		if(cmd == "html"){
			document.write("<div id='Menu'>"
				+ "<button class='editMode' id='editMode' onClick='setMode(0);' title='编辑模式:视图' onMouseover='this.style.border=\"1px outset buttonhighlight\"' onMousedown='this.style.border=\"1px inset buttonhighlight\"' onMouseout='this.style.border=\"0px none buttonface\"' onMouseup='this.style.border=\"0px none buttonface\"'onFocus='this.blur()'>编辑</button>"
				+ "<button class='editMode' id='editMode' onClick='setMode(1);' title='编辑模式:源代码' onMouseover='this.style.border=\"1px outset buttonhighlight\"' onMousedown='this.style.border=\"1px inset buttonhighlight\"' onMouseout='this.style.border=\"0px none buttonface\"' onMouseup='this.style.border=\"0px none buttonface\"'onFocus='this.blur()'>代码</button>"
				+ "<button class='editMode' id='editMode' onClick='setMode(2);' title='编辑模式:预览' onMouseover='this.style.border=\"1px outset buttonhighlight\"' onMousedown='this.style.border=\"1px inset buttonhighlight\"' onMouseout='this.style.border=\"0px none buttonface\"' onMouseup='this.style.border=\"0px none buttonface\"'onFocus='this.blur()'>预览</button>"
				+ "<button class='editMode' id='editMode' onClick='preView();' title='从新窗口中预览' onMouseover='this.style.border=\"1px outset buttonhighlight\"' onMousedown='this.style.border=\"1px inset buttonhighlight\"' onMouseout='this.style.border=\"0px none buttonface\"' onMouseup='this.style.border=\"0px none buttonface\"'onFocus='this.blur()'>打开</button>"
				+ "<button class='editMode' id='editMode' onClick='showModalDialog(\"editHelp.htm\", \"\", \"dialogWidth:21em; dialogHeight:13em; help: no; scroll: no; status: no\");' title='查看帮助' onMouseover='this.style.border=\"1px outset buttonhighlight\"' onMousedown='this.style.border=\"1px inset buttonhighlight\"' onMouseout='this.style.border=\"0px none buttonface\"' onMouseup='this.style.border=\"0px none buttonface\"'onFocus='this.blur()'>帮助</button>"
				+ "<button class='editMode' id='editMode' onClick='contDiv.style.height=divHeight+=200;' title='增加编辑器大小' onMouseover='this.style.border=\"1pxā????眨???????忠??????? outset buttonhighlight\"' onMousedown='this.style.border=\"1px inset buttonhighlight\"' onMouseout='this.style.border=\"0px none buttonface\"' onMouseup='this.style.border=\"0px none buttonface\"'onFocus='this.blur()'>↓</button>"
				+ "<button class='editMode' id='editMode' onClick='if(divHeight>300){contDiv.style.height=divHeight-=200;};' title='减小编辑器大小' onMouseover='this.style.border=\"1px outset buttonhighlight\"' onMousedown='this.style.border=\"1px inset buttonhighlight\"' onMouseout='this.style.border=\"0px none buttonface\"' onMouseup='this.style.border=\"0px none buttonface\"'onFocus='this.blur()'>↑</button>"
				+ "<button class='editMode' id='editMode' onClick='this.value=writeType(this.value);' title='输入模式' onMouseover='this.style.border=\"1px outset buttonhighlight\"' onMousedown='this.style.border=\"1px inset buttonhighlight\"' onMouseout='this.style.border=\"0px none buttonface\"' onMouseup='this.style.border=\"0px none buttonface\"'onFocus='this.blur()'>插入</button>"
				+ "</div>");
		}else{
			document.write("<div id='Menu'>"
				+ "<button class='editMode' id='editMode' onClick='preViewB(this.form.content.value);' title='从新窗口中预览' onMouseover='this.style.border=\"1px outset buttonhighlight\"' onMousedown='this.style.border=\"1px inset buttonhighlight\"' onMouseout='this.style.border=\"0px none buttonface\"' onMouseup='this.style.border=\"0px none buttonface\"'onFocus='this.blur()'>打开</button>"
				+ "<button class='editMode' id='editMode' onClick='this.form.content.rows+=5;' title='增加编辑器大小' onMouseover='this.style.border=\"1px outset buttonhighlight\"' onMousedown='this.style.border=\"1px inset buttonhighlight\"' onMouseout='this.style.border=\"0px none buttonface\"' onMouseup='this.style.border=\"0px none buttonface\"'onFocus='this.blur()'>↓</button>"
				+ "<button class='editMode' id='editMode' onClick='if(this.form.content.rows>15){this.form.content.rows-=5;};' title='减小编辑器大小' onMouseover='this.style.border=\"1px outset buttonhighlight\"' onMousedown='this.style.border=\"1px inset buttonhighlight\"' onMouseout='this.style.border=\"0px none buttonface\"' onMouseup='this.style.border=\"0px none buttonface\"'onFocus='this.blur()'>↑</button>"
				+ "请升级您的IE版本,IE 6.0以上版本才能使用HTML编辑器!</div>");
		}
		document.write("<div id='Menu'><span class='leftInfo'>指定代表图片:</span>"
			+ "<input name='topPic' type='text' id='topPic' size='30' maxlength='250'>"
			+ "<select name='picList' id='picList' onChange='topPic.value=this.value;'>"
			+ "<option selected>不指定代表图片</option>"
			+ "</select>"
			+ "</div>");
		document.write("<div id='Menu'><span class='leftInfo'>直接下载文件:</span>"
			+ "<input name='titlePic' type='text' id='titlePic' size='30' maxlength='250'>"
			+ "<select name='titlePicList' id='titlePicList' onChange='titlePic.value=this.value;'>"
			+ "<option selected>不指定下载链接</option>"
			+ "</select>"
			+ "</div>");
	}

	function ubb(cmd, theAct){
		document.edit.content.focus();
		if(cmd == 0){
			fontBegin = "[" + theAct + "]";
			fontEnd = "[/" + theAct + "]";
		}else{
			fontBegin = "[" + cmd + "=" + theAct + "]";
			fontEnd = "[/" + cmd + "]";
		}
		if ((document.selection) && (document.selection.type == "Text")) {
			var range = document.selection.createRange();
			var theText = range.text;
			range.text = fontBegin + theText + fontEnd;
		}
	}

	function doIt(theAct){
		if(myMode != 0) return;
		contDiv.focus();
		contDiv.document.execCommand(theAct, true);
	}

	function selectDoIt(theAct, what){
		if(myMode != 0) return;
		contDiv.focus();
		contDiv.document.execCommand(theAct, true, what);
	}

	function doAdd(me){
		if(myMode != 0) return;
		contDiv.focus();
		var range = contDiv.document.selection.createRange();
		range.pasteHTML(me);
	}

	function doTime(){
		var d = new Date();
		return d.getYear()+"年"+(d.getMonth() + 1)+"月"+d.getDate() +"日  " + d.getHours() +":"+d.getMinutes()+":"+d.getSeconds();
	}

	function preView(){
		var theCont
		win = window.open("about:blank", "", "resizable=yes,scrollbars=yes");
		if(myMode == 0 || myMode == 2)theCont = contDiv.innerHTML;
		if(myMode == 1)theCont = contDiv.innerText;
		win.document.write("<title>iYork'EasyNews 预览</title><link rel=\"stylesheet\" type=\"text/css\" href=\"images/css.css\"><body>" + theCont + "</body>");
	}
	function preViewB(theCont){
		win = window.open("about:blank", "", "resizable=yes,scrollbars=yes");
		win.document.write("<title>iYork'EasyNews 预览</title><link rel=\"stylesheet\" type=\"text/css\" href=\"images/css.css\"><body>" + theCont + "</body>");
	}

	function setMode(myId){
		if(myMode == 0 || myMode == 2)theHtml = contDiv.innerHTML.replace(HTTPURL, "");
		if(myMode == 1)theHtml = contDiv.innerText.replace(HTTPURL, "");
		if(myId == 1){
			contDiv.innerText = theHtml;
		}else{
			contDiv.innerHTML = theHtml;
		}
		myMode = myId;
		contDiv.className = "div" + myId;
		if(myId == 2){
			contDiv.contentEditable = false;
		}else{
			contDiv.contentEditable = true;
		}
	}

	function writeType(me){
		if(myMode != 0) return me;
		doIt("OverWrite");
		if(me == "插入"){
			return "修改";
		}else{
			return "插入";
		}
	}
/*
	eval(oldM).disabled = false;
	eval(m).disabled = true; 
*/
	function startIt(initHtml, initPic, initTitlePic){
		if(isIE6() == true && initHtml != true){
			contDiv.innerHTML = initHtml.replace(HTTPURL, "");
			contDiv.style.height = divHeight;
			contDiv.document.execCommand("LiveResize");
		}
		if(initPic != ""){
			edit.topPic.value = initPic;
			edit.picList.options[edit.picList.length] = new Option(initPic,initPic);
			edit.picList.selectedIndex += 1;
		}
		if(initTitlePic != ""){
			edit.titlePic.value = initTitlePic;
			edit.titlePicList.options[edit.titlePicList.length] = new Option(initTitlePic,initTitlePic);
			edit.titlePicList.selectedIndex += 1;
		}
	}

	function showColor(what){
		if(myMode != 0) return;
		contDiv.focus();
		var range = contDiv.document.selection.createRange();
		var str = showModalDialog("editSetColor.htm", "", "dialogWidth:18em; dialogHeight:15em; help: no; scroll: no; status: no");  
		if (str != null){
			selectDoIt(what, str);
		}
	}

	function isInt(){
		return ((event.keyCode >= 48) && (event.keyCode <= 57));
	}

	// 添加到顶图
	function injoItImage(){
		if(myMode != 0) return;
		contDiv.focus();
		var range = contDiv.document.selection.createRange();
		var str = showModalDialog("editInjoPic.htm", "", "dialogWidth:23em; dialogHeight:13em; help: no; scroll: no; status: no");
		if (str != null){
			var sss = str.split("$$");
			range.pasteHTML("" + sss[0] + "");
			AddItem(sss[1]);
		}
	}
	function AddItem(strFileName){
		var fileExt = strFileName.split(".")[strFileName.split(".").length - 1];
		if(fileExt == "jpg" || fileExt == "bmp" || fileExt == "gif"){
			edit.topPic.value = strFileName;
			edit.picList.options[edit.picList.length] = new Option(strFileName,strFileName);
			edit.picList.selectedIndex += 1;
			edit.titlePicList.options[edit.titlePicList.length] = new Option(strFileName,strFileName);
		}
	}
	function injoPicOk(){
		var picUrl = document.formPic.url.value;
		if(picUrl == "" || picUrl == "http://"){
			alert("请先输入图片地址,或者上传图片!");
			document.formPic.url.focus();
			return;
		}else{
			thePicStr = "<img style='cursor: hand;' onclick=\"window.open('" + document.formPic.url.value + "')\" src='";
			var fileExt = document.formPic.url.value.split(".")[document.formPic.url.value.split(".").length - 1];
			if(fileExt == "jpg" || fileExt == "bmp" || fileExt == "gif" || fileExt == "png"){
				thePicStr += document.formPic.url.value + "'";
				if(document.formPic.vspace.value != "")thePicStr += " vspace='" + document.formPic.vspace.value + "'";
				if(document.formPic.hspace.value != "")thePicStr += " hspace='" + document.formPic.hspace.value + "'";
				if(document.formPic.styleType.value != "")thePicStr += " style='" + document.formPic.styleType.value + "'";
				if(document.formPic.width.value != "" && document.formPic.width.value != "0")thePicStr += " width='" + document.formPic.width.value + "'";
				if(document.formPic.height.value != "" && document.formPic.height.value != "0")thePicStr += " height='" + document.formPic.height.value + "'";
				if(document.formPic.border.value != "")thePicStr += " border='" + document.formPic.border.value + "'";
				if(document.formPic.altText.value != "")thePicStr += " alt='" + document.formPic.altText.value + "'";
				if(document.formPic.alignType.value != "")thePicStr += " align='" + document.formPic.alignType.value + "'";
				thePicStr += " onload='if(this.width>550)this.width=550;'>";
			}else{
				thePicStr += "images/" + fileExt + ".gif' align='middle'><a href=\"" + document.formPic.url.value + "\">点这里下载附件</a>";
			}
			window.returnValue = thePicStr + "$$" + document.formPic.url.value;
			window.close();
		}
	}

	function injoItFlash(){
		if(myMode != 0) return;
		contDiv.focus();
		var range = contDiv.document.selection.createRange();
		var str = showModalDialog("editInjoFlash.htm", "", "dialogWidth:23em; dialogHeight:5em; help: no; scroll: no; status: no");  
		if (str != null){
			range.pasteHTML("" + str + "");
		}
	}
	function injoFlashOk(){
		var FlashUrl = document.formFlash.url.value;
		if(FlashUrl == "" || FlashUrl == "http://"){
			alert("请先输入Flash地址!");
			document.formFlash.url.focus();
			return false;
		}else{
			theFlashStr = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'"
			theFlashStr += " width="
			if(document.formFlash.width.value != ""){
				theFlashStr += "'" + document.formFlash.width.value + "'";
			}else{
				theFlashStr += "'500'";
			}
			theFlashStr += " height="
			if(document.formFlash.height.value != ""){
				theFlashStr += "'" + document.formFlash.height.value + "'";
			}else{
				theFlashStr += "'500'";
			}
			theFlashStr += "><param name=movie value=" + document.formFlash.url.value
			theFlashStr += "><param name=quality value=high><embed src='" + document.formFlash.url.value
			theFlashStr += "' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' "
			theFlashStr += " width="
			if(document.formFlash.width.value != ""){
				theFlashStr += "'" + document.formFlash.width.value + "'";
			}else{
				theFlashStr += "'500'";
			}
			theFlashStr += " height="
			if(document.formFlash.height.value != ""){
				theFlashStr += "'" + document.formFlash.height.value + "'";
			}else{
				theFlashStr += "'500'";
			}
			theFlashStr += "></embed></object>"
//			alert(theFlashStr);
			window.returnValue = theFlashStr;
			window.close();
		}
	}

	function injoItMp(){
		if(myMode != 0) return;
		contDiv.focus();
		var range = contDiv.document.selection.createRange();
		var str = showModalDialog("editInjoMp.htm", "", "dialogWidth:23em; dialogHeight:8em; help: no; scroll: no; status: no");  
		if (str != null){
			range.pasteHTML("" + str + "");
		}
	}
	function injoMpOk(){
		var mpUrl = document.formMp.url.value;
		if(mpUrl == "" || mpUrl == "http://"){
			alert("请先输入文件地址!");
			document.formMp.url.focus();
			return false;
		}else{
			theMpStr = "<embed src=" + document.formMp.url.value
			+ " width=" + document.formMp.width.value
			+ " height=" + document.formMp.height.value
			+ "></embed>"
			window.returnValue = theMpStr;
			window.close();
		}
	}

	function injoItIframe(){
		if(myMode != 0) return;
		contDiv.focus();
		var range = contDiv.document.selection.createRange();
		var str = showModalDialog("editInjoIframe.htm", "", "dialogWidth:23em; dialogHeight:9em; help: no; scroll: no; status: no");  
		if (str != null){
			range.pasteHTML("" + str + "");
		}
	}
	function injoIframeOk(){
		var iframeUrl = document.formIframe.url.value;
		if(iframeUrl == "" || iframeUrl == "http://"){
			alert("请先输入网页地址!");
			document.formIframe.url.focus();
			return false;
		}else{
			theIframeStr = "<iframe src='" + document.formIframe.url.value + "'"
			theIframeStr += " scrolling='" + document.formIframe.scrolling.value + "'"
			theIframeStr += " frameborder='" + document.formIframe.frameborder.value + "'"
			if(document.formIframe.marginwidth.value != ""){
				theIframeStr += " marginwidth='" + document.formIframe.marginwidth.value + "'";
			}
			if(document.formIframe.marginheight.value != ""){
				theIframeStr += " marginheight='" + document.formIframe.marginheight.value + "'";
			}
			if(document.formIframe.width.value != ""){
				theIframeStr += " width='" + document.formIframe.width.value + "'";
			}
			if(document.formIframe.height.value != ""){
				theIframeStr += " height='" + document.formIframe.height.value + "'";
			}
			theIframeStr += "></iframe>";
			window.returnValue = theIframeStr;
			window.close();
		}
	}

	function pasteWord(){
		if(myMode != 0) return;
		var editBody = contDiv;
		for(var intLoop = 0;intLoop < editBody.all.length;intLoop++){
			el = editBody.all[intLoop];
			el.removeAttribute("className","",0);
			el.removeAttribute("style","",0);
			el.removeAttribute("font","",0);
		}
		var html = contDiv.innerHTML;
		html = html.replace(/<o:p>&nbsp;<\/o:p>/g,"");
		html = html.replace(/o:/g,"");
		html = html.replace(/<font>/g, "");
		html = html.replace(/<FONT>/g, "");
		html = html.replace(/<span>/g, "");
		html = html.replace(/<SPAN>/g, "");
		html = html.replace(/<SPAN lang=EN-US>/g, "");
		html = html.replace(/<P>/g, "");
		html = html.replace(/<\/P>/g, "");
		html = html.replace(/<\/SPAN>/g, "");
		contDiv.innerHTML = html;
		doIt('selectall');
		doIt('RemoveFormat');
	}

	function submitIt(isHtml, me){
		if(isIE6() == true && isHtml == "true"){
			if(myMode == 1){
				theHtml = contDiv.innerText;
			}else{
				theHtml = contDiv.innerHTML;
			}
			me.content.value = theHtml;
		}
		if(me.content.value.length < 50 || me.content.value.length > 65536){
			alert("文章内容必须大于50bit,小于64KB!");
			return false;
		}
		if(me.authorName.value == ""){
			alert("作者不能为空!请返回添加.");
			me.authorName.focus();
			return false;
		}
		if(me.listId.value == 0 || me.listId.value == "" || me.listId.value == null){
			alert("外链,关闭,与非最小分类不能添加!");
			if(me.listId.value != null) me.listId.focus();
			return false;
		}
		if(me.articleTitle.value == ""){
			alert("标题不能为空!请返回添加.");
			me.articleTitle.focus();
			return false;
		}
		me.submit();
	}

	function turnPage(pageNo, pageSize, PageCount, RecordCount, thePageUrl){
		document.write(" 共 " + RecordCount + " 条, 每页 " + pageSize +" 条 第 " + pageNo + "/" + PageCount + " 页 ");
		if(pageNo > 1)document.write("<a href='" + thePageUrl + "pageNo=1'>首页</a> <a href='" + thePageUrl + "pageNo=" + eval(pageNo - 1) + "'>上一页</a>");
			else document.write("首页 上一页");
		if(pageNo < PageCount)document.write(" <a href='" + thePageUrl + "pageNo=" + eval(pageNo + 1) + "'>下一页</a> <a href='" + thePageUrl + "pageNo=" + PageCount + "'>尾页</a>");
			else document.write(" 下一页 尾页");
		if(PageCount > 1){
			document.write(" 转到:<select name=select size=1 onChange=\"javascript:window.location=(this.options[this.selectedIndex].value)\" style=\"COLOR: rgb(0,0,128);\">");
			for(var i = 1; i <= PageCount; i ++){
				document.write("<option value='" + thePageUrl + "pageNo=" + i + "'");
				if(i == pageNo)document.write(" selected");
				document.write(">第" + i + "页</option>");
			}
			document.write("</select>");
		}
	}

	function checkAllBox(obj, me){
		if(obj == null) return;
		for(var i = 0; i < obj.length; i++)
				obj[i].checked = me.checked;
	}

	function onkeyboard(){
		if((event.ctrlKey) && (event.keyCode)) injoItImage();
	}


	function ShowChildClass(o)
	{
		var obj = document.all("ChildClasses");
		obj.innerHTML = o.ChildList;
	}