window.onload = function() {
    stripe("Table1");
    highlightFormFields();
}

function highlightFormFields() {
    var types = new Array("INPUT", "TEXTAREA");
    var elems;
    for(var i = 0; i < types.length; i++) {
        elems = document.getElementsByTagName(types[i]);
        for(var j = 0; j < elems.length; j++) {
            var el = elems[j];

            if(el.type === 'submit') { continue; }

            el.onfocus = function() {
                this.className = "focus";
            }
            el.onblur = function() {
                this.className = "";
            }
        }
    }
}

function stripe(tablename) {
    var table = document.getElementById(tablename);
    if(table != null) {
        var cells = table.getElementsByTagName("TR");
        for(var i = 0; i < cells.length; i++) {
            if(i % 2 == 0) cells[i].className = "alt";
        }
    }
}

// could just use form.reset() but we don't
// wanna clear out all the other data
function resetFees() {
    var arr = document.getElementsByTagName("INPUT");
    for(var i = 0; i < arr.length; i++) {
        if(arr[i].type == "radio") arr[i].checked = false;
    }
}

