"previewurl" : pageEnvelope.getContext() + url, "url" : pageEnvelope.getContext() + url,   
"previewurl" : baseUrl + url, "url" : baseUrl + url, 
function publication_image_library() {            var flowHelper = cocoon.getComponent("org.apache.lenya.cms.cocoon.flow.FlowHelper");    var pageEnvelope = flowHelper.getPageEnvelope(cocoon);    var areaName = pageEnvelope.getArea();    var site = pageEnvelope.getPublication().getArea(areaName).getSite();    var imageInfos = new ArrayList();        var rootPath = cocoon.parameters["rootPath"];    var allNodes = site.getNode(rootPath).preOrder();        for (var i=0; i < allNodes.length; i++) {            if (allNodes[i].getPath().equals(pageEnvelope.getDocument().getPath()))            continue;                    var languages = allNodes[i].getLanguages();        for (var lang = 0; lang < languages.length; lang++) {            var doc = allNodes[i].getLink(languages[lang]).getDocument();            if (doc.getResourceType().getName().equals("resource")) {            	            var title = getTitle(doc);	            var url = doc.getCanonicalWebappURL();	            url = url.substring(0, url.length() - 4);	            url = url + doc.getSourceExtension();	            	            imageInfos.add({	                    "previewurl" : pageEnvelope.getContext() + url,	                    "url" : pageEnvelope.getContext() + url,	                    // FIXME: this uses UUIDs, but they are not resolved to URLs yet	                    // "url" : "lenya-document:" + doc.getUUID(),	                    "name" : doc.getName(),	                    "title" : title,	                    "length" : doc.getContentLength(),	                    "iconUrl" : cocoon.parameters["iconUrl"]	            });            }        }                }    cocoon.releaseComponent(flowHelper);    cocoon.sendPage(cocoon.parameters["template"], {"imageInfos" : imageInfos});}
791	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/791/a4de6d6412add122ede9f5c8f554812c4adb2ab8/kupu.js/clean/src/modules/kupu/kupu.js