/**********************************************************************************************/
function configurarModal() {
    var modals = $(".modal");
    for (var i = 0; i < modals.length; i++) {
        $('#' + modals[i].id).css({ position: 'absolute', 'z-index': '110', 'display': 'none' });
        $('#' + modals[i].id).hide();
    }
}
function MostrarDivModal(divId) {
    $('#' + divId).css({
        top:	getPageScroll()[1] + (getPageHeight() / 10) ,
        left:	($(document).width()-$('#' + divId).width())/2
      }).show('blind')
      showOverlay();  
}

function OcultarDivModal(divId) {
    hideOverlay();
    $('#' + divId).hide('blind');
}

// getPageScroll() by quirksmode.com
  function getPageScroll() {
    var xScroll, yScroll;
    if (self.pageYOffset) {
      yScroll = self.pageYOffset;
      xScroll = self.pageXOffset;
    } else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
      yScroll = document.documentElement.scrollTop;
      xScroll = document.documentElement.scrollLeft;
    } else if (document.body) {// all other Explorers
      yScroll = document.body.scrollTop;
      xScroll = document.body.scrollLeft;	
    }
    return new Array(xScroll,yScroll) 
  }
  
  
  
   // Adapted from getPageSize() by quirksmode.com
  function getPageHeight() {
  
    var windowHeight
    if (self.innerHeight) {	// all except Explorer
      windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
      windowHeight = document.documentElement.clientHeight;
    } else if (document.body) { // other Explorers
      windowHeight = document.body.clientHeight;
    }	    
    return windowHeight
  }
  
  
  function showOverlay() {
    //if (skipOverlay()) return
    
    if ($('#overlay').length == 0) 
      $("body").append('<div id="overlay"></div>');    
    
      $('#overlay').show();
    return false
  }

  function hideOverlay() {
    //if (skipOverlay()) return

    $('#overlay').fadeOut(200);    
    return false
  }
  
  
/**********************************************************************************************/
