var lastDiv = null;var FileNum;var FolderNum;var ClickArea = 0;window.status = "就绪";
FolderNum =document.getElementById("ObjectNum").value.split("|")[0];FileNum = document.getElementById("ObjectNum").value.split("|")[1];
document.getElementById("filename").innerHTML = "共计:&nbsp;"+FileNum+"&nbsp;个对象<br>";document.getElementById("fileinfo").innerHTML = "目录:&nbsp;"+FolderNum+"&nbsp;个<br>文件:&nbsp;"+(FileNum-FolderNum)+"&nbsp;个";
document.getElementById("CurrentFolder").value = "";document.getElementById("CurrentFile").value = "";
if(typeof document.getElementById("Button_copy")!="undefined"){document.getElementById("Button_copy").setAttribute("disabled","disabled");document.getElementById("Button_cut").setAttribute("disabled","disabled");}	


function killErrors(){return true;}window.onerror = killErrors; 


function BodyClick(){
if(ClickArea == 1){ClickArea = 0;return;}
else{
window.status = "就绪";
if(lastDiv){lastDiv.style.border = "1px solid #ccc";lastDiv.style.background = "#fff";}
document.getElementById("filename").innerHTML = "共计:&nbsp;"+FileNum+"&nbsp;个对象<br>";document.getElementById("fileinfo").innerHTML = "目录:&nbsp;"+FolderNum+"&nbsp;个<br>文件:&nbsp;"+(FileNum-FolderNum)+"&nbsp;个";	
document.getElementById("CurrentFolder").value="";document.getElementById("CurrentFile").value="";
if(typeof document.getElementById("Button_copy")!="undefined"){document.getElementById("Button_copy").setAttribute("disabled","disabled");document.getElementById("Button_cut").setAttribute("disabled","disabled");}
return;
}
}

				
function SelectDiv(theDiv,FileName,lFileName,lFileSize,lFileModify,lFileProperty,isFile){
if (lastDiv) {lastDiv.style.border = "1px solid #ccc";lastDiv.style.background = "#fff";}
lastDiv = theDiv;theDiv.style.border = "1px solid #316AC5";theDiv.style.background = "#EBF0FA";
if(isFile == 1){document.getElementById("CurrentFile").value = FileName;document.getElementById("CurrentFolder").value = "";window.status = "文件「"+FileName+"」被选中!";}else{document.getElementById("CurrentFolder").value = FileName;document.getElementById("CurrentFile").value = "";window.status = "文件夹「"+FileName+"」被选中!";}	
document.getElementById("filename").innerHTML = "<div class=\"str flow\" style=\"width:180px;word-wrap:break-word;word-break:break-all\">"+FileName+"</div>"+lFileName+"<br>";document.getElementById("fileinfo").innerHTML = "修改时间:&nbsp;<div class=\"flow\" style=\"width:180px;word-wrap:break-word;word-break:break-all\">"+lFileModify+"</div>大小:&nbsp;"+lFileSize+"<br>"+lFileProperty;
ClickArea = 1;
if(typeof document.getElementById("Button_copy")!="undefined"){document.getElementById("Button_copy").removeAttribute("disabled");document.getElementById("Button_cut").removeAttribute("disabled");}
}

function OpenObject(FileName,isFile){
if(isFile == 1){
if(confirm("请选择操作类型：\n一、下载该文件请点击确定！\n二、复制该文件地址请点击取消！")==false){
var str1=document.getElementById("HiddenField1").value+FileName;
copyToClipboard(str1.replace(/\\/g,"/"));
}
else document.getElementById("Button_download").click();
}
else window.location=("?dir="+escape((document.getElementById("AddressUrl").value+"\\"+FileName+"\\").replace("\\\\","\\")));
}

function ShowPic(FileName,isFile){
if(isFile == 1){
if(FileName.toLowerCase().indexOf(".gif")!=-1||FileName.toLowerCase().indexOf(".jpg")!=-1||FileName.toLowerCase().indexOf(".bmp")!=-1||FileName.toLowerCase().indexOf(".jpeg")!=-1||FileName.toLowerCase().indexOf(".png")!=-1){
var str1=document.getElementById("HiddenField1").value+FileName;
document.getElementById("picture").src=str1.replace(/\\/g,"/");
document.getElementById("picture").style.display="block";
}
else document.getElementById("picture").style.display="none";
}
else document.getElementById("picture").style.display="none";
}
	
function copyToClipboard(txt){if(window.clipboardData){window.clipboardData.clearData();window.clipboardData.setData("Text", txt);}else alert("浏览器拒绝该功能！");}
    