function $liyu() { return document.getElementById ? document.getElementById(arguments[0]) : eval(arguments[0]); }
        var OverH, OverW, ChangeDesc, timexxx, ChangeH = 50, ChangeW = 50;
        function alert(_Desc) {
clearTimeout(timexxx);
            $liyu("Loading").innerHTML = "";
		var _Dw = 350, _Dh = 0;
            OverH = _Dh; OverW = _Dw; ChangeDesc = _Desc;
            $liyu("Loading").style.display = '';
            if (_Dw > _Dh) { ChangeH = Math.ceil((_Dh - 10) / ((_Dw - 10) / 50)) } else if (_Dw < _Dh) { ChangeW = Math.ceil((_Dw - 10) / ((_Dh - 10) / 50)) }
if (document.documentElement.scrollTop==0) {$liyu("Loading").style.top = document.body.scrollTop + (document.documentElement.clientHeight - 10) / 2 + "px";}else{$liyu("Loading").style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight - 10) / 2 + "px";}
//$liyu("Loading").style.top = document.body.scrollTop + (document.documentElement.clientHeight - Nh) / 2 + "px"	// document.documentElement.clientHeight
            $liyu("Loading").style.left = (document.documentElement.clientWidth - 10) / 2 + "px";
            OpenNow()
timexxx=window.setTimeout("Openxxx()", 2000);
        } 
		var Nw = 10, Nh = 10;
        function OpenNow() {
            if (Nw > OverW - ChangeW) ChangeW = 20;
            if (Nh > OverH - ChangeH) ChangeH = 20;
            Nw = Nw + ChangeW; Nh = Nh + ChangeH;
            if (OverW > Nw || OverH > Nh) {
                if (OverW > Nw) {
                    $liyu("Loading").style.width = Nw + "px";
                    $liyu("Loading").style.left =  (document.documentElement.clientWidth - Nw) / 2 + "px";
                }
                if (OverH > Nh) {
                    $liyu("Loading").style.height = Nh + "px";
if (document.documentElement.scrollTop==0) {$liyu("Loading").style.top = document.body.scrollTop + (document.documentElement.clientHeight - 10) / 2 + "px";}else{$liyu("Loading").style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight - 10) / 2 + "px";}
//$liyu("Loading").style.top = document.body.scrollTop + (document.documentElement.clientHeight - Nh) / 2 + "px"	// document.documentElement.clientHeight
                }
                window.setTimeout("OpenNow()", 10);
            } else {
                Nw = 10; Nh = 10; ChangeH = 50; ChangeW = 50;
                $liyu("Loading").innerHTML = ChangeDesc;
            }
        }
        function Openxxx() {
	$liyu("Loading").style.display = 'none';
        }

var Ajax_msg="获取失败";
var webdir="./";


//调用用户短信管理
function get_msg()
{
	$('#msg_num').html("");
	$('#msg_num').load("ajax.asp?a=get_msg_num&b="+Math.random()+""); 
}
//用户当前位置提交给服务器统计在线
function get_wz(wz)
{
	if (wz!='')
	{	$('#msg_num').load("ajax.asp?a=get_wz&wz="+wz+"&b="+Math.random()+"");}
}

//检测注册用户名问题
function get_checkReg(username,t1){
	$('#'+t1).html("正在检测用户名……");
	$.ajax({
	type: "get",
	cache:false,
	url: webdir+"ajax.asp?a=checkreg&un="+username+"&b="+Math.random()+"",
	timeout: 20000,
	error: function(){$('#'+t1).html(Ajax_msg);},
	success: function(t0){$('#'+t1).html(t0);}
	});
}
//后台调用追梦阳光动力官方网站最新头条
function Get_Notice(t0){
	var remoteUrl="http://8s88.net/info/index.asp?t="+t0+"";//远程调用URL
	jQuery.getScript(remoteUrl, function(){
	var boxInfoWrapper=jQuery('#announce');
	if (t0==1){boxInfoWrapper.html(getBoxHtml(nicedata));}else{boxInfoWrapper.html(getBoxlink(noticedata.url,noticedata.title))}
	});
}

function getBoxHtml(data)
{
	var t2="<dl>";
	for(var e in data) 
	{ 
		t2+="<dt>"+data[e]+"</dt>";
	}
	t2+="</dl>";
	return t2;
}
function getBoxlink(url,title){
return '<div><a href="'+url+'" target="_blank">'+title+'</a></div>';
}
//调用匿名发帖的ip归属地区
function showIpData(ip,spanid,t1){
	$.ajax({
	type: "get",
	cache:false,
	url: webdir+"ajax.asp?a=ipname&ip="+ip+"&t1="+t1+"",
	timeout: 20000,
	error: function(){$('#'+spanid).html(Ajax_msg);},
	success: function(t0){$('#'+spanid).html(t0);}
	});
}
//调用帖子的附件归属
function get_guishu(filename,t1){
	$('#'+t1).html("gsdfsdfds");
	$.ajax({
	type: "get",
	cache:false,
	url: webdir+"ajax.asp?a=guishu&fn="+filename+"&b="+Math.random()+"",
	timeout: 20000,
	error: function(){$('#'+t1).html(Ajax_msg);},
	success: function(t0){$('#'+t1).html(t0);}
	});
}
//调用发帖权限管理
function get_bqx(boardid,t1){
	$('#'+t1).html("正在获取……");
	$.ajax({
	type: "get",
	cache:false,
	url: webdir+"ajax.asp?a=bqx&bid="+boardid+"&b="+Math.random()+"",
	timeout: 20000,
	error: function(){$('#'+t1).html(Ajax_msg);},
	success: function(t0){$('#'+t1).html(t0);}
	});
}

function SetValue(ctrl,val)
{
	try
	{
		document.getElementById(ctrl).innerHTML = val;
	}
	catch(e)
	{
	}
}


function Get_Cookie(name) {     
   var start = document.cookie.indexOf(name+"=");    
   var len = start+name.length+1;    
   if ((!start) && (name != document.cookie.substring(0,name.length))) return null;    
   if (start == -1) return null;    
   var end = document.cookie.indexOf(";",len);    
   if (end == -1) end = document.cookie.length;    
   return unescape(document.cookie.substring(len,end));      
}     
     
function Set_Cookie(name,value,expires) {     
    expires = expires * 60*60*24*1000;    
    var today = new Date();    
    var expires_date = new Date( today.getTime() + (expires) );    
    var cookieString = name + "=" +escape(value) +    
       ( (expires) ? ";expires=" + expires_date.toGMTString() : "") +";path=/";    
    document.cookie = cookieString;    
}   

function postCheck(formct){
	if (formct.BoardId.value=='' ){
		alert('分类不能为空.');
		formct.BoardId.focus();
		return false; 
	}
	if (formct.title.value=='' ){
		alert('标题不能为空,请填写.');
		formct.title.focus();
		return false; 
	}
	if (editor.getSource()=='' ){
		alert('内容不能为空,请填写.');
		return false; 
	}
	if (formct.zd_code.value=='' ){
		alert('验证码不能为空,请填写.');
		formct.zd_code.focus();
		return false; 
	}
	formct.Submit.disabled=true;
	return true;
}

function reCheck(formct){
	if (editor.getSource()=='' ){
		alert('回复内容不能为空,请填写.');
		return false; 
	}
	if (formct.zd_code.value=='' ){
		alert('验证码不能为空,请填写.');
		formct.zd_code.focus();
		return false; 
	}
	formct.Submit.disabled=true;
	return true;
}


//快捷的删除确认程序
function delete_confirm(e) {
 if (event.srcElement.outerText=="删除")
  event.returnValue=confirm("您确认执行该操作么？不可恢复!");
 }
document.onclick=delete_confirm;

//定义一个运行代码的函数，
function runCode(o)
{
    ie = (document.all)? true:false
    if (ie)
    {
        var code=o.innerText;//即要运行的代码。
        var newwin=window.open('','','');  //打开一个窗口并赋给变量newwin。
        newwin.opener = null // 防止代码对论谈页面修改
        newwin.document.write(code);  //向这个打开的窗口中写入代码code，这样就实现了运行代码功能。
        newwin.document.close();
    }
}
//ff下ctrl+Enter提交贴子
function ctlent (eventobject) { 
   var evt = window.event ? window.event : eventobject; 
   if (evt.ctrlKey && evt.keyCode == 13) {  
      document.getElementById('save').submit(); 
   } 
} 
//发贴内容缓存
function CopyText(obj) {
	ie = (document.all)? true:false
	if (ie){
		var rng = document.body.createTextRange();
		rng.moveToElementText(obj);
		rng.scrollIntoView();
		rng.select();
		rng.execCommand("Copy");
		rng.collapse(false);
	}
}


function CheckAll(form1)  {
  for (var i=0;i<form1.elements.length;i++)    {
    var e = form1.elements[i];
    if (e.name != 'chkall')       e.checked = form1.chkall.checked; 
   }
  }

function socheck(formct){
	if (formct.Keys.value=='' ){
		alert('关键词不能为空！');
		formct.Keys.focus();
		return false; 
	}
	formct.Submit.disabled=true;
	return true;
}

function tnavblock(){
	document.getElementById("tbn1").className = "tbn1s";
	document.getElementById("tbbox").style.display = "block";
	}

function tnavhidden(){
	document.getElementById("tbn1").className = "tbn1";
	document.getElementById("tbbox").style.display = "none";
	}