/* Hack the registration form, so that clicking on the "register" tab will
 * redirect to my own registration form */

(function() {
	var oldOnload = window.onload;
	window.onload = function() {
		if(typeof oldOnload == 'function') {
			oldOnload();
		}
		var $ = jQuery;
		var liCallback = function() {
			window.location = '/register/register.php';
		};

		var setLiEvent = function() {
			$('li').each(function() {
				var li = $(this);
				if(li.find('a').hasClass('second') && li.find('a').attr('href') == '#') {
					console.info('li callback set up');
					this.onclick = liCallback;
					return false;
				}
			});
			setTimeout(setLiEvent, 100);
		};
		setTimeout(setLiEvent, 100);
	};
})();

