function getCoord(elm){
var coords = {x: 0, y: 0};
while (elm) {
coords.x += elm.offsetLeft;
coords.y += elm.offsetTop;
elm=elm.offsetParent;
}
return coords;
}

function ajusta1p(){
 var bott=document.getElementById("footer_div");
 var aux2=document.getElementById("aux_div_c");

 var coords1=getCoord(aux2);
 var coords2=getCoord(bott);

 aux2=document.getElementById("aux_div_c");
 aux3=document.getElementById("aux_div_c_int");

 if(h>0){
  aux2.style.height=h;
  var h2=h-36;
  if(h2>0)
   aux3.style.height=h2;
  aux2.style.visibility="visible";
 }
 else{
  aux2.style.height=36;
  aux2.style.visibility="visible";
  aux3.style.height=0;
 }
 
 aux2=document.getElementById("aux_div_c2");
 bott=document.getElementById("footer_div");
 
 coords1=getCoord(aux2);
 coords2=getCoord(bott);

 var h=bottdt-coords1.y;
 aux2=document.getElementById("aux_div_c2");
 if(h>0){
  aux2.style.height=h;
  aux2.style.visibility="visible";
 }
}

function ajusta(){
 var bott=document.getElementById("footer_div");
 var aux2=document.getElementById("aux_div_c");

 var coords1=getCoord(aux2);
 var coords2=getCoord(bott);

 var h=coords2.y-coords1.y;
 aux2=document.getElementById("aux_div_c");
 aux3=document.getElementById("aux_div_c_int");

 if(h>0){
  aux2.style.height=h;
  var h2=h-36;
  if(h2>0)
   aux3.style.height=h2;
  aux2.style.visibility="visible";
 }
 else{
  aux2.style.height=36;
  aux2.style.visibility="visible";
  aux3.style.height=0;
 }
}
