Hello, I have a problem with a flash gallery I purchased. I need the images in the gallery to not be cropped, so I've changed the image position function that is called when the browser is resized.

It all works except there’s a flicker when increasing the browser height once you’ve decreased the height. Does anyone have any advice? I'm a bit of a novice.

Here's a demo page:

http://workshop.c2clearcreative.co.u.../Main_Files_2/

And here's the function:

Code:
function setPositions () { 

// - - - - - IF PICTURE VERTICAL - - - - -
if (imageContainer._height > imageContainer._width) {
    if (imageContainer._width >= Stage.width - 20) {
        imageContainer._width = Stage.width - 20;
        imageContainer._yscale = imageContainer._xscale;
    }
    else {
        imageContainer._height = Stage.height - 20;
        imageContainer._xscale = imageContainer._yscale;
    }
    if (imageContainer._height >= Stage.height - 20) {
        imageContainer._height = Stage.height - 20;
        imageContainer._xscale = imageContainer._yscale;
    }
    else {
        imageContainer._width = Stage.width - 20;
        imageContainer._yscale = imageContainer._xscale;
    }
}
// - - - - - IF PICTURE HORIZONAL - - - - - 
if (imageContainer._height < imageContainer._width) {
    if (imageContainer._height >= Stage.height - 20) {
        imageContainer._height = Stage.height - 20;
        imageContainer._xscale = imageContainer._yscale;
    }
    else {
        imageContainer._width = Stage.width - 20;
        imageContainer._yscale = imageContainer._xscale;
    }
    if (imageContainer._width >= Stage.width - 20) {
        imageContainer._width = Stage.width - 20;
        imageContainer._yscale = imageContainer._xscale;
    }
    else {
        imageContainer._height = Stage.height - 20;
        imageContainer._xscale = imageContainer._yscale;
    }
}
//------------------------------------------------------- 
imageContainer._x = Stage.width / 2 - imageContainer._width / 2;
imageContainer._y = Stage.height / 2 - imageContainer._height / 2;

}