File: /home/c0400220/public_html/VARIOS2022/js/magic.js
$.ajaxSetup({
'beforeSend' : function(xhr) {
try{
xhr.overrideMimeType('text/html; charset=UTF-8');
}
catch(e){
}
}});;
$(function(){
/*
// ----------------------------------------------------------------------------
// INICIALIZA EL SISTEMA DE RUTEO
var router = new Simrou();
router.addRoute('!/home/:lang', false).get(function(event, params) {
$('#contentinside').animate({ opacity: 0 }, 250, function() {
// header multi-idioma
$.get('inc/i_header.php?lang='+params.lang, function(data) {
$("#header_ajax").hide().html(data).fadeIn('slow');
// current menu
doSelect('home');
doLangSelect ( params.lang )
});
$.get('home.php?lang='+params.lang, function(data) {
event.preventDefault();
$('#contentinside').html(data);
$('#contentinside').animate({ opacity: 1 }, 500);
});
//footer multi-idioma
$.get('inc/i_footer.php?lang='+params.lang, function(data) {
$("#footer_ajax").hide().html(data).fadeIn('slow');
});
});
});
router.addRoute('!/empresa/:lang', false).get(function(event, params) {
$('#contentinside').animate({ opacity: 0 }, 250, function() {
// header multi-idioma
$.get('inc/i_header.php?lang='+params.lang, function(data) {
$("#header_ajax").hide().html(data).fadeIn('slow');
// current menu
doSelect( 'empresa' );
doLangSelect ( params.lang )
});
$.get('empresa.php?lang='+params.lang, function(data) {
event.preventDefault();
$('#contentinside').html(data);
$('#contentinside').animate({ opacity: 1 }, 500);
});
//footer multi-idioma
$.get('inc/i_footer.php?lang='+params.lang, function(data) {
$("#footer_ajax").hide().html(data).fadeIn('slow');
});
});
});
router.addRoute('!/internacional/:lang', false).get(function(event, params) {
$('#contentinside').animate({ opacity: 0 }, 250, function() {
// header multi-idioma
$.get('inc/i_header.php?lang='+params.lang, function(data) {
$("#header_ajax").hide().html(data).fadeIn('slow');
// current menu
doSelect( 'internacional' );
doLangSelect ( params.lang )
});
$.get('internacional.php?lang='+params.lang, function(data) {
event.preventDefault();
$('#contentinside').html(data);
$('#contentinside').animate({ opacity: 1 }, 500);
});
//footer multi-idioma
$.get('inc/i_footer.php?lang='+params.lang, function(data) {
$("#footer_ajax").hide().html(data).fadeIn('slow');
});
});
});
router.addRoute('!/servicios/:id/:lang', false).get(function(event, params) {
$('#contentinside').animate({ opacity: 0 }, 250, function() {
// header multi-idioma
$.get('inc/i_header.php?lang='+params.lang, function(data) {
$("#header_ajax").hide().html(data).fadeIn('slow');
// current menu
doSelect( 'servicios' );
doSubSelect( params.id );
doLangSelect ( params.lang )
});
$.get('servicios.php?lang='+params.lang+'&id='+params.id, function(data) {
event.preventDefault();
$('#contentinside').html(data);
$('#contentinside').animate({ opacity: 1 }, 500);
doSubSelect( params.id );
});
//footer multi-idioma
$.get('inc/i_footer.php?lang='+params.lang, function(data) {
$("#footer_ajax").hide().html(data).fadeIn('slow');
});
});
});
router.addRoute('!/contacto/:lang', false).get(function(event, params) {
$('#contentinside').animate({ opacity: 0 }, 250, function() {
// header multi-idioma
$.get('inc/i_header.php?lang='+params.lang, function(data) {
$("#header_ajax").hide().html(data).fadeIn('slow');
// current menu
doSelect( 'contacto' );
doLangSelect ( params.lang )
});
$.get('contacto.php?lang='+params.lang, function(data) {
event.preventDefault();
$('#contentinside').html(data);
$('#contentinside').animate({ opacity: 1 }, 500);
});
//footer multi-idioma
$.get('inc/i_footer.php?lang='+params.lang, function(data) {
$("#footer_ajax").hide().html(data).fadeIn('slow');
});
});
});
router.addRoute('!/contacto/:lang/:status', false).get(function(event, params) {
$('#contentinside').animate({ opacity: 0 }, 250, function() {
// header multi-idioma
$.get('inc/i_header.php?lang='+params.lang, function(data) {
$("#header_ajax").hide().html(data).fadeIn('slow');
// current menu
doSelect( 'contacto' );
doLangSelect ( params.lang )
});
$.get('contacto.php?lang='+params.lang+'&status='+params.status, function(data) {
event.preventDefault();
$('#contentinside').html(data);
$('#contentinside').animate({ opacity: 1 }, 500);
});
//footer multi-idioma
$.get('inc/i_footer.php?lang='+params.lang, function(data) {
$("#footer_ajax").hide().html(data).fadeIn('slow');
});
});
});
router.start('!/home/es');
*/
});
function doSelect( item ) {
$('#menu-main li a').removeClass('current');
$('.'+item).addClass('current');
}
function doSubSelect( item ) {
$('.menu-sub-servicios li a').removeClass('current');
$('.menu-sub-servicios .'+item).addClass('current');
}
function doLangSelect( lang ) {
$('#lang a').removeClass('current');
$('.lang-'+lang).addClass('current');
}