bqc.advInputBox = {

    inputs: {},

    focus: function(el) {
        var input = bqc.advInputBox.inputs[el.id];
        if (input == null) {
            input = {
                original: el.value
            };
            bqc.advInputBox.inputs[el.id] = input;
        }
        if (el.value == input.original) {
            el.value = '';
        }
    },

    blur: function(el) {
        if (el.value == null || el.value.length == 0) {
            el.value = bqc.advInputBox.inputs[el.id].original;
        }
    },

    isSet: function(el) {
        var input = bqc.advInputBox.inputs[el.id];
        return el.value != null && el.value.length > 0 && input != null &&
            input.original != el.value;
    },

    getValue: function(el) {
        return (bqc.advInputBox.isSet(el)) ? el.value : '';
    }
};
