(function($) {
	//Removes the displayed value in the input-fields. So that they can used as user hints.
	//If the input-value empty, the hint will be taken back.
	//If the class has a password the type will change to password. It will be also taken back to text.
	$(document).on({
			'focusout': function() {
				var $t = $(this);
				if($t.val() == "") {
					$t.val(this.defaultValue);
					$t.addClass('defaultstate');
				} 
				else{
					$t.removeClass('defaultstate');
				}
			},
			'focusin': function() {
				var $t = $(this);
				if($t.val() == this.defaultValue) {
					$t.val('');
				}
				/*
				if($t.hasClass('password')) {
					var newInput = '<input type="password" class="'+$t.attr('class')+'"" id="'+$t.attr('id')+'" name="'+$t.attr('name')+'" />';
					$t.replaceWith(newInput);
					setTimeout(function(){
						$t.focus();
					}, 1000);
				}
				*/
			}
		}, 
		'input[type="text"]'
	);
})(jQuery);

