addLoadListener(init);



function init()

{

  var button = document.getElementById("subscribe_button");

  button.onclick = function()

  {

    var subscribe = popupForm(document.forms[0].action, 300, 160, 'scroll');



    return subscribe.closed;

  };



  return true;

}



function popupForm(url, width, height, overflow)

{

  if (width > 640) { width = 640; }

  if (height > 480) { height = 480; }



  if (overflow == '' || !/^(scroll|resize|both)$/.test(overflow))

  {

    overflow = 'both';

  }



  var win = window.open(url, '',

      'width=' + width + ',height=' + height

      + ',scrollbars=' + (/^(scroll|both)$/.test(overflow) ? 'yes' : 'no')

      + ',resizable=' + (/^(resize|both)$/.test(overflow) ? 'yes' : 'no')

      + ',status=yes,toolbar=no,menubar=no,location=no'

  );



  return win;

}



function addLoadListener(fn)

{

  if (typeof window.addEventListener != 'undefined')

  {

    window.addEventListener('load', fn, false);

  }

  else if (typeof document.addEventListener != 'undefined')

  {

    document.addEventListener('load', fn, false);

  }

  else if (typeof window.attachEvent != 'undefined')

  {

    window.attachEvent('onload', fn);

  }

  else

  {

    var oldfn = window.onload;

    if (typeof window.onload != 'function')

    {

      window.onload = fn;

    }

    else

    {

      window.onload = function()

      {

        oldfn();

        fn();

      };

    }

  }

}

