function setPic(pic, width, height, alt) {
    writestr = "<img src='" + pic + "' ";
    if (width != 0) {
        writestr += " width=" + width;
    }
    if (height != 0) {
        writestr += " height=" + height;
    }
    writestr = writestr + " alt='" + alt + "' />";
    document.write(writestr);
}