//Funció per saber l'alçada de la finestra del navegador
function windowHeight() {
        // Standard browsers (Mozilla, Safari, etc.)
        if (self.innerHeight)
                al_var = document.innerHeight;
        // IE 6
        if (document.documentElement && document.documentElement.clientHeight)
                al_var = document.documentElement.clientHeight;
        // IE 5
        if (document.body)
                al_var = document.body.clientHeight;
        // Just in case. 
        return al_var;
}

//Funció per canviar l'alçada de l'element mapa segons el tamany del navegador
function handleResize() {
        windowHeight();
		al_var = al_var - 343;
		if (al_var >= 570) {
        document.getElementById('mapa').style.height = al_var + 'px';
		document.getElementById('inici').style.height = al_var + 70 + 'px';
		}
		else {
		al_var = 570;
		document.getElementById('mapa').style.height = al_var + 'px';
		document.getElementById('inici').style.height = al_var + 70 + 'px';
		}
}

//Funcions amagar/mostrar DIVs
function amaga( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'none';
}

function mostra( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'block':'block';
}


window.onresize = handleResize;
