jQuery.browser = {}; (function () { jQuery.browser.msie = false; jQuery.browser.version = 0; if (navigator.userAgent.match(/MSIE ([0-9]+)\./)) { jQuery.browser.msie = true; jQuery.browser.version = RegExp.$1; } })(); function slideSwitch() { var $active = jQuery('#cabecera_slide canvas.active'); if ( $active.length == 0 ) $active = jQuery('#cabecera_slide canvas:last'); // use this to pull the images in the order they appear in the markup var $next = $active.next().length ? $active.next() : jQuery('#cabecera_slide canvas:first'); // uncomment the 3 lines below to pull the images in random order // var $sibs = $active.siblings(); // var rndNum = Math.floor(Math.random() * $sibs.length ); // var $next = $( $sibs[ rndNum ] ); $active.addClass('last-active'); $next.css({opacity: 0.0}) .addClass('active') .animate({opacity: 1.0}, 1000, function() { $active.removeClass('active last-active'); }); } jQuery(function() { jQuery.each(jQuery('ul.art-menu'), function(i, val) { var cambiado = false; var m = jQuery(val); var links = m.find('a'); for (var i = 0; i < links.length; i++){ if (links[i].href == window.location.href) { cambiado = true; } } if (cambiado) m.find("ul, a").removeClass('active'); for (var i = 0; i < links.length; i++){ if (links[i].href == window.location.href) { var a = jQuery(links[i]); a.parent().children('ul').addClass('active'); a.parents('ul.art-menu ul').addClass('active'); a.parents('ul.art-menu li').children('a').addClass('active'); break; } } }); }); var idioma; function setIdioma(sIdioma) { idioma = sIdioma; jQuery.ajax({ contentType: "application/x-www-form-urlencoded", type: "POST", url: "setIdioma.php", data: "idioma=" + sIdioma, success: function(datos){ setTimeout("location.href = location.href;",1000); } }); } function getIdioma() { return idioma; } function ResizeIframeFromParent(id) { if (jQuery('#'+id).length > 0) { var window = document.getElementById(id).contentWindow; var prevheight = jQuery('#'+id).attr('height'); var newheight = Math.max( window.document.body.scrollHeight, window.document.body.offsetHeight, window.document.documentElement.clientHeight, window.document.documentElement.scrollHeight, window.document.documentElement.offsetHeight ); if (newheight != prevheight && newheight > 0) { jQuery('#'+id).attr('height', newheight); //console.log("Adjusting iframe height for "+id+": " +prevheight+"px => "+newheight+"px"); } } } jQuery(document).ready(function() { jQuery(".btnNewsletter").click(function() { jQuery.colorbox({inline:true, width:"100%", maxWidth:"570px", open:true, href:"#divNewsletter"}); /*jQuery.colorbox({ href:"box_newsletter&clean=1", height: '440px', width: '570px', close:"cerrar"}); */ }); /* jQuery(window).scroll(function(){ $(".scrollImg").each(function( index ) { var barra = jQuery(window).scrollTop()-jQuery(this).offset().top + 550; var posicion = (barra * 0.30); jQuery(this).css({ 'background-position-y': (posicion-200) + 'px' }); }); }); */ }); function setCookie(nombre, valor) { var fifteenDays = 1000*60*60*24*30; var expires = new Date((new Date()).valueOf() + fifteenDays); document.cookie = nombre + "=" + valor + ";expires=" + expires.toUTCString(); } jQuery(document).ready(function(){ // fade in and fade out jQuery(function () { jQuery(window).scroll(function () { if (jQuery(this).scrollTop() > 50) { jQuery('#uparrow').fadeIn(); } else { jQuery('#uparrow').fadeOut(); } }); // scroll body to 0px on click jQuery('#uparrow').click(function () { jQuery('body,html').animate({ scrollTop: 0 }, 800); return false; }); }); jQuery('.countAnimated').each(function () { $(this).prop('Counter',0).animate({ Counter: $(this).text() }, { duration: 4000, easing: 'swing', step: function (now) { $(this).text(Math.ceil(now)); } }); }); });