var taula_central_height=0 //  variable que vull utilitzar després
var contenedor_width=0
// -- funció per determinar l'ample del div contenedor i l'alçada per defecte, abans de recrèixer pel contingut si cal
// -- veure http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
function setSize() {
var contenedor_height=0
var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
contenedor_width=myWidth
contenedor_height=myHeight
// -- controlo els amples i alts mínims, màxims:
// -- ample entre 780 i 1260 per cubrir pantalles de 800x600 fins ..... veient la de 1024 i 1280 també aprofitada
if (contenedor_width<780) contenedor_width=780;
if (contenedor_width>1200) contenedor_width=1100;
// -- l'alt com a mínim vull 500 px...
if (contenedor_height<500) contenedor_height=500;
contenedor_width=contenedor_width-40;

// **** FORÇO pq el explorer 6.0 fa el tonto al redimensionar (lag)
contenedor_width=984;

taula_central_height=contenedor_height-80-20-40;
document.getElementById("div_contenedor").style.width= contenedor_width+'px';
document.getElementById("div_contenedor").style.height= contenedor_height+'px';
document.getElementById("taula_central").style.height= taula_central_height+'px';
}

// posa una cookie
function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}

// canvia l'idioma
function setLanguage(nIdioma)
{
//  0.cat 1.cas 2.ang (castellà per defecte)
// poso una cookie amb el nou idioma
SetCookie("bomasl_idioma",nIdioma,30);

// recarrego la pàgina
document.location.reload();
}
