// webmusicdb.js
//
// common javascript routines for webmusicdb
//
// by Bill Weinman
//
// Copyright 2001 Polymorphic Data Corporation
//

var screen_offset = 0;
var window_width = 498;

function popup(u,n)
{
if(!n) n = "PDBpopup";

// adjust the new position to make sure it doesn't cover the current window
if(screen_offset > 50) screen_offset = 0;
screen_offset += 10;
if((window.screenX == screen_offset) && (window.screenY == screen_offset) ) screen_offset += 10;

popupWindow=window.open(u, n,
  "height=500,width=" + window_width + 
  "toolbar=no,scrollbars=yes,resizable=yes," + 
  "screenX=" + screen_offset +
  ",screenY=" + screen_offset
  );
popupWindow.focus();
}

function button_popup (t,n)
{
t.form.target = n;

// let the receiving instance know that we have a popup window
if(! t._havepopup) {
  t.name = t.name + '_p^popup^';
  t._havepopup = true;
  }

popup('',n);

return true;
}

function button_nopopup (t)
{
t.form.target="_self";
return true;
}

