function shows(htmlurl)
{
var newwin=window.open(htmlurl,"_blank","scrollbars=yes,top=20,left=20,width=470,height=300");
newwin.focus();
return false;
}
function showb(htmlurl)
{
var newwin=window.open(htmlurl,"_blank","scrollbars=yes,top=10,left=10,width=530,height=360");
newwin.focus();
return false;
}
function showc(htmlurl)
{
var newwin=window.open(htmlurl,"_blank","scrollbars=yes,top=10,left=10,width=690,height=400");
newwin.focus();
return false;
}

var EFlag=1
function addcontent(str1,str2)
{
if(EFlag == 1)
{
topic.content.focus();
if ((document.selection)&&(document.selection.type== "Text"))
{
var range= document.selection.createRange();
var ch_text=range.text;
range.text= str1 + ch_text + str2;
} 
else
{
document.topic.content.value=document.topic.content.value+str1+str2;

}
}
else{document.topic.content.insertHTML2(str1+str2);return;}
}

function addrecontent(str1,str2)
{
if(EFlag == 1)
{
reply.content.focus();
if ((document.selection)&&(document.selection.type== "Text"))
{
var range= document.selection.createRange();
var ch_text=range.text;
range.text= str1 + ch_text + str2;
} 
else
{
document.reply.content.value=document.reply.content.value+str1+str2;
}
}
else{document.reply.content.insertHTML2(str1+str2);return;
}
}

function runCode() 
{
var code=event.srcElement.parentElement.children[0].value
newwin=window.open('','','') // 由于要用到setInterval，所以将newwin改为全局变量
newwin.opener = null // 防止代码对论谈页面修改
newwin.document.write(code)
focuswin = setInterval("try{newwin.document.body.focus();clearInterval(focuswin)}catch(e){}", 10) //激活新开窗口
newwin.document.close()
}
