/* --- Start /home/httpd/public/app_frame2/webroot/js/SearchDining.js --- */

$(document).ready(function() {
	var defaultKeywords = 'Keywords';
	var defaultZipCode  = 'Zip Code';
	
	$('.search_keywords').val(defaultKeywords);
	$('.search_zipcode').val(defaultZipCode);
	
	$('.search_keywords').focus(function() {
		if ($('.search_keywords').val() == defaultKeywords) {
			$('.search_keywords').val('');
		}
	});
	$('.search_zipcode').focus(function() {
		if ($('.search_zipcode').val() == defaultZipCode) {
			$('.search_zipcode').val('');
		}
	});

    $('.search_form').submit(function() {
        if ($('.search_keywords').val() == defaultKeywords) {
            $('.search_keywords').val('');
        }
        if ($('.search_zipcode').val() == defaultZipCode) {
            $('.search_zipcode').val('');
        }
        
        // if we have a zip, we go to /locations/map regardless of 
        // presence of keyword
        if ($('.search_zipcode').val() != '') {
            $('.search_form').attr('action', '/locations/map');
            $('.search_form').attr('method', 'get');
        }
        
        return true;
    });
});


/* --- End /home/httpd/public/app_frame2/webroot/js/SearchDining.js --- */
/* --- Start /home/httpd/public/app_frame2/webroot/js/SearchEventsMusic.js --- */

$(document).ready( function() {
    $( "#searchEventMusicGenre, #searchEventMusicArtist, #searchEventMusicVenue").change( function() {
        var url = $(this).val();
        if ( url != '' ) {
            document.location.href = url;   
        }
    });
    if ( $( "#homecal_datepicker_element").length > 0 ) {
        $( "#homecal_datepicker_element" ).datepicker( datepickerConfig );
    }

                 // Calendar
    var datepickerConfig = {
        dateFormat: "yy-m-d",
        changeMonth: true,
        changeYear: true,
        nextText: "&nbsp;",
        prevText: "&nbsp;",
        showOn: 'button',
        buttonImageOnly: true,
        buttonImage: '/img/icon-calendar.gif',
        onSelect: function( dateText, inst ) {
            var url = $( this ).attr( "name" ) + dateText;
            document.location.href = url;
        }   
    }
});


/* --- End /home/httpd/public/app_frame2/webroot/js/SearchEventsMusic.js --- */
/* --- Start /home/httpd/public/app_frame2/webroot/js/AdIndexTower.js --- */

$(document).ready(function(){
    var section = $("#AdIndexTower").children("form").children("input[name='section']").val();
    var limit = $("#AdIndexTower").children("form").children("input[name='limit']").val();
    if ( section ) {
        $.get(
            '/adIndex/ajaxTower/' + section + '/' + limit,
            function (data) {
                $('#AdIndexTower').append(data);
            }
        );
    }
});


/* --- End /home/httpd/public/app_frame2/webroot/js/AdIndexTower.js --- */


/* Generated at 2010-03-19 17:35:45 */
