$(function() {
	var geolocated_state = $("#state_invisible").html();
	var geolocated_city = $("#city_invisible").html();


	if(geolocated_state && geolocated_city){
	
		// City and State were found,  offer click-thru to State coverage page
		$("#eoc_availability_message").html("Your current location appears to be in "+geolocated_state+".<br><br> Click the Check Availability button to proceed to the list of cities in "+geolocated_state+" which support our Ethernet Over Copper service.   Alternatively,  select a different state.<br>");
	
	
	}
	else{
		
		// City and State were not found, allow user to select state
		$("#eoc_availability_message").html("Please select a state to proceed to the list of cities in that state which support our Ethernet Over Copper service.<br>");
		
	}
	
	
	
	// Set the EoC availability message text color
	$("#eoc_availability_message").addClass("dark_orange");
	
	
	
	
	
	// Button action to simulate form
	var $selected_state = $("#state_list_geolocated option:selected").val();
	
	$("#state_list_geolocated").change(function(){
		$selected_state = $("#state_list_geolocated option:selected").val();
	});
	
	$("#eoc_check_availability_button").click(function(){
          var $destination = "/ethernet-over-copper-coverage-"+$selected_state;
          window.location.href = $destination;
    });
		
	


});
