  Ajax.Responders.register({
    onComplete: function(){
      var lbContent = document.getElementsById('lbContent');
      var links = $A(lbContent.getElementsByTagName('a'));
      if (link.rel.indexOf("popup")!=-1) {
        Event.observe(link, 'click', function(e){
          popupWindow(e);
          Event.stop(e);
        }, false);
      }
    }
  });

  function popupWindow(link) {
    var el = Event.element(link);
    if (el.tagName == 'IMG') {
      if (el.parentNode.tagName == 'A') {
        var el = el.parentNode;
      } else {
        return false;
      }
    }
    window.open(el.href);
    return false;
  }

  function init() {
    var links = $A(document.getElementsByTagName('a'));
    links.each( function(link) {
      if (link.rel.indexOf("popup")!=-1) {
        Event.observe(link, 'click', function(e){
          popupWindow(e);
          Event.stop(e);
        }, false);
      }
    });
  }

  Event.observe(window,'load',init);
  
jQuery.fn.center = function () {
	this.css("position","absolute");
	this.css("top", ((jQuery(window).height() - this.outerHeight()) / 2) + jQuery(window).scrollTop() + "px");
	this.css("left", ((jQuery(window).width() - this.outerWidth()) / 2) + jQuery(window).scrollLeft() + "px");
	return this;
}	
function showHideWhatIsCVV(){
	jQuery('body').append(jQuery('#whatIsCvv'));
	jQuery('#whatIsCvv').toggle().center();
}	
function showHideCCSafety(){
	jQuery('body').append(jQuery('#ccSafety'));
	jQuery('#ccSafety').toggle().center();
}
