var field_from_location;
var field_to_location;
  

var field_from_location;
var field_to_location;
  
$(document).ready(function() {	
 
$(".side_search_cal").datepicker(
{dateFormat: 'dd.mm.yy',
selectedDates : ""+juri_base+"index.php?option=com_jomroutes&format=raw&view=moduledates|date:#side_search_cal|from:#ajax_field_from_location|to:#ajax_field_to_location"
} ); 
 

 

var onAutocompleteSelect1 = function(value, data) { }

var options = {
mainclass: 'osuggestionsBox',
serviceUrl: ''+juri_base+'index.php?option=com_jomroutes&view=modulestops&type=1&format=raw',
width: 160,
delimiter: /(,;)\s*/,
secondaryInputs:'#ajax_field_to_location:to|#side_search_cal:date',
 
onSelect: onAutocompleteSelect1,
deferRequestBy: 0, 
noCache: true 
};

field_from_location = $('#ajax_field_from_location').autocomplete(options);

var onAutocompleteSelect = function(value, data) { }

var options = {
mainclass: 'osuggestionsBox',
 
secondaryInputs:'#ajax_field_from_location:from|#side_search_cal:date',
 
serviceUrl: ''+juri_base+'index.php?option=com_jomroutes&view=modulestops&type=2&format=raw',
width: 160,
delimiter: /(,;)\s*/,
onSelect: onAutocompleteSelect,
deferRequestBy: 0, 
noCache: true 
};

field_to_location = $('#ajax_field_to_location').autocomplete(options); 
});

function emptynext(){
$('#ajax_field_to_location').val('');
}

function setautooff(ele){
$(ele).attr('autocomplete','off');

}

 
