//Extend height of Right column with respect to left column
//fixing column height problem for sub page

Event.observe(window,"load",function(){    
    var leftmaxheight = 0;
    var maxheight = 0;
    var totop = 0;
    if(document.all) { //This means it is IE
        if($('content_middle') != null){
            var FramecontentLeft = parseInt(document.getElementById('left').offsetHeight);
            var FramecontentRight = parseInt(document.getElementById('content_middle').offsetHeight);            
            var maxheight = (FramecontentLeft>FramecontentRight)?(FramecontentLeft):(FramecontentRight);
            totop = (FramecontentLeft>FramecontentRight)?(0):(1);
            maxheight = maxheight - 33;
            leftmaxheight = (parseInt(maxheight)) + 'px';
            $('content_middle').setStyle({'height' : leftmaxheight});
        }
        if($('totop') != null ) {
            if(totop == 1) { $('totop').setStyle({'visibility' : 'visible'}); }
            else { $('totop').setStyle({'height' : 'hidden'}); }
        }
        if($('left_cot_menu') != null ) {
            var LeftCotMenu = parseInt(document.getElementById('left_cot_menu').offsetHeight);
            if(LeftCotMenu < 16) { 
                $('left_cot_menu').setStyle({'visibility' : 'hidden'}); 
                $('left_cot_menu').setStyle({'height' : '0'}); 
            }
            else {
                $('left_cot_menu').setStyle({'visibility' : 'visible'});
            }
        }         
    } else {
        if($('content_middle') != null){
            var FramecontentLeft = parseInt(document.getElementById('left').getStyle('height'));
            var FramecontentRight = parseInt(document.getElementById('content_middle').getStyle('height'));            
            var maxheight = (FramecontentLeft>FramecontentRight)?(FramecontentLeft):(FramecontentRight);
            totop = (FramecontentLeft>FramecontentRight)?(0):(1);                        
            maxheight = maxheight - 33;
            leftmaxheight = (parseInt(maxheight)) + 'px';
            $('content_middle').setStyle({'height' : leftmaxheight});
        }
        if($('totop') != null ) {
            if(totop == 1) { $('totop').setStyle({'visibility' : 'visible'}); }
            else { $('totop').setStyle({'height' : 'hidden'}); }
        }
        if($('left_cot_menu') != null ) {
            $('left_cot_menu').setStyle({'visibility' : 'hidden'});
            var LeftCotMenu = parseInt(document.getElementById('left_cot_menu').getStyle('height'));
            if(LeftCotMenu < 16) { 
                $('left_cot_menu').setStyle({'visibility' : 'hidden'}); 
                $('left_cot_menu').setStyle({'height' : '0'}); 
            }
            else {
                $('left_cot_menu').setStyle({'visibility' : 'visible'});                
            }
        }        
    }
});


