(function($) {

$.widget("ui.textelement", {
	getter: "value",
	version: "1.8",
	eventPrefix: "textelement",
   	options: {
        processHover: true
	},	
	
	_create: function() {
		var self = this, o = this.options;
        
        this.element.addClass('ui-widget ui-widget-content ui-state-default ui-corner-all');
        this.element.bind({
            focusin: function() {
                $(this).addClass('ui-state-active');
            },
            focusout: function() {
                $(this).removeClass('ui-state-active');
            }
        });
        
        if (o.processHover == true) {
            this.element.hover(
                function(){
                    $(this).addClass("ui-state-hover");
                },
                function(){
                    $(this).removeClass("ui-state-hover");
                }
            );
        }
    }
});
})(jQuery);

