// Code for scaled background

    NS4 = (document.layers);
    IE4 = (document.all);
    scaleWidth = true;
    scaleHeight = true;
    imSRC = "/statistical/fondo.jpg";
    if (NS4) window.onload = setResize;
    function setResize(){
        setTimeout("window.onresize=reDo;",500);
    }
    function reDo(){
        window.location.reload()
    }
    if (IE4) window.onresize = reDoIE;
    function reDoIE(){
        imBG.width = document.body.clientWidth;
        imBG.height = document.body.clientHeight;
    }
    function makeIm() {
      winWid = (NS4) ? innerWidth : document.body.clientWidth;
      winHgt = (NS4) ? innerHeight : document.body.clientHeight;
      imStr = "<DIV ID=elBGim"
      + " STYLE='position:absolute;left:0;top:0;z-index:-1'>"
      + "<IMG NAME='imBG' BORDER=0 SRC=" + imSRC;
      if (scaleWidth) imStr += " WIDTH=" + winWid;
      if (scaleHeight) imStr += " HEIGHT=" + winHgt;
      imStr += "></DIV>";
      document.write(imStr);
    }


// Code for random images
var ic = 4;  
var images=new Array(ic); 
var credits=new Array(ic);
images[0] = "images/hbutterfly.png"; 
credits[0]= "<a href='http://people.sissa.it/~jrlaguna/lamaga/hbutterfly.html'>Hofstadter butterfly</a>";
images[1] = "images/fig_exc2d.png"; 
credits[1]= "<a href='http://arxiv.org/abs/cond-mat/0207340'>Exciton in random potential with long-ranged correlations</a>";
images[2] = "images/passive.jpg"; 
credits[2]= "<a href='http://people.sissa.it/~jrlaguna/lamaga/passive.html'>Passive scalar in a turbulent flow</a>";
images[3] = "images/dressing.png"; 
credits[3]= "<a href='http://people.sissa.it/~jrlaguna/lamaga/dressing.html'>Dressing generation of a potential</a>"
function pickRandom(range) 
{ if (Math.random) return Math.round(Math.random() * (range-1)); 
else { var now = new Date(); return (now.getTime() / 1000) % range; }
}  
var choice = pickRandom(ic); 

