
var copytoclip=1

function JM_cc(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
if (document.all&&copytoclip==1){
therange=tempval.createTextRange()
therange.execCommand("Copy")
window.status="内容已经复制到剪贴板！"
setTimeout("window.status=''",1800)
}
}

function runEx(theField) 
{
var tempval=eval("document."+theField)
if(tempval.value.length>0)
{
code=tempval.value;
  var newwin=window.open('','','');  //打开一个窗口并赋给变量newwin。
  newwin.opener = null // 防止代码对论谈页面修改
  newwin.document.write(code);  //向这个打开的窗口中写入代码code，这样就实现了运行代码功能。
  newwin.document.close();


}
else alert('没有可以预浏览的文本内容!')
}
function ck()
{

if (PostTopic2.username.value=='')
{alert('您总得有个名字吧^.^');PostTopic2.username.focus();return false;}
if (PostTopic2.email.value!=''){
if (check_mail(PostTopic2.email.value)==false)
{alert('Email输入不正确唉>_<~');PostTopic2.email.focus();return false;}
}

if (PostTopic2.Message.value=='')
{alert('您总得说什么再提交吧^.^');PostTopic2.Message.focus();return false;}
}
function check_mail(str)
{
var pattern = /^([\.a-zA-Z0-9_-]){3,}@([\.a-zA-Z0-9_-]){3,}(\.([a-zA-Z0-9]){2,4}){1,2}$/; 
return pattern.test(str);
}
					
function ignoreError() {
  return true;
}

window.onerror = ignoreError;
//-->