/**
 * Function: loginForm()
 * Toggles the login form on and off
 * when clicking the "Login" link at
 * the top. It gradually degrades to
 * just linking to a login page if
 * the user doesn't have Javascript
 * enabled.
 */
function loginForm() {
	if(document.getElementById("loginForm").style.display == 'block') {
		document.getElementById("loginForm").style.display = 'none';
	}
	else {
		document.getElementById("loginForm").style.display = 'block';
	}
	
	return true;
}

/**
 * Function: loginCP()
 * Toggles the login form on and off
 * when clicking the "Login" link at
 * the top. It gradually degrades to
 * just linking to a login page if
 * the user doesn't have Javascript
 * enabled.
 */

function loginCP() {
	if(document.getElementById("loginCP").style.display == 'block') {
		document.getElementById("loginCP").style.display = 'none';
	}
	else {
		document.getElementById("loginCP").style.display = 'block';
	}
	
	return true;
}

/**
 * Function: focused()
 * Changes an object's value when focused.
 *
 * Parameters:
 *  - object: object resource identifier
 */
function focused(object) {
	if(object.value == " Username  ") {
		object.value = "";
	}
	return true;
}

/**
 * Function: blurred()
 * Changes an object's value when blurred.
 *
 * Parameters:
 *  - object: object resource identifier
 */
function blurred(object) {
	if(object.value == "") {
		object.value = " Username  ";
	}
	return true;
}

/**
 * Function: focusedpass()
 * Changes a password's value and type when focused.
 *
 * Parameters:
 *  - object: object resource identifier
 */
function focusedpass(object) {
	if(object.value == " Password  ") {
		object.value = "";
	}
	return true;
}

/**
 * Function: blurredpass()
 * Changes a password's value and type when blurred.
 *
 * Parameters:
 *  - object: object resource identifier
 */
function blurredpass(object) {
	if(object.value == "") {
		object.value = " Password  ";
	}
	return true;
}