<script type="text/javascript">
    function selectAoCurrentDate() {
        
        if (document.layers) {
            document.banner.visibility = 'hidden';
            document.banner.left = ((window.innerWidth-800)/2);
            document.banner.visibility = 'visible';
        }
        
        var months = new makeAoMonthArray('January','February','March','April','May','June','July','August','September','October','November','December');
        var date = new Date();
        var day = date.getDate();
        var month = date.getMonth() + 1;
        var yy = date.getYear();
        var year = (yy < 1000) ? yy + 1900 : yy;
        
        // add the years to the dropdown
        for (i = 0; i<=2; i++) {
            var optn   = document.createElement("OPTION");
            optn.text  = year + i;
            optn.value = year + i;
            document.ao_availability_search.yearselect.options.add(optn);
        }
        
        document.ao_availability_search.monthselect.selectedIndex=month-1;
        document.ao_availability_search.dayselect.selectedIndex=day-1;
        document.ao_availability_search.yearselect.selectedIndex=0;
    }
    
    function makeAoMonthArray() {
        for (i = 0; i<makeAoMonthArray.arguments.length; i++) {
            this[i + 1] = makeAoMonthArray.arguments[i];
        }
    }
    
    function setFormAction() {
        if(document.pressed == 'Search Availability') {
            document.ao_availability_search.action ="http://www.availabilityonline.com/availability_search.php";
        } else if (document.pressed == 'View All') {
            document.ao_availability_search.action ="http://www.availabilityonline.com/availtable.php";
        }
        return true;
    }
</script>
