var checkboxHeight = "25", radioHeight = "25", selectWidth = "190"; document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: ' + selectWidth + "px; opacity: 0; filter: alpha(opacity=0); z-index: 5; } .disabled { opacity: 0.5; filter: alpha(opacity=50); }</style>");
var Custom = { init: function() {
    var c = document.getElementsByTagName("input"), e = [], f, g; for (a = 0; a < c.length; a++) if (("checkbox" == c[a].type || "radio" == c[a].type) && -1 != c[a].className.indexOf("styled")) {
        e[a] = document.createElement("span"); e[a].className = c[a].type; if (!0 == c[a].checked) position = "checkbox" == c[a].type ? "0 -" + 2 * checkboxHeight + "px" : "0 -" + 2 * radioHeight + "px", e[a].style.backgroundPosition = position; c[a].parentNode.insertBefore(e[a], c[a]); c[a].onchange = Custom.clear; c[a].getAttribute("disabled") ? e[a].className =
e[a].className += " disabled" : (e[a].onmousedown = Custom.pushed, e[a].onmouseup = Custom.check)
    } c = document.getElementsByTagName("select"); for (a = 0; a < c.length; a++) if (-1 != c[a].className.indexOf("styled")) {
        g = c[a].getElementsByTagName("option"); f = g[0].childNodes[0].nodeValue; f = document.createTextNode(f); for (b = 0; b < g.length; b++) !0 == g[b].selected && (f = document.createTextNode(g[b].childNodes[0].nodeValue)); e[a] = document.createElement("span"); e[a].className = "select"; e[a].id = "select" + c[a].name; e[a].appendChild(f); c[a].parentNode.insertBefore(e[a],
c[a]); c[a].getAttribute("disabled") ? c[a].previousSibling.className = c[a].previousSibling.className += " disabled" : c[a].onchange = Custom.choose
    } document.onmouseup = Custom.clear
}, pushed: function() { element = this.nextSibling; this.style.backgroundPosition = !0 == element.checked && "checkbox" == element.type ? "0 -" + 3 * checkboxHeight + "px" : !0 == element.checked && "radio" == element.type ? "0 -" + 3 * radioHeight + "px" : !0 != element.checked && "checkbox" == element.type ? "0 -" + checkboxHeight + "px" : "0 -" + radioHeight + "px" }, check: function() {
    element =
this.nextSibling; if (!0 == element.checked && "checkbox" == element.type) this.style.backgroundPosition = "0 0", element.checked = !1; else {
        if ("checkbox" == element.type) this.style.backgroundPosition = "0 -" + 2 * checkboxHeight + "px"; else { this.style.backgroundPosition = "0 -" + 2 * radioHeight + "px"; group = this.nextSibling.name; inputs = document.getElementsByTagName("input"); for (a = 0; a < inputs.length; a++) if (inputs[a].name == group && inputs[a] != this.nextSibling) inputs[a].previousSibling.style.backgroundPosition = "0 0" } element.checked =
!0
    } $(element).trigger("change")
}, clear: function() {
    inputs = document.getElementsByTagName("input"); for (var c = 0; c < inputs.length; c++) if ("checkbox" == inputs[c].type && !0 == inputs[c].checked && -1 != inputs[c].className.indexOf("styled")) inputs[c].previousSibling.style.backgroundPosition = "0 -" + 2 * checkboxHeight + "px"; else if ("checkbox" == inputs[c].type && -1 != inputs[c].className.indexOf("styled")) inputs[c].previousSibling.style.backgroundPosition = "0 0"; else if ("radio" == inputs[c].type && !0 == inputs[c].checked && -1 != inputs[c].className.indexOf("styled")) inputs[c].previousSibling.style.backgroundPosition =
"0 -" + 2 * radioHeight + "px"; else if ("radio" == inputs[c].type && -1 != inputs[c].className.indexOf("styled")) inputs[c].previousSibling.style.backgroundPosition = "0 0"
}, choose: function() { option = this.getElementsByTagName("option"); for (d = 0; d < option.length; d++) if (!0 == option[d].selected) document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue } 
}; window.onload = Custom.init;
