var inputUsername, inputPassword;
var inputSingle = false;

function focususername() {
	$user_loc=document.getElementById('nutrigoals_user');
	$pass_loc=document.getElementById('nutrigoals_pass');
	if ($user_loc.value=='') {
		$user_loc.focus();
	} else {
		$pass_loc.focus();
	}	
}

function goto(where) {
	window.location=where;	
}

function begintextboxwatch(which) {
	if (which == 'regular') {
		if (inputSingle != 'username') {
			if (inputUsername.value != "") {
				inputUsername.className = 'inputnull';
			} else {
				inputUsername.className = 'inputhover_username';
			}
		}
		if (inputSingle != 'password') {
			if (inputPassword.value != "") {
				inputPassword.className = 'inputnull';
			} else {
				inputPassword.className = 'inputhover_password';
			}
		}
		setTimeout('begintextboxwatch(\'regular\')',100);
	} else if (which == 'focus_username') {
		inputUsername.className = 'inputnull';
		inputSingle = 'username';
	} else if (which == 'blur_username') {
		inputSingle = false;
		setTimeout('begintextboxwatch(\'regular\')',100);
	} else if (which == 'focus_password') {
		inputPassword.className = 'inputnull';
		inputSingle = 'password';
	} else if (which == 'blur_password') {
		inputSingle = false;
		setTimeout('begintextboxwatch(\'regular\')',100);
	}
}

function inittextbox() {
	inputUsername = document.getElementById('nutrigoals_user');
	inputPassword = document.getElementById('nutrigoals_pass');
	begintextboxwatch('regular');
}