

function validate_required(field)
{
	with (field)
	{
		if (value==null||value=="")
			{
			return false;
			}
		else {return true;}
	}
}

function validateLogin(usernameField, passField) {
	
	var valid = true;
	
	if (validate_required(usernameField)==false) {
		
		usernameField.style.backgroundColor = "#ffcccc";
		document.getElementById('spanUsername').style.display = "inline";
		usernameField.focus();
		valid = false;
		
	}
	else {
		
		usernameField.style.backgroundColor = "#ffffff";
		document.getElementById('spanUsername').style.display = "none";
		
	}
	
	if (validate_required(passField)==false) {
		
		passField.style.backgroundColor = "#ffcccc";
		document.getElementById('spanPassword').style.display = "inline";
		passField.focus();
		valid = false;
		
	}
	else {
		
		passField.style.backgroundColor = "#ffffff";
		document.getElementById('spanPassword').style.display = "none";
		
	}
	
	return valid;
		
}
