function openWithSelfMain(url,name,width,height) {

// This makes new window's height 80px higher, to add space for the picture description.
// Comment this out, if don't needed:
var height = Number(height)+80;

// This sets options to open window:
var options = "width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no";

newWindow = window.open('','',options);
newWindow.document.open();
newWindow.document.write('<html><title>'+name+'</title><body bgcolor="#CCCCCC" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onblur="self.close();" onclick="self.close();"><img src="'+url+'" alt="'+name+'" title="'+name+'"><center>&nbsp;<br>'+name+'</center></body></html>');
window.self.name = "Picture";

// This moves new window to the center of the screen and sets focus on it:
newWindow.moveTo(((screen.availWidth/2)-(width/2)),((screen.availHeight/2)-(height/2)));
newWindow.focus();
}


