var flag = false;

function imageLoad() {  // called with body onload()
    if (document.images) {
        m2on = new Image(); m2on.src = "img/2.gif";
        m3on = new Image(); m3on.src = "img/4.gif";
        m4on = new Image(); m4on.src = "img/u.gif";
        // set the flag and let the function know now it can work
        return (flag = true);  
    }
}

if (document.images) {   // load the off images in the normal way
    m2off = new Image(); m2off.src = "img/two.gif";
    m3off = new Image(); m3off.src = "img/for.gif";
    m4off = new Image(); m4off.src = "img/you.gif";
}


function rollIn(imgName) {
    if (document.images && (flag == true)) {
        document[imgName].src = eval(imgName + "on.src");
    }
}

function rollOut(imgName) {
    if (document.images){
        document[imgName].src = eval(imgName + "off.src");
    }
}
