Salve, ho scaricato uno script da HTML.it per aprire delle popup a centro pagina... questo è il codice della funzione che esegue la funzionalità:

codice:
function openWindow(windowURL, options) {

	var args = '';

	if (typeof(options) == 'undefined') { var options = new Object(); }
	if (typeof(options.name) == 'undefined') { options.name = 'win' + Math.round(Math.random()*100000); }

	if (typeof(options.height) != 'undefined' && typeof(options.fullscreen) == 'undefined') {
		args += "height=" + options.height + ",";
	}

	if (typeof(options.width) != 'undefined' && typeof(options.fullscreen) == 'undefined') {
		args += "width=" + options.width + ",";
	}

	if (typeof(options.fullscreen) != 'undefined') {
		args += "width=" + screen.availWidth + ",";
		args += "height=" + screen.availHeight + ",";
	}

	if (typeof(options.center) == 'undefined') {
		options.x = 0;
		options.y = 0;
		args += "screenx=" + options.x + ",";
		args += "screeny=" + options.y + ",";
		args += "left=" + options.x + ",";
		args += "top=" + options.y + ",";
	}

	if (typeof(options.center) != 'undefined' && typeof(options.fullscreen) == 'undefined') {
		options.y=Math.floor((screen.availHeight-(options.height || screen.height))/2)-(screen.height-screen.availHeight);
		options.x=Math.floor((screen.availWidth-(options.width || screen.width))/2)-(screen.width-screen.availWidth);
		args += "screenx=" + options.x + ",";
		args += "screeny=" + options.y + ",";
		args += "left=" + options.x + ",";
		args += "top=" + options.y + ",";
	}

	if (typeof(options.scrollbars) != 'undefined') { args += "scrollbars=1,"; }
	if (typeof(options.menubar) != 'undefined') { args += "menubar=1,"; }
	if (typeof(options.locationbar) != 'undefined') { args += "location=1,"; }
	if (typeof(options.resizable) != 'undefined') { args += "resizable=0,"; }

	var win = window.open(windowURL, options.name, args);
	return false;

}
Richiamando la funzione con un evento di questo tipo:

codice:
onclick="return openWindow('image/paesaggio.jpg', {width:425,height:284,center:true})"
effettivamente la finestra si apre al centro come promesso... però ho un problema: benchè io passi alla funzione l'esatte dimensioni dell'immagine ottengo come risultato una finestra dove intorno all'immagine c'è del bianco, mentre io vorrei che la finestra contornasse esattamente l'immagine, senza bianco e senza niente altro.

Siccome (come avrete capito ) non sono esperto di JS, adesso non so quale opzione serve al mio scopo ed anche se la sapessi non saprei dove mettere le mani nella funzione!!!

Qualcuno mi può aiutare?

Grazie Felix