if (typeof Prototype != "undefined") {
	document.observe("dom:loaded", function() {
		var payOnlineForms = $$("form.pay_online");
		var objForm;
		var inputUsername, inputPassword;
		
		for (var i = 0; i < payOnlineForms.length; i++) {
			objForm = payOnlineForms[i];
			
			// Username
			inputUsername = objForm.down("input[name='operinit']");
			if (inputUsername) {
				inputUsernameBlurHandler = function() {
					if (!this.value) {
						this.style.color = "#a0a0a0";
						this.value = "username";
						this.setByScript = true;
					}
				};
				inputUsername.observe("blur", inputUsernameBlurHandler);
				inputUsernameBlurHandler.call(inputUsername);
				
				inputUsername.observe("focus", function() {
					if (this.value == "username" && this.setByScript) {
						this.setByScript = false;
						this.style.color = "black";
						this.value = "";
					}
				});
			}
			
			// Password
			inputPassword = objForm.down("input[type='password']");
			if (inputPassword) {
				inputPasswordBlurHandler = function() {
					if (!this.value) {
						this.style.color = "#a0a0a0";
						this.value = "password";
						this.setByScript = true;
					}
				};
				inputPassword.observe("blur", inputPasswordBlurHandler);
				inputPasswordBlurHandler.call(inputPassword);
				
				inputPassword.observe("focus", function() {
					if (this.value == "password" && this.setByScript) {
						this.setByScript = false;
						this.style.color = "black";
						this.value = "";
					}
				});
			}
		}
	});
}
