allora il problema puo' dipendere dal fatto che richiami questa funzione runtime, quando il documento si sta renderizzando, quindi il body non e' ancora a disposizione e a maggior ragione il clientWidth/Height
sconvolgi un po' il sistema
codice:
function showpic(idEl, src, w, h, alt, aln, pw, ph, bw, bh) {
if (src == null) return;
var iw, ih; // Set inner width and height
iw=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
ih=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;
if (w == null) w = iw;
if(h == null) h = ih;
if(alt == null) alt = "Picture";
if(aln == null) aln = "left";
if(pw == null) pw = 100;
if(ph == null) ph = 100;
if(bw == null) bw = 24;
if(bh == null) bh = 24;
var sw = Math.round((iw - bw) * pw / 100);
var sh = Math.round((ih - bh) * ph / 100);
if ((w * sh) / (h * sw) < 1) sw = Math.round(w * sh / h);
else sh = Math.round(h * sw / w);
document.getElementById(idEl).innerHTML='[img]'+src+'[/img]';
}
window.onload=function(){
showpic("idElemento1", "crowd.gif", 362, 113, "A crows of people", "middle");
// qui aggiungi i vari richiami per ogni immagine
}
e nel body, al posto di quel blocco di script, dove vuoi appaia un' immagine
<div id="idElemento1"></div>