<!--
var g_winhdlHash = new Object();  // Global hash of handle pop-up window handles
                                  // Called "associate arrays" in JavaScript 
var g_popup_default_width = 455;
var g_popup_default_height = 514;
var g_popup_default_resizeable = 'yes';
var g_popup_fromedge = 10;
var g_popup_width = g_popup_default_width;
var g_popup_height = g_popup_default_height;
var g_popup_resizeable = g_popup_default_resizeable;


//###############################################################
//
function popup(mylink, windowname, bar)
{  // 'bar' is 0 for no sliders or 1 for sliders
if (!window.focus)
  {  // Done if the parent window does not have focus
  return true;
  }
  
close_popup(windowname);  // Close the window if it's open

if('undefined' == bar)
  {  // see if the new window should have sliders, default is none
  bar = 0;
  }  // Anything except zero is a request for sliders

var include_bar = 'no';  
if(0 != bar)
  {
  include_bar = 'yes';
  }
    
var href;
//var width = 455;
//var height = 514;
//var fromedge = 10;
if (typeof(mylink) == 'string')
  {
  href=mylink;
  } else
  {
  href=mylink.href;
  }
//alert(href);  
var left = Math.floor(screen.availWidth - (g_popup_fromedge + g_popup_width));   // Calculate position
//g_winhdlHash[windowname] = window.open(href,windowname,'width=' + width + ',height=' + height + ',dependent=yes,scrollbars=yes,directories=no,location=no,menubar=no,resizable=no,status=no,toolbar=no,left=' + left + ',top=' + fromedge + ',screenX=' + left + ',screenY=' + fromedge);
g_winhdlHash[windowname] = window.open(href,windowname,'width=' + g_popup_width + ',dependent=yes,scrollbars=' + include_bar + ',directories=no,location=no,menubar=no,resizable=' + g_popup_resizeable + ',status=no,toolbar=no,left=' + left + ',top=' + g_popup_fromedge + ',screenX=' + g_popup_width + ',screenY=' + g_popup_height);

//return false;
}


//###############################################################
// This function is supposed to close al1 pop-up windows
// I'm not sure about persistant windows like those made and
// named in topwind()

function cleanup_popup()
{
//var limit = 0;
var hashEntry;
for (hashEntry in g_winhdlHash)
  {
  if(false == g_winhdlHash[hashEntry].closed)
    {
    g_winhdlHash[hashEntry].close();
    }
//  limit++;  // Count entries
  }
  
for (; 0 < hashEntry;)
  {
  hashEntry--;
  delete g_winhdlHash[hashEntry];
  }
}


//###############################################################
// This function closes a specific named pop-up window

function close_popup(windowname)
{
if('undefined' != typeof(g_winhdlHash[windowname]))
  {  // Close any existing pop up window with this name
  if(false == g_winhdlHash[windowname].closed)
    {
    g_winhdlHash[windowname].close();
    }
  delete g_winhdlHash[windowname];
  }
}



//###############################################################
//

function top_size(width, height)
{
if('undefined' == height)
  {
  g_popup_height = g_popup_default_height;
  } else
  {
  g_popup_height = height;
  }
  
if('undefined' == width)
  {
  g_popup_width = g_popup_default_width;
  } else
  {
  g_popup_width = width;
  }
}


//###############################################################
//
function top_resize(allow)
{  // 0 to not allow resizing, 1 to allow it
g_popup_resizeable = g_popup_default_resizeable;
if('undefined' == allow)
  {
  allow = 0;
  }
if(1 == allow)
  {
  g_popup_resizeable = 'yes';
  } 
}



//###############################################################
//
function card_popup(provider)
{ // provider is the encrypted provider information from ParseToolTravelPack()
//alert('In card_popup(');
var tempstr = 'GenerateContactProviderForm.cgi?provider=' + provider;
//alert('tempstr in popuphelps.js card_popup() is ' + tempstr);
top_size(500, 100);
top_resize(1);
//alert('About to do topwind() with ' + tempstr);
topwind(tempstr, 1);  // Make a persistant window
//alert('Exit card_popup()');
}


//###############################################################
// Special Purpose JavaScript Persistent Pop-up Strategy
//   This pop-up will take over until deliberately 
//   clicked off
// Here is the script that will stay here
function topwind(mylink, bar)
{
//g_popup_width = 350;
//g_popup_height = 135;
//g_popup_fromedge = 10;
//g_popup_resizeable = 'no';
popup(mylink, 's_ContactPopup', bar);
top_resize();  // Restore defaults
top_size();
}
//  This goes into the body of the HTML where the pop-up will happen
//
//    <a href="javascript:topwind('windowedHTML');">Click</a> to open small window.</p>
//
//  The following goes in the <body> tag of the HTML passed in by "widowedHTML"
//
//    <body onLoad="window.focus();" onBlur="setTimeout('window.focus()', 100);">


//-->
