2017-11-22 21:17:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2017-11-15 18:17:06 +00:00
|
|
|
function showmsg(msgTxt,ok){
|
|
|
|
if(ok){
|
|
|
|
$("#statusmsg").removeClass("alert-danger");
|
|
|
|
$("#statusmsg").addClass("alert-success");
|
|
|
|
$("#statusmsg").html("<strong>Ok!</strong> " + msgTxt);
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
$("#statusmsg").removeClass("alert-success");
|
|
|
|
$("#statusmsg").addClass("alert-danger");
|
|
|
|
var error;
|
|
|
|
$("#statusmsg").html("<strong>Error!</strong><br>");
|
|
|
|
for(error in msgTxt){
|
|
|
|
$("#statusmsg").append("<span>"+msgTxt[error]+"</span><br>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#statusmsg").show();
|
|
|
|
}
|
|
|
|
|
2017-12-01 12:52:43 +00:00
|
|
|
|
2017-11-15 18:17:06 +00:00
|
|
|
function onReturnCallback(response){
|
|
|
|
if(response != ""){
|
|
|
|
$("div.g-recaptcha").tooltip("hide");
|
|
|
|
$("div.g-recaptcha").tooltip("destroy");
|
|
|
|
}
|
|
|
|
}
|
2017-12-01 12:52:43 +00:00
|
|
|
|
2017-11-15 18:17:06 +00:00
|
|
|
function loadFragments(){
|
|
|
|
$("#header").load("snippets/header.html",routeMenu);
|
|
|
|
$("#footer").load("snippets/footer.html");
|
|
|
|
$(".sidebar").load("snippets/sidebar.html");
|
|
|
|
}
|
|
|
|
|
|
|
|
function routeMenu(){
|
|
|
|
var ruta = window.location.pathname.split(".")[0];
|
|
|
|
$("ul#menu li").removeClass("selected");
|
|
|
|
switch(ruta){
|
|
|
|
case "/":
|
|
|
|
$("li#home").addClass("selected");
|
|
|
|
break;
|
|
|
|
case "/contacto":
|
|
|
|
$("li#contacto").addClass("selected");
|
|
|
|
break;
|
|
|
|
case "/registro":
|
|
|
|
$("li#registro").addClass("selected");
|
|
|
|
break;
|
|
|
|
case "/mapa":
|
|
|
|
$("li#mapa").addClass("selected");
|
|
|
|
break;
|
|
|
|
case "/programa":
|
|
|
|
$("li#programa").addClass("selected");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
2017-11-22 21:17:19 +00:00
|
|
|
var jumboHeight = $('.jumbotron').outerHeight();
|
|
|
|
function parallax(){
|
|
|
|
var scrolled = $(window).scrollTop();
|
|
|
|
$('.bg').css('height', (jumboHeight-scrolled) + 'px');
|
|
|
|
}
|
|
|
|
|
|
|
|
$(window).scroll(function(e){
|
|
|
|
parallax();
|
2017-11-28 19:02:04 +00:00
|
|
|
});
|
2017-11-29 21:15:01 +00:00
|
|
|
|
2017-12-01 12:52:43 +00:00
|
|
|
|
2017-11-15 18:17:06 +00:00
|
|
|
routeMenu();
|
2017-12-01 12:52:43 +00:00
|
|
|
|
|
|
|
|
2017-11-15 18:17:06 +00:00
|
|
|
|
|
|
|
$('#contactform').submit(function(event){
|
|
|
|
var fail=false;
|
|
|
|
$("#statusmsg").hide();
|
|
|
|
event.preventDefault();
|
|
|
|
if($('#g-recaptcha-response').val() == ""){
|
|
|
|
$("div.g-recaptcha").tooltip({
|
|
|
|
"title":'Marque "No soy un robot"',
|
|
|
|
"pacement":"right",
|
|
|
|
"trigger":"manual"
|
|
|
|
});
|
|
|
|
$("div.g-recaptcha").tooltip("show");
|
|
|
|
fail=true;
|
|
|
|
}
|
|
|
|
if(!fail){
|
|
|
|
var post = $.post('contact', $(this).serialize());
|
|
|
|
post.done(function(data){
|
|
|
|
data = $.parseJSON(data);
|
|
|
|
if(data.success){
|
|
|
|
showmsg(data.message,true);
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
showmsg(data.message,false);
|
|
|
|
|
|
|
|
}
|
|
|
|
console.log(data)
|
|
|
|
|
|
|
|
});
|
|
|
|
post.fail(function(error){
|
|
|
|
console.log(error)
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2017-11-29 21:15:01 +00:00
|
|
|
|
|
|
|
|
2017-11-15 18:17:06 +00:00
|
|
|
});
|