﻿
function fillthescreen(){
	    winH = windowHeight();
	    heightNeeded=winH-232;//Los 232px son 157 de la cabecera, 75 del pie
	    if( typeof( window.innerWidth ) != 'number' ) { //Explorer no reconoce min-height	
			    if (winH > 0) {
			    var contentHeight = document.getElementById('content').offsetHeight;
			    var footerHeight  = document.getElementById('footer').offsetHeight;
			    if (winH - (contentHeight + footerHeight + 212) >= 0) {
			        document.getElementById('content').style.height=(winH - 232)+'px';
			        document.getElementById('footer').style.top = (winH - 232)+'px';
			    }
		    }
	    }
	    else{ //Para cualquier otro navegador-> minHeight
            heightNeeded=winH-237; //Los 232px son 133 de la cabecera, 63 del pie y 30 del logo
		    document.getElementById('content').style.minHeight=heightNeeded+'px'; 
	    }
    }
    	
    function windowHeight(){
	    var alto= 0;
	    if( typeof( window.innerWidth ) == 'number' ) {
		    alto= window.innerHeight; //Firefox
	    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		    alto= document.documentElement.clientHeight;
	    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		    alto = document.body.clientHeight; //Explorer
	    }
		    return alto;
    }

    window.onresize = function() {
	    fillthescreen();
    }	

    window.onload= function(){
	    fillthescreen();
    	
    }
