/**
 * UVa User Interface
 */ 
var UVa = {
    /**
     * Init UI functions
     */         
    init: function () {
        UVa.azIndex('#az-index-search', '#az-index-results', '#az-desc');
        $(".az-index form").bind("submit", function() { return false; });
    },
    /** 
     * A-Z Index Autocomplete
     * @param searchbox - <input> to be bound
     * @param results - id of results target
     * @loading - id of loading image/animation
     * @desc - id of element which describes the content (ARIA)
     */
    azIndex: function (searchbox, results, desc) {
        clearAutoComplete();
        setAutoComplete(searchbox, results);
        autoComplete("a", "alpha");
        $(searchbox).focus(function(){ $(this).attr("value",""); });
        $(desc).hide();
    }
}
$(document).ready(function () {
    UVa.init();
});