//скрипт для формирования красивых выпадающих списков
document.write('<style type="text/css">input.normal_filter,input.active_filter { display: none; } select.normal_filter,select.active_filter { position: relative; opacity: 0; filter: alpha(opacity=0); z-index: 5; } .disabled { opacity: 0.5; filter: alpha(opacity=50); }</style>');
var Custom = {
    init: function () {
        var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active;
       
        
        inputs = document.getElementsByTagName("select");
        for (a = 0; a < inputs.length; a++) {
            if (inputs[a].className == "normal_filter" || inputs[a].className == "active_filter") {
                option = inputs[a].getElementsByTagName("option");
                active = option[0].childNodes[0].nodeValue;
                textnode = document.createTextNode(active);
                for (b = 0; b < option.length; b++) {
                    if (option[b].selected == true) {
                        textnode = document.createTextNode(option[b].childNodes[0].nodeValue);
                    }
                }
                span[a] = document.createElement("span");
                if (inputs[a].className == "active_filter")
                    span[a].className = "select_active";
                else
                    span[a].className = "select";
                span[a].id = "select" + inputs[a].name;
                span[a].appendChild(textnode);
                //span[a].style.font-size='12pt'

                span[a].style.width = inputs[a].offsetWidth + 15 + 'px';
                inputs[a].style.width = inputs[a].offsetWidth + 29 + 'px';
                //alert(inputs[a].width());
                inputs[a].parentNode.insertBefore(span[a], inputs[a]);
                if (!inputs[a].getAttribute("disabled")) {
                    // inputs[a].onchange = Custom.choose;
                } else {
                    inputs[a].previousSibling.className = inputs[a].previousSibling.className += " disabled";
                }
            }
        }
       // document.onmouseup = Custom.clear;
    }
    
    
   
}
//window.onload = Custom.init;

