//Numero de elementos por página (paginador tabla de actividades) var numElemPagina = 10; $(document).ready(function() { $('#acti_info_form').submit(enviarSolicitud); $('#acti_busc_form').submit(enviarBusqueda); $('#enc_test_form').submit(calcularTest); $('#expandInformacion').click(function() { if($('#acti_info_form').is(':visible')) { $('#acti_info_form').slideUp(150); $(this).removeClass('expandido'); } else { $(this).addClass('expandido'); $('#acti_info_form').slideDown(150); } }); $('#expandBuscador').click(function() { if($('#acti_busc_form').is(':visible')) { $('#acti_busc_form').slideUp(150); $(this).removeClass('expandido'); } else { $(this).addClass('expandido'); $('#acti_busc_form').slideDown(150); } }); $('#expandTest').click(function() { if($('#enc_contenido').is(':visible')) { $('#enc_contenido').slideUp(150); $(this).removeClass('expandido'); } else { $(this).addClass('expandido'); $('#enc_contenido').slideDown(150); } }); $("#yt_player").tubeplayer({ width: 900, // the width of the player height: 327, // the height of the player allowFullScreen: "true", // true by default, allow user to go full screen initialVideo: "Y1gwYCDs_vA", // the video that is loaded into the player preferredQuality: "large",// preferred quality: default, small, medium, large, hd720 iframed: true, showControls: 0, onPlay: function(id){ $('.panel6').removeClass('start').addClass('stop') .data('videoPlaying', true); }, onPause: function(){ $('.panel6').removeClass('stop').addClass('start') .data('videoPlaying', false); }, onStop: function(){ $('.panel6').removeClass('stop').addClass('start') .data('videoPlaying', false); }, onSeek: function(time){} // after the video has been seeked to a defined point }); $('#acti_info_form').hide(); $('#slider').anythingSlider({ // Appearance mode : "horiz", // Set mode to "horizontal", "vertical" or "fade" (only first letter needed); replaces vertical option expand : false, // If true, the entire slider will expand to fit the parent element resizeContents : true, // If true, solitary images/objects in the panel will expand to fit the viewport showMultiple : false, // Set this value to a number and it will show that many slides at once easing : "swing", // Anything other than "linear" or "swing" requires the easing plugin or jQuery UI buildArrows : false, // If true, builds the forwards and backwards buttons buildNavigation : true, // If true, builds a list of anchor links to link to each panel buildStartStop : false, // If true, builds the start/stop button appendNavigationTo : null, // Append navigation buttons to a HTML element (jQuery Object, selector or HTMLNode), if not null toggleArrows : false, // If true, side navigation arrows will slide out on hovering & hide @ other times toggleControls : false, // if true, slide in controls (navigation + play/stop button) on hover and slide change, hide @ other times tooltipClass : "tooltip", // Class added to navigation & start/stop button (text copied to title if it is hidden by a negative text indent) // Navigation startPanel : 1, // This sets the initial panel changeBy : 1, // Amount to go forward or back when changing panels. hashTags : true, // Should links change the hashtag in the URL? infiniteSlides : true, // if false, the slider will not wrap & not clone any panels navigationFormatter : null, // Details at the top of the file on this use (advanced use) navigationSize : false, // Set this to the maximum number of visible navigation tabs; false to disable // Slideshow options autoPlay : true, // If true, the slideshow will start running; replaces "startStopped" option autoPlayLocked : true, // If true, user changing slides will not stop the slideshow autoPlayDelayed : false, // If true, starting a slideshow will delay advancing slides; if false, the slider will immediately advance to the next slide when slideshow starts pauseOnHover : true, // If true & the slideshow is active, the slideshow will pause on hover stopAtEnd : false, // If true & the slideshow is active, the slideshow will stop on the last page. This also stops the rewind effect when infiniteSlides is false. playRtl : false, // If true, the slideshow will move right-to-left // Times delay : 20000, // How long between slideshow transitions in AutoPlay mode (in milliseconds) resumeDelay : 10000, // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds). animationTime : 600, // How long the slideshow transition takes (in milliseconds) delayBeforeAnimate : 0, // How long to pause slide animation before going to the desired slide (used if you want your "out" FX to show). // Interactivity clickControls : "click focusin", // Events used to activate navigation control functionality clickSlideshow : "click", // Event used to activate slideshow play/stop button allowRapidChange : false, // If true, allow rapid changing of the active pane, instead of ignoring activity during animation // Video resumeOnVideoEnd : true, // If true & the slideshow is active & a supported video is playing, it will pause the autoplay until the video is complete resumeOnVisible : true, // If true the video will resume playing (if previously paused, except for YouTube iframe - known issue); if false, the video remains paused. addWmodeToObject : "opaque", // If your slider has an embedded object, the script will automatically add a wmode parameter with this setting isVideoPlaying : function(base){ return true; }, // return true if video is playing or false if not - used by video extension onSlideComplete : function(slider) { var numSlide = slider.currentPage; $("#present_titulo h3").html($("#slideTitle_"+numSlide).html()); $("#present_notice").html($("#slideText_"+numSlide).html()); } }); $('.icono_reproducir').click(playVideo).show(); $('.panel6').mousedown(function(){ if($(this).hasClass('cur')) { if($(this).data('videoPlaying')==true) { stopVideo(); } else { playVideo(); } } }).addClass('play').data('videoPlaying', false); }); function playVideo() { $('.icono_reproducir').hide().parent().find('.imagen_slider').hide() .parent().find('.video_slider').show(); $("#yt_player").tubeplayer('play'); } function stopVideo() { $("#yt_player").tubeplayer('stop'); $('.icono_reproducir').show().parent().find('.imagen_slider').show() .parent().find('.video_slider').hide(); } function enviarSolicitud() { var retVal = validar(); var data = $('#acti_info_form').serialize(); if(retVal == false) { return retVal; } else { $.ajax({ url: 'http://www.cruzroja.es/pls/portal30/site_alicante.vovi_salamanca.solicitud_informacion_ajax', type: 'post', dataType: 'json', data: data, beforeSend: function() { $('#mensajes_envio').removeClass('cargando') .removeClass('correcto').removeClass('error') .addClass('cargando').html('Cargando...').show(); }, success: function(json) { if(json.result=='OK') { $('#mensajes_envio').removeClass('cargando') .removeClass('correcto').removeClass('error') .addClass('correcto') .html('Su solicitud se ha enviado con éxito. El responsable de voluntariado de Salamanca le responderá a la dirección de correo que haya introducido.') .show(); } else { $('#mensajes_envio').removeClass('cargando') .removeClass('correcto').removeClass('error') .addClass('error') .html('Ha habido un error en la tramitación de la solicitud. Por favor, vuélvalo a intentar en unos momentos.') .append('

Si el problema persiste, puede enviar un correo con sus datos a voluntariado.virtual@cruzroja.es

') .append('

Perdone las molestias

') .show(); } }, error: function() { $('#mensajes_envio').removeClass('cargando') .removeClass('correcto').removeClass('error') .addClass('error') .html('Ha habido un error en la tramitación de la solicitud. Por favor, vuélvalo a intentar en unos momentos.') .append('

Si el problema persiste, puede enviar un correo con sus datos a voluntariado.virtual@cruzroja.es

') .append('

Perdone las molestias

') .show(); }, timeout: 30000 }) } return false; } function validar() { var retVal = true; var notEmptyRegExp = /^\s*\S.*$/; var phoneRegExp = /^[0-9\-\+]{9,}$/; var emailRegExpr = /^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/ var divErrores = $('
').attr('id', 'capa_errores'); var ulErrores = $('