var isOldIE = ((navigator.userAgent.indexOf('MSIE 6') > -1)||(navigator.userAgent.indexOf('MSIE 5') > -1));
var i;

function CheckCompatibility(){
    if (isOldIE){
        document.getElementsByTagName('body')[0].style.backgroundImage = 'url(images/map_background.gif)';
        document.getElementById('MenuLeft').style.backgroundImage = 'url(images/map_background_sm_blue.gif)';
        var Header = document.getElementById('Header');
        if (Header != null){
            Header.style.position = 'absolute';
            Header.style.top = '0';
            Header.style.left = '15%';
            Header.style.width = '70%';
        }
        
        var Content = document.getElementById('Content');
        if (Content != null){
            Content.style.position = 'absolute';
            Content.style.left = '15%';
            Content.style.width = '70%';
            Content.style.margin = '0';
            Content.style.paddingLeft = '1em';
            Content.style.paddingRight = '1em';
            
        }
        /*Warning for IE6 users is (I hope) no longer required, because
        the layout code is working OK now. Put it back if any further inconsistencies emerge.*/
        /*if (document.getElementById('IE6Warning') != null){
            document.getElementById('IE6Warning').style.display = 'block';
        }*/
        var heightForSidebars = document.body.scrollHeight;
        if (document.body.offsetHeight > heightForSidebars){
            heightForSidebars = document.body.offsetHeight;
        }
        var mnuLeft = document.getElementById('MenuLeft');
        var mnuRight = document.getElementById('MenuRight');
        
/*        alert(document.body.scrollHeight + '; ' + mnuLeft.offsetHeight + '; ' + mnuRight.offsetHeight + '; ' + heightForSidebars); */
        
        if (mnuLeft != null){
            mnuLeft.style.margin = '0';
            mnuLeft.style.position = 'absolute';
            mnuLeft.style.left = '0';
            mnuLeft.style.top = '0';
            mnuLeft.style.width = '15%';
            if (mnuLeft.offsetHeight > heightForSidebars){
                heightForSidebars = mnuLeft.offsetHeight;
            }   
        }
        if (mnuRight != null){
            mnuRight.style.margin = '0';
            mnuRight.style.position = 'absolute';
            mnuRight.style.right = '0';
            mnuRight.style.top = '0';
            mnuRight.style.width = '15%';
            
            if (mnuRight.offsetHeight > heightForSidebars){
                heightForSidebars = mnuRight.offsetHeight;
            }
        }
        /*alert(document.body.scrollHeight + '; ' + mnuLeft.offsetHeight + '; ' + mnuRight.offsetHeight + '; ' + heightForSidebars);*/
        if (mnuLeft != null){
            mnuLeft.style.height = heightForSidebars + 'px';
        }
        if (mnuRight != null){
            mnuRight.style.height = heightForSidebars + 'px';
        }

        var Footer = document.getElementById('Footer');
        if (Footer != null){
            Footer.style.position = 'static';
            Footer.style.left = '';
            Footer.style.bottom = '';
        }
    }
}