function placeholderFocus() {
    if (!this.is_focused) {
        this.is_focused = 1;
        this.value = "";
        this.style.color = "#000";
        var rs = this.getAttribute("radioselect");
        if (rs && rs != "") {
            var re = document.getElementById(rs);
            if (!re) {
                return;
            }
            if (re.type != "radio") {
                return;
            }
            re.checked = true;
        }
    }
}

function placeholderBlur() {
    var ph = this.getAttribute("placeholder");
    if (this.is_focused && ph && this.value == "") {
        this.is_focused = 0;
        this.value = ph;
        this.style.color = "#777";
    }
}


function placeholderSetup(id) {
        var el = document.getElementById(id);
        if (!el) {
            return;
        }
       
        var ph = el.getAttribute("placeholder");
        if (ph && ph != "") {
            el.value = ph;
            el.style.color = "#777";
            el.is_focused = 0;
            el.onfocus = placeholderFocus;
            el.onblur = placeholderBlur;
        }
    }
