function showImage(path,w,h,caption){ var sw = screen.width-20; var sh = screen.height-100; if(sw < w){ var w1 = sw; h = Math.round(h*sw/w); w = w1; } if(sh < h){ var h1 = sh; w = Math.round(w*sh/h); h = h1; } var querystring = "?path="+path; querystring += (caption != null) ? "&caption="+caption : ""; window.open(pathToRoot+"image.php"+querystring,"image","width="+w+",height="+h); } function deleteItem(path,item,name){ if(window.confirm("Are you sure you want to delete "+unescape(name))){ document.location="?action=deleteItem&path="+path+"&item="+item; return true; } return false; } function deleteItemMedia(item,media,name){ if(window.confirm("Are you sure you want to delete "+unescape(name))){ document.location="?action=deleteItemMedia&item="+item+"&media="+media; return true; } return false; } function deletePageMedia(path,media,name){ if(window.confirm("Are you sure you want to delete "+unescape(name))){ document.location="?action=deletePageMedia&path="+path+"&media="+media; return true; } return false; } function deletePageUser(path,username,name){ if(window.confirm("Are you sure you want to delete "+unescape(name))){ document.location="?action=deletePageUser&path="+path+"&username="+username; return true; } return false; } function changePageUserAccess(select,path,username){ var access = select.options[select.selectedIndex].value; document.location="?action=changePageUserAccess&path="+path+"&username="+username+"&access="+access; } /* MODULE METHODS */ function moduleSwitcher(){ this.modules = new Array();// array to hold DOM objects of modules this.activeModule = 0;// current visible module this.attributes = new Object();// array of attributes this.divsAligned = false; this.transitionStep = 5; this.moduleOpacityArr = new Array(); this.setAttribute = function(a,v){ this.attributes[a] = v; } this.setAttributes = function(){ for(var i=0;i 1){ if(this.modules[0].offsetWidth){ divWidth = this.modules[0].offsetWidth; divHeight = this.modules[0].offsetWidth; }else if(this.modules[0].style.pixelWidth){ divWidth = this.modules[0].style.pixelWidth; divHeight = this.modules[0].style.pixelHeight; } var pos = findPos(this.modules[0]); divTop = pos[1]; for(var i=1;i 0){ this.moduleOpacityArr[i] -= this.transitionStep; transitionsLeft = true; setOpacity(this.modules[i],this.moduleOpacityArr[i]); } } } if(transitionsLeft){ var thisObj = this; window.setTimeout(function(){ thisObj.doTransition() },50); } } */ } /* AJAX methods */ var ajaxContentObjects = new Array(); function ajaxShowContent(divId,ajaxContentIndex,url,returnFunction){ var div = document.getElementById(divId); if(div != null){ var html = ajaxContentObjects[ajaxContentIndex].response; div.innerHTML = html; ajaxContentObjects[ajaxContentIndex] = false; evalScripts(divId); } if(returnFunction != null){ returnFunction(); } } function ajaxLoadContent(divId,url,returnFunction){ var ajaxContentIndex = ajaxContentObjects.length; ajaxContentObjects[ajaxContentIndex] = new sack(); ajaxContentObjects[ajaxContentIndex].requestFile = url; // Specifying which file to get ajaxContentObjects[ajaxContentIndex].onCompletion = function(){ ajaxShowContent(divId,ajaxContentIndex,url,returnFunction); }; // Specify function that will be executed after file has been found ajaxContentObjects[ajaxContentIndex].runAJAX(); // Execute AJAX function } var ajaxServerProcesses = new Array(); function ajaxServerStatus(ajaxServerIndex,returnFunction){ if(returnFunction != null){ returnFunction(); } } function ajaxServerProcess(action,params,returnFunction){ var ajaxServerIndex = ajaxServerProcesses.length; ajaxServerProcesses[ajaxServerIndex] = new sack(); ajaxServerProcesses[ajaxServerIndex].method = "POST"; ajaxServerProcesses[ajaxServerIndex].setVar("action",action); if(params != null){ params = params.split("&"); for(var i=0;i