function changeImage(action, objId) {
    obj = document.getElementById(objId);
    if (action == 'over') {
        obj.src = obj.src.replace(/\.gif/, '-over.gif');
    } else {    
        obj.src = obj.src.replace(/-over\.gif/, '.gif');
    }
}

/* WINDOW MANIPULATION FUNCTIONS -------------------------------------------- */

windowExtraWidth = 0;
windowExtraHeight = 0;

windowInnerWidth = 500;
windowInnerHeight = 500;

windowOuterWidth = 500;
windowOuterHeight = 500;

function InnerWindowGet()
{
    /* from a script by Jan Peter Koch - quirksmode.org */
    if (window.innerHeight) {
        /* all except Explorer */
    	windowInnerWidth = window.innerWidth;
    	windowInnerHeight = window.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        /* Explorer 6 Strict Mode */
    	windowInnerWidth = document.documentElement.clientWidth;
    	windowInnerHeight = document.documentElement.clientHeight;
    } else if (document.body) {
        /* other Explorers */
    	windowInnerWidth = document.body.clientWidth;
    	windowInnerHeight = document.body.clientHeight;
    }
    return new Array(windowInnerWidth, windowInnerHeight);
}

function OuterWindowSet(theWidth, theHeight)
{
    window.resizeTo(theWidth, theHeight);
    windowOuterWidth = theWidth;
    windowOuterHeight = theHeight;
    /* recalc inner size */
    InnerWindowGet();
    return new Array(windowOuterWidth, windowOuterHeight);
}

function ResizeWindow()
{
    /* parse params */
    myWishedWidth = 'auto';
    myWishedHeight = 'auto';
    extraWidth = 100;
    if (ResizeWindow.arguments.length > 2) {
        myDiv = document.getElementById(ResizeWindow.arguments[2]);
    } else {
        myDiv = document.getElementById('site_frame_div_id');
    }
    if (ResizeWindow.arguments.length > 3) {
        extraWidth = ResizeWindow.arguments[3];
    }
    /* determine sizing */
    if (myWishedWidth == 'auto') {
        myWishedWidth = myDiv.offsetWidth + 2 * myDiv.offsetLeft + document.body.offsetLeft;
    }
    if (myWishedHeight == 'auto') {
        myWishedHeight = myDiv.offsetHeight + 2 * myDiv.offsetTop + document.body.offsetTop;
    }
    /* resize */
    OuterWindowSet(myWishedWidth, myWishedHeight);
    myWidth = 2 * myWishedWidth - windowInnerWidth + windowExtraWidth;
    myHeight = 2 * myWishedHeight - windowInnerHeight + windowExtraHeight;
    /* remove scrollbars */
    OuterWindowSet(myWidth + 60, myHeight + 60);
    /* correct size */
    OuterWindowSet(myWidth + extraWidth, myHeight + 70);
    /* correct for screen resolution */
    myResCorrect = false;
    if (screen && screen.availWidth && (windowOuterWidth > screen.availWidth)) {
        myResCorrect = true;
        windowOuterWidth = screen.availWidth;
    }
    if (screen && screen.availHeight && (windowOuterHeight > screen.availHeight)) {
        myResCorrect = true;
        windowOuterHeight = screen.availHeight;
    }
    if (myResCorrect) {
        OuterWindowSet(windowOuterWidth, windowOuterHeight);
        window.moveTo(0, 0);
    }
}
