var PromptLabel = function (field) {
	this.field = field;
	this.label = this.field.find('label'); // the <label>
	this.input = this.field.find('.prompt'); // the <input>
	this.setup();
};
PromptLabel.prototype = {
	setup: function () {
		var self = this;
		if (this.input.val() != '') {
			this.focus();
		}
		this.label.click(function () { self.focus(); });
		this.input.focus(function () { self.focus(); });
		this.input.blur(function () { self.blur(); });
	},
	focus: function () {
		this.label.hide();
		this.field.addClass('active');
		this.input.addClass('active');
	},
	blur: function () {
		if (this.input.val() == '') {
			this.label.show();
		}
		this.field.removeClass('active');
	}
};


jQuery(document).ready(function () {
	try {
		document.execCommand('BackgroundImageCache', false, true);
	} catch (e) {}

	jQuery('.tout.contact .field').each(function () {
		new PromptLabel(jQuery(this));
	});
});
