function toggle_visibility(id) {
    var e = document.getElementById(id);
    if(e.style.display == 'none')
        e.style.display = 'inline';
    else
        e.style.display = 'none';
}


function adjust_content_height() {
    
    win_y = getWindowHeight(); // the height of inner window
    content_y = document.getElementById('right').offsetHeight; // content height
    container_y = 660; // the height that fits all content
    
    //alert("win_inner: " + win_y + ", content_y: " + content_y + ", container_y: " + container_y);
    
    if (content_y > container_y) {
        if (win_y > container_y) {
            diff = win_y - container_y;
            
            content_height = document.getElementById('content').offsetHeight;
            
            //alert("content height: " + content_height + ", diff: " + diff);
            
            // make content higher
            document.getElementById('content').style.height = content_height + diff + "px";
            
            //alert("new content height: " + document.getElementById('content').style.height);
        }
    }
    
}

function getWindowHeight() {
    myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
    }
    return myHeight;
}

window.onload = adjust_content_height;
