

function prepare_login_boxes() {
	if (!document.getElementById) return false;
	if (!document.getElementById('login-username') || !document.getElementById('login-password')) return false;
	
	var $field = Array();
	$field['username'] = document.getElementById('login-username');
	$field['password'] = document.getElementById('login-password');
	
	// Set username field behaviour
	if (!$field['username'].value) $field['username'].value = 'Username';
	$field['username'].onfocus = function() {
		if (this.value == 'Username') this.value = '';
	}
	$field['username'].onblur = function() {
		if (this.value == '') this.value = 'Username';
	}
	
	// Set password field behaviour
	if (!$field['password'].value) $field['password'].value = 'Password';
	$field['password'].onfocus = function() {
		if (this.value == 'Password') this.value = '';
	}
	$field['password'].onblur = function() {
		if (this.value == '') this.value = 'Password';
	}
}
addLoadEvent(prepare_login_boxes);
