var lang				= new Array();
window.onerror = function(){
return true;
}
function doKeyDown()
{
   if (event.ctrlKey && event.keyCode == 13) 
   {
      document.getElementById("AddBtn").click();
   }
}
function Return_Click()
{ 
   document.getElementById("returnlist").click();
}
function runCode(obj) {
        var winname = window.open('', "_blank", '');
        winname.document.open('text/html', 'replace');
	    winname.opener = null
        winname.document.write(obj.value);
        winname.document.close();
}
function saveCode(obj) {
        var winname = window.open('', '_blank', 'top=10000');
        winname.document.open('text/html', 'replace');
        winname.document.write(obj.value);
        winname.document.execCommand('saveas','','code.htm');
        winname.close();
}
function copycode(obj) {
	var rng = document.body.createTextRange();
	rng.moveToElementText(obj);
	rng.scrollIntoView();
	rng.select();
	rng.execCommand("Copy");
	rng.collapse(false);
}

function Anthem_Error(result) 
{
    alert('页面显示出现错误,请将此错误报告管理员Email:webmaster@aspxcn.cn,错误信息如下: ' + result.error);
}

var divTime;
//var timeout;
function Anthem_PreCallBack()
{
    //timeout = setTimeout('abortCallBack()',30000);
    divTime = setTimeout("document.getElementById('loading').style.visibility = 'visible'","1000")
    
}

function Anthem_PostCallBack() 
{ 
    //clearTimeout(timeout);
    clearTimeout(divTime);
	document.getElementById("loading").style.visibility="hidden";
}

function Anthem_CallBackCancelled() 
{
    clearTimeout(divTime);
	document.getElementById("loading").style.visibility="hidden";
}

function CancelAsyncPostBack() 
{
    Anthem_GetXMLHttpRequest().abort();
}

function popWinClear()
{
    return confirm('是否要清空您的内容?');
}

function popWinFav()
{
    return confirm('是否添加该主题到您的收藏夹?');
}

function popWinFav() 
{
    return confirm('是否添加该主题到您的收藏夹?');
}

function popWinEdit() 
{
    if(confirm('是否要编辑您发表的主题?'))
    {
    document.getElementById("postContent").focus();
    return true ;
    }
    else
    {
    return false;
    }
}

function popWinDel() 
{
    return confirm('是否要删除您发表的主题?');
}

function focusInput() 
{
    document.getElementById("postContent").focus();
}

function insertEmot(strCode)
{
	var txtarea = document.getElementById("postContent");
	if (txtarea.createTextRange && txtarea.caretPos) {
	var caretPos = txtarea.caretPos;
	caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? strCode + ' ' : strCode;
	txtarea.focus();
	} else {
	txtarea.value  += strCode;
	txtarea.focus();
　　}
}

function insertQuote() 
{
	var txtarea = document.getElementById("postContent");
	txtarea.value  += '[quote]'+document.getElementById("TopicContent").innerText.substr(0,100)+'[/quote]';
	txtarea.focus();
}

function insertReplyQuote(obj)
{
    var txtarea = document.getElementById("postContent");
    var rowid=obj.split("_");
	txtarea.value  += '[quote]'+document.getElementById("showReply_"+rowid[1]+"_TopicRelpy").innerText.substr(0,100)+'[/quote]';
	txtarea.focus();
}

function insertReplyTitle(obj)
{
    var txtarea = document.getElementById("userTitle");
    var rowid=obj.split("_");
	txtarea.value  = 'RE:'+document.getElementById("showReply_"+rowid[1]+"_TopicRelpyTitle").innerText;
	txtarea.focus();
}

function insertTitle() 
{
	var txtarea = document.getElementById("userTitle");
	txtarea.value  = 'RE:'+document.getElementById("showListTitle").innerText;
	txtarea.focus();
}

String.prototype.len=function()
{ 
return this.replace(/[^\x00-\xff]/g,"**").length; 
} 

function CheckNameLength(source, arguments) 
{
if (arguments.Value.len()<=12) 
arguments.IsValid = true; 
else 
arguments.IsValid = false; 
}

function CheckTitleLength(source, arguments) 
{ 
if (arguments.Value.len()<=70)
arguments.IsValid = true; 
else 
arguments.IsValid = false; 
}