function moldejaCos( ) {

	if( document.getElementById ){
		
		window.moldes = new Array();
		window.moldes[0] = new Array( document.getElementById( "cos" ), document.getElementById( "franjes" ), document.getElementById( "visible" ) );
		window.moldes[1] = new Array( 0, 0, document.getElementById( "pagina" ) );
		window.moldes[2] = new Array( 0, 0, document.getElementById( "toc" ) );
		window.moldes[3] = new Array( document.getElementById( "todmic" ), document.getElementById( "tod_retol" ), document.getElementById( "tod_llista" ) );
		window.moldes[4] = new Array( document.getElementById( "todcp" ), document.getElementById( "tod_retol" ), document.getElementById( "tod_llista" ) );
		
		window.moldejador = function() {
			
			for( var i = 0; i < this.moldes.length; i++ ){
				
				if( this.moldes[i][0] ){
				
					this.moldes[i][2].style.height = ( this.moldes[i][0].offsetHeight - this.moldes[i][1].offsetHeight ) + "px";
					
				}else if( this.moldes[i][0] == 0 && this.moldes[i][2] ){
					
					this.moldes[i][2].style.height = Math.round( ( this.moldes[ this.moldes[i][1] ][2].offsetHeight / 100 ) * 94 ) + "px";
					
				}
			}
		}
		
		var altDisponible = window.moldes[0][0].offsetHeight - window.moldes[0][1].offsetHeight;
		
		if( window.moldes[0][2].offsetHeight > ( altDisponible + 5 ) || window.moldes[0][2].offsetHeight < ( altDisponible - 5 ) ){
			window.moldejador();
			window.onresize = window.moldejador;
		}
	}
}
