/*
 *   Coding Domain scripting functions: Popup Windows
 *
 *   Copyright (c) 2001 Diederik van der Boor - All Rights Reserved
 *   http://www.codingdomain.com
 *   webmaster@codingdomain.com
 */



// ----------------------------------------------------------------------
// Open a Popup Window


// You can define the functions here that should be called from a
// onClick event in a <A href="..." target="name"> tag.
//
// The first argument should be identical to the name specified in
// the target="name" attribute of the <A href> tag.
// o Example:
//   <A href="/cgi-bin/x-forum.cgi" target="XProgForum" onClick=return OpenForum(this)">Forum</A>



function OpenForum(O)     { return OpenPopup(O.href,  O.target, 'menubar,toolbar,location'           ); }
function OpenDownload(O)  { return OpenPopup(O.href,  O.target, 'width=580,height=170'               ); }


// ----------------------------------------------------------------------
// Function to open a popup window

function OpenPopup(href, ClassName, MoreParams)
{
  // Default Parameters
  MoreParams = "status,scrollbars,resizable" + (MoreParams ? "," + MoreParams : '');

  // Show the popup
  var Popup = window.open(href, ClassName, MoreParams);
  if(Popup.location.href != href) { Popup.location.href = href; } // IE3 bugfix
  Popup.focus();           // If already shown, bring to top.

  // The "Popup.location.href" will be set from the hyperlink
  // when the window name matches the target property of the link.
  return false;
}

