function showSubscribeForm()
{
  hideSelectBoxes();
  hideFlash();
	
  var arrayPageSize = getPageSize();
  Element.setWidth('subscribeFormOverlay', arrayPageSize[0]);
  Element.setHeight('subscribeFormOverlay', arrayPageSize[1]);
  new Effect.Appear('subscribeFormOverlay', { duration: 0.2, from: 0.0, to: 0.8 });

  var arrayPageScroll = getPageScroll();
  var lightboxTop = arrayPageScroll[1] + (arrayPageSize[3] / 5);
  var lightboxLeft = arrayPageScroll[0];
  Element.setTop('subscribeForm', lightboxTop);
  Element.setLeft('subscribeForm', lightboxLeft);
  Element.setWidth('subscribeForm', arrayPageSize[0]);
  // Element.show('subscribeForm');
  new Effect.Appear('subscribeForm', { duration: 0.2, from: 0.0, to: 1.0 });
  // new Effect.Appear('subscribeFormContainer', { duration: 0.2, from: 0.0, to: 1.0 });
}

function closeSubscribeForm()
{
  Element.hide('subscribeForm');
  new Effect.Fade('subscribeFormOverlay', { duration: 0.2});
  showSelectBoxes();
  showFlash();
}

function submitSubscribeForm(form)
{
    if($('email').value.match(/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/gi) != null)
    {
        new Ajax.Request('/subscribe.php', {
            asynchronous:true, 
            parameters: 
                Form.serialize(form),
                onSuccess:function(t) {
                    closeSubscribeForm()
                    },
                on500:function(t) {
                    alert("Can't process submission at this time, please try again later.")
                    closeSubscribeForm()
                    },
                on400:function(t) {
                    $('email').className = 'text error';
                    $('emailError').style.visibility = 'visible';
                    }
                });
    }
    else
    {
        $('email').className = 'text error';
    }
}