/* my_account.js */

// used on many pages 
function enableLinks () {
    $$('a[href="why.htm"]').each( function p(n) {
	    n.observe('click', createPopup);
	});
}

function enablePaypalPopups() {
	$$('a[title="Paypal PayLater"]').each ( function p(n) {
		n.observe('click', createPopup);
    });
}

function createPopup(e) {
    var thelink = Event.findElement(e, 'A');
	window.open(thelink.href, '', "scrollbars=yes,height=650,width=800,top=100,left=100");
	Event.stop(e);
}


/* create account page */
function loadCreateAccount() {
    document.observe ('dom:loaded', function x() {
	    enableLinks();
	});
}

/* can be used on multiple pages */
function loadPaypalPayLater() {
	document.observe ('dom:loaded', function x() {
	    enablePaypalPopups();
	});
}