/**********************************************************************************************/

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);    
    $('#overlay').remove();
    return false
  }
      function MostrarModalJQ(divId){
    $("#"  + divId).dialog('open');
  }
  function OcultarModalJQ(divId){
    $("#"  + divId).dialog('close');
  }
  
/**********************************************************************************************/
