function document.onreadystatechange()
{
idContent.document.designMode="On"
}
function cmdExec(cmd,opt)
{
if (isHTMLMode){alert("Please uncheck 'Edit HTML'");return;}
idContent.document.execCommand(cmd,"",opt);idContent.focus();
}
function setMode(bMode)
{
var sTmp;
isHTMLMode = bMode;
if (isHTMLMode){sTmp=idContent.document.body.innerHTML;idContent.document.body.innerText=sTmp;}
else {sTmp=idContent.document.body.innerText;idContent.document.body.innerHTML=sTmp;}
idContent.focus();
}
function createLink()
{
if (isHTMLMode){alert("Please uncheck 'Edit HTML'");return;}
cmdExec("CreateLink");
}
function insertImage()
{
idContent.focus();
document.frames.idContent.document.execCommand('InsertImage','xxx');
}
function doInsertTable(){
var dotable=showModalDialog("editor_table.htm",false,"dialogWidth:200px;dialogHeight:156px;status:0;");
if (dotable!=undefined){
document.frames.idContent.document.body.innerHTML=document.frames.idContent.document.body.innerHTML+dotable;
}else{
return false;
}
idContent.focus()
}
function Save()
{
if (isHTMLMode){alert("Please uncheck 'Edit HTML'");return;}
var sImgTag = idContent.document.body.all.tags("IMG");
var oImg;
for (var i = sImgTag.length - 1; i >= 0; i--)
{
oImg = sImgTag[i];
alert("Add your code to Upload local image file here. Image Inserted : " + oImg.src );
}
alert("Add your code to Save Document here");
alert("Your Document : " + idContent.document.body.innerHTML);
}
function subchk()
{
document.form1.content.value=idContent.document.body.innerHTML;
}
function doForeColor(){
var fcolor=showModalDialog("editor_color.htm",false,"dialogWidth:106px;dialogHeight:126px;status:0;");
document.frames.idContent.document.execCommand('ForeColor',false,fcolor);
idContent.focus();
}
function doBackColor(){
var bcolor=showModalDialog("editor_color.htm",false,"dialogWidth:106px;dialogHeight:126px;status:0;");
document.frames.idContent.document.execCommand('BackColor',false,bcolor);
idContent.focus();
}
function checkdata() {
if (document.form1.title.value=="") {
window.alert ("请输入标题 !")
form1.title.focus()
return false
}
if (document.form1.type.value=="") {
window.alert ("请选择所属大类!")
return false
}
if (document.form1.subtype.value=="") {
window.alert ("请选择所属子类 !")
return false
}
return true
}
function showInputFile(){
window.location="/ezhishimanagesystem/fuzhumanageadd.asp?num="+form1.numPic.options[form1.numPic.selectedIndex].value
}