﻿    function pop_page(the_URL,page_name,pop_width,pop_height) {
   
    var screen_height = window.screen.availHeight;
    var screen_width = window.screen.availWidth; 

    var doPopUpX = parseInt(screen_width/2)-(pop_width/2); 
    var doPopUpY = parseInt(screen_height/2)-(pop_height/2);    
    
    var pop_resize = "yes";
    var location = "no";
    var mbar = "no";
    var pos = "left="+doPopUpX+",top="+doPopUpY;

    open( the_URL ,page_name,"location="+location+",toolbar="+mbar+",resizable="+pop_resize+",scrollbars=yes,width="+pop_width+",height="+pop_height+"," + pos);
    }
    
    
    
function setVisibility(elementRef, panelRef, eventRef)
{
 if ( typeof elementRef == 'string' )
  elementRef = document.getElementById(elementRef);                                       
 if ( typeof panelRef == 'string' )
  panelRef = document.getElementById(panelRef);                                       

 if ( panelRef != null )
 {
  eventRef = (eventRef) ? eventRef : (window.event) ? window.event : (event.which) ? event.which : null;

  if ( !eventRef )
   return;

  if ( panelRef.style.visibility == 'hidden' )     
  {                             
   panelRef.style.left = eventRef.clientX + document.body.scrollLeft + 10;
   panelRef.style.top = eventRef.clientY + document.body.scrollTop + 10;
   panelRef.style.visibility = 'visible';
   
   // No need to use both the visibility and display properties.
   // Use one or the other.
   //panelRef.style.display = 'block';
   
   elementRef.value = 'Hide Panel';
  }
  else
  {
   panelRef.style.visibility = 'hidden';
   
   // No need to use both the visibility and display properties.
   // Use one or the other.
   //panelRef.style.display = 'none';

   elementRef.value = 'Show Panel';
  }        
 }     
}   
