var _url_loader ="/components/com_agmdondeestamos/images/ajax-loader.gif";var _url_ok ="/components/com_agmdondeestamos/images/email-ok.png";var _url_error ="/components/com_agmdondeestamos/images/email-error.png";//Agedum Sistema de informaciĆ³n....
function validaformulario(f){if(document.formvalidator.isValid(f)){return sendajax();} else {return false;}}
function sendajax() {
jQuery('#imgload').html('
');
jQuery('#idboton-enviar').attr("disabled", "disabled");
var _dat = jQuery('#idformcontactar').serialize();
request = {'option' : 'com_agmdondeestamos','data' : _dat,'format' : 'raw'};
jQuery.ajax({type: "POST",data: request,format: 'raw',
success: function (response) {
jQuery('#idrespuesta').css('color','white');var _json = JSON.parse(response);var _texto='';
if (jQuery.isArray(_json)){
switch (_json[0].toLowerCase()){
case 'ok':{
_texto = _json[1];
jQuery('#idrespuesta').css('color','green');
jQuery('#idrespuesta').html(_texto);
jQuery('#idformcontactar').html('' + _json[2] + '
');
jQuery('#imgload').html('');
break;
}
default :{
jQuery('#imgload').html('');
_texto = 'Error: ' + _json[1];
jQuery('#idrespuesta').css('color','red');
jQuery('#idrespuesta').html(_texto);
jQuery('#idboton-enviar').removeAttr("disabled");
break;
}
}
} else {jQuery('#imgload').html('');_texto = 'Error: ' + response;jQuery('#idrespuesta').html(_texto);jQuery('#idboton-enviar').removeAttr("disabled");}
}
});
return false;
}
// cerrar el formulario
var _show = true;
function clickbotoncerrar(){
if (_show == true){
jQuery('#mapa-formulario').animate({'height':'30px'},500, function(){
jQuery('#idcontenedorformulario').css('display','none');
jQuery('#mapa-formulario').css('height','auto');
jQuery('#mapa-formulario').css('width','auto');
});
_show=false;
} else {
jQuery('#mapa-formulario').animate({'width':'220px'},500, function(){
jQuery('#mapa-formulario').css('height','auto');
jQuery('#mapa-formulario').css('width','220px');
jQuery('#idcontenedorformulario').css('display','block');
});
_show=true;
}
}
jQuery('#mapa-botoncerrar').click(function(){
alert('Pulsado');
jQuery('#mapa-formulario').animate({'display':'none'},500,function(){
});
});