﻿// JScript File

function showModal(blackOutID, contentID) 
 {
  var screenWidth = document.body.clientWidth; 
  var screenHeight = document.body.clientHeight;
    
  var modalWidth = contentID.style.width;
  modalWidth = modalWidth.replace(/px/gi,'');
    
  var modalHeight = contentID.style.height;
  modalHeight = modalHeight.replace(/px/gi,'');
  
  var leftLoc;
  if (modalWidth == 'auto' || modalWidth == '')
   {
    leftLoc = (screenWidth/4);
    leftLoc = leftLoc + 'px';
   }
  else
   {
    leftLoc = (screenWidth - modalWidth)/2;
    leftLoc = leftLoc + 'px';
   }
  
  var topLoc;
  if (modalHeight == 'auto' || modalHeight == '')
   {
    topLoc = (screenHeight/4);
    topLoc = topLoc + 'px';
   }
  else
   {
    topLoc = (screenHeight - modalHeight)/2;
    topLoc = topLoc + 'px';
   }
  
  contentID.style.display = 'block';
  contentID.style.left = leftLoc; 
  contentID.style.top =  topLoc;
  blackOutID.style.display = 'block';
  blackOutID.style.width = screenWidth;
  blackOutID.style.height = screenHeight;
 }
 
 
function hideModal(blackOutID, contentID)
 {
  blackOutID.style.display = 'none';
  contentID.style.display = 'none';  
 }
 

