﻿jQuery(function() {

    jQuery('input[type=text]').addClass('txt-blur')
    .blur()
    .each(function() {
        var _this = jQuery(this);
        var _title = _this.data('title');
        if (undefined === _title) { return; }
        _this.val(_title);
    })
    .focus(function() {
        var _this = jQuery(this);
        var _title = _this.data('title');
        _this.removeClass('txt-blur');
        if (undefined !== _title) {
            if (_title == _this.val()) { _this.val(''); }
        }
    })
    .blur(function() {
        var _this = jQuery(this);
        var _title = _this.data('title');
        if (_this.val() == '') {
            _this.addClass('txt-blur');
            if (undefined !== _title) {
                _this.val(_title);
            }
        }
    });

    if (ieVersion < 8) {
        jQuery('input[type=text]').focus(function() {
            jQuery(this).addClass('txt-focus');
        })
        .blur(function() {
            jQuery(this).removeClass('txt-focus');
        });
    }
    
});
