var rateWin; var clientDownloadPage = ""; function IsImage(fileName) { var extent = GetExtension(fileName).toLowerCase(); if(extent==".jpg" || extent==".jpeg" || extent==".gif" || extent==".bmp") { return true; } else { return false; } } function IsMusic(fileName) { var extent = GetExtension(fileName).toLowerCase(); if (extent == ".mp3" || extent == ".mid" || extent == ".midi" || extent == ".wav" || extent == ".wma") { return true; } else { return false; } } function GetExtension(fileName) { if(fileName=="") return ""; var pos = fileName.lastIndexOf('.'); if(pos<0) return ""; else return fileName.substring(pos, fileName.length); } function GetNumImageSelect() { var i; var numImageSelect = 0; var images = document.getElementsByName("chkFile"); for(i=0; images!=null && i0) url = url + "&shareID=" + shareID; if(parentID>0) url = url + "&parentID=" + parentID; window.open (url, 'newwindow' + shareID + parentID, 'height=600, width=800, toolbar=no, left=' + pLeft + ', top=' + pTop + ', menubar=no, scrollbars=yes, resizable=yes,location=no, status=no') ; } function CheckClicked() { var i; if(document.ShowFolderID.selectAllFlag.value=="folder" ) { for(i=0; document.ShowFolderID.FileChecks!=null && i=0) filename = filename.replace('&', 'A'); while(filename.indexOf("%")>=0) filename = filename.replace('%', 'P'); while(filename.indexOf("#")>=0) filename = filename.replace('#', 'N'); return filename; } function Action(action) { var numImageSelect = GetNumImageSelect(); var numFileSelect = GetNumFileSelect(); var numFolderSelect = GetNumFolderSelect(); var numImages = GetNumImages(); if(action=="down") { if(includeIn=="folder") { if(numFolderSelect>0) { if (confirm(cultureResource.File_DownloadFolderAlert.Format(fileManager.Name))) { if (clientDownloadPage == "") { clientDownloadPage = fileManager.DownloadPage; } var newwin = window.open(clientDownloadPage); if(newwin==null) alert(cultureResource.File_PopWinBlocked); return; } else return; } if(numFileSelect>1) { if (confirm(cultureResource.File_DownloadManyFileAlert.Format(fileManager.Name))) { if (clientDownloadPage == "") { clientDownloadPage = fileManager.DownloadPage; } var newwin = window.open(clientDownloadPage); if(newwin==null) alert(cultureResource.File_PopWinBlocked); return; } else return; } else if(numFileSelect==0) { alert(cultureResource.File_SelectFileDownload); return; } var selectedFileID = GetCheckedFileID(); if(selectedFileID>0) { var url = dfURL.replace("{fileid}", selectedFileID) + "&forcedDownload=true"; document.location = url; } } else { document.location = dfURL + "&forcedDownload=true"; } return; }else if(action=="zipdown"){ if(numFileSelect==0 && numFolderSelect==0) { alert(cultureResource.File_SelectFileDownload); return; } var fileIDs = ""; var folderIDs = ""; var files = document.getElementsByName("chkFile"); for(i=0; files!=null && i1 && action=="selectonefile") { alert(cultureResource.File_SelectOnlyOneFile); return; } else if(numFolderSelect>0) { alert(cultureResource.File_SelectOnlyFile); return; } } else if(action=="selectonefolder" || action=="selectfolders") { if(numFolderSelect==0 && (action=="selectonefolder") ) { alert(cultureResource.File_SelectOneFolder); return; } else if(numFolderSelect==0 && action=="selectfolders") { alert(cultureResource.File_SelectFolder); return; } else if(numFolderSelect>1 && (action=="selectonefolder")) { alert(cultureResource.File_SelectOnlyOneFolder); return; } else if(numFileSelect>0) { alert(cultureResource.File_SelectOnlyFolder); return; } } else if(action=="select" || action=="copy" || action=="cut" || action=="delete") { if(includeIn=="folder") { if(numFileSelect==0 && numFolderSelect==0) { alert(cultureResource.File_SelectFileOrFolder); return; } if(action=="delete") { var folderLib1 = "|foldermy documents|folderwwwhome|folderpublicfolder|folderrecycle bin|"; var folderLib2 = "|folderdrivehqdata|"; var folderLib3 = "|\\drivehqdata\\|\\my documents\\my encrypted data\\|"; var parentFolder = inputParentPath.value; if(parentFolder.toLowerCase()=="\\") { var sysNum = 0, proNum = 0; var folders = document.getElementsByName("chkFolder"); for(var i=0; folders!=null && i=0) sysNum ++; if(folderLib2.indexOf("|" + folders[i].parentNode.childNodes[1].value.toLowerCase() + "|")>=0) proNum ++; } } var result; if(sysNum>0) { if (sysNum == 1) result = confirm(cultureResource.File_DeleSysFolderAlert); else result = confirm(cultureResource.File_DeleManySysFolderAlert); if(!result) return; } if(proNum>0) { if (proNum == 1) result = window.confirm(cultureResource.File_DeleDataFolderAlert); else result = window.confirm(cultureResource.File_DeleManyDataFolderAlert); if(!result) return; result = confirm(cultureResource.File_DeleDataWarning); if(!result) return; } else { if (!window.confirm(cultureResource.File_DeleteAlert)) return; } } else { if (folderLib3.indexOf("|" + parentFolder.toLowerCase() + "|") >= 0) { var result; result = window.confirm(cultureResource.File_DeleInDataFolderAlert); if (!result) return; result = window.confirm(cultureResource.File_DeleDataWarning); if (!result) return; } else { if (!window.confirm(cultureResource.File_DeleteAlert)) return; } } } } } else if(action=="share" || action=="publish") { if(numFileSelect>0 || numFolderSelect>1) { alert(cultureResource.File_SelectOnlyOne); return; } if(numFolderSelect<1 ) { alert(cultureResource.File_SelectObjectAction.Format(action)); return; } var selectedFolderID = GetCheckedFolderID(); if(action=="publish") document.location = "/sharing/SetPermission.aspx?publish=true&action=load&objTypeID=0&objID=" + selectedFolderID; else document.location = "/sharing/SetPermission.aspx?share=true&action=load&objTypeID=0&objID=" + selectedFolderID; return; } else if(action=="folder") { var url = "/file/NewEditFolder.aspx?action=load"; if(share!="") url = url + "&share=" + share; if(shareID>0) url = url + "&shareID=" + shareID; url = url + "&parentID=" + parentID; document.location = url; return; } else if(action=="file") { var url = "/file/EditFile.aspx?action=load&isNew=true"; if(share!="") url = url + "&share=" + share; if(shareID>0) url = url + "&shareID=" + shareID; url = url + "&parentID=" + parentID; document.location = url; return; } document.getElementById("FolderAction").value = action; if(action=="delete"||action=="paste") { ShowProgress(action); return; } btnAction.click(); } function ShowProgress(action) { var container = document.getElementById("divStatus"); if(container) { var frmStatus = document.createElement("iframe"); frmStatus.setAttribute("frameborder", "0"); frmStatus.setAttribute("scrolling","no"); frmStatus.setAttribute("src","/file/ActionProgress.aspx?progressID="+SetProgressID()+"&action="+action); frmStatus.frameBorder = 0; frmStatus.style.borderWidth = 0; frmStatus.style.width = 400; frmStatus.style.height = 150; container.style.display = ""; container.style.left = 250; container.style.top = 300; if(container.childNodes.length<=1) { container.appendChild(frmStatus); } } } function SetProgressID() { var left = Math.round(Math.random() * 100000); var right = Math.round(Math.random() * 100000); var progressID = "" + left + right; document.getElementById("ProgressID").value= progressID; return progressID; } function DoSelectAll() { var isCheck; var checkValue = "" + document.getElementById("SelectAll").value; if(checkValue.toLowerCase()=="true") isCheck = false; else isCheck = true; var i; var allFiles = document.getElementsByName("chkFile"); for(i=0; allFiles!=null && i0) url = url + "&shareID=" + shareID; window.open (url, '_top', 'height=0, width=0, toolbar=no,left='+pLeft+',top='+pTop+', menubar=no, scrollbars=no, resizable=no,location=no, status=no') ; } function ChangeLineColor(box) { if(box.checked) { if(box.parentNode.parentNode.className) box.parentNode.parentNode.className = "SelectedRow"; box.parentNode.parentNode.setAttribute("class", "SelectedRow"); } else { if(box.parentNode.parentNode.className) box.parentNode.parentNode.className = "UnSelectedRow"; box.parentNode.parentNode.setAttribute("class", "UnSelectedRow"); } } function AdaptScreen() { var mainDiv = document.getElementById("AdaptPanel"); if(mainDiv) { var width, height; var screenWidth, screenHeight; var margin = 0; var isIE = (window.navigator.userAgent.indexOf("MSIE")>=0); if (isIE) margin = 120;//996 else margin = 270;//996 screenHeight= screen.availHeight - margin; screenWidth = screen.availWidth; if(document.body) { height = document.body.offsetHeight; width = document.body.offsetWidth; } else { height = screen.availHeight; width = screen.availWidth; } var inHeight = screenHeight - height; if(height0) { for(var i=container.childNodes.length-1; i>=0; i--) { container.removeChild(container.childNodes[i]); } } if(container.childNodes.length<1) { container.appendChild(frmStatus); } var windowInfo = GetWindownInfo(); var mask = document.getElementById("divMask"); if(mask) { mask.style.width = windowInfo.Width + "px"; mask.style.height = windowInfo.Height + "px"; mask.style.display = ""; } container.style.display = ""; } function GetWindownInfo() { var scrollX=0,scrollY=0,width=0,height=0,contentWidth=0,contentHeight=0; if(typeof(window.pageXOffset)=='number') { scrollX=window.pageXOffset; scrollY=window.pageYOffset; } else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)) { scrollX=document.body.scrollLeft; scrollY=document.body.scrollTop; } else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)) { scrollX=document.documentElement.scrollLeft;scrollY=document.documentElement.scrollTop; } if(typeof(window.innerWidth)=='number') { width=window.innerWidth;height=window.innerHeight; } else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)) { width=document.documentElement.clientWidth;height=document.documentElement.clientHeight; } else if(document.body&&(document.body.clientWidth||document.body.clientHeight)) { width=document.body.clientWidth;height=document.body.clientHeight; } if(document.documentElement&&(document.documentElement.scrollHeight||document.documentElement.offsetHeight)) { if(document.documentElement.scrollHeight>document.documentElement.offsetHeight) { contentWidth=document.documentElement.scrollWidth; contentHeight=document.documentElement.scrollHeight; } else { contentWidth=document.documentElement.offsetWidth; contentHeight=document.documentElement.offsetHeight; } } else if(document.body&&(document.body.scrollHeight||document.body.offsetHeight)) { if(document.body.scrollHeight>document.body.offsetHeight) { contentWidth=document.body.scrollWidth; contentHeight=document.body.scrollHeight; } else { contentWidth=document.body.offsetWidth; contentHeight=document.body.offsetHeight; } } else { contentWidth=width; contentHeight=height; } if(height>contentHeight) height=contentHeight; if(width>contentWidth) width=contentWidth; var rect=new Object(); rect.ScrollX=scrollX; rect.ScrollY=scrollY; rect.Width=width; rect.Height=height; rect.ContentWidth=contentWidth; rect.ContentHeight=contentHeight; return rect; }