(function(a){a.extend(a.fn,{getCss:function(c){var b=parseInt(this.css(c));
if(isNaN(b)){return false;
}return b;
}});
a.fn.resizable=function(c){var e;
var d=a.extend({handler:null,min:{width:0,height:0},max:{width:a(document).width(),height:a(document).height()},onResize:function(){},onStop:function(){}},c);
var b={resize:function(g){var f=g.data.resizeData;
f.target.css({width:Math.min(Math.max(g.pageX-f.offLeft+f.width,f.min.width),d.max.width),height:Math.min(Math.max(g.pageY-f.offTop+f.height,f.min.height),d.max.height)});
doane(g);
},stop:function(f){f.data.resizeData.onStop(f);
document.body.onselectstart=function(){return true;
};
f.data.resizeData.target.css("-moz-user-select","");
f.data.resizeData.target.parents(".arcarea").unbind("dblclick",b.stop);
a(document).unbind("mousemove",b.resize).unbind("mouseup",b.stop).unbind("click",b.stop);
doane(f);
a("#dragfloatbg").remove();
}};
return this.each(function(){var g=this;
var f=null;
if(typeof d.handler=="undefined"||d.handler==null){f=a(g);
}else{f=(typeof d.handler=="string"?a(d.handler,this):d.handle);
}f.bind("mousedown",{e:g},function(i){var l=a(i.data.e);
var k={width:l.width()||l.getCss("width"),height:l.height()||l.getCss("height"),offLeft:i.pageX,offTop:i.pageY,onResize:d.onResize,onStop:d.onStop,target:l,min:d.min,max:d.max,zhuobiao:a(f).is(".dragrightbottom")?"lefttop":"righttop"};
document.body.onselectstart=function(){return false;
};
l.css("-moz-user-select","none");
f.bind("mouseup",{resizeData:k},b.stop);
l.parents(".arcarea").bind("dblclick",{resizeData:k},b.stop);
a(document).bind("mousemove",{resizeData:k},b.resize).bind("click",{resizeData:k},b.stop).bind("mouseup",{resizeData:k},b.stop);
doane(i);
var h=0;
try{h=a.cleditor.curtopindex+10;
}catch(j){h=10;
}a("<div id='dragfloatbg' style='opacity:0;-moz-opacity: 0;filter:alpha(opacity=0);background:#fff;top:0;left:0;position:absolute;width:100%;height:100%;z-index:"+h+";'></div>").appendTo("body");
});
});
};
a.fn.redrag=function(b,e,d){var f=a.extend({moveDirection:"Horizontal",min:0,max:a(document).height(),onResize:function(){},onStop:function(){}},d);
var c={dragmove:function(k){var g,i,j=k.data.resizeData;
if(j.zhuobiao=="lefttop"){g=Math.min(Math.max(k.pageX-j.offLeft+j.width,j.min.width),f.max.width);
i=Math.min(Math.max(k.pageY-j.offTop+j.height,j.min.height),f.max.height);
}else{if(j.zhuobiao=="righttop"){g=Math.min(Math.max(j.offLeft-k.pageX+j.width,j.min.width),f.max.width);
i=Math.min(Math.max(k.pageY-j.offTop+j.height,j.min.height),f.max.height);
}else{if(j.zhuobiao=="leftbottom"){g=Math.min(Math.max(k.pageX-j.offLeft+j.width,j.min.width),f.max.width);
i=Math.min(Math.max(j.offTop-k.pageY+j.height,j.min.height),f.max.height);
}else{if(j.zhuobiao=="rightbottom"){g=Math.min(Math.max(j.offLeft-k.pageX+j.width,j.min.width),f.max.width);
i=Math.min(Math.max(j.offTop-k.pageY+j.height,j.min.height),f.max.height);
}}}}j.target.css({width:g,height:i});
j.onResize(k);
},stop:function(g){g.data.resizeData.onStop(g);
document.body.onselectstart=function(){return true;
};
g.data.resizeData.target.css("-moz-user-select","");
a(document).unbind("mousemove",resize.resize).unbind("mouseup",resize.stop).unbind("click",resize.stop);
}};
this.bind("mousedown",function(g){var h={offLeft:g.pageX,offTop:g.pageY,onResize:f.onResize,onStop:f.onStop,min:f.min,max:f.max};
document.body.onselectstart=function(){return false;
};
a(b).add(e).css("-moz-user-select","none");
this.bind("mouseup",{resizeData:h},c.stop);
a(document).bind("mousemove",{resizeData:h},c.resize).bind("click",{resizeData:h},c.stop).bind("mouseup",{resizeData:h},c.stop);
});
return this;
};
})(jQuery);
var Class=function(name,base,members,staticMembers){var klass=eval("(function(){ return function(){ this."+name+".apply(this, arguments);}})()");
var prototype=klass.prototype;
if(base){extend(prototype,base.prototype);
}extend(prototype,members);
extend(klass,staticMembers);
function extend(obj,exed){for(var i in exed){obj[i]=exed[i];
}return obj;
}window[name]=klass;
if(klass[name]){klass[name]();
}return klass;
};
function draginit(a){$("div.textareacontainer",a).each(function(){if($(this).attr("adddrag")!=1){$(this).get(0).callback=savedrag;
new Drag($(this).get(0));
}});
}Class("straightDrag",null,{straightDrag:function(g,h,c,d,b,a){var i=this;
this.dragicon=$("#"+h).get(0);
this.clientXY=g;
this.frontdivid=c;
this.backdivid=d;
this.childid=b;
this.parentdivid=a;
var e=0;
if(this.childid){if(this.clientXY=="clientY"){e=parseInt($("#"+this.backdivid).attr("clientHeight"))-parseInt($("#"+this.childid).attr("clientHeight"))+10;
}else{e=parseInt($("#"+this.backdivid).attr("clientWidth"))-parseInt($("#"+this.childid).attr("clientWidth"))+10;
}}this.__oStartOffset__={x:0,y:0};
this.__oMinwidthandMinheight__={x:e+600,y:e+24};
var f="";
this.fnOnMouseUp=function(j){j=window.event||j;
i.stopDrag(j);
};
this.fnOnMouseMove=function(j){j=window.event||j;
i.doDrag(j);
};
this.dragicon.onmousedown=function(j){j=window.event||j;
i.startDrag(j);
return false;
};
},startDrag:function(a){this.__oStartOffset__.y=a.clientY;
this.__oStartOffset__.x=a.clientX;
doane(a);
document.body.onselectstart=function(){return false;
};
$("#"+this.frontdivid).add("#"+this.backdivid).css("-moz-user-select","none");
if(this.dragicon.setCapture){this.dragicon.onmouseup=this.fnOnMouseUp;
this.dragicon.onmousemove=this.fnOnMouseMove;
document.onmouseup=this.fnOnMouseUp;
this.dragicon.setCapture();
}else{document.addEventListener("mouseup",this.fnOnMouseUp,true);
document.addEventListener("mousemove",this.fnOnMouseMove,true);
window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
if(document.menufra&&document.menufra.document){document.menufra.document.addEventListener("mouseup",this.fnOnMouseUp,true);
document.menufra.document.addEventListener("mousemove",this.fnOnMouseMove,true);
document.menufra.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
}}},stopDrag:function(a){if(this.dragicon.releaseCapture){this.dragicon.onmouseup=null;
this.dragicon.onmousemove=null;
document.onmouseup=null;
this.dragicon.releaseCapture();
}else{document.removeEventListener("mouseup",this.fnOnMouseUp,true);
document.removeEventListener("mousemove",this.fnOnMouseMove,true);
window.releaseEvents(Event.MOUSE_MOVE|Event.MOUSE_UP);
if(document.menufra&&document.menufra.document){document.menufra.document.removeEventListener("mouseup",this.fnOnMouseUp,true);
document.menufra.document.removeEventListener("mousemove",this.fnOnMouseMove,true);
document.menufra.releaseEvents(Event.MOUSE_MOVE|Event.MOUSE_UP);
}}doane(a);
document.body.onselectstart=function(){return true;
};
$("#"+this.frontdivid).add("#"+this.backdivid).css("-moz-user-select","");
},doDrag:function(b){doane(b);
if(this.clientXY=="clientY"){var c=b.clientY;
this.addheight=c-this.__oStartOffset__.y;
this.tianjiaheight=(parseInt($("#"+this.frontdivid).attr("clientHeight"))+this.addheight);
this.jianshaoheight=(parseInt($("#"+this.backdivid).attr("clientHeight"))-this.addheight);
if(this.tianjiaheight>2&&this.jianshaoheight>this.__oMinwidthandMinheight__.y){$("#"+this.frontdivid).css("height",this.tianjiaheight+"px");
$("#"+this.backdivid).css("height",this.jianshaoheight+"px");
this.__oStartOffset__.y=b.clientY;
if($("#"+this.childid).length>0){$("#"+this.childid).css("height",(parseInt($("#"+this.childid).attr("clientHeight"))-this.addheight)+"px");
}}}else{var a=b.clientX;
this.addwidth=a-this.__oStartOffset__.x;
this.tianjiawidth=(parseInt($("#"+this.frontdivid).attr("clientWidth"))+this.addwidth);
this.jianshaowidth=(parseInt($("#"+this.backdivid).attr("clientWidth"))-this.addwidth);
if(this.tianjiawidth>160&&this.jianshaowidth>this.__oMinwidthandMinheight__.x){$("#"+this.frontdivid).css("width",this.tianjiawidth+"px");
$("#"+this.backdivid).css("width",this.jianshaowidth+"px");
if($("#"+this.childid).length>0){$("#"+this.childid).css("width",(parseInt($("#"+this.childid).attr("clientWidth"))-this.addwidth)+"px");
}this.__oStartOffset__.x=b.clientX;
}}}},{});
function PagingBar(a){this.instancename="new_coreply_pageing";
this.contentbox;
this.pagebar;
this.total=0;
this.showpages=7;
this.size=20;
for(var b in a){this[b]=a[b];
}this.init=function(){this.pagebar=(typeof this.pagebar==="string")?document.getElementById(this.pagebar):this.pagebar;
this.contentbox=(typeof this.contentbox==="string")?document.getElementById(this.contentbox):this.contentbox;
};
this.pagebar="";
this.createHref=function(e,d,f){var c=document.createElement("A");
c.href="javascript:void(0);";
c.innerText=e;
if(f===d){c.className="pageselected";
}c.onclick=(function(g,h){return function(){g.html(h);
};
})(this,d);
return c;
};
this.createHreftxt=function(e,d,f){var c="";
if(f===d){c=' class="pageselected" ';
}return"<a"+c+' href="javascript:void(0);" onclick="'+this.instancename+".html(this,"+d+');">'+e+"</a>";
};
this.contentchange=function(d,e,c){d.children().hide();
d.children("div:lt("+c+"):gt("+e+")").show();
};
this.html=function(j,e,k){this.total=k?k:this.total;
if(!e||e==0){e=1;
}this.pagebar="";
if(j){this.pagebar=$(j).closest(".itemtoolbar").get(0);
this.pagebar.innerHTML="";
var c=(e-1)*this.size;
var f=c+this.size-1;
this.contentchange($(j).closest(".fieldlable1").next(),c,f);
}var h=Math.ceil(this.total/this.size);
if(e<1){e=1;
}if(e>h){e=h;
}var l=e+"/"+h+"页，共"+this.total+"条 ";
if(h>1){if(e>1){l+=this.createHreftxt("首页",1,e)+this.createHreftxt("上一页",e-1,e);
}else{l+="首页 上一页";
}var d=(this.showpages%2===0?this.showpages/2:(this.showpages-1)/2+1);
var c;
var f;
if((e<=d)||h-e<=d){var n=h<this.showpages?0:h-this.showpages;
var c=e<=d?0:n;
var f=c+this.showpages>=h?h:c+this.showpages;
}else{var c=e-d;
var f=c+this.showpages;
}for(var g=c+1;
g<=f;
g++){l+=this.createHreftxt(g,g,e);
}if(e<h){l+=this.createHreftxt("下一页",e+1,e)+this.createHreftxt("尾页",h,e);
}else{l+="下一页 尾页";
}}if(this.pagebar){$(this.pagebar).append(l);
return true;
}else{return l;
}};
}