	function registerLoginForm() {
		$('userLoginForm').addEvent('submit', function(e) {
	
				new Event(e).stop();
	
				var log = $('user_menu');

				this.send({
					update: log,
					evalScripts: true
				});

		});


	}

function clearAuthUser(box) {
if (box.value == "Notandanafn") {
box.value = "";
box.style.color = "#7c7c7c";
}
}

function restoreAuthUser(box) {
if (box.value == "") {
box.value = "Notandanafn";
box.style.color = "#c0c0c0";
}
}

function clearAuthPasswd(box) {
if (box.value == "Lykilorš") {
box.type = "password";
box.value = "";
box.style.color = "#7c7c7c";
}
}

function restoreAuthPasswd(box) {
if (box.value == "") {
box.type = "text";
box.value = "Lykilorš";
box.style.color = "#c0c0c0";
}
}

function highLightPasswordFields() {
	var newPasswd = $('userProfilePasswdNew');
	var repeatPasswd = $('userProfilePasswdRepeat');

	var startFx = new Fx.Styles(newPasswd, {duration: 200, transition: Fx.Transitions.linear, wait: true});
	var endFx = new Fx.Styles(newPasswd, {duration: 200, transition: Fx.Transitions.linear, wait: true});
	startFx.start({'border-color': ['#C0C0C0', '#FF0000']}).chain(function () {endFx.start.delay(3000, endFx, {'border-color': ['#FF0000', '#C0C0C0']})});

	var startFx2 = new Fx.Styles(repeatPasswd, {duration: 200, transition: Fx.Transitions.linear, wait: true});
	var endFx2 = new Fx.Styles(repeatPasswd, {duration: 200, transition: Fx.Transitions.linear, wait: true});
	startFx2.start({'border-color': ['#C0C0C0', '#FF0000']}).chain(function () {endFx2.start.delay(3000, endFx2, {'border-color': ['#FF0000', '#C0C0C0']})});

}




function checkPasswordMatch() {
	var newPasswd = $('userProfilePasswdNew');
	var repeatPasswd = $('userProfilePasswdRepeat');

	if (newPasswd.value != repeatPasswd.value) {
		$('passwordMismatch').setText("Lykiloršin eru ekki eins");
		highLightPasswordFields();
		document.getElementById('userProfilePasswdNew').focus();

	} else
		$('passwordMismatch').setText(" ");
			
}


