var UVa = {
    init: function () {
        UVa.wipSlideshow('#slideshow', '{timeout: 1000}');
    },
    textSize: function () {
    },
    homeAccordion: function () {
    },           
    expandableBoxes: function () {
    },
    audiencePanels: function () {
    },
    emulateHover: function (items) {
    },
    sitePrefsToggle: function (items) {
    },
    mainNav: function () {
    },
    rollovers: function () {
    },
    preloadImages: function (images) {
    },
    azIndex: function (searchbox, results, desc) {},
    wipSlideshow: function (target, args) {
        $(target).slideshow({timeout: 1000});
    },
    loadPrefs: function() {
    
        //nav mouseover or hover
        if($.cookie('prefs_navclick') !== null && $.cookie('prefs_navclick') == "1") {
          UVa.emulateHover($('#nav li'));
        } else {
          UVa.mainNav();
        }
        //accordion
        if ($.cookie('prefs_accordion') !== null && $.cookie('prefs_accordion') != '') {
          $('#home-accordion').accordion('activate', parseInt($.cookie('prefs_accordion')));
        }
        //search
        if ($.cookie('prefs_search') !== null && $.cookie('prefs_search') != '') {
          $(".search_type:eq(" + $.cookie('prefs_search') + ")").attr("checked","checked");
          $(".search_type2:eq(" + $.cookie('prefs_search') + ")").attr("checked","checked");
        } else {
          $(".search_type:eq(0)").attr("checked","checked");
          $(".search_type2:eq(0)").attr("checked","checked");
        }
    }
}
/**
 * Sortable boxes 
 */
UVa.SortableBoxes = {
    closed: Array, 
    numSortables: 3,

    init: function () {
    
    },
    
    moveBoxes: function () {
    
        $("#sortable1").sortable({
            connectWith: ["#sortable2", "#sortable3"],
            handle: "h2",
			update: function(e, ui) {
               UVa.SortableBoxes.createCookie('sortable1', $(this).sortable('toArray'));
            },
            receive: function(e, ui) {
                UVa.SortableBoxes.createCookie('sortable1', $(this).sortable('toArray'));
            },
            remove: function(e, ui) { 
                UVa.SortableBoxes.createCookie('sortable1', $(this).sortable('toArray'));
            } 
        }); 
        $("#sortable2").sortable({
            connectWith: ["#sortable1", "#sortable3"],
            handle: "h2",
			 update: function(e, ui) { 
               //UVa.SortableBoxes.createCookie('sortable2', $(this).sortable('toArray')); 
            },
            receive: function(e, ui) { 
                //UVa.SortableBoxes.createCookie('sortable2', $(this).sortable('toArray')); 
            },
            remove: function(e, ui) { 
                //UVa.SortableBoxes.createCookie('sortable2', $(this).sortable('toArray'));
            } 
        });
        $("#sortable3").sortable({
            connectWith: ["#sortable1", "#sortable2"],
            handle: "h2",
			 update: function(e, ui) { 
               
            },
            receive: function(e, ui) { 
                
            },
            remove: function(e, ui) { 
                
            } 
        });
    },
    createCookie: function (column, boxes) {
    },
    toggleBoxes: function () {
},
    toggleBoxesOnLoad: function () {
}
}    
$(document).ready(function () {
    UVa.init();
});