﻿
function AdjustSideDivHeight() {
  // obter ref para as Div's
  var ContentDiv = document.getElementById('ContentDiv');
  var SideDiv = document.getElementById('SideDiv');

  // obter quanto pixels de padding vertical a Div lateral tem
  //var wPadding = $(SideDiv).outerWidth() - $(SideDiv).width();
  var hPadding = $(SideDiv).outerHeight() - $(SideDiv).height();
  //var HeightPadding = wPadding + hPadding;

  //alert('sidediv height: ' + $(SideDiv).height() + '  x  contentdiv height: ' + $(ContentDiv).height());
  // se a altura da Div lateral for menor que a altura da div do conteudo
  if ($(SideDiv).height() < $(ContentDiv).height()) {
    // fazer a div lateral ficar com a mesma altura da div do conteudo
    SideDiv.style.height = ContentDiv.offsetHeight - hPadding + 'px';
  }
  // alert(SideDiv.style.height);
};

// funcao para exibir um texto qualquer para ajudar no desenvolvimento/debug
// a var bDebugMode deve estar declarada e preenchida na pagina que usar esta funcao
function ShowDebugInfo(pText) {
  if (bDebugMode) { // apenas se estiver em debugmode, exibir o texto
    alert('(Mensagem exibida devido ao debugmode=1)\n\n' + pText);
  }
}

//funcao para exibir u mtexto qualquer para ajudar no desenvolvimento/debug
// o texto serah exibido no TesteSPAN que fica declarado no site.Master, se este TesteSPAN for encontrado
function ShowDebugText(pText) {
  var TesteSPAN = document.getElementById('TesteSPAN');
  if (TesteSPAN) { // se o controle foi encontrado
    var TesteSPAN_Display = TesteSPAN.style.display; // obter o texto do atributo CSS display para usar abaixo com o toLowerCase()
    if (TesteSPAN_Display.toLowerCase() != 'none') { // se o controle encontrado estah sendo exibido na tela
      //alert(TesteSPAN.style.display);
      TesteSPAN.innerHTML += '<br />' + (new Date).toLocaleTimeString() + ' - ' + (new Date).getMilliseconds() + ' --> ' + pText;
    } 
  }
}

