$(document).ready(function() {
	$("#editLocation").click(function () {
      $("#locationSettings").slideToggle(300);
      return false;
    });
    
    $("#updateLocation").click(function () {      
	      	$.post("./events/get_event_by_location_and_set_location", 
	      			{ 
	      				new_location : $('#new_location').val(), 
	      			},
			
			function(data){
				$("#eventsByLocation").empty().html('<img src="./images/ajax-loader.gif" alt="loading" />');
				$("#theLocation").empty().html('In '+data.result);
				$('#eventsByLocation').load('./events/ajax_events_in_area',1,function(str){
			});
		}, "json");
		
      return false;
    });
    
    
    
    $("#eventsByLocation ul li").hover(
      function () {
        $(this).css({'background' : '#D7E7F8 url(./images/eventsSummaryLi.gif) bottom left repeat-x'});
      }, 
      function () {
        $(this).css({'background' : 'url(./images/eventsSummaryLi.gif) bottom left repeat-x'});
      }
    );

    

});
