function resizeWindow() {
    if (document.images) {
        if (windowHandle.document.images.length == 1) {
            if (document.layers) windowHandle.resizeTo(windowHandle.document.images[0].width+20,windowHandle.document.images[0].height+20)
            else if (document.all) windowHandle.resizeTo(windowHandle.document.images[0].width+30,windowHandle.document.images[0].height+50)
        }
        else 
            setTimeout('resizeWindow()',2000);
    }
}
