LoginWP = Class.create();
Object.extend(LoginWP.prototype, 
{
	initialize: function(el) {
		this.container = $(el);
		if (this.container == undefined) return 0;
		
		this.userfield = this.container.down("input.txtUsername");
		this.passfield = this.container.down("input.txtPassword");
		this.userfield.value = "username";
		this.passfield.value = "password";
		
		this.userfield.observe("focus", this.handlefocus.bind(this));
		this.passfield.observe("focus", this.handlefocus.bind(this));
		this.userfield.observe("blur", this.handleblur.bind(this));
		this.passfield.observe("blur", this.handleblur.bind(this));
	},
	handlefocus: function(e) {
		if (this.userfield.value == "username") this.userfield.value = "";
		if (this.passfield.value == "password") this.passfield.value = "";
	},
	handleblur: function(e) {
		if (this.userfield.value.length == 0) this.userfield.value = "username";
		if (this.passfield.value.length == 0) this.passfield.value = "password";
	}
});