window.addEvent('domready', function() {    
    var myWindowHeight = 0;
    var contentHeight = 0;
    var middleHeight = 0;
    var rightHeight = 0;
    var max = 0;
    
    /*wysokosc strony*/
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWindowHeight = window.innerHeight;
        contentHeight = document.getElementById("content").offsetHeight;
        middleHeight = document.getElementById("middle").offsetHeight;
        rightHeight = document.getElementById("right").offsetHeight;
      } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWindowHeight = document.documentElement.clientHeight;
        contentHeight = document.getElementById("content").offsetHeight;
        middleHeight = document.getElementById("middle").offsetHeight;
        rightHeight = document.getElementById("right").offsetHeight;
      } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWindowHeight = document.body.clientHeight;
        contentHeight = document.getElementById("content").offsetHeight;
        middleHeight = document.getElementById("middle").offsetHeight;
        rightHeight = document.getElementById("right").offsetHeight;
      }
    if(rightHeight > middleHeight) {max = rightHeight;}
    else if(rightHeight < middleHeight) {max = middleHeight;}
    
    if(myWindowHeight > (max + 107)) {
        $('container').style.height = myWindowHeight + "px";
        
        $('content').style.height = (myWindowHeight - 107) + "px";                    
        $('strip').style.height = (myWindowHeight - 107) + "px";                    
    }
    else{
        $('container').style.height = (max + 107) + "px";
        $('wrapper').style.height = (max + 107) + "px";
        $('content').style.height = (max) + "px";
        $('strip').style.height = (max) + "px";                                            
    }
    
    /*obrazki w menu**/
    $$('ul.menu img').each(function(img) {
        var src = img.getProperty('src');
        var extension = src.substring(src.lastIndexOf('.'),src.length)
        img.addEvent('mouseenter', function() { img.setProperty('src',src.replace(extension,'_on' + extension)); });
        img.addEvent('mouseleave', function() { img.setProperty('src',src); });
    });
    
    /*chowanie tabel w kontakcie*/

    //$('tabela').setStyles({'display':'none'});
    function toogleVisible() {
        //if($('tabela').)
    }

});





