﻿var nEdi=0
var Modifyid=0;
function $(id){return document.getElementById(id);}

function init(){

}

String.prototype.replaceAll = function(fnd, rep){
    return this.split(fnd).join(rep);
}
String.prototype.trim = function() {
    return this.replace(/(^\s*)|(\s*$)/g, "");
}


String.prototype.UrlEncode = function() {
    return encodeURIComponent(this);
}

var ddid = "DivDropdown";
var tmrDD;
var LA = [];
LA[0] = [
 ['产品介绍', '下载试用', '有口皆碑', '如何购买', '代理合作', '帮助中心', '改进建议', 'Bug提交','更新日志'],
 ['/product.html', '/download.html', '/reputation.html', '/howtobuy.html', '/agent.html', '/D4/index.html', '/sgst/list.html', '/bug/list.html','/changelog.html']
];
LA[1] = [
 ['成功案例', '会计知识','资格考试', '行业方案', '政策法规', '最新动态'],
 [ '/succeed.html', '/doc/201/list.html','/doc/203/list.html','/bizsln.html','/doc/206/list.html','/whatisnew.html']
];
LA[2] = [
 ['发表','编辑','删除','刷新','Ｏ４'],
 ['#" onclick="newDoc();"', '#" onclick="modiDoc();"', '#" onclick="delDoc();"', '#" onclick="reflashALL();"', '/apps/o4/']
];

//文章分类
var BX = [
  ['0', '1', '2', '3', '4'], //大分类的代码
  ['已归档', '核心网页', '财务资讯', '文档中心', '论坛社区'], //大类的名称
  [
    [['0'], ['已归档']],
    [['101', '102', '103', '104', '105', '106', '107', '199'], ['产品介绍', '下载中心', '有口皆碑', '如何购买', '代理合作', '成功案例', '行业方案', '其他']],
    [['201', '202', '203', '204', '205', '206'], ['财务资讯', '财会实务', '资格考试', '财会人生', '会计软件', '政策法规']],
    [['3'], ['----']],
    [['41', '42', '43', '44', '45', '46', '47'], ['4Fang产品', '其他品牌软件', '资格考试', '行业会计', '会计实务', '代理合作', '休闲娱乐']]
  ]
];

var B3 = {
'41': [['411', '412', '413', '414', '415', '416'], ['安装版(海量版、全财版...)系列', '在线版/U盘版/全托版/集团版系列', '新安装版(橙色)系列', '网站及服务方面', '4Fang其他产品','软件及模板共享下载']],
'42': [['421', '422', '423', '424', '425', '426', '427'], ['用友软件', '金蝶软件', '管家婆软件', '速达软件', '微软Office', '杀毒软件','SaaS及其他软件']],
'43':[['431','432','433','434','435','436'],['会计电算化','会计从业考试','会计初级考试','会计中级考试','会计高级考试','注册会计考试']],
'47':[['471','472','473','474','475','476'],['休闲灌水','音乐共享','影视欣赏','娱乐前线','健康生活','经典笑话']]
}

function dropdown(i) {
    clearTimeout(tmrDD);
    var dv =$(ddid)
    if (!dv) {
        dv = document.createElement("DIV");
        dv.id = ddid;
        document.body.appendChild(dv);
        dv.onmousemove = function(ev){clearTimeout(tmrDD);}
        dv.onmouseout =function(ev){closeup();};
    }
    var e = $('li' + i);
    try { e.childNodes[0].title = ''; } catch (ex) { }
    dv.style.left = (getLeft(e) + 3) + 'px';
    dv.style.top = (getTop(e) + e.offsetHeight) + 'px';
    dv.innerHTML = '';
    var A=LA[i][0];
    var B=LA[i][1];
    for (var j = 0; j < A.length; j++) {
        dv.innerHTML = dv.innerHTML + '<a href="' + B[j] + '">' + A[j] + '</a><br/>';
    }    
    dv.style.display = "";
}



function closeup(f){
    if(!f){
      tmrDD=setTimeout("closeup(true);", 500);
      return;
    }
    $(ddid).style.display='none';  
}

function getTop(e){ 
  var t=e.offsetTop; 
  if(e.offsetParent!=null) t+=getTop(e.offsetParent); 
  return t; 
} 

function getLeft(e){
 var l = e.offsetLeft;
 if(e.offsetParent!=null) l+=getLeft(e.offsetParent); 
 return l; 
}

var hLogin;
function login(qs) {
    if (!qs) qs = '';
  var s='<iframe style="width:100%;height:100%;" src="/apps/logon.aspx?'+qs+'"></iframe>';
  hLogin=$n(document.body).showbox(s,['600px','402px'],"WinLogin")	;
}

function hideLogin(isOK) {
    $n(document.body).hidebox(hLogin);
    if (isOK) {
        init__();
        eventLoginOK();
    }
    hLogin = null; 
}

function logoff() {
    $n.AJAX('/apps/logon.aspx?logoff=1&no-cache=' + Math.random(), null, function(x) { if (x){eval(x);init__();}}, 0, true);
}

var hReg;
function reg() {
    var s = '<iframe style="width:100%;height:100%;" src="/apps/register.aspx"></iframe>';
    hReg = $n(document.body).showbox(s, ['966px', '450px'], "WinReg");
}

function hideReg() {
    $n(document.body).hidebox(hReg);
    hReg = null;
}

/*页面载入时，我们做一些公用的操作，例如判断用户是否已经登录等*/
if (window.addEventListener) {
    window.addEventListener("load", evonload, false);
} else {
    window.attachEvent("onload", evonload);
}

function evonload() {
    init__();
    setATag();
    showAF();
    setTimeout('HitCount();',3000)
}

function HitCount() {
  try{
    if (!PINFO.ID) return;
    $n.AJAX("/apps/C4/aspx/HitCount.aspx?ID=" + PINFO.ID, null, function(x) {}, 0, true);
  }catch(ex){}
}

//显示所有附件
function showAF() {
    if (!window.PINFO) return;
    if (!PINFO.A) return;
    for (x in PINFO.A) {
        if (x == "T" || x.split('$')[0] == 'R') {
            if (PINFO.A[x].trim() != '') {
                var e;
                if (x == "T") {
                    e = $('editpart');
                    if (!e) e = $('content');
                } else {
                    e = $(x);
                }
                var s = '';
                if (!e) return;
                var a = PINFO.A[x].split('|');
                for (var i = 0; i < a.length; i++) {
                    if (a[i] != '') {
                        var f = a[i].split('#');
                        var aid;
                        if (x == "T") {
                            aid = 'TID=' + PINFO.ID;
                        } else {
                        aid = 'RID=' + x.split('$')[1];
                        }
                        s = s + '<li><a target="_blank" href="/apps/C4/GetAttachFile.aspx?' +aid+ '&f=' + f[0] + '&U=' + PINFO.URL.UrlEncode() + '"><img src="/template/v2011/fileico/' + f[0].split(".")[1] + '.gif"/>附件:' + f[0] + '( 已下载<span class="downtimes">' + f[1] + '</span>次)</a></li>'
                    }
                }
                if (s != '') s = '<ul class="attfile">' + s + '</ul>';
                e.insertAdjacentHTML("BeforeEnd", s);
            }
        }
    }
}

//重新设置A标签的Link,因为是静态网页，所以必须在静态网页后面加?no-cache=Math.....
function setATag() {
    var A = document.getElementsByTagName("A");
    for (var i = 0; i < A.length; i++) {
        if (A[i].href.substring(A[i].href.lastIndexOf('.')).toLowerCase() == '.html') {
            A[i].href = A[i].href + '?no-cache=' + Math.random();
        }
        //javascript:开头的target要改为_self
        if (A[i].href.substring(0, 11) == 'javascript:') {
            A[i].target = '_self';
        }
    }  
}

var U4;
var tmrKOL = null;
function init__() {
    U4 = null;
    var s = document.cookie.split('U4INFO=')[1];
    if (s) {
        s = s.split(";")[0];
        s = decodeURIComponent(s);
        U4 = s.split('|');
    }
    if (!tmrKOL) tmrKOL = window.setInterval(keepOnline, 120000);
    P4U();
}


//其他页面可以重载这个函数来处理登录成功后要做的事情
function eventLoginOK() { 

}

//根据不同的用户信息设置页面的功能按钮等
var L4;
function P4U() {
    try {
        if (!L4) L4 = $('toprighttel').innerHTML;
        if (!U4) {
            $('toprighttel').innerHTML = L4;
        } else {
            var u = U4[1];
            if (u == '') u = U4[0];
            var m = ' | <a href="/apps/o4/">订 购</a>'

            if (U4[2] == '1') {
                m = ' | <a href="###" id="li2" onmouseover="dropdown(2);" onmouseout="closeup();">管 理</a>'
            }
            $('toprighttel').innerHTML = '<a href="###">' + u + '</a>' + m + ' | <a href="###" onclick="logoff();">退 出</a>';
        }
    } catch (ex) { }  
}

function keepOnline(){
   //用AJAX保持用户在线,每隔2分钟
    $n.AJAX('/apps/C4/keeponline.aspx?no-cache=' + Math.random(), null, function(x) { if (!x) { U4 = null; P4U(); } else { init__(); } }, 0, true);
}

function dockd(e) {
  if((e.which || e.keyCode)==13){
     document.getElementById('bgo').click();  }
}

// JavaScript Document
var N_Aj=new Array();
var $n=function(n){return $n.fn.init(n)};
$n.userAgent=navigator.userAgent.toLowerCase(); 
$n.browser={
   version:($n.userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ )||[])[1],
   safari:/webkit/.test($n.userAgent),
   opera:/opera/.test($n.userAgent),
   msie:/msie/.test($n.userAgent)&&!/opera/.test($n.userAgent),
   mozilla:/mozilla/.test($n.userAgent)&&!/(compatible|webkit)/.test($n.userAgent)
}
$n.IE=$n.browser.msie;
$n.isOO=function(o){return typeof(o)=='object'}
$n.isV=function(o){return ($n(o).style.visibility=='hidden'||$n(o).style.display=='none')?false:true;}
$n.Bgx=function(o,x){$n.IE?o.style.backgroundPositionX=x:o.style.backgroundPosition=x+"px 0px"}
$n.Bgy=function(o,y){$n.IE?o.style.backgroundPositionY=y:o.style.backgroundPosition="0px "+y+"px"}
$n.cwh=function(){var doc=window.document.documentElement;return [doc.clientWidth,doc.clientHeight];}
$n.w=function(o,w){o.style.width=w+'px';}
$n.h=function(o,h){o.style.height=h+'px';}
$n.v=function(o){return $n(o).value};
$n.Show=function(o,a,b){if(!$n.isOO(o))o=$n(o);if(b){a?o.style.display='block':o.style.display='none';}else{a?o.style.visibility='visible':o.style.visibility='hidden';}}
$n.Hide=function(o,a){if(!$n.isOO(o))o=$n(o).style;if(a){o.width='auto';o.height='auto';o.overflow='auto';}else{o.width='1px';o.height='1px';o.overflow='hidden';}}
$n.CreateAjax=function(){if(window.XMLHttpRequest){return new XMLHttpRequest();}else if(window.ActiveXObject){try{return new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(e){alert("Sorry,你的机子缺少AJAX组件。");return false;}}}}
$n.AJAX=function(U,C,F,P,T){
//U 地址，C命令数据，F回调函数，P GET或POST，1为POST, T是否异步
if(typeof(P)!='string'){if(P){P='POST'}else{P='GET'}}
var ix=0;
for(var i=0;i<=N_Aj.length;i++){if(!N_Aj[i]){ix=i;break}ix=i+1;}
 N_Aj[ix]=$n.CreateAjax();
 if(N_Aj[ix]){
	if(T){N_Aj[ix].onreadystatechange=function(){
	   if(N_Aj[ix].readyState==4){if(N_Aj[ix].status==200){F(N_Aj[ix].responseText);N_Aj[ix]=null}else{F(false);N_Aj[ix]=null}}} 
	}
	N_Aj[ix].open(P,U,T);
	if(C)N_Aj[ix].setRequestHeader("Content-Length",C.length);
	N_Aj[ix].setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");
	N_Aj[ix].send(C); 
	if(!T){
		if(N_Aj[ix].readyState==4){
			//if(N_Aj[ix].status==200){
			F(N_Aj[ix].responseText);
			}else{F(false);}
	   // }
	}
}}
$n.SetHtml=function(U,C,o,p,T){
$n.o=o;$n.AJAX(U,C,function(v){try{$n.o.innerHTML=v}catch(e){}},p,T)}
$n.findtree=function (e,f){
       if(e.childNodes.length==0)return;
       for(var i=0;i<e.childNodes.length;i++){
        f(e.childNodes[i])
		$n.findtree(e.childNodes[i],f)
	}}

$n.arrycmp=function(a,b){
	if(a.constructor==b.constructor==Array){
		for(var i=0;i<a.length;i++){
			for(var j=0;j<b.length;j++){
			     if(a[i]==b[j])return true	
				}
			}
		}
	else if(a.constructor==Array){
		for(var i=0;i<a.length;i++){
			if(a[i]==b)return true
			}
		}
	else if(b.constructor==Array){
		for(var i=0;i<b.length;i++){
			if(a==b[i])return true
			}
	}
	else{if(a===b)return true}
	return false
}
$n.fn = $n.prototype = {
    $: function(n) { return document.getElementById(n) },
    each: function(f) {
        if (this[0]) {
            for (var i = 0; i < this[0].length; i++) {
                f(this[0][i], i)
            }
        }
    },
    init: function(s) {
        s = s || document;
        if (s.nodeType) { this[0] = s; return this }
        if (typeof s === "object") { var e; if (window.event) { e = event.srcElement || event.target; } else { e = this } this[0] = e; return this }
        var ary = s.split(' ');
        if (ary.length == 1) {
            this[0] = document.getElementById(s);
        } else {
            var o = document.getElementById(ary[0]);
            for (var i = 1; i < ary.length; i++) {
                if (o) o = o.getElementsByTagName(ary[i])
            }
            this[0] = o;
        }
        return this
    },
    hide: function() {
        this[0].style.display = 'none';
    },
    show: function() {
        this[0].style.display = 'block';
    },
    elee: function(f) {
        if (this[0]) {
            for (var i = 0; i < this[0].length; i++) {
                var e = this[0][i];
                for (a in f) {
                    if (e.addEventListener)
                        e.addEventListener(a, f[a], false);
                    else if (e.attachEvent)
                        e.attachEvent("on" + a, f[a]);
                }
            }
        }
    },
    hover: function(a, b, c) {
        if (this[0]) {
            for (var i = 0; i < this[0].length; i++) {
                var e = this[0][i];
                e.tag = i;
                e.onmouseover = a;
                e.onmouseout = b;
                if (c) e.onclick = c;
            }
        }
    },
    elm: function(i) { return i != null ? this[0][i] : this[0]; },
    elms: function(i) { return this[0].getElementsByTagName(i) },
    csstext: function(a) {
        this[0].style.cssText = a;
    },
    cssname: function(a) {
        if (this[0][0]) {
            for (var i = 0; i < this[0].length; i++) {
                this[0][i].className = a;
            }
        } else {
            this[0].className = a;
        }
    },
    addclass: function(a) {
        c = this[0].className
        if (c) { this[0].className = c + " " + a; } else { this[0].className = a }
    },
    delclass: function(a) {
        c = this[0].className;
        if (c) { this[0].className = c.replace(new RegExp(a, "g")).trim() }
    },
    getxy: function(o) {
        if (!o) o = this[0];
        var a = o.offsetLeft;
        var b = o.offsetTop;
        var c = o.offsetParent;
        try {
            while (c.tagName != "BODY") { a += c.offsetLeft; b += c.offsetTop; c = c.offsetParent; }
        } catch (e) { } return ([a, b]);
    },
    setxy: function(x, y) {
        if (x.constructor == Array) {
            this[0].style.left = x[0] + 'px';
            this[0].style.top = x[1] + 'px';
        } else {
            this[0].style.left = x + 'px';
            this[0].style.top = y + 'px';
        }
    },
    w: function() { return this[0].offsetWidth; },
    h: function() { return this[0].offsetHeight; },
    getstyle: function(v) {//取当前某一样式值
        if ($n.browser.msie) {
            if (this[0].style[v]) { return this[0].style[v] } else
                return this[0].currentStyle[v];
        } else {
            return window.getComputedStyle(this[0], null)[v];
        }
    },
    setstyle: function(a, v) {
        if ($n.browser.msie) {
            if (this[0].style[v]) { this[0].style[a] = v } else
                this[0].currentStyle[a] = v;
        } else {
            window.getComputedStyle(this[0], null)[v] = a;
        }
    },
    hoverb: function(c, d, h) {
        //c为类或id,d为排除的类,h为新样式
        //d,h可选，只用c时，为背景左右分半显示
        //鼠标特效
        if (c.indexOf('.') != -1) {
            //css类
            if (!d) d = "";
            c = c.replace(/\./g, '');
            d = d.replace(/\./g, '').split(/\s+/)
            var a = c.split(/\s+/)
            $n.findtree(this[0],
			function(e) {
			    var elm = new Array()
			    var s = e.className;
			    if (s == null) s = ""
			    var b = s.split(/\s+/)
			    if ($n.arrycmp(a, b) && !$n.arrycmp(a, d)) {
			        (e.tagName && e.tagName.toUpperCase() == "UL") ?
				   elm = e.getElementsByTagName("li") : elm[0] = e;
			        for (var i = 0; i < elm.length; i++) {
			            s = elm[i].className;
			            if (s == null) s = ""
			            var t = s.split(/\s+/)
			            if (!$n.arrycmp(d, t)) {
			                elm[i].onmouseover = function() {
			                    if (h) { $n(this).addclass(h); } else {
			                        var x = this.offsetWidth.toString().replace('px');
			                        $n.Bgx(this, 0 - x)
			                    }
			                };
			                elm[i].onmouseout = function() {
			                    if (h) { $n(this).delclass(h) } else
			                    { $n.Bgx(this, 0) }
			                    //elm[i].onmousedown=function(){this};
			                };
			            }
			        }
			    }
			})
        } else {
            //id

        }
    },
    showboxer: function(a, wh, c, b, t) {
        var p = this[0];
        var f = this.hidebox;
        var hWnd = this.showbox(a, wh, c, b)
        window.setTimeout(function() { this[0] = p; f(hWnd) }, t);
    },
    showbox: function(a, wh, c, b) {
        var bg = document.createElement("DIV");
        var v = document.createElement("DIV");
        this[0].appendChild(v);
        this[0].appendChild(bg);
        v.innerHTML = a;
        $n(v).csstext("position:absolute;z-index:101;");
        if (b) bg.className = b;
        else
            $n(bg).csstext("z-index:100;position:absolute;left:0px;top:0px;opacity:0.6;-moz-opacity:0.6;filter:alpha(opacity=60);background-color:#000")
        if (c) v.className = c;
        if (wh) { v.style.width = wh[0]; v.style.height = wh[1] }
        var doc = window.document.documentElement; //没DOCTYPE声明的用document.body;
        var h = document.documentElement.scrollTop;
        var h1 = doc.clientHeight;
        var w1 = doc.clientWidth;
        var kw = parseInt(wh[0]);
        var kh = parseInt(wh[1]);
        if (isNaN(kw)) kw = $n(v).w();
        if (isNaN(kh)) kh = $n(v).h();
        v.style.left = (w1 - kw) / 2 + "px";
        v.style.top = (h1 - kh) / 2 + h + "px";
        $n.w(bg, doc.scrollWidth);
        $n.h(bg, doc.scrollHeight);
        bg.style.displaay = 'block';
        v.style.display = 'block';
        return [v, bg];
    },
    hidebox: function(v) {
        var f = new $n(this).GyLight;
        var f1 = new $n(this).GyLight;
        f(v[0], 1);
        f1(v[1], 1);
        eval('try{ winresize();}catch(ex){}');
        //this[0].removeChild(v[0])
        //this[0].removeChild(v[1])
    },
    GyLight: function(a, k) {
        var L = parseFloat($n(a).getstyle("opacity"))
        if (isNaN(L)) { L = 1; $n(a).addclass("nnde_filter") }
        L *= 100;
        Ap(L)
        function Ap(L) {
            L -= 10;
            $n(a).Alpha(L);
            if (L <= 0) { if (k) { a.parentNode.removeChild(a) } else { $n(a).csstext("display:none") } return }
            window.setTimeout(function() { Ap(L) }, 10);
        }
    },
    Alpha: function(i) {//IE要设filter才有效，本程序提供css类nnde_filter
        $n.browser.msie && $n.browser.version < 9 ? this[0].filters.Alpha.opacity = i : this[0].style.opacity = i / 100;
    },
    oddevencss: function(a, b, c) {
        var li = $n(this[0]).elms();
        for (var i = 0; i < li.length; i++) {
            if (i % 2) {
                if (b) $(this[0]).addclass(b)
            }
            else {
                if (c) $(this[0]).addclass(c)
            }
        }
    },
    value: function(v) { if (!this[0]) return; if (v) { this[0].value = v } else { return this[0].value } },
    text: function(v) {
        if (v) {
            $n.browser.msie ? this[0].innerText = v : this.textContent = v;
        }
        else {
            return $n.browser.msie ? this[0].innerText : this[0].textContent;
        }
    },
    html: function(v) { if (v) { this[0].innerHTML = v } else { return this[0].innerHTML } }
}

function GetPostF(f){
var s="";if(f){
var eb=f.elements;
var obj;
if(eb){
    for(var i=0; i<eb.length;i+=1){
	 obj=eb[i];
     if(obj.name!=undefined&&obj.name!=""){
      s+="&"+obj.name+"="+encodeURIComponent(obj.value);
  }
    }
   }else{
    alert("没有elements对象!");
    return ;
   }
}else{
   //alert("form不存在!");
   return ;
}
return s;
}
document.write("<style>.nnde_filter{filter:alpha(opacity=100)}</style>")
function DrawImage(ImgD,w,h){
var ig=new Image();ig.src=ImgD.src;if(ig.width>0 && ig.height>0){if(ig.width/ig.height>= w/h){if(ig.width>w){ImgD.width=w;ImgD.height=(ig.height*w)/ig.width;}else{ImgD.width=ig.width;ImgD.height=ig.height;}}else{if(ig.height>h){ImgD.height=h;ImgD.width=(ig.width*h)/ig.height;}else{ImgD.width=ig.width;ImgD.height=ig.height;}}}}

var hEdit;
function hideEdit() {
    $n(document.body).hidebox(hEdit);
    hEdit = null;
    
}

//发表
function newDoc() {
    var qs = '';
    try {
        if (PINFO.iX1) {
            qs = qs + '&r_dt=' + PINFO.iX1;
        }
        if (PINFO.BX==3) {
            qs = qs + '&pid=' + PINFO.ID;
        }
        if (PINFO.BX) {
            qs = qs + '&BX=' + PINFO.BX;
        }
        if (PINFO.HYMC) {
            qs = qs + '&HYMC=' + PINFO.HYMC.UrlEncode();
        }
    } catch (ex) { }
    showEdit(qs);
}

//修改
function modiDoc() {
    //还要判断作者是否本人
    try {
        if (U4) {
            if (U4[2] != '1') {
                if (U4[0].toLowerCase() != PINFO.Author.toLowerCase()) return;
            }
        } 
    var qs = '';
        if (PINFO.ID) {
            qs = qs + '&ID=' + PINFO.ID;
        } else {
            return;
        }
    } catch (ex) { }
    showEdit(qs);
}

function showEdit(qs, h) {
    if (!h) h = '620px';
    var s = '<iframe style="width:100%;height:100%;" src="/apps/C4/edit.aspx?ajax=1' + qs + '"></iframe>';
    hEdit = $n(document.body).showbox(s, ['965px', h], "WinEdit");
}

//回复
function reply() {
    try {if (!PINFO.ID) { return; }if (PINFO.iX5 < 1){alert("抱歉，本文被作者设置为不可回复和评论");return;}} catch (ex) {return;}
    var qs = '&isReply=1';
    qs = qs + '&ID=' + PINFO.ID;    
    showEdit(qs,'360px');
}

//关注
function addAttention(x) {
    try {
        if (!x) x = 0;
        if (!PINFO.ID) return;
        $n.AJAX("/apps/C4/Attention.aspx?id=" + PINFO.ID + "&x=" +x, null, function(x) { if (x) { try { eval(x) } catch (ex) { } } }, 0, true);
    }catch(ex){}
}

function delDoc() {
    if (!PINFO.ID) return;
    if (!confirm("确实要删除这篇文章吗？")) return;
    $n.AJAX("/apps/C4/delete.aspx?id=" + PINFO.ID + "&U=" + PINFO.URL.UrlEncode(), null, function(x) { if (x) { alert(x) } }, 0, true);
    
}

function reflashALL() {
    $n.AJAX("/apps/C4/reload.aspx?no-cache=" + Math.random(), null, function(x) { if (x) { alert(x) } }, 0, true);
}

window.onscroll = setTBar;
function setTBar() {
    var e = $('DV_TBAR');
    if (!e) return;
    var t = 0;
    if (document.documentElement && document.documentElement.scrollTop) {
        t = document.documentElement.scrollTop;
    } else {
        t = document.body.scrollTop;
    }
    e.style.top = ($n.cwh()[1] + t - e.offsetHeight) + 'px';
    e.style.left = ($n.cwh()[0] - e.offsetWidth)/2 + 'px';
}

//回复DIV上的鼠标移动事件，ClickReplyAdmin
var curRID;
function CRA(ev) {
    ev = ev || window.event;
    var e = ev.srcElement || ev.target;
    if (e.id == '') e = e.parentNode;
    if (e.id.substring(0, 2) != 'R$') return;
    curRID = e.id.split('$')[1];
    if (!U4) return;
    if (U4[2] != '1') return;
    var ee = $('DV_DEL_R');
    if (!ee) {
        ee = document.createElement('div');
        ee.id = 'DV_DEL_R';
        ee.onclick = delRpy;
        ee.innerHTML = '<img src="/images/v2011/Remove.png">';
        document.body.appendChild(ee);
    }
    ee.style.top = getTop(e) + 'px';
    ee.style.left = (getLeft(e) - ee.offsetWidth) + 'px';

}
function delRpy() {
    if (!confirm("确实要删除这篇回复吗？")) return;
    $n.AJAX("/apps/C4/delete.aspx?RID=" + curRID + "&U=" + PINFO.URL.UrlEncode(), null, function(x) { if (x) { alert(x); location.reload(); } }, 0, true);
}

function lnkchk(a) {
    if (!U4) {
        login();
        return;
    }
    window.open("/apps/C4/linkchk.aspx?a="+a) 
}
