﻿function pageLoad(sender, args)
{
   //An array of the behavior IDs of each modal popup
   var modalPopups = ['ctl01_mpeImages'];
   AddHiddenEventToPopups(modalPopups);
}
function AddHiddenEventToPopups(modalPopups)
{
   //step through the popups
   for (var i=0; i < modalPopups.length; i++)
   {
      //find the current popup
     var popUp = $find(modalPopups[i]);
     
      //check it exists so the script won't fail
      if (popUp)
      {
         //Add the function below as the event
         popUp.add_hidden(HidePopupPanel);
      }
   }
}

function HidePopupPanel(source, args)
{
   //find the panel associated with the extender
   objPanel = document.getElementById(source._PopupControlID);

   //check the panel exists
   if (objPanel)
   {
      //set the display attribute, so it remains hidden on postback
      objPanel.style.display= 'none';
   }
}



