var offset;
function getPointer(e) {
if (is_ie) {
DocX = event.clientX + document.body.scrollLeft;
DocY = event.clientY + document.body.scrollTop;
} else {
DocX = e.pageX;
DocY = e.pageY;
}
}
function loadHistory(filename){
cExecute_( URL_SERVER + 'index.php?menuaction=filemanager.uifilemanager.history&file='+base64_encode(filename)+"&path="+base64_encode(currentPath),draw_window);
}
function loadPermissions(data){
var permission = parseInt(data);
var ACL_READ = 1;
var ACL_ADD = 2;
var ACL_EDIT = 4;
var ACL_DELETE = 8;
var ACL_PRIVATE = 16;
permissions['read']=(permission & ACL_READ);
permissions['add']=(permission & ACL_ADD);
permissions['edit']=(permission & ACL_EDIT);
permissions['delete']=(permission & ACL_DELETE);
permissions['private']=(permission & ACL_PRIVATE);
toolbar.load();
}
function close_window(){
var menu = document.getElementById('dwindow');
if (menu != null)
menu.style.visibility = 'hidden'
}
function draw_window(htmlData){
var menu = document.getElementById('dwindow');
headerWin = '
';
if (!menu){
menu = document.createElement('DIV');
menu.id = "dwindow";
menu.style.left = 200;
menu.style.width = "400px";
menu.style.top = DocY;
menu.className = 'menubox';
menu.style.zIndex='1';
menu.innerHTML = headerWin+htmlData;
document.getElementById('tdAppbox').appendChild(menu);
}
else{
menu.innerHTML = headerWin+htmlData;
menu.style.visibility = 'visible';
}
}
function draw_menu(id,elements){
var menu = document.getElementById('menu_newFile'+id);
if (menu == null){
menu = document.createElement('DIV');
menu.id = "menu_newFile"+id;
menu.style.left = DocX;
menu.style.top = DocY;
for(j in elements)
{
if (typeof(elements[j]['text']) == 'undefined')
continue;
var link = document.createElement( 'A' );
if (typeof(elements[j]['img']) != 'undefined'){
var img = document.createElement( 'IMG' );
img.src = elements[j]['img'];
link.appendChild(img);
}
link.href = elements[j]['url'];
link.appendChild( document.createTextNode( elements[j]['text'] ) );
menu.appendChild(link);
menu.appendChild(document.createElement( 'BR' ));
}
menu.onmouseout = function () { menuTimeout = setTimeout("document.getElementById('menu_newFile"+id+"').style.visibility = 'hidden'",50);}
menu.onmouseover = function () { clearTimeout(menuTimeout); };
menu.className = 'menubox';
menu.style.zIndex='1';
document.getElementById('divAppboxHeader').appendChild(menu);
}
menu.style.visibility = 'visible';
}
function resizeDiv(){
defaultHeight = document.body.clientHeight ? document.body.clientHeight : document.body.offsetHeight;
document.getElementById('fmFileWindow').style.height = defaultHeight-170;
document.getElementById('content_folders').style.height = defaultHeight - (is_ie ? 230 : 215);
}
var headerMsgLock = false;
var labelBefore = "";
function write_msg (message){
connector.hideProgressBar();
if (headerMsgLock){
setTimeout('write_msg("'+message+'");', 300);
return;
}
headerMsgLock = true;
headerDiv = document.getElementById("main_title");
labelBefore = headerDiv.innerHTML;
headerDiv.innerHTML = '';
setTimeout('headerMsgLock = false; document.getElementById("main_title").innerHTML = labelBefore;', 3000);
}
function write_error (message){
connector.hideProgressBar();
if (headerMsgLock){
setTimeout('write_error("'+message+'");', 300);
return;
}
headerMsgLock = true;
headerDiv = document.getElementById("main_title");
labelBefore = headerDiv.innerHTML;
headerDiv.innerHTML = '';
setTimeout('headerMsgLock = false; document.getElementById("main_title").innerHTML = labelBefore;', 3000);
}
function displayMessages(){
var messages = document.getElementById("allMessages");
for (i=0; i < messages.childNodes.length; i++){
if (messages.childNodes[i].innerHTML.indexOf(get_lang('Error:')) == 0)
write_error(messages.childNodes[i].innerHTML);
else
write_msg(messages.childNodes[i].innerHTML);
}
}
function loadPreferences(){
preferencesEl = document.getElementById('userPreferences');
preferences = unserialize(preferencesEl.value);
preferencesEl.parentNode.removeChild(preferencesEl);
}
function reloadFiles(newCriteria){
if (newCriteria == criteria)
order_type = (order_type=='1'?'0':'1')
else
criteria = newCriteria;
toolbar.control('reload');
}
function initDrawApi(){
loadPreferences();
preferences.files_per_page = (preferences.files_per_page != undefined) ? preferences.files_per_page : 10;
offset = (current_page-1)*preferences.files_per_page;
currentPath = document.getElementById('currentPath').value;
document.getElementById('divAppboxHeader').innerHTML = title_app;
displayMessages();
resizeDiv();
window.onresize = resizeDiv;
document.body.style.overflow = "hidden";
cExecute_( URL_SERVER + 'index.php?menuaction=filemanager.uifilemanager.get_folders_list',handler.draw_folders_list);
}
function folderList(){
this.td = '';
}
folderList.prototype.init = function(){
this.element = document.getElementById('fmFileWindow');
}
folderList.prototype.clear = function(){
this.element.innerHTML = "";
}
folderList.prototype.drawSearch = function(data){
var fl = folderList;
var files = unserialize(data);
if (files == null)
{
alert(get_lang('No results found'));
return
}
toolbar.clear();
fl.init();
fl.clear();
var newpage;
var sp_hd = ' | | | ';
newpage += fl.td+sp_hd+' id="name">'+get_lang('file name')+sp_tl;
newpage += fl.td+sp_hd+' id="folder">'+get_lang('folder')+sp_tl;
if (preferences.mime_type =='1')
newpage += fl.td+sp_hd+' id="mime_type">'+get_lang('mime type')+sp_tl;
if (preferences.size =='1')
newpage += fl.td+sp_hd+' id="size">'+get_lang('size')+''+sp_tl;
if (preferences.created =='1')
newpage += fl.td+sp_hd+' id="created">'+get_lang('created')+''+sp_tl;
if (preferences.modified =='1')
newpage += fl.td+sp_hd+' id="modified">'+get_lang('modified')+''+sp_tl;
if (preferences.createdby_id =='1')
newpage += fl.td+sp_hd+' id="createdby_id">'+get_lang('created by')+''+sp_tl;
if (preferences.modifiedby_id =='1')
newpage += fl.td+sp_hd+' id="modifiedby_id">'+get_lang('modified by')+''+sp_tl;
if (preferences.comment =='1')
newpage += fl.td+sp_hd+' id="comment">'+get_lang('comment')+''+sp_tl;
if (preferences.version =='1') newpage += fl.td+sp_hd+' id="version">'+get_lang('version')+''+sp_tl+'';
for (var i=0; i < files.length; i++)
{
newpage += ''+fl.td;
newpage += '';
newpage += ' | | ';
newpage += fl.td+'
';
newpage += ''+files[i].name+' ';
newpage += fl.td+files[i].directory+'';
if (preferences.mime_type =='1') newpage += fl.td+files[i].mime_type+'';
if (preferences.size =='1') newpage += fl.td+borkb(files[i].size)+'';
if (preferences.created =='1') newpage += fl.td+files[i].created+'';
if (preferences.modified =='1') newpage += fl.td+files[i].modified+'';
if (preferences.createdby_id =='1') newpage += fl.td+files[i].createdby_id+'';
if (preferences.modifiedby_id =='1') newpage += fl.td+files[i].modifiedby_id+'';
if (preferences.comment =='1') newpage += fl.td+''+files[i].comment+'';
if (preferences.version =='1') newpage += fl.td+''+files[i].version+'
';
}
fl.element.innerHTML = newpage;
fl.drawStripes();
}
folderList.prototype.createLine = function(file){
var fl = folderList;
retBuff = '';
retBuff += fl.td;
retBuff += '';
if (permissions['private']) {
retBuff += ' | ';
}
else
retBuff += ' | ';
switch (file.mime_type)
{
case 'text/html':
retBuff += ' | ';
break;
case 'application/zip':
retBuff += ' | '
break;
default:
retBuff += ' | ';
}
retBuff += fl.td+'';
if((file.mime_type).toUpperCase().indexOf('IMAGE') == 0)
var mousefunc = 'draw_card(\'preview\',\''+file.name+'\')'
else
var mousefunc = 'hide_card()';
retBuff += '
'+file.name+' ';
if (preferences.mime_type =='1') retBuff += fl.td+file.mime_type+'';
if (preferences.size =='1') retBuff += fl.td+borkb(file.size)+'';
var now = new Date();
var midnight = Date.parse(now.toDateString());
var dtString = "";
if (preferences.created =='1') {
var created = new Date();
created.setTime(file.created*1000);
if (created.getTime() > midnight)
if (created.getMinutes() < 10 )
dtString = created.getHours()+":0"+created.getMinutes();
else
dtString = created.getHours()+":"+created.getMinutes();
else {
dtString = (created.getDate() < 10) ? "0"+created.getDate()+"/" : created.getDate()+"/";
dtString += (created.getMonth() < 9) ? "0" : "";
dtString += (created.getMonth()+1)+"/"+created.getFullYear();
}
retBuff += fl.td+dtString+'';
}
if (preferences.modified =='1'){
var modified = new Date();
modified.setTime(file.modified*1000);
if (file.modified != "")
if (modified.getTime() > midnight)
if (modified.getMinutes() < 10)
dtString = modified.getHours()+":0"+modified.getMinutes();
else
dtString = modified.getHours()+":"+modified.getMinutes();
else {
dtString = (modified.getDate() < 10) ? "0"+modified.getDate()+"/" : modified.getDate()+"/";
dtString += (modified.getMonth() < 9) ? "0" : "";
dtString += (modified.getMonth()+1)+"/"+modified.getFullYear();
}
else
dtString = "";
retBuff += fl.td+dtString+'';
}
if (preferences.owner =='1'){
retBuff += fl.td;
retBuff += ''+file.owner+'
';
}
if (preferences.createdby_id =='1'){
retBuff += fl.td;
retBuff += ''+file.createdby_id+'
';
}
if (preferences.modifiedby_id =='1'){
retBuff += fl.td;
retBuff += ''+file.modifiedby_id+'
';
}
if (preferences.comment =='1') retBuff += fl.td+'';
if (preferences.version =='1') retBuff += fl.td+''+file.version+'';
retBuff += "
";
return retBuff;
}
folderList.prototype.updateQuota = function(quotaSize,usedSpace){
if (parseInt(quotaSize) != 0){
var contentQuota = document.getElementById('content_quota');
if (contentQuota != null)
contentQuota.innerHTML = '';
}
}
folderList.prototype.drawFiles = function(data){
var fl = folderList;
var returnData = unserialize(data);
loadPermissions(returnData.permissions);
var files = returnData.files;
draw_paging(returnData.files_count,data);
fl.init();
fl.clear();
var newpage = '';
if (preferences.viewIcons == 1){
for (var i = 0; i < files.length; i++)
{
newicon = '';
newpage += newicon;
}
fl.element.innerHTML = newpage;
}
else
{
var sp_hd = '';
if (files != null)
for (var i = 0; i < files.length; i++)
{
newpage += fl.createLine(files[i]);
}
else
newpage = ""+get_lang('no files in this directory.')+"";
fl.element.innerHTML = newpage;
header = document.getElementsByName('head');
for (var i=0; i < header.length; i++)
{
if (header[i].id == criteria){
header[i].style.fontWeight = 'bold';
arrow = document.createElement('IMG');
if (order_type == '1')
arrow.src = templatePath+'images/arrow_ascendant.gif';
else
arrow.src = templatePath+'images/arrow_descendant.gif';
header[i].appendChild(arrow);
}
}
fl.drawStripes();
}
folderList.updateQuota(returnData.quota.quotaSize,returnData.quota.usedSpace);
}
folderList.prototype.drawStripes = function(){
var classTr = "tr_msg_read";
folderList.init();
var elements = folderList.element.firstChild.firstChild.childNodes;
for (var i = 1; i < elements.length; i++){
elements[i].className = classTr;
classTr = (classTr == "tr_msg_read"?"tr_msg_read2":"tr_msg_read");
}
}
var folderList = new folderList();
function _toolbar()
{
var element;
}
_toolbar.prototype.clear = function (){
this.element.innerHTML = "";
}
_toolbar.prototype.load = function (){
this.element = document.getElementById('fmMenu');
if (permissions['read'] == 0){
this.element.innerHTML = "";
return;
}
var pageContent = '';
var createButton = function(name) { return ' '+get_lang(name.replace('_',' '))+' | '; }
if (permissions['edit'] != 0){
pageContent += createButton('edit');
pageContent += createButton('rename');
}
if (permissions['delete'] != 0){
pageContent += createButton('delete');
pageContent += createButton('move_to');
}
pageContent += createButton('copy_to');
this.element.innerHTML = pageContent+'
';
}
_toolbar.prototype.getCheckedFiles = function () {
filesUrl = "";
var one_checked = false;
files=document.getElementsByName('fileman');
var j=0;
for (i = 0; i < files.length; i++)
if (files[i].checked){
one_checked = true;
filesUrl += "&fileman["+j+"]="+base64_encode(files[i].value);
j++;
}
if (!one_checked)
{
write_msg(get_lang('Please select a file'));
return;
}
return filesUrl;
}
_toolbar.prototype.control = function (arg)
{
//Used to get button position
var button = document.getElementsByName(arg);
button = button[0];
switch (arg) {
case 'new':
elements = new Array();
elements[0] = { 'text': get_lang('empty file'),
'url': 'javascript:newEmptyFile()'};
elements[1] = new Array();
elements[1]['text'] = get_lang('File from model');
address = document.location.toString();
address = address.split("?");
elements[1]['url'] = address[0]+"?menuaction=filemanager.uifilemanager.fileModels";
elements[2] = { 'text' : get_lang('Upload'),
'url': 'javascript:newUpload()'};
draw_menu(arg,elements);
break;
case 'rename':
var one_checked = false;
files=document.getElementsByName('fileman');
for (i = 0; i < files.length; i++)
if (files[i].checked){
one_checked = true;
files[i].checked = false;
var nameLink = document.getElementById('name_'+files[i].value);
var inputName = document.createElement('INPUT');
inputName.id = 'input_'+files[i].value;
var filename = nameLink.innerHTML;
inputName.value = filename;
inputName.onclick = function () { oldValue = inputName.value; }
inputName.onblur = function () { if (inputName.value == oldValue) handler.rename(); else cExecute_( URL_SERVER + 'index.php?menuaction=filemanager.vfs_functions.rename&file='+base64_encode(this.id.substr(6))+'&to='+base64_encode(this.value)+"&path="+base64_encode(currentPath),handler.rename) };
inputName.onkeydown=function (event) {if (event.keyCode == KEY_ENTER) this.blur(); };
nameLink.parentNode.appendChild(inputName);
nameLink.parentNode.removeChild(nameLink);
}
if (!one_checked)
write_msg(get_lang('Please select a file'));
break;
case 'edit':
var one_checked = false;
files=document.getElementsByName('fileman');
for (i = 0; i < files.length; i++)
if (files[i].checked){
one_checked = true;
var filename=files[i].value;
}
if (one_checked){
address = document.location.toString();
address = address.split("&");
document.location = URL_SERVER + 'index.php?menuaction=filemanager.uifilemanager.index&'+arg+".x=1&filename="+base64_encode(filename)+".&path="+base64_encode(currentPath);
}
else
{
write_msg(get_lang('Please select a file'));
return;
}
break;
case 'delete':
var filesUrl = this.getCheckedFiles();
cExecute_( URL_SERVER + 'index.php?menuaction=filemanager.vfs_functions.delete&path='+
base64_encode(currentPath)+filesUrl,handler.del);
break;
case 'archive':
var filesUrl = this.getCheckedFiles();
password = prompt(get_lang('Please, type a strong password (suggestion: at least 8 characters, letters and numbers) or leave it empty to archive only'));
if (password == null)
return;
if (password.length > 0)
{
password2 = prompt(get_lang('Please, retype your password'));
if (password != password2)
{
alert(get_lang('Error:')+get_lang('passwords are differents'));
return;
}
}
var pswd = expresso.crypt.encode(password);
cExecute_( URL_SERVER + 'index.php?menuaction=filemanager.vfs_functions.archive&pswd='+base64_encode(pswd.toString())+'&path='+base64_encode(currentPath)+filesUrl,handler.archive);
break;
case 'move_to':
case 'copy_to':
var filesUrl = this.getCheckedFiles();
var elements = new Array();
for(i=0; i< folders.length; i++)
{
elements[i] = new Array();
elements[i]['text']=folders[i];
address = document.location.toString();
address = address.split("&");
elements[i]['url'] = "javascript:"+escape(arg)+"('"+folders[i]+"','"+filesUrl+"')";
}
draw_menu(arg,elements);
break;
case 'reload':
last_folder = last_folder ? last_folder : currentPath;
current_folder = current_folder ? current_folder : currentPath;
cExecute_( URL_SERVER + 'index.php?menuaction=filemanager.uifilemanager.dir_ls&path='+base64_encode(currentPath)+'&criteria='+criteria+'&otype='+order_type+'&limit='+preferences.files_per_page+'&offset='+offset,folderList.drawFiles);
return;
case 'tools':
elements = new Array();
elements[0] = { 'text' : get_lang('Preferences'),
'url' : URL_SERVER + 'preferences/preferences.php?appname=filemanager',
'img' : templatePath+'images/preferences.png'};
elements[1] = { 'text' : get_lang('Search'),
'url' : 'javascript:document.getElementById("menu_newFiletools").style.visibility="hidden";\
document.getElementById("em_message_search").focus();',
'img' : templatePath+'images/search.gif'};
elements[2] = { 'text' : get_lang('Edit Folders'),
'url' : 'javascript:editFolders()',
'img' : templatePath+'images/button_createdir.png'};
elements[3] = { 'text' : get_lang('Share Folders'),
'url' : URL_SERVER + "index.php?menuaction=preferences.uiaclprefs.index&acl_app=filemanager",
'img' : templatePath+'images/mime16_directory.png'};
elements[4] = { 'text' : get_lang('View'),
'url' : "javascript:EditColumns()",
'img' : templatePath+'images/editpaste.png'};
elements[5] = {'text' : get_lang('Archive'),
'url' : "javascript:toolbar.control('archive')",
'img' : templatePath+'images/button_zip.png'};
draw_menu(arg,elements);
break;
default:
return;
}
}
var toolbar = new _toolbar();
function unarchive(filename){
password = expresso.crypt.encode(prompt(get_lang('Please, type archive password or leave it empty if it is not encrypted')));
if (password == null)
return;
cExecute_( URL_SERVER + 'index.php?menuaction=filemanager.vfs_functions.unarchive&pswd='+base64_encode(password)+'&path='+base64_encode(currentPath)+'&file='+base64_encode(filename),handler.archive);
}
function move_to(to,filesUrl){
cExecute_( URL_SERVER + 'index.php?menuaction=filemanager.vfs_functions.moveto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.moveto);
}
function copy_to(to,filesUrl){
cExecute_(URL_SERVER + 'index.php?menuaction=filemanager.vfs_functions.copyto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.copyto);
}
function draw_card(type,name){
clearTimeout(menuTimeout);
switch(type){
case 'preview':
var url = URL_SERVER + 'index.php?menuaction=filemanager.vfs_functions.summary&file='+base64_encode(name)+"&path="+base64_encode(currentPath);
var htmlData = '
';
menuTimeout = setTimeout("draw_window_card(\'"+htmlData+"\')",500);
break;
case 'user':
var url = URL_SERVER + 'index.php?menuaction=filemanager.user.card&lid='+base64_encode(name);
menuTimeout = setTimeout("cExecute_('"+url+"',draw_window_card)",500);
break;
default:
break;
}
}
function editFolders(operation){
if (operation == 'new'){
var name = prompt(get_lang('Enter with the name of new file/directory'), '');
if (name != null && name != '')
{
var parentDir = document.getElementById('folders_box').value;
cExecute_( URL_SERVER + 'index.php?menuaction=filemanager.uifilemanager.createdir&path='+base64_encode(parentDir)+'&filename='+base64_encode(name),handler.refreshDir);
currentPath = parentDir+'/'+name;
close_window();
}
}
else
if (operation == 'remove'){
var Dfolder = document.getElementById('folders_box').value;
if (confirm(get_lang('Do you really want to remove folder: %1?',Dfolder), ''))
{
cExecute_( URL_SERVER + 'index.php?menuaction=filemanager.uifilemanager.removedir&path='+base64_encode(expresso.crypt.encode(Dfolder)),handler.refreshDir);
var lastIndex = Dfolder.lastIndexOf('/');
currentPath = Dfolder.substr(0,lastIndex);
close_window();
}
}
else{
var buf = "";
code = "";
draw_window(code);
}
}
function draw_window_card(content){
var menu = document.getElementById('menu_newFile');
if (menu == null){
menu = document.createElement('DIV');
menu.className = 'menubox';
menu.id = "menu_newFile";
menu.style.left = DocX;
menu.style.top = (DocY+20)+"px";
menu.width = "100%";
menu.onmouseout = function () { menuTimeout = setTimeout("hide_card()",50);}
menu.onmouseover = function () { clearTimeout(menuTimeout); };
menu.style.zIndex='1';
document.getElementById('tdAppbox').appendChild(menu);
}
else
{
menu.style.left = DocX;
menu.style.top = (DocY+20)+"px";
}
menu.innerHTML = content;
menu.style.visibility = 'visible';
clearTimeout(menuTimeout);
menuTimeout = setTimeout("hide_card()",4000);
}
function hide_card(){
var e=document.getElementById('menu_newFile');
if (e!=null)
e.style.visibility = 'hidden';
}
function draw_paging(num_files,data){
num_files = parseInt(num_files);
total_pages = 1;
if(last_folder != current_folder){
lastPage = 1;
current_page = 1;
last_folder = current_folder;
}
if(num_files > parseInt(preferences.files_per_page)) {
total_pages = parseInt(num_files/preferences.files_per_page);
if((num_files/preferences.files_per_page) > total_pages)
total_pages++;
}
if(total_pages == 1) {
if(span_paging = document.getElementById("span_paging")) {
span_paging.parentNode.removeChild(span_paging);
}
return;
}
span_paging = document.getElementById("span_paging");
if(!span_paging){
span_paging = document.createElement("DIV");
span_paging.id = "span_paging";
span_paging.className = "boxHeaderText";
span_paging.align="right";
document.getElementById("div_menu_c3").appendChild(span_paging);
}
span_paging.style.width="100%";
span_paging.innerHTML="";
files_range_begin = 1;
files_range_end = preferences.files_per_page;
if(current_page != 1) {
lnk_page = document.createElement("A");
lnk_page.setAttribute("href", "javascript:current_page=1;offset=0;toolbar.control('reload');");
}
else {
lnk_page = document.createElement("SPAN");
}
span_paging.appendChild(lnk_page);
lnk_page.innerHTML = "<<";
lnk_page.title = get_lang("First");
span_paging.innerHTML += " ";
if(current_page == lastPage + numPages)
lastPage = current_page - 1;
else if((lastPage != 1 && lastPage == current_page) || current_page == total_pages)
lastPage = current_page - (numPages - 1);
else if(current_page == 1)
lastPage = 1;
if(lastPage < 1)
lastPage = 1;
else if(lastPage > 1 && (lastPage > (total_pages -(numPages - 1))))
lastPage = total_pages -(numPages - 1);
var hasMarked = false;
for(i = lastPage; i <= total_pages; i++) {
if(current_page == i || (i == total_pages && !hasMarked)) {
lnk_page = document.createElement("SPAN");
span_paging.appendChild(lnk_page);
lnk_page.innerHTML = " "+i+" ";
hasMarked = true;
continue;
}
else{
lnk_page = document.createElement("A");
span_paging.appendChild(lnk_page);
files_range_begin = ((i*preferences.files_per_page)-(preferences.files_per_page-1));
files_range_end = (i*preferences.files_per_page);
lnk_page.setAttribute("href", "javascript:current_page="+i+";offset=((current_page-1)*preferences.files_per_page);toolbar.control('reload');");
}
lnk_page.innerHTML = " ... ";
if(i == (lastPage + numPages))
break;
else if(lastPage == 1 || i != lastPage)
lnk_page.innerHTML = " "+i+" ";
span_paging.innerHTML += " ";
}
if(current_page != total_pages) {
lnk_page = document.createElement("A");
files_range_begin = ((total_pages*preferences.files_per_page)-(preferences.files_per_page-1));
files_range_end = (total_pages*preferences.files_per_page);
lnk_page.setAttribute("href", "javascript:current_page="+total_pages+";offset=((current_page-1)*preferences.files_per_page);toolbar.control('reload');");
}
else {
lnk_page = document.createElement("SPAN");
}
span_paging.innerHTML += " ";
span_paging.appendChild(lnk_page);
lnk_page.title = get_lang("Last");
lnk_page.innerHTML = ">>";
}