function printPopup(url) {
    newwindow = window.open(url, 'print', 'width=600,height=450,left=25,top=25,screenX=25,screenY=25,toolbar=yes,status=yes,resizable=yes,scrollbars=yes');
    if (navigator.appName.indexOf('Microsoft') != -1 && navigator.appVersion.indexOf('5.') == -1)
        newwindow.focus();
}


var inStretchSite = 0;
function stretchSite(){
    if (inStretchSite > 0){
    } else {
        inStretchSite++;
        _stretchSite();
        inStretchSite--;
    }
}

function _stretchSite() {
    var clientHeight  = xClientHeight();
    var topHeight     = xHeight("banner_top");
    var maxBottom     = clientHeight;
    var footerHeight  = xHeight('footer');
    
    var columns       = ['content_main_small', 'nav', 'content_right', 'content_main_wide', 'banner_right'];
    var columns       = ['content_main_small', 'nav', 'content_right', 'content_main_wide', 'content_main', 'content_right_wide'];
    for (var i=0; i < columns.length; i++){
        
        try{
            var top        = xOffsetTop(columns[i]);
            var height     = xHeight(columns[i]);
            var bottom     = top + height;
            if (bottom > maxBottom){
                maxBottom = bottom;
                
            }
            // debug(columns[i] + ' ' + bottom + 'max: ' + maxBottom);
        }catch(e){
            debug(e);
        }
    }
    
    for (var i=0; i < columns.length; i++){
        try{
            var top        = xOffsetTop(columns[i]);
            var height     = xHeight(columns[i]);
            var bottom     = top + height;
            
            //debug('top=' + top + ' height=' + height);
            var diff   = maxBottom - bottom;
            // debug('diff:' + diff);
            var newHeight = diff + height ;
            // debug ('set ' + columns[i] + ': ' + newHeight);
            xHeight(columns[i], newHeight);
        }catch(e){
            debug(e);
        }
    }
    xHeight('wrapper', maxBottom + footerHeight);
} // end _stretchSite


function switchimg(id, src){
    try{
        el =    document.getElementById(id);
        el.src= src;
    } catch(e){
        debug(e);
    }
}


function debug(text){
    try{
        debug_el = document.getElementById('debug');
        old = debug_el.innerHTML;
        debug_el.innerHTML = text + '<br /> ' + old;
    }
    catch(e){
    }     
}// end debug

onload   = stretchSite;
onresize = stretchSite;
