
function init() {
	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 == "styled") {
			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");
			span[a].className = "select";
			span[a].id = "select" + inputs[a].name;
			span[a].appendChild(textnode);
			inputs[a].parentNode.insertBefore(span[a], inputs[a]);
		}
	}
}

init();