function localFilename(url) // removing path
{
 var x = url.lastIndexOf("/");
 url = url.slice(x + 1);
 return url;
}

// images are loaded asynchronously with no delay

function preloading(name)
{
 var xhr=createXHR(); // new instance of object
 xhr.open("GET", name, true);
 xhr.send(null); // we don't need for the result, just loading it in memory
}

function enlarge(element, caminho)
{
 var name = element.src;

 name = localFilename(name);
// name = name.slice(8); // remove the "thumb-" part
 //name = caminho + name; // restore path and add the new "big-" prefix

 // building a string to display the image

 var str = "<img src='" + caminho + "' border='0' alt='Indisponível' jqimg='" + name + "' />";
 
 document.getElementById("bigview").innerHTML = str;

}

