function collectExternalLinks() {
	$$('a.external').each(
		function(link) {
			link.onclick = function() {
				window.open(this.href);
				return false;
			}
		}
	);
}

// add the '>' after the bigbutton contents in f***ing ie who doesn't support css cg...
function addIEBigbuttonContent() {
	if(false == Prototype.Browser.IE) {
		return;
	}
	$$('a.bigbutton').each(
		function(btn){
			if ( !btn.className.include('back') ) {
				btn.insert('&nbsp;&gt;');
			}
		}
	);
	
	$$('a.back').each(
		function(btn){
			btn.insert({ top: '&lt;&nbsp;' });
		}
	);
}

function assignPWLostBtnAction() {
	if ( !$('show-pwlost-form') ) {
		return;
	}
	
	$('show-pwlost-form').onclick = function() {
		if ( !$('pwlost-form').className.include('none') ) {
			return false;
		}
		$('pwlost-form').removeClassName('none');
		$('pwlost-form').hide();
		new Effect.Appear( $('pwlost-form'), { duration: .5 } );
		return false;		
	};

}

// add the '>' to form submit buttons
function tuneSubmitButtons() {
	$$('input[type=submit]') . each(
		function(element) {
			element.value += ' >';
		}
	);
}

function initJS() {
	collectExternalLinks();
	addIEBigbuttonContent();
	assignPWLostBtnAction();
	tuneSubmitButtons();
}

document.observe(
	'dom:loaded',
	initJS
);
