
var DcxDoc={DataList:{"pLists":new Array()},GroupId:0,MaxId:0,GroupId:0,ParentId:0,PageIndex:1,PageSize:15,AllCount:0,$dlGroup:null,xzi:null,jet:null,zre:null,$divDocList:null,iiu:null,akl:null};$(window).load(function(){DcxDoc.UserId=Dcx.lux();DcxDoc.$dlGroup=$("#dlGroup");DcxDoc.$dlGroup.find("[ismsgtab=1]").unbind("click").bind("click",function(){DcxDoc.ParentHsty=new Array();var a=$(this);DcxDoc.GroupId=parseInt(a.attr("val"),10);if(isNaN(DcxDoc.GroupId))DcxDoc.GroupId=0;if(DcxDoc.GroupId==0)DcxDoc.MaxId=-1;DcxDoc.$dlGroup.children().removeClass("active");a.addClass("active");DcxDoc.PageIndex=1;DcxDoc.ParentId=-1;DcxDoc.$divDocList.children("div[ismsglist=1]").html("");DcxDoc.$divDocList.children("div[istopmsg=1]").html("");if(DcxDoc.akl==null)DcxDoc.akl=DcxDoc.$divDocList.children("div[ispage=1]").find("#divMsgPage");DcxDoc.akl.html("");DcxDoc.$divDocList.children("div[isloading=1]").show();DcxDoc.suk()});DcxDoc.jet=$("#a_curPage");DcxDoc.zre=DcxDoc.jet.prev();var b=$.browser.msie?"mouseenter":"mouseover";var c=$.browser.msie?"mouseleave":"mouseout";DcxDoc.jet.unbind(b).bind(b,function(){DcxDoc.jet.prev().show()});$(document).mouseup(function(a){DcxDoc.jet.prev().hide()});DcxDoc.$divDocList=$("#divDocList");DcxDoc.suk()});DcxDoc.ped=function(a,b){var c=DcxDoc.oml(b);window.open("/ajax/DownLoad.ashx?fileId="+b+"&filename="+escape(c.FileName)+"&FilePath="+escape(c.FilePath),"_blank")};DcxDoc.sly=function(a){if(ymr(a))a=new Array();if(ymr(a)||a.length<1){return null}
var b=new nzy();b.append("<ul class=\"filecell unselect \" id=\"column_con\" isList=1>\n");for(var i=0;i<a.length;i++){var c=a[i];if(c.FileTypeId==1||c.GroupId==5)b.append(DcxDoc.sly2(c))}
for(var i=0;i<a.length;i++){var c=a[i];if(c.FileTypeId!=1)b.append(DcxDoc.sly2(c))}
b.append("</ul>\n");return b.toString()}
DcxDoc.sly2=function(a){var b=$.browser.msie;var c=new nzy();c.append("<li class=\"filecolumn \" "+($.browser.msie?"onmouseleave='javascript:pcq(this,false);'  onmouseenter='javascript:pcq(this,true);'":"")+" fileId=\""+a.FileId+"\" isfile=\"1\"><a class=\"f_type ");if(a.FileTypeId==2)c.append("f_type_img");else if(a.FileTypeId==2||a.FileTypeId==3||a.FileTypeId==8||a.FileTypeId==9)c.append("f_type_single");c.append(" \" >\n");var d="";if(a.FileTypeId==1)d="打开文件夹";if(a.FileTypeId!=2){c.append("<span class=\""+fdo(a.FileTypeId)+"\"  onclick=\"javascript:DcxDoc.qbp(this,"+a.FileId+","+a.FileTypeId+");\" unselectable=\"on\"></span>\n")}else{c.append("<div class=\"f_img_box\">");c.append("<table cellspacing=\"0\" cellpadding=\"0\">");c.append("<tbody>");c.append("<tr>");c.append("<td>");c.append(" <img src=\""+Dcx.File.trv(a.FilePath)+"\" onclick=\"javascript:DcxDoc.qbp(this,"+a.FileId+","+a.FileTypeId+");\" title=\"预览图片\"></td>");c.append(" </tr>");c.append("</tbody>");c.append("</table>");c.append("</div>")}
c.append("</a>\n");c.append("<div class=\"filedetail\" data-columnselect=\"1\">\n");c.append("<div class=\"filename\" >"+a.FileName+"</div>\n");if(a.FileTypeId!=1){c.append("<p class=\"graytext datasize\" data-columnselect=\"1\">\n");c.append(" "+Dcx.Utility.ucr(a.FileSize)+"</p>\n")}
c.append("</div>\n");if(a.FileTypeId!=1){c.append("<div class=\"operation\" >\n");c.append("<ul class=\"btn_operation\">\n");c.append("<li><a class=\"ico_attach ico_odown\" title=\"下载\" onclick=\"DcxDoc.ped('"+escape(a.FilePath)+"',"+a.FileId+")\"></a></li>\n");c.append("<li><a class=\"ico_attach ico_ostar\" title=\"删除\" onclick=\"DcxDoc.fvs("+a.FileId+",this);\"></a></li>\n");c.append("<li><a class=\"ico_attach ico_osend\" title=\"重命名\" onclick=\"DcxDoc.pxh("+a.FileId+",'"+a.FileName+"',this);\"></a></li>\n");c.append("</ul>\n");c.append("</div>\n")}else{c.append("<div class=\"operation\" >\n");c.append("<ul class=\"btn_operation\">\n");c.append("<li><a class=\"ico_attach ico_ostar\" title=\"删除\" onclick=\"DcxDoc.fvs("+a.FileId+",this);\"></a></li>\n");c.append("</ul>\n");c.append("</div>\n")}
c.append("</li>\n");return c.toString()}
DcxDoc.bvo=function(a){if(DcxDoc.ParentId==0){return}
if(DcxDoc.ParentHsty.length<1){DcxDoc.ParentId=0}else DcxDoc.ParentId=DcxDoc.ParentHsty.pop();DcxDoc.GroupId=0;DcxDoc.MaxId=-1;DcxDoc.$dlGroup.children().removeClass("active");DcxDoc.PageIndex=1;DcxDoc.$divDocList.children("div[ismsglist=1]").html("");DcxDoc.$divDocList.children("div[istopmsg=1]").html("");if(DcxDoc.akl==null)DcxDoc.akl=DcxDoc.$divDocList.children("div[ispage=1]").find("#divMsgPage");DcxDoc.akl.html("");DcxDoc.$divDocList.children("div[isloading=1]").show();DcxDoc.suk();if(DcxDoc.ParentId==0)$("#a_bvo").hide()};DcxDoc.ParentHsty=new Array();DcxDoc.qbp=function(g,i,j){if(j==1){DcxDoc.ParentHsty.push(DcxDoc.ParentId);DcxDoc.ParentId=i;DcxDoc.GroupId=0;DcxDoc.MaxId=-1;DcxDoc.$dlGroup.children().removeClass("active");DcxDoc.PageIndex=1;DcxDoc.$divDocList.children("div[ismsglist=1]").html("");DcxDoc.$divDocList.children("div[istopmsg=1]").html("");if(DcxDoc.akl==null)DcxDoc.akl=DcxDoc.$divDocList.children("div[ispage=1]").find("#divMsgPage");DcxDoc.akl.html("");DcxDoc.$divDocList.children("div[isloading=1]").show();DcxDoc.suk();$("#a_bvo").show()}else if(j==2){var k=Dcx.File.fxg($(g).attr("src"));var l="    <img class='imgbox-img' id='imgbox-img-6' src='"+k+"' alt='' style='padding: 0px; margin: 0px; border: none; vertical-align: top; '>";var m="<div id='imgboxwrap' class='imgbox-wrap' style='position: absolute;background: #FFF;z-index: 90; padding: 10px; width: 800px;height: 532px; top: 86px; left: 221px; display: block;overflow:hidden;'>"+($.browser.msie?l:"")+"<a href='javascript:void(0);' class='imgbox-close'></a></div>";var n=window.top.document;var o=$("#imgboxoverlay",n);if(o.length<1){$("body",window.top.document).append("<div id='imgboxoverlay' style='display: block;filter: alpha(opacity=50);opacity: 0.5;-moz-animation: opacity_5 0.25s ease;-webkit-animation: opacity_5 0.25s ease;position: fixed;_position :absolute ;top: 0;left: 0;width: 100%;height: 100%;background: #000;display: none;z-index: 80;'></div>");o=$("#imgboxoverlay",n)}
o.show().after(m);var q=o.next("#imgboxwrap");q.hide();var r=null;var s=function(){q.show();t=r.width();u=r.height();r.css({"width":"auto","height":"auto"});t=r.width();u=r.height();var p=t/u;var a=$(window.top).width();var b=$(window.top).height();var c=0.85;var w=a*c;var h=b*c;if(p>=1){if(w>t){w=t;h=w/p}else{w=h*p}}else{if(h>u){h=u;w=h*p}else{w=h*p}}
if(w<5||h<5){w=800;h=532}
var d=(b-h)/2-10+$(window.top).scrollTop();var e=(a-w)/2-10;r.width(w).height(h);q.css({"width":w+"px","height":h+"px","top":d+"px","left":e+"px"});r.css({"width":"100%","height":"100%"});q.width(w);q.height(h);var f=function(){o.hide();o.next("#imgboxwrap").remove()};o.unbind("click").bind("click",f);q.unbind("click").bind("click",f)};if($.browser.msie){r=o.next().find("img");s()}else{r=$("<img class='imgbox-img' id='imgbox-img-6' src='"+k+"' alt='' style='padding: 0;margin: 0;border: none;vertical-align: top;'>");var t=r.width();var u=r.height();r.load(function(){s()});q.prepend(r)}}else if(j==3){return"pic_v2 v_pic_txt "}else if(j==4){return"pic_v2 v_pic_doc "}else if(j==5){return"ico_fppt"}else if(j==6){return"ico_fexl"}else if(j==7){return"pic_v2 v_pic_pdf"}else if(j==8){return"ico_frar"}else{return"ico_fother"}}
DcxDoc.cga=function(a,b){if(!ymr(DcxDoc.DataList)){var b=$.trim(b.toLowerCase());for(var c in DcxDoc.DataList){if(ymr(DcxDoc.DataList[c])||DcxDoc.DataList[c].length<1)continue;var d=DcxDoc.DataList[c];for(var i=0;i<d.length;i++){if(d[i].FileId!=a&&$.trim(d[i].FileName.toLowerCase())==b){art.VLdialog.tips("此文件名称已存在。",1);return true}}}}
return false}
DcxDoc.oml=function(a){if(!ymr(DcxDoc.DataList)){for(var b in DcxDoc.DataList){var c=DcxDoc.DataList[b];if(ymr(c)||c.length<1)continue;for(var i=0;i<c.length;i++){if(c[i].FileId==a){return c[i]}}}}
return null}
DcxDoc.arw=function(a){if(!ymr(DcxDoc.DataList)){var a=$.trim(a.toLowerCase());for(var b in DcxDoc.DataList){if(ymr(DcxDoc.DataList[b])||DcxDoc.DataList[b].length<1)continue;var c=DcxDoc.DataList[b];for(var i=0;i<c.length;i++){if(c[i].FileId==fileId){c[i].FileName=a}}}}}
DcxDoc.pxh=function(f,g){var h=DcxDoc.oml(f);g=h.FileName;var i=g;var j="";var k=i.lastIndexOf(".");if(k>0){i=g.substr(0,k);j=g.substr(k+1,g.length)}
$("#d2035_FileName").val(i);art.VLdialog({content:$("#divFileNameEdit").get(0),top:100,ok:function(){var c=$.trim($("#d2035_FileName").val());if(ymr(c)){art.VLdialog.tips("请输入名称。",1);return false}
if(ymr(j))c=c+"."+j;if(DcxDoc.cga(f,c))return false;if(Dcx.Utility.hmv(c)>120){art.VLdialog.tips("不能超过60个字符。",1);return false}
var d={"fileId":f,"fileName":c};var e="/WebServices/MyApp/Document.asmx/UpdateFileName";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:e,async:false,data:JSON2.stringify(d),dataType:'json',beforeSend:function(a){},complete:function(a,b){},error:function(a){var b=JSON2.stringify(a);if(b.length>600)b=b.substr(0,600);alert("修改名称时失败。详情："+b);return false},success:function(a){a=hmy(a);if(ymr(a)){art.VLdialog.alert("修改名称时失败。",function(){},14,"提示");return false}
art.VLdialog.tips("修改成功。",2)}})},close:function(){}})};DcxDoc.bns=function(){$("#d2035_FileName").val("");art.VLdialog({content:$("#divFileNameEdit").get(0),top:100,ok:function(){var c=DcxDoc.ParentId;var d=$.trim($("#d2035_FileName").val());if(ymr(d)){art.VLdialog.tips("请输入名称。",1);return false}
if(DcxDoc.cga(-1,d))return false;if(Dcx.Utility.hmv(d)>120){art.VLdialog.tips("不能超过60个字符。",1);return false}
var e={"parentId":c,"fileName":d};var f="/WebServices/MyApp/Document.asmx/bns";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:f,async:false,data:JSON2.stringify(e),dataType:'json',beforeSend:function(a){},complete:function(a,b){},error:function(a){var b=JSON2.stringify(a);if(b.length>600)b=b.substr(0,600);alert("新建文件夹时失败。详情："+b);return false},success:function(a){a=hmy(a);if(ymr(a)){art.VLdialog.alert("修改名称时失败。",function(){},14,"提示");return false}
art.VLdialog.tips("新建文件夹成功。",2);var b={};b.FileId=a.NewId;b.FilePath=null;b.FileName=d;b.FileTypeId=1;b.FileSize=0;b.ParentId=c;b.IsCollect=false;b.IsDelete=false;b.DeleteDate=null;b.CreatorId=null;b.CreatorName=null;b.CreateDate=new Date();b.GroupId=5;b.FileSource=0;b.LinkDataJson=null;if(ymr(DcxDoc.DataList["pLists"]))DcxDoc.DataList["pLists"]=new Array();DcxDoc.DataList["pLists"].push(b);DcxDoc.$divDocList.children("div[ismsglist=1]").find("ul[islist=1]").prepend(DcxDoc.sly2(b))}})},close:function(){}})};function fdo(a){if(a==1){return"pic_v2"}else if(a==3){return"pic_v2 v_pic_txt "}else if(a==4){return"pic_v2 v_pic_doc "}else if(a==5){return"ico_fppt"}else if(a==6){return"ico_fexl"}else if(a==7){return"pic_v2 v_pic_pdf"}else if(a==8){return"ico_frar"}else{return"ico_fother"}}
function rotate(a,p){var b=$(a).parent();while(b.length>0){if(b.hasClass("WB_media_expand"))break;b=b.parent()}
var c=b.find("img[isbigImg=1]").get(0);Dcx.Rotate(c,p)}
DcxDoc.tmc=function(a){if(DcxDoc.$divDocList==null)DcxDoc.$divDocList=$("#divDocList");var b=DcxDoc.$divDocList.children("div[ispage=1]");if(DcxDoc.akl==null)DcxDoc.akl=b.find("#divMsgPage");if(isNaN(a)||a<1){a=0}
var c=parseInt(DcxDoc.AllCount/DcxDoc.PageSize,10);if(DcxDoc.AllCount%DcxDoc.PageSize!=0)c=c+1;if(DcxDoc.AllCount<1||c==1)b.hide();else b.show();var d=50;var e=a-d;var f=a+d;if(e<1)e=1;if(f>c)f=c;var g=new nzy();for(var i=e;i<=f;i++){g.append("<a pageId=\""+i+"\"    style=\"width:50px;\"  href =\"javascript:void(0);\" onclick=\"javascript:DcxDoc.uio("+i+",this);\" "+(i==a?" class=\"current\" ":"")+">第&nbsp;"+i+"&nbsp;页</a>\n")}
DcxDoc.akl.html(g.toString());if(a<2)b.find("[isPrev=1]").hide();else b.find("[isPrev=1]").show();if(c<=a)b.find("[isNext=1]").hide();else b.find("[isNext=1]").show();DcxDoc.akl.css("overflow-x","hidden");DcxDoc.akl.css("overflow-y","auto")}
function fdo(a){if(a==1){return"pic_v2"}else if(a==3){return"pic_v2 v_pic_txt "}else if(a==4){return"pic_v2 v_pic_doc "}else if(a==5){return"ico_fppt"}else if(a==6){return"ico_fexl"}else if(a==7){return"pic_v2 v_pic_pdf"}else if(a==8){return"ico_frar"}else{return"ico_fother"}}
DcxDoc.hrk=function(a,b){var c=DcxDoc.oml(a);if(c!=null)return c[b];return null}
DcxDoc.twv=function(a,b,c){if(!ymr(DcxDoc.DataList["pLists"])){for(var i=0;i<DcxDoc.DataList["pLists"].length;i++){if(DcxDoc.DataList["pLists"][i].FileId==a){DcxDoc.DataList["pLists"][i][b]=c;return true}}}
if(!ymr(DcxDoc.DataList["tLists"])){for(var i=0;i<DcxDoc.DataList["tLists"].length;i++){if(DcxDoc.DataList["tLists"][i].FileId==a){DcxDoc.DataList["tLists"][i][b]=c;return true}}}
false}
DcxDoc.uio=function(a,b,p){var c=DcxDoc.$divDocList.children("div[ispage=1]");if(a<1){if(p==1)DcxDoc.PageIndex=DcxDoc.PageIndex-1;else DcxDoc.PageIndex=DcxDoc.PageIndex+1;if(DcxDoc.PageIndex<1){DcxDoc.PageIndex=1;art.VLdialog.tips("已是第一页",1.8);return}
var d=c.find("[isPageList=1]");d.children().removeClass("current");var e=d.children("[pageId="+DcxDoc.PageIndex+"]");if(e!=null&&e.length>0)e.addClass("current");c.find("[isCurPage=1]").html("第&nbsp;"+DcxDoc.PageIndex+"&nbsp;页")}else{DcxDoc.PageIndex=a;var d=$(b).parent();d.children().removeClass("current");$(b).addClass("current");d.next().find("span").html("第&nbsp;"+a+"&nbsp;页");d.hide()}
DcxDoc.$divDocList.children("div[ismsglist=1]").html("");DcxDoc.$divDocList.children("div[istopmsg=1]").html("");DcxDoc.$divDocList.children("div[isloading=1]").show();$('body,html').scrollTop(0);var f=parseInt(DcxDoc.AllCount/DcxDoc.PageSize,10);if(DcxDoc.AllCount%DcxDoc.PageSize!=0)f=f+1;if(DcxDoc.PageIndex<2)c.find("[isPrev=1]").hide();else c.find("[isPrev=1]").show();if(f<=DcxDoc.PageIndex)c.find("[isNext=1]").hide();else c.find("[isNext=1]").show();$('body,html',window.top.document).scrollTop(0);DcxDoc.czp()}
DcxDoc.goz=function(a,b){if(DcxDoc.$divDocList==null)DcxDoc.$divDocList=$("#divDocList");DcxDoc.$divDocList.children("div[isloading=1]").hide();if(b!=2){DcxDoc.DataList["pLists"]=a}else{DcxDoc.DataList["tLists"]=a}
if((ymr(a)||a.length<1)&&DcxDoc.PageIndex==1){if(b!=2)DcxDoc.$divDocList.children("div[ismsglist=1]").html("");else DcxDoc.$divDocList.children("div[istopMsg=1]").html("");if(b!=2){DcxDoc.$divDocList.children("[iswarn=1]").show().html("<span style=\"font-size:17px;\">亲，没有找到文档哦...</span>")}
return false}else if(b!=2)DcxDoc.$divDocList.children("[iswarn=1]").hide();if(!ymr(a)){if(a.length>0)DcxDoc.$divDocList.children("[iswarn=1]").hide();var c=DcxDoc.sly(a);if(!ymr(c)){var d=null;if(b!=2)d=DcxDoc.$divDocList.children("div[ismsglist=1]");else d=DcxDoc.$divDocList.children("div[istopMsg=1]");d.html(c)}}}
DcxDoc.cuh=function(b){DcxEditor.UpFileCount=0;DcxEditor.FileList=new Array();DcxEditor.fcg=function(a){DcxEditor.wux.find(".pic_list_count").html("共 "+DcxEditor.FileList.length+DcxEditor.StrUnit+"，本次您还可以上传 "+(DcxEditor.MaxCount-DcxEditor.FileList.length)+" "+DcxEditor.StrUnit+"<em class=\"S_txt2\"></em>")};DcxEditor.kwi="/Ajax/UploadFile/Upload.ashx";DcxEditor.wbt=2;var c=false;if(ymr(DcxEditor.wux)){c=true}
DcxEditor.cuh(b,false,10,700,400,true);if(c){DcxEditor.wux.find(".aui_state_highlight").unbind("click").bind("click",function(){DcxDoc.aka()});DcxEditor.wux.find(".aui_state_colse").unbind("click").bind("click",function(){DcxDoc.mal()})}}