
var div_central_height=0;
var div_contenedor_height=0;
var div_peu_height=50; // ha de coincidir amb la mida del peu que tenim al css
var div_peu_adicional_height=0;


function setSize_accordion_content()
{
	if (document.getElementById("content_resize"))
	{
	// alert(div_central_height);
	document.getElementById("content_resize").style.height=(div_central_height-90-20*5-4)+'px';
	}
}

// -- 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_1()
{
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;
  }
  
div_contenedor_height=myHeight;
// -- controlo els amples i alts mínims, màxims:
// -- el width el tinc forçat a 984px pq es vegi correctament a partir de 1024
// -- ALT TOTAL DE CAP+COS+PEU entre 600 i 1060 MAXIM
if (div_contenedor_height<600) div_contenedor_height=600;
if (div_contenedor_height>1060)
{
div_peu_adicional_height=div_contenedor_height-1060;
div_contenedor_height=1060;
}

div_central_height=div_contenedor_height-div_peu_height-div_peu_adicional_height; // 90 és el banner

// --------- elements centrals i esquerra
document.getElementById("div_contenedor").style.height= div_contenedor_height+'px';
document.getElementById("div_central").style.height= div_central_height+'px';
document.getElementById("div_central_esquerra").style.height= div_central_height+'px';
document.getElementById("div_central_esquerra_body").style.height= (div_central_height-90)+'px';
}



// -- 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_2()
{
// -- elements de la dreeta
document.getElementById("div_central_dreta").style.height= div_central_height+'px';
document.getElementById("div_central_dreta_body").style.height= (div_central_height-90)+'px';

// -- peu
if (div_peu_adicional_height>0)
{
document.getElementById("div_peu_adicional").style.height=div_peu_adicional_height+'px';	
}

// calculem la mida final de la imatge:
var alt_body_imatge=div_central_height-90;
if (alt_body_imatge<525) alt_body_imatge=525;
if (alt_body_imatge>525)
{
var ample=alt_body_imatge*1.33;	
document.getElementById("back_image").width=ample;
document.getElementById("back_image").height=alt_body_imatge;
}
// si la mida és més petita la deixem tal com està

document.getElementById("translucentbkg").style.height=(div_central_height-90-20)+'px'; // 20 és la mida del label que sempre tinc
document.getElementById("div_over_transparency").style.height=(div_central_height-90-20)+'px';

// FAIG SORTIR ELS SCROLLS DEL MENU !!!!!!!!
document.getElementById("content_scroll_resize_1").style.height=(div_central_height-90-20*5-4)+'px';
document.getElementById("content_scroll_resize_2").style.height=(div_central_height-90-20*5-4)+'px';
document.getElementById("content_scroll_resize_3").style.height=(div_central_height-90-20*5-4)+'px';
document.getElementById("content_scroll_resize_4").style.height=(div_central_height-90-20*5-4)+'px';
document.getElementById("content_scroll_resize_5").style.height=(div_central_height-90-20*5-4)+'px';
// alert("size 2");
}


// -- 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_obsolet_hofaigenvariesetapes()
{
var div_central_height=0;
var div_contenedor_height=0;
var div_peu_height=50; // ha de coincidir amb la mida del peu que tenim al css
var div_peu_adicional_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;
  }
  
div_contenedor_height=myHeight;
// -- controlo els amples i alts mínims, màxims:
// -- el width el tinc forçat a 984px pq es vegi correctament a partir de 1024
// -- ALT TOTAL DE CAP+COS+PEU entre 600 i 1060 MAXIM
if (div_contenedor_height<600) div_contenedor_height=600;
if (div_contenedor_height>1060)
{
div_peu_adicional_height=div_contenedor_height-1060;
div_contenedor_height=1060;
}

div_central_height=div_contenedor_height-div_peu_height-div_peu_adicional_height; // 90 és el banner

document.getElementById("div_contenedor").style.height= div_contenedor_height+'px';
document.getElementById("div_central").style.height= div_central_height+'px';
document.getElementById("div_central_esquerra").style.height= div_central_height+'px';
document.getElementById("div_central_dreta").style.height= div_central_height+'px';

document.getElementById("div_central_esquerra_body").style.height= (div_central_height-90)+'px';
document.getElementById("div_central_dreta_body").style.height= (div_central_height-90)+'px';

if (div_peu_adicional_height>0)
{
document.getElementById("div_peu_adicional").style.height=div_peu_adicional_height+'px';	
}

// calculem la mida final de la imatge:
var alt_body_imatge=div_central_height-90;
if (alt_body_imatge<525) alt_body_imatge=525;
if (alt_body_imatge>525)
{
var ample=alt_body_imatge*1.33;	
document.getElementById("back_image").width=ample;
document.getElementById("back_image").height=alt_body_imatge;
}
// si la mida és més petita la deixem tal com està

document.getElementById("translucentbkg").style.height=(div_central_height-90-20)+'px'; // 20 és la mida del label que sempre tinc
document.getElementById("div_over_transparency").style.height=(div_central_height-90-20)+'px';

// SOL EL CONTENT OBERT
document.getElementById("content_resize").style.height=(div_central_height-90-20*5-4)+'px';
// PERO TOTS ELS SCROLLS !!!!!!!!
document.getElementById("content_scroll_resize_1").style.height=(div_central_height-90-20*5-4)+'px';
document.getElementById("content_scroll_resize_2").style.height=(div_central_height-90-20*5-4)+'px';
document.getElementById("content_scroll_resize_3").style.height=(div_central_height-90-20*5-4)+'px';
document.getElementById("content_scroll_resize_4").style.height=(div_central_height-90-20*5-4)+'px';
document.getElementById("content_scroll_resize_5").style.height=(div_central_height-90-20*5-4)+'px';
// document.write
}



