$.extend({
getRegions: function(type,val){
$.ajax({
url: "https://www.construccionessabas.com/web/modules/contacto/engine/regions.snx?type=" + type + "&geonameId=" + val,
success: function(data){
$("#" + type).html(data);
}
});
}
});
$(document).ready(function(){
$("#ADM2").live("change",function(){
$("#locations").prev().html("▼Localidad");
$("#locations").html("Cargando...
");
$("#ADM3").val("");
$.getRegions("locations",$("#ADM2").attr("rel"));
});
$("#submit").bind("click",function(){
$.ajax({
url: "https://www.construccionessabas.com/web/modules/contacto/engine/exec.snx",
type: "post",
data: $("#form").serialize(),
success: function(data) {
$("#result").html(data);
}
});
});
});