﻿//Funcion Bajar pie abajo
function fillthescreen(){
	        winH = windowHeight();
	        heightNeeded=winH-276;//Los 276px son 193 de la cabecera,83 del pie
	        if( typeof( window.innerWidth ) != 'number' ) { //Explorer no reconoce min-height	
			        if (winH > 0) {
			        var contentHeight = document.getElementById('div_central').offsetHeight;
			        var footerHeight  = document.getElementById('pie').offsetHeight;
			        if (winH - (contentHeight + footerHeight + 193) >= 0) {
			            document.getElementById('div_columna_central').style.height=(winH - 276) - document.getElementById('div_central_inferior').offsetHeight +'px';
			            document.getElementById('pie').style.top = (winH - 276)+'px';
			        }
		        }
		        
		        document.getElementById('div_columna_central').style.height=document.getElementById('div_central_superior').offsetHeight + 'px';
		        document.getElementById('div_columna_izquierda').style.height=document.getElementById('div_central_superior').offsetHeight + 'px';
		        document.getElementById('div_columna_derecha').style.height=document.getElementById('div_central_superior').offsetHeight + 'px';
		        
//		        if((document.getElementById('div_central_superior').offsetHeight)>(contentHeight = document.getElementById('div_content').offsetHeight))
//		        {
//		            document.getElementById('div_columna_central').style.height=document.getElementById('div_central_superior').offsetHeight + 'px';
//		            document.getElementById('div_columna_izquierda').style.height=document.getElementById('div_central_superior').offsetHeight + 'px';
//		            document.getElementById('div_columna_derecha').style.height=document.getElementById('div_central_superior').offsetHeight + 'px';
//		        }
	        }
	        else{ //Para cualquier otro navegador-> minHeight
		        heightNeeded=winH-276; //Los 276px son 193 de la cabecera,83 del pie
		        document.getElementById('div_columna_central').style.minHeight=heightNeeded - document.getElementById('div_central_inferior').offsetHeight +'px'; 
		        //Iguala el alto de las columnas al alto de la mayor
		        document.getElementById('div_columna_central').style.minHeight=document.getElementById('div_central_superior').offsetHeight + 'px';
		        document.getElementById('div_columna_izquierda').style.minHeight=document.getElementById('div_central_superior').offsetHeight + 'px';
		        document.getElementById('div_columna_derecha').style.minHeight=document.getElementById('div_central_superior').offsetHeight + '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();
        }

//BUSCADOR
function make_blank(aux,frase)
        {
            if(document.getElementById( aux + "_txt_buscar").value == frase)
            {
                document.getElementById(aux + "_txt_buscar").value ="";
                document.getElementById(aux + "_txt_buscar").text = "";
            }
        }

function undo_blank(aux,frase)
{
    if(document.getElementById(aux + "_txt_buscar").value == "")
    {
        document.getElementById(aux + "_txt_buscar").value =frase;
    }
}
