﻿// JScript File

function OpenPagePanel(panel)
{
    DarkenPage();
    
    ShowPanel(panel);
}

function DarkenPage()
{
    var page_screen = document.getElementById('page_screen');
    page_screen.style.height = document.body.parentNode.scrollHeight + 'px';
    page_screen.style.display = 'block';
    page_screen.style.zindex = '9999';
}


function ShowPanel(panel)
{
   var page_panel = document.getElementById(panel);
    
    // w is a width of the page panel
   w = 500;
    // h is a height of the page panel
   h = 300;
    
   //get the x and y coordinates to center the page panel
   xc = Math.round((document.body.clientWidth/2)-(w/2))
   yc = Math.round(150)
    
    //show the page panel
   page_panel.style.left = xc + "px";
   page_panel.style.top  = yc + "px";
   page_panel.style.display = 'block'; 
   page_panel.style.position = 'absolute';
   page_panel.style.zindex = '10000';
  // page_panel.style.
}

function HidePanel(panel)
{
    // hide the page panel
    var page_panel = document.getElementById(panel);
    page_panel.style.display = 'none';
      LightenPage();
    // clear errors
    ClearErrorMessages();    
    
    // lighten the page again
  
}



// this function removes the dark screen and the page is light again
function LightenPage()
{
    var page_screen = document.getElementById('page_screen');
    page_screen.style.display = 'none';
  
}


function ClearErrorMessages()
{
    document.getElementById('EmailTextBox').style.display = 'none';
}
