//global variables that can be used by all the functions on this page. var selects; var inputs; var radios = new Array(); var checkboxes = new Array(); var hovers = new Array(); var buttons = new Array(); //this function runs when the page is loaded so put all your other onload stuff in here too. function init() { //check if styles are enabled and only then start replacing elements if(findPosX(document.getElementById('stylesheetTest')) == -999) { replaceSelects(); replaceRadios(); replaceCheckboxes(); } hoverEffects(); buttonHovers(); } function replaceRadios() { //get all the radio buttons on the page var inputs = document.getElementsByTagName('input'); var j = 0; for(var i=0; i < inputs.length; i++) { if(inputs[i].type=='radio') { radios[j] = inputs[i]; ++j; } } //cycle through the radio inputs for(var i=0; i