/* * Scripts IE Business School * http://ie.edu * * Copyright 2011, EtnasSoft * Release under the MIT and GPL Licenses. * http://www.etnassoft.com/licencias/ * * Date: Thu Ago 02 12:00 2011 GMT+2 */ /* inicio de codigo generado por accenture */ var $ = jQuery.noConflict(); /* fin de codigo generado por accenture */ // Init PrettyBox var prettyBoxDefaults = function(){ return { theme: 'grey_rounded', show_title: false, default_width: 560, default_height: 540, changepicturecallback: function(){ var highestCol = Math.max($('.upcoming-event-plannig-col-left').height(),$('.upcoming-event-plannig-col-right').height()); // $('.upcoming-event-plannig .col').height(highestCol - 125); addthis.button('.share-this'); // event button share this // www.addthis.com validarFormulario(); // accenture agrega otro fix }, deeplinking: false, markup: '
\
 
\
\
\
\
\
\
\
\
\
\
\
\ \
\ next \ previous \
\
\
\
\ Previous \

0/0

\ Next \
\
\
\
\
\
\
\
\
\
\
\
\
\
' } }; $(document).ready( function(){ var temp_program; try { // Round corners $('.round').corner(); } catch(e) { isException(true); // DEBUG } // Display Live Search $('#search').focus( function(e){ $('#live-search-module').show(); } ).blur( function(){ // $('#live-search-module').hide(); }); // Home Video $('.welcome-video').click( function(e){ e.preventDefault(); // Variables iniciales var $video = $('#special-video-home'); var $videoContent = $video.find('#special-video-home-content'); var $realVideo = $videoContent.find('iframe'); var realVideoWidth = $realVideo.width(); var realVideoHeight = $realVideo.find('iframe').height(); var videoWidth = $video.width(); var videoHeight = $realVideo.height(); var overlay = $('#overlay'); // Overlay overlay.appendTo(document.body).fadeIn('slow', function(){ $('html, body').animate({ scrollTop: 0 }, 250, function(){ var marginLeft = parseInt( videoWidth / 2, 10 ); var curTop = parseInt( $video.css('top'), 10 ); var curHeight = $video.height(); var newMarginTop = curTop - ( videoHeight - curHeight ) / 2; var newMarginLeft = parseInt( realVideoWidth / 2, 10 ) + 20; // 20 for paddings $video.insertBefore(overlay).fadeIn('slow', function(){ $video.animate({ width: realVideoWidth, marginLeft : - newMarginLeft }, 300, function(){ $video.animate({ height: videoHeight, top: newMarginTop + 40 }, 200, entryVideoHome); }); }); }); }); // Hacemos que el video redimensione y aparezca. function entryVideoHome(){ $videoContent.css({ width: realVideoWidth, height: realVideoHeight }).show(); $realVideo.show(); $videoContent.find('.share-this-button').show(); } } ); // Cerramos el velo $('#overlay, #special-video-home .close-overlay').live( 'click', function(){ // Variables iniciales var $overlay = $('#overlay'); var $video = $('#special-video-home'); var $videoContent = $video.find('#special-video-home-content'); var $realVideo = $videoContent.find('iframe'); $videoContent.find('.share-this-button').hide(); $('html, body').animate({ scrollTop: 0 }, 250, function(){ $realVideo.fadeOut('slow', function(){ $video.animate({ width: 950, marginLeft : '-495' }, 300, function(){ $video.animate({ height: 315, top: 162 }, 200, function(){ $video.fadeOut('fast', function(){ $overlay.fadeOut(); }); }); }); }); }); }); // Ajustando los programas en Preexperience Landing if( $('#programs-resume-module').length > 0 ){ var programs = $('#programs-resume-module .program-item').length; if (programs % 2 !== 0){ var lastItem = $('#programs-resume-module .program-item:last'); lastItem.addClass('single').find('.info-balloon-program').addClass('mirror'); } } // Get StreetMaps links $('.street-view-link').click( function(e){ var streetLink = $('#pano a:first').attr('href'); // console.log( streetLink );e.preventDefault(); if(!streetLink){ e.preventDefault(); } else{ $(this).attr('href', streetLink); } } ); // Comportamiento de las FAQs: mostrar solo aquellas relacionadas con la // busqueda // $('#search-program-faq').click( function(e){ // e.preventDefault(); // var programSelected = $('#program option:selected').val(); // if( !programSelected ) return false; // $('.faqs-list-module').not('.faqs-related-list-module').fadeOut(); // $('.faqs-list-module.faqs-related-list-module').fadeIn().find('h3>span').html( // programSelected ); // } ); // Comportamiento del check Programs en las FAQs $('#about_program', '#research-project-box').click(function(){ if(!$(this).is(':checked')){ $('.dropdown_paragraph', '#research-project-box').find('input:checked').removeAttr('checked'); $('.ui-dropdownchecklist-text:first', '#research-project-box').html('Please select...'); } }); /* * Codigo movido por ACCENTURE a la funcion GoToContactFAQs() // Go to contact on FAQs $('#goContact').click( function(e){ e.preventDefault(); var target_offset = * $("#faqs-research-module").offset(), target_top = target_offset.top; $('html, body').animate({scrollTop:target_top}, 500); } ); */ // Init dropdowns with checkboxes where avaible initDropDowns(); // Clone Address for Impression var realAddress = $('#links-col-three p:first').html(); $('#footer-print .din-address').html( realAddress ); // Print Region $('.printIt').live('click', function(e){ e.preventDefault(); var $region_to_print = $(this).parents('.print-region'); if( !$region_to_print.length ){ // Check for Lightbox $region_to_print = $('.pp_content .pp_inline>div'); } if( !$region_to_print.length ){ return false; } print_region( $region_to_print ); } ); // Print any page $('.print-button').click( function(e){ e.preventDefault(); if( !$(this).hasClass('printIt') ){ window.print(); } } ); // Collapse areas of interest when apply $('#apply-area').click( function(e){ e.preventDefault(); $(this).parent().slideUp( 'normal', function(){ $('#by-area', '#program-search-box').removeClass('active'); }); } ); // Progression Bar for Teaching Periods var $teaching_periods = $('.program-structure-preprogram-module').not('.core-module').find('.program-period'); $teaching_periods.each( function(){ var $this = $(this), periodTime = $this.find('.program-timeline').attr('data-time'); if (periodTime){ var periods = periodTime.split('-'), periodStart = parseInt( (periods[0]).substr(1), 10), periodWidth = parseInt( (periods[1]).substr(1), 10) - periodStart; $this.find('.program-progression').css({ width : periodWidth + '%', left: periodStart + '%' }); } }); $('.core-module .asdprogram-switch').click( function(e){ e.preventDefault(); $(this).parent().find('.program-details').slideToggle(); } ); // Programs expand with interval /* * $('.program-description.nofollow').mouseenter( function(){ var $parent = $(this).parents('.program-item-content'); temp_program = setTimeout(function(){ * $parent.find('.program-expanded').slideDown(); }, 1000); }).mouseleave(function(){ clearTimeout( temp_program ); var $parent = $(this).parents('.program-item-content'); * $parent.find('.program-expanded').slideUp(); }); */ // Selects with anchors $('.anchor-selectables').change( function(){ var $this = $(this); var urlToJump = $this.find('option:selected').val(); if( !urlToJump ) return false; window.location.href = urlToJump; }); // Show shorcuts on Header $('#view_shortcuts').click( function(e){ e.preventDefault(); var $parent = $(this).parent(); if( $parent.hasClass('active') ){ $('#header-shortcuts-wrap').hide(); $parent.removeClass('active'); }else{ $('#header-shortcuts-wrap').show(); $parent.addClass('active'); } } ); // Find programs checks $('#program-search-box input:checkbox').click( function(e){ var $this = $(this), $parent = $this.parent(); if( $this.is(':checked') ){ $parent.addClass('current'); }else{ $parent.removeClass('current'); } }); // agregarClickExpandedLinkProgramas(); /* inicio de código generado por accenture */ // function agregarClickExpandedLinkProgramas() { // Expand all Programs /* * $('.expanded-link').click( function(e){ e.preventDefault(); var $this = $(this); if($this.hasClass('expand')){ $('.program-expanded', '.programs-container').slideUp(); * //$('.program-item-container p').slideUp(); $this.text('expanded view').removeClass('expand'); }else{ $('.program-expanded', '.programs-container').slideDown(); * //$('.program-item-container p').slideDown(); $this.text('colapsed view').addClass('expand'); } } ); */ // } /* fin de código generado por accenture */ // Expand areas of interest $('.area-interest').click( function(e){ e.preventDefault(); var $this = $(this); $this.parents('.white-box').toggleClass('active'); $('.area-interest-expanded').slideToggle(); } ); $('.new-plus-programs .close-window').click( function(e){ e.preventDefault(); $(this).parent().fadeOut(); } ); // Extend Alumni Details on slider $('.alumni-slider img').click( function(e){ // Avoid behaviour for the Flex Content Module if($(this).parents('#flex-content-module').length > 0) return false; var $this = $(this), $currentLi =$this.parents('li'), $currentUl = $currentLi.parent(), $currentDetails = $currentLi.find('.alumni-slider-details'); $('.right', $currentUl).removeClass('right'); // Fix IE7 z-index bug (crazy mode!) $currentUl.find('li').css({ 'z-index' : 1 }); $currentLi.css({ 'z-index' : 99999 }); var ulLeft = $currentUl.position(); var scrollTimes = Math.abs( parseInt(ulLeft.left, 10) / 143 ); // 143 es lo que avanza en pixeles el carrusel a cada scroll var imgSpecial = scrollTimes + 4; // 3 es el numero de imagenes que tiene el carrusel en pantalla al mismo tiempo var currentImgNumber = ( $currentLi.index() ) + 1; var cDirection = 'left'; if( currentImgNumber == imgSpecial){ // En este caso, el slide se tiene que abrir hacia la izquierda cDirection = 'right'; $currentDetails.addClass('right'); } $('.alumni-slider-details', '.alumni-slider').not($currentDetails).hide(); if( $currentDetails.is(':visible') ){ $currentDetails.hide("slide", { direction: cDirection }, 400); }else{ $currentDetails.show("slide", { direction: cDirection }, 400); } } ); // Closing Alumni Details with its button $('.close-extend').click( function(e){ e.preventDefault(); $(this).parent().hide(); } ); // Closing Alumni Details on slider when scrolling $('.jcarousel-prev, .jcarousel-next').live('click', function(){ var $this = $(this), $currentCarrusel = $this.parent(); if( $currentCarrusel.find('.alumni-slider-details').length > 0 ){ $currentCarrusel.find('.alumni-slider-details').hide(); } }); // Extend Alumni Details on Flex Content Module $('#flex-content-module img').click( function(e){ var $this = $(this), $currentDiv =$this.parent(), $currentUl = $currentDiv.parents('ul'), $currentDetails = $currentDiv.find('.alumni-slider-details'); $('.right', $currentUl).removeClass('right'); // Fix IE7 z-index bug (crazy mode!) $currentUl.find('.alumni-person').css({ 'z-index' : 1 }); $currentDiv.css({ 'z-index' : 99999 }); var imgSpecial = 8; // 6 es el numero de imagenes que tiene el carrusel en // pantalla al mismo tiempo var currentImgNumber = ( $currentDiv.index() ) + 1; var cDirection = 'left'; if( currentImgNumber == imgSpecial || currentImgNumber == imgSpecial / 2 ){ // El condicional OR es porque en este caso, hay dos columnas con fotos // En este caso, el slide se tiene que abrir hacia la izquierda cDirection = 'right'; $currentDetails.addClass('right'); } $('#flex-content-module .alumni-slider-details').not($currentDetails).hide(); if( $currentDetails.is(':visible') ){ $currentDetails.hide("slide", { direction: cDirection }, 400); }else{ $currentDetails.show("slide", { direction: cDirection }, 400); } } ); // Extend Programs Details $('.program-switch').click( function(e){ e.preventDefault(); $('.info-balloon-program').fadeOut(); var current = $(this); if($(".program-structure-preprogram-module").find(".extended").length > 0){ $(".program-structure-preprogram-module").find(".extended").prev().slideUp(600,function(){ $(this).next().removeClass("extended"); current.toggleClass('extended').parent().find('.program-details').slideToggle(600); }); } else{ $(this).toggleClass('extended').parent().find('.program-details').slideToggle(600); } } ); // Expand Programs timeline $('.masters-timeline-module ul li.combo span').click( function(e){ e.preventDefault(); var $this = $(this).parent().toggleClass('expanded').siblings().removeClass('expanded'); } ); $('.masters-timeline-module ul li.combo a').click( function(e){ e.preventDefault(); var $this = $(this); var new_label = $this.text(); $this.parents('.combo').removeClass('expanded').find('span').text( new_label ).end(); $('.go-to-program', '.masters-timeline-module').show(); $('.available', '.masters-timeline-module').hide(); }); // Hack for Programs Page: Timeline over menu if( $('.masters-timeline-module').length > 0){ $('#sub-main-menu').addClass('special'); } // width: 100% $(".masters-timeline-module ul li ul").each(function(i){ $(this).parent().width($(this).width() +7) $(this).width($(this).width() +7); }); // Show Programs Info Balloon $('.program-tags a').click( function(e){ e.preventDefault(); $('.info-balloon-program').fadeOut(); $('.info-balloon-program').remove(); var $this = $(this), $program_title = $this.html(), $program_description = $this.parent().find('span').html(); // Si no tenemos descripcion NO generamos nada if($program_description){ var offset = $this.offset(), top = parseInt( offset.top, 10) - 400; var marginLeft = $this.width(); // top = parseInt($(this).position().top) - // $('.info-balloon-program').height() ; var $program_balloon = '
'; $program_balloon += '
'; $program_balloon += '' + $program_title + ''; $program_balloon += 'X'; $program_balloon += '

' + $program_description + '

'; $program_balloon += '
'; $program_balloon += '
'; $program_balloon += '
'; $($program_balloon).prependTo( $this.parent() ).show(); var top = parseInt($(this).position().top) - $('.info-balloon-program').height() +25 ; $('.info-balloon-program').css("top",top+"px"); $('.program-tags a.current').removeClass('current'); $this.addClass('current'); } } ); // Close Balloon Teaching Periods $('.close-balloon-teaching-period-tags').live('click', function(e){ e.preventDefault(); var $this = $(this); $('.info-balloon-program').fadeOut('normal', function(){ if( !$this.hasClass('to-hide') ) $this.parent().parent().remove(); }) $('.program-tags li a').each(function(i,e){ $(this).removeClass('current'); }); } ); // Show Programs Info Balloon $('.legend-show-baloon').click( function(e){ e.preventDefault(); $('.info-balloon-program').fadeOut(); var $this = $(this), $parent = $this.parent(), $program_title = $parent.find('.legend-title').html(), $program_description = $parent.find('.legend-excerpt').html(); var offset = $this.offset(), top = parseInt( offset.top, 10) - 400; var marginLeft = 570; var $program_balloon = '
'; $program_balloon += '
'; $program_balloon += '' + $program_title + ''; $program_balloon += 'X'; $program_balloon += '

' + $program_description + '

'; $program_balloon += '
'; $program_balloon += '
'; $program_balloon += '
'; $($program_balloon).prependTo( $parent ).show(); } ); // Close Balloon $('.close-balloon').live('click', function(e){ e.preventDefault(); var $this = $(this); $('.info-balloon-program').fadeOut('normal', function(){ if( !$this.hasClass('to-hide') ) $this.remove(); }) }); // Show Partners Info Balloon $('#partners-info-switch').click( function(e){ e.preventDefault(); var $partners_balloon = $('.info-balloon'); if( $partners_balloon.is(':visible') ){ partnerDissapear(); }else{ $partners_balloon.show(); $('#main').css('overflow', 'visible'); $('#container').css('z-index', '99999'); } } ); $('body').click( function(e){ if( e.target.id != "partners-info-switch" && $('.info-balloon').is(':visible') ){ partnerDissapear(); } } ); function partnerDissapear(){ $('.info-balloon').fadeOut('', function(){ $('#main').css('overflow', 'hidden'); $('#container').css('z-index', '1'); }); } // Hovering programs at Home $('.program-module, .methodology-type').mouseenter( function(){ $(this).addClass('hover'); }).mouseleave( function(){ $(this).removeClass('hover'); }); $('.program-button').click( function(){ var $this = $(this), nextID = $this.attr('id'); $this.addClass('current').siblings().removeClass('current'); $('.find-program-modules>div').hide(); $next = $('.find-program-modules').find( nextID ); /* inicio de codigo generado por accenture */ $next.removeClass('hide'); /* fin de codigo generado por accenture */ $next.show(); $next.find('.equalCols').equalCols().removeClass('equalCols'); $next.find('.equalCols2').equalCols().removeClass('equalCols2'); }); /* * $('#by-profile .program-module').click( function(e){ e.preventDefault(); $(this).parent().hide(); $('#by-type').show(); * $('.program-button:eq(1)').addClass('current').siblings().removeClass('current'); }); * * $('#by-type .program-module').click( function(e){ e.preventDefault(); $(this).parent().hide(); $('#by-methodology').show(); * $('.program-button:eq(2)').addClass('current').siblings().removeClass('current'); }); */ // Show Ballons on programs $('.program-topics a.program-description.nofollow, .program-entry>h3>a').click( function(e){ // e.preventDefault(); $('.program-topics .info-balloon-program').hide(); $(this).parents('.program-item').find('.info-balloon-program').toggle(); }); // Init Carrousels where avaible initCarrouselCircular(); // Open Related Docs on Carrusels $('.related-docs.super-button').click(function(e){ e.preventDefault(); var $this = $(this); if( !$this.hasClass('opened') ){ $this.addClass('opened'); $('.related-docs-content').slideDown(); }else{ $('.related-docs-content').slideUp(function(){ $this.removeClass('opened'); }); } }); $('.related-docs3.super-button').click(function(e){ e.preventDefault(); var $this = $(this); if( !$this.hasClass('opened') ){ $this.addClass('opened'); $('.related-docs-content').slideDown(); }else{ $('.related-docs-content').slideUp(function(){ $this.removeClass('opened'); }); } }); // Carrousels FlexSlider. // El orden es importante!! // Hack for only one element $('.flexslider-with-details').each(function(){ var $this = $(this); if ( $this.find('li').length < 2 ){ change_slider_details( $this[0], 0 ); } }); $('.flexslider-with-details').flexslider({ slideshow: false, pausePlay: true, slideshowSpeed: 3000, start: function(slider){ change_slider_details(slider, slider.currentSlide); }, after: function(after_slider){ change_slider_details(after_slider, after_slider.currentSlide); } }); $('#news-detail-gallery .flexslider').flexslider({ slideshow: false, pausePlay: true, slideshowSpeed: 3000, after: function(slider) { var $currentSlide = $('#news-detail-gallery ul li:eq(' + slider.currentSlide + ')'); var $currentSlideDetails = $currentSlide.find('.slide-details'); $('.news-detail-gallery-infobar-header h3').html( $currentSlideDetails.find('.slide-details-title').html() ); $('.news-detail-gallery-infobar-body p').html( $currentSlideDetails.find('.slide-details-content').html() ); } }); $('.flexslider').flexslider({ slideshow: false, pausePlay: true, slideshowSpeed: 3000 }); $('.flexslider-special.no-buttons').flexslider({ animation: "slide", slideshow: false, pausePlay: true, directionNav: false, slideshowSpeed: 3000 }); $('.photo-slides .flexslider-special').flexslider({ animation: "slide", slideshow: false, pausePlay: true, slideshowSpeed: 3000 }); $('.documents-slides .flexslider-special').flexslider({ animation: "fade", slideshow: false, pausePlay: true, directionNav: false, slideshowSpeed: 3000 }); $('.flexslider-full').flexslider({ slideshow:false, directionNav:false, pausePlay:true, slideshowSpeed:3000 }); // alert('V1'); // RMJ:11.03.14 $('#carrousel-special-module > .flexslider-special-wrapper > .flexslider-special').flexslider({ slideshow: false, pausePlay: true, directionNav: false }); // *****/ $('.flexslider-special-wrapper').not('.news-slides').find('.flexslider-special').flexslider({ before: function (){$('#carrousel-special-module').attr('style','background-color: red;');}, animation: "fade", slideshow: false, pausePlay: true, directionNav: false }); $('.flexslider-special-wrapper.news-slides').find('.flexslider-special').flexslider({ animation: "slide", slideshow: false, pausePlay: true, directionNav: false }); $('.flickr-special').flexslider({ animation: "slide", slideshow: false, directionNav: false, pausePlay: true, slideshowSpeed: 3000 }); function change_slider_details(slider, current){ var first_li = $(slider).find('li:eq(' + current + ')'), title = first_li.find('.item-details .item-title').html(), content = first_li.find('.item-details .item-content').html(); // Anadiendo etiquetas a los campos anexos en el padre (por si hay mas de // un slide en la pagina) $(slider).parents('.module-item').find('.slide-dinamic-data:last h2').html(title); $(slider).parents('.module-item').find('.slide-dinamic-data:last p').html(content); } // Open/Closing Special Carrousel $('.toggle-special-slide').click( function(e){ e.preventDefault(); var $this = $(this), sliderParent = $this.parents('div.flexslider-special-wrapper'), slides = sliderParent.find('ul.slides'); if( slides.is(':visible') ){ sliderParent.find('.slide-special-subtitle').addClass('collapse'); slides.slideUp(); sliderParent.find('.flex-control-nav').hide(); $this.addClass('open'); }else{ sliderParent.find('.slide-special-subtitle').removeClass('collapse'); slides.slideDown(); sliderParent.find('.flex-control-nav').show(); $this.removeClass('open'); } } ); // Close overlays $('.close-overlay').click( function(e){ e.preventDefault(); $(this).parents('.overlay:first').fadeOut(); } ); /* * codigo movido por accenture a la funcion addEventToScholarshipsList() y así poderlo reutilizar al cargar html por ajax */ addEventToScholarshipsList(); // Show Request Book Overlay $('.request').live('click', function(e){ e.preventDefault(); var $this = $(this), $toShow = $this.parents('.pp_inline').find('#book-request-form'); $this.parent().hide("slide", { direction: "left" }, 400, function(){ $toShow.show("slide", { direction: "right" }, 400); }); }); $('.back-publication').live('click', function(e){ var $this = $(this); var $toShow = $this.parent().parent().find('#book-details-mock-content'); $this.parent().hide("slide", { direction: "right" }, 400, function(){ $toShow.show("slide", { direction: "left" }, 400); }); e.preventDefault(); }); // Añadido cambio buscador eventos // Se han efectuado cambios por parte de Accenture // Open/Closing Special Carrousel $('.toggle-special-slide-events').click( function(e){ e.preventDefault(); var $this = $('div.flexslider-special-wrapper documents-slides'), sliderParent = $this.parents('div.flexslider-special-wrapper'), slides = sliderParent.find('ul.slides'); if( slides.is(':visible') ){ sliderParent.find('.slide-special-subtitle').addClass('collapse'); slides.slideUp(); sliderParent.find('.flex-control-nav').hide(); $this.addClass('open'); }else{ sliderParent.find('.slide-special-subtitle').removeClass('collapse'); slides.slideDown(); sliderParent.find('.flex-control-nav').show(); $this.removeClass('open'); } }); // Select $('#searchbox-program').click( function(e){ e.preventDefault(); }); // QS and ScrollTo $('div.pane').scrollTo( 0 ); $.scrollTo( 0 ); var qs = $.QueryString("event"), qs = ( !qs )? "":qs; if(qs != ""){ $.scrollTo({top:($('#'+qs).offset().top-370)+'px', left:'0px'}, 800); } /* * Codigo movido a filtroBuscadorEventos.js // // Mini Map $("#mini-world-map").bind("mouseleave",function(){ $(this).fadeOut(); $('.see-map').removeClass('current'); }); * $("#mini-world-map li").each(function() { $(this).click(function() { $('#mini-world-map').fadeOut(); $('.see-map').html($(this).html()); * $('.see-map').removeClass('current'); $('.see-map').addClass('selected'); }); $(this).mouseover(function() { $('#mini-world-map .title').html($(this).html()); }); * $(this).mouseout(function() { $('#mini-world-map .title').html(''); }); }); * * $('.see-map').click( function(e){ e.preventDefault(); * * if($(this).hasClass('selected')){ $(this).removeClass('selected'); $(this).html('see map'); }else{ var $this = $('#mini-world-map'); if($this.is(':visible')){ * //$this.css('display', 'none'); $this.fadeOut(); $(this).removeClass('current'); }else{ //$this.css('display', 'block'); $this.fadeIn(); $(this).addClass('current'); } } * }); */ // // Text Option $('#searchbox-country').change(function(){ var val = $(this).val(); if(val == 'SPAIN'){ $(this).addClass('selected'); }else{ $(this).removeClass('selected'); } }); $('#searchbox-country').click(function(){ if($(this).hasClass('selected')){ $(this).removeClass('selected'); $(this).val(''); } }); // // Select Options $('#searchbox-type-event').change(function(){ var val = $(this).find('option:selected').val(); if(val == -1){ $(this).removeClass('selected'); $(this).addClass('none-selected'); }else{ $(this).removeClass('none-selected'); $(this).addClass('selected'); } }); $('#searchbox-program option:selected').val(-1); $('#searchbox-program').change(function(){ var val = $(this).find('option:selected').val(); if(val == -1){ $(this).removeClass('selected'); $(this).addClass('none-selected'); }else{ $(this).removeClass('none-selected'); $(this).addClass('selected'); } }); $('#searchbox-program option:selected').val(-1); // // Open/Close /* * Codigo movido al archivo rend_destacadosCuatro.jsp $('#show-events-type').click( function(e){ e.preventDefault(); var $this = $('div.flexslider-special'), sliderParent = * $this.parents('div.flexslider-special-wrapper'), slides = sliderParent.find('ul.slides'); if( slides.is(':visible') ){ * sliderParent.find('.slide-special-subtitle').addClass('collapse'); slides.slideUp(function() { sliderParent.css('display', 'none'); }); * sliderParent.find('.flex-control-nav').hide(); $this.addClass('open'); * * $(this).html('show events type'); }else{ * sliderParent.find('.slide-special-subtitle').removeClass('collapse'); sliderParent.css('display', 'block'); slides.slideDown(); sliderParent.find('.flex-control-nav').show(); * $this.removeClass('open'); * * $(this).html('hide events type'); } }); * * $('#show-events-type').click(); */ /* * Codigo movido a filtroBuscadorEventos.js //$('.toggle-special-slide-events').click( function(e){ $('#free-text-search').click( function(e){ e.preventDefault(); var $this = * $('#events-module-search-box'); * * if( $this.is(':visible') ){ $this.slideUp(); * * $(this).html('free text search'); }else{ $this.slideDown(); * * $(this).html('hide text search'); } }); */ // // FIN añadido cambio buscador eventos /* code move by accenture to end file */ // Accept or Reject Terms addEventAcceptOrRejectTerms(); // Show Special terms inside Light boxes addEventToShowSpecialTermsAndBack(); try { // Equal Cols Height where necessary $('.equalCols').equalCols(); $('.equalCols2').equalCols(); $('.equalColsAlternativo').equalColsAlternativo(); $('.equalCols3').equalCols(); } catch(e) { isException(true); // DEBUG } /* codigo movido por accenture a function initPrettyBox */ initPrettyBox(); /* * Codigo movido por ACCENTURE a la funcion searchFaqList() // Animate anchor link FAQs $('#search-faqs-list a').click(function(e){ e.preventDefault(); var full_url = this.href, * parts = full_url.split("#"), trgt = parts[1]; * * $('.faqs-list-module.faqs-related-list-module').fadeOut( function(){ $('#program option:first').attr('selected', 'selected'); * $('.faqs-list-module').not('.faqs-related-list-module').fadeIn( function(){ var target_offset = $("#"+trgt).offset(), target_top = target_offset.top; $('html, * body').animate({scrollTop:target_top}, 500); }); }); }); */ /* * Codigo movido por ACCENTURE a la funcion dropdownsManagementAreas() // Dropdowns Management Areas $('.list-dropdown').click( function(e){ e.preventDefault(); var $this = * $(this), $parent = $this.parent(); * * $parent.parent().find('.extra-info-container').hide(); * * if($parent.hasClass('expanded')){ $parent.parent().find('.expanded').find('p').slideUp().end().removeClass('expanded'); * * }else{ $parent.parent().find('.expanded').find('p').slideUp().end().removeClass('expanded'); $parent.addClass('expanded').find('p').slideDown(); * $this.parent().find('.extra-info-container').show(); } } ); */ // Expand Make Fit Module $('#make-fit-module .title-module').click( function(e){ var $content = $('.make-fit-content', '#make-fit-module'); var $title = $('.title-module', '#make-fit-module'); if( $title.hasClass('opened') ){ $title.removeClass('opened'); $content.slideUp(); }else{ $title.addClass('opened'); $content.slideDown(); if( !$content.hasClass('resized') ){ $content.addClass('resized'); $('.equalCols', '#make-fit-module').equalCols(); } } } ); // Select options in Find your Program $('.search-row li').click( function(e){ e.preventDefault(); $(this).toggleClass('selected'); } ); // Select program in Contact Departments Programs $('#programs-list').click( function(e){ e.preventDefault(); var $this = $(this); var option = $this.find('option:eq(' + e.currentTarget.selectedIndex + ')'); var option_val = option.val(); // AJAX para cargar panel lateral. // ... // ... $('#program-details .subtitle-module').html( option.html() ); $('#program-details').fadeIn('normal'); } ); // Expand the Corporate Details on Gateway Corporate $('.extend-corporate').click( function(e){ e.preventDefault(); var $this = $(this); $this.parents('li:first').find('.corporate-extend-info-content').slideToggle(); $this.toggleClass('expanded'); } ); // Show Ponents Details $('#upcoming-staff-list .ponent').live( 'click', function(e){ e.preventDefault(); var $this = $(this); $this.parents('#upcoming-staff-list').find('.staff-details').hide(); $this.parent().find('.staff-details').fadeIn(); } ); $('.staff-details-close').live( 'click', function(e){ e.preventDefault(); $(this).parent().fadeOut(); } ); /* * inicio de codigo generado por accenture la implementacion de la funcion se encuentra al final */ validarFormulario(); /* fin de codigo generado por accenture */ /** * Search Event Form * * Used on - Events Module (events-module.php) * * @param object * @return void */ $('#events-form').submit( function(e){ e.preventDefault(); var no_results = '
'; no_results += '

No results for your search

'; no_results += '

Have a look to our upcoming events or the next virtual sessions.

'; no_results += '

Don\'t find what you\'re looking for? Tell us bt email: admission@ie.edu

'; no_results += '
'; $('#events-module-results').html( no_results ); $('#events-modules-info').remove(); } ); /** * Admissions Process Options * * Used on - Admision Process Module (admissions-process-module.php) * * @param object * @return void */ $('#admissions-process-steps li').click( function(e){ e.preventDefault(); var $this = $(this); if($this.hasClass('current')) return false; $this.parent().find('.current').removeClass('current'); $this.addClass('current'); var admission_id = $this.attr('id'), layer_name = admission_id.replace('process', 'request'); $('#admissions-process-module .admission-content-tab').hide(); $('#' + layer_name).fadeIn(); } ); /* * codigo movido por accenture a function showHideTabsCampusLocalization /** Show/Hide Tabs content * */ showHideTabsCampusLocalization(); /* codigo movido por accenture a function sliderVerticalControls() */ sliderVerticalControls(); /** * Accordion * * Used on - Campus Localization Module (campus-localization-module.php) * * @param object * @return void */ $('.accordion>li>a').click( function(e){ e.preventDefault(); var $this = $(this), $li = $this.parent(), $child_ul = $li.find('ul, form'); if( !$li.hasClass('current') ){ $child_ul.fadeIn(); $li.parent().find('.current').removeClass('current').find('ul, form').hide(); $li.addClass('current'); } }); /** * Selecting a format Media Results * * Used on - Events Module Searchbox (events.module.php) * * @param object * @return void */ $('#events-module-searchbox-format a').click( function(e){ e.preventDefault(); $(this).toggleClass('current'); } ); /** * Selecting an event on the event list * * Used on - Events List Module (events-list-module.php) * * @param object * @return void */ // $('#events-list li').click( function(e){ // e.preventDefault(); // // // Hack for show a Version without Asociated Programs // if( ( $(this).index('#events-list li') ) % 2 == 0 ){ // $('.upcoming-event-programs').hide(); // $('.for-students').show(); // }else{ // $('.upcoming-event-programs').show(); // $('.for-students').hide(); // } // // var $this = $(this), // $context = $this.parents('#events-module-results').find('#event-wrapper'), // $event_list = $this.parents('#events-list'), // item_pos = $this[0].offsetTop, // event_detail_height = 0, // $event_detail = $('.upcoming-event-detail-wrap', $context); // // // Hack for round all corners in details // if ($this.is(":first-child")) { // $context.removeClass('all-rounded'); // }else{ // $context.addClass('all-rounded'); // } // // $('.see-more-information').hide(); // event_detail_height = $event_detail.show().height(); // // // Adjust layer position // if( item_pos > ( event_detail_height - $(this).height() - 5 ) ){ // The // second argument is a safe margin. // $context.css('top', ( item_pos - event_detail_height ) + ( $(this).height() + // 30 ) + 'px'); // }else{ // $context.css('top', '0'); // } // // $('.current', $event_list ).removeClass('current'); // $(this).addClass('current'); // // } ); /** * Selecting an event on the event list * * Used on - Events List Module (events-list-module.php) * * @param object * @return void */ $('#results-items-list li').click( function(e){ e.preventDefault(); var $this = $(this), item_pos = $this[0].offsetTop, event_detail_height = 0, $event_detail = $('.results-item-details'), correction = 0; if( !$('#event-wrapper').data('correction') ){ $('#event-wrapper').data('correction', $('#results-items-list li:first')[0].offsetTop ); } // Hack for round all corners in details if ($this.is(":first-child")) { $('.results-item-details').removeClass('all-rounded'); }else{ $('.results-item-details').addClass('all-rounded'); } $('.see-more-information').hide(); event_detail_height = $event_detail.show().height(); // Adjust layer position if( item_pos > event_detail_height ){ // The second argument is a safe // margin. $('#event-wrapper').css('top', ( item_pos - $('#event-wrapper').data('correction') - event_detail_height ) + 'px'); }else{ $('#event-wrapper').css('top', '0'); } $('.current', '#results-items-list').removeClass('current'); $(this).addClass('current'); } ); /** * Selecting an event on the ranking list * * Used on - Ranking List Module (ranking-module.php) * * @param object * @return void */ $('.ie-ranking-detail-wrap-content li').click( function(e){ e.preventDefault(); var item_pos = $(this)[0].offsetTop, event_detail_height = 0, aside_height = $('#ie-ranking-detail-wrap-aside').height(), $event_detail = $('#ie-ranking-detail-widget'); event_detail_height = $event_detail.height(); // Adjust layer position if( item_pos > ( event_detail_height - ( $(this).height() ) ) ){ // The // second // argument // is a // safe // margin. if( ( ( item_pos - 30 ) + event_detail_height ) > aside_height ) { $('#ie-ranking-detail-widget').css('top', ( aside_height - event_detail_height ) + 35 ); }else{ $('#ie-ranking-detail-widget').css('top', ( item_pos - 30 ) + 'px'); } }else{ $('#ie-ranking-detail-widget').css('top', '0'); } $('.current', '.ie-ranking-detail-wrap-content ul').removeClass('current'); $(this).addClass('current'); } ); /** * Selecting a blog from the list * * Used on - All IE Blogs Module (all-ie-blog-module.php) * * @param object * @return void */ $('#blog-selector ul li').click( function(e){ e.preventDefault(); var $this = $(this); $('.current', '#blog-selector').removeClass('current'); $this.addClass('current'); // Aquí vendría la llamada AJAX para rellenar el cuadro de la derecha. } ); /* * codigo movido por accenture a la function agregarClickVerDetalleRanking /** Selecting a ranking from the list * * Used on - All IE Ranking Module (all-ie-ranking-module.php) * * @param object @return void * * $('#all-ie-ranking-module ul li').click( function(e){ * * e.preventDefault(); $('.current', '#all-ie-ranking-module ul').removeClass('current'); var $this = $(this).addClass('current'); // Aqui lanzo la peticion AJAX para cargar todo * el contenido posterior. // $.ajax(); // Mock de la respuesta // Aqui deberia inyectarse la respuesta del server en la pagina. * * * $('#ie-ranking-detail-wrap-module').show( 'normal', function(){ var target_offset = $(this).offset(), target_top = target_offset.top; $('html, * body').animate({scrollTop:target_top}, 500); }); * * $('.ie-ranking-detail-wrap-content ul li').click( function(e){ e.preventDefault(); $('.current', '.ie-ranking-detail-wrap-content ul').removeClass('current'); var $this = * $(this).addClass('current'); var rank_id = $this.attr('id'); $('.see-more-information, .ie-ranking-detail-content').hide(); $('#details-' + rank_id ).show(); } ); * * }); */ /* fin de codigo movido por accenture */ /* inicio de codigo generado por accenture */ agregarClickVerDetalleRanking(); searchFaqList(); dropdownsManagementAreas(); GoToContactFAQs(); /* inicio de codigo generado por accenture */ /** * Injecting Title and Content in News Detail slideshow * * Used on - News Detail Module (news-detail-module.php) * * @param object * @return void */ if( $('#news-detail-gallery').length > 0 ){ var news_details = $('#news-detail-gallery .slides li:first .slide-details'); $('.news-detail-gallery-infobar-header h3').html( news_details.find('.slide-details-title').html() ); $('.news-detail-gallery-infobar-body p').html( news_details.find('.slide-details-content').html() ); } /** * Main Menu Behaviour * * Used on - main-menu-inc.php * */ var timeout = null; $('#main-menu').mouseenter( function(){ // console.log( 'entro' ); if(timeout !== null ){ clearTimeout(timeout); timeout = null; } } ); $('#main-menu>ul>li>a').mouseenter(function(e){ e.stopPropagation(); // console.log( 'entro tb' ); var $element = $(this), $this = $element.parent(), menu_section = $this.attr('id'); if(timeout !== null ){ clearTimeout(timeout); timeout = null; } $this.addClass('current'); if( $('#main-submenu ul:visible').length == 0){ timeout = setTimeout(function() { var timeout = null; $('#main-submenu ul#' + menu_section + '-dropdown').slideDown('normal', function(){ $('#main-submenu ul').find('li').fadeIn('slow'); }); $this.addClass('hovering'); }, 500); }else{ $('#main-submenu ul').hide(); $('#main-submenu ul#' + menu_section + '-dropdown').show(); $('.hovering', '#main-menu').removeClass('hovering'); $this.addClass('hovering'); } });/* * .click( function(e){ e.preventDefault(); if(timeout !== null ){ clearTimeout(timeout); timeout = null; } * * var $this = $(this).parent(); if($this.hasClass('current')){ $('#main-submenu ul').slideUp(); $this.removeClass('current'); }else{ var menu_section = * $this.addClass('current').attr('id'); $('#main-submenu ul#' + menu_section + '-dropdown').slideDown(); } }); */ $('#main-menu-wrapper').mouseleave(function(){ clearTimeout(timeout); var $this = $(this); if(timeout !== null ){ clearTimeout(timeout); timeout = null; } timeout = setTimeout(function() { var timeout = null; if (timeout == null) { $this.find('.current').removeClass('current'); $('.level-3', '#main-submenu').hide(); $('#main-submenu ul li').fadeOut('slow', function(){ $(this).parent().slideUp(); }); $('.hovering', '#main-menu').removeClass('hovering'); $('.hovering_2', '#main-submenu').removeClass('hovering_2'); } }, 3000); }); // Level 3 $('#main-submenu>ul>li>a').mouseenter( function(){ var $this = $(this); $('.level-3', '#main-submenu').hide(); $('.hovering_2', '#main-submenu').removeClass('hovering_2'); if( $this.hasClass('hasDropdown') ){ $this.addClass('hovering_2').parent().find('.level-3').show(); } }); /* * * Nuevo Main Menu * * */ var securTimeout = null; // Retardo de seguridad para evitar navegacion // diagonal. var collapseTime = null; var collapseTime2 = null; var out = null; var expand_especial = null; $('#botonera .liprimernivel').mouseenter(function(e){ clearTimeout( securTimeout ); clearTimeout( collapseTime ); // clearTimeout( collapseTime2 ); $("a.relleno").removeClass("on"); if( $(this).hasClass('current') ) return false; if( $(this).parent().hasClass('content-expanded') ) return false; securTimeout = setTimeout( function(){ partnerDissapear(); var $target = $(e.target); var $botonera = $('#botonera'); $botonera.find('.liprimernivel.current').removeClass('current'); $target.parent().addClass('current'); if($botonera.hasClass('expand')){ show_second_level($target); // $(".tercernivel-special").slideUp(1000); }else{ expand_second_level($target); } // $(".tercernivel-special").hide(); $(".tercernivel-special").slideUp(600); expand_especial = 0; }, 200); }); $('.primernivel').mouseleave( function(){ clearTimeout( securTimeout ); if( $('#botonera').hasClass('expand') ){ collapseTime = setTimeout( function(){ // if($(".tercernivel-special").css("display") !="block") if(out==0){ collapse_second_level(); // $(".tercernivel-special").hide(); $(".tercernivel-special").slideUp(600); } }, 2000); } }); function expand_second_level($target){ $('#botonera').addClass("expand").animate({ height: 85 }, 500, function(){ show_second_level($target); }); } function collapse_second_level(){ if( $('#botonera').hasClass('content-expanded') ) return false; var $botonera = $('#botonera'); $botonera.find('.liprimernivel.current').removeClass('current'); $botonera.find('.segundonivel').hide(); $botonera.animate({ height: /* 52 */46 }, 500, function(){ $('#botonera').removeClass("expand").find('.segundonivel').hide().removeClass('current'); // $(".tercernivel-special").slideUp(1000); }); } function show_second_level($target){ var $botonera = $('#botonera'); $botonera.find('.segundonivel').hide(); $botonera.find('.segundonivel.current').removeClass('current'); $target.parent().find('.segundonivel').addClass('current').fadeIn(); if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) $("#botonera-content").height(90) } $(".special-li").hover(function(){ id = $(this).attr("id"); expand_especial = 1; $(".tercernivel-special").not("#tercernivel-" + id).slideUp(600,function(){ // $(".tercernivel-special").not("#tercernivel-" + id).hide(); if((!navigator.userAgent.match(/iPhone/i)) && (!navigator.userAgent.match(/iPod/i)) && (!navigator.userAgent.match(/iPad/i))){ collapseTime2 = setTimeout( function(){ if(expand_especial == 1){ clearTimeout( collapseTime2 ) $("#tercernivel-" + id).delay(600).slideDown(900,function(){;}); } }, 400); } }) },function(){ expand_especial = 0; }); $(".tercernivel-special").mouseenter(function(){ clearTimeout( collapseTime2 ); expand_especial = 1; id = $(this).attr("id"); if(id ==("tercernivel-special-green")) $("#special-green a.relleno").addClass("on"); if(id ==("tercernivel-special-red")) $("#special-red a.relleno").addClass("on"); if(id ==("tercernivel-special-purple")) $("#special-purple a.relleno").addClass("on"); if(id ==("tercernivel-special-brown")) $("#special-brown a.relleno").addClass("on"); out=1; }) /* * $(".tercernivel-special").mouseleave(function(){ clearTimeout( collapseTime2 ); id = $(this).attr("id"); $("a.relleno").removeClass("on"); * * collapseTime2 = setTimeout( function(){ * * $("#"+id).slideUp(500,function(){ if( $('#botonera').hasClass('expand') ){ * * if(out==1) collapse_second_level(); } });}, 2000); }) */ $("#botonera .lisegundonivel").hover(function(){ if(!$(this).hasClass("special-li")){ clearTimeout( collapseTime2 ); expand_especial=0; $(".tercernivel-special").slideUp(300,function(){$("a.relleno").removeClass("on");}); // $(".tercernivel-special").hide(); // $("a.relleno").removeClass("on"); } clearTimeout( collapseTime ); out=0; }); $(".tercernivel-special a.close").click(function(event){ event.preventDefault(); clearTimeout( collapseTime2 ); $(this).parent().parent().hide(); $(this).parent().parent().slideUp(600,function(){ // $("a.relleno").removeClass("on"); collapseTime2 = setTimeout( function(){ if(out==1) collapse_second_level(); }, 2000); }); }) // ipad and iphone fix if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) { $('#botonera').css({'width':'1024px'}); /* * $('#botonera .liprimernivel > a').click(function(e){ e.preventDefault(); clearTimeout( securTimeout ); clearTimeout( collapseTime ); * * if( $(this).hasClass('current') ) return false; if( $(this).parent().hasClass('content-expanded') ) return false; * * securTimeout = setTimeout( function(){ partnerDissapear(); var $target = $(e.target); * * var $botonera = $('#botonera'); $botonera.find('.liprimernivel.current').removeClass('current'); $target.parent().addClass('current'); * * if($botonera.hasClass('expand')){ show_second_level($target); }else{ expand_second_level($target); } }, 200); }); * * $("a.relleno").click(function(e){ e.preventDefault(); $(this).parent().find(".tercernivel").show(); }); * * $(".special-li a").click(function(e){ e.preventDefault(); object = $(this); id =$(this).parent().attr("id"); * * if($("#tercernivel-"+id).is(":hidden")){ $("#tercernivel-"+id).fadeIn(500); $("a.relleno").removeClass("on") object.addClass("on"); } else{ $("#tercernivel-"+id).hide(); * //$("#tercernivel-"+id).slideUp(1000,function(){ $("a.relleno").removeClass("on"); object.css({"background":"none","color":"#FFF"}); //}); } }) * */ } anularEnlaces(); } ); function anularEnlaces(){ // Anular los enlaces con class "anularEnlace" $('.anularEnlace').click( function(e){ e.preventDefault(); return null; }); } /* * ! * * Print a region of HTML * */ function print_region( layer ){ if(!layer) return false; var prtContent = layer[0], WinPrint = window.open('','','left=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0'); var preCSS = "", cadenaCSS = ""; cadenaCSS += ""; var postCSS = ""; postCSS += $('#header').html(); postCSS += "
"; var prtContent = preCSS + cadenaCSS + postCSS + prtContent.innerHTML; var postCierre = "
"; postCierre += $('#footer').html(); postCierre += ""; var total = prtContent + postCierre; WinPrint.document.write(total); WinPrint.document.close(); WinPrint.focus(); WinPrint.print(); // WinPrint.close(); // prtContent.innerHTML=strOldOne; } function initDropDowns(){ try { // Las variables literalSeleccionar y literalTodosElegidos se // inicializan en el UtilsBusiness.jsp para darles valor segun el // idioma var litSelec = literalSeleccionar ? literalSeleccionar : 'Please Select...'; var litAll = literalTodosElegidos ? literalTodosElegidos : 'All selected'; $(".dp-checkbox:visible").dropdownchecklist({ firstItemChecksAll: true, width: ($('#faqs-research-module').length > 0) ? 290 : 116, maxDropHeight: 265, textFormatFunction: function(options) { var selectedOptions = options.filter(":selected"); var countOfSelected = selectedOptions.size(); var size = options.size(); switch(countOfSelected) { case 0: // Hack for FAQS if($('#faqs-research-module').length > 0){ $('#about_program').removeAttr('checked'); } return "" + litSelec + ""; // case 1: return selectedOptions.text(); case options.size(): $('#about_program').attr('checked', 'checked'); return "" + litAll + ""; default: // Hack for FAQS if($('#faqs-research-module').length > 0){ $('#about_program').attr('checked', 'checked'); } return countOfSelected + " marked"; } } }); } catch(e) { isException(true); // DEBUG } } function alinear(){ var maxheight = 0; $("#advanced-options-list li").each(function(){ console.log( $(this), $(this).height() ); if( $(this).height() > maxheight ){ maxheight = $(this).height(); } }); $("#advanced-options-list li").css('height', maxheight); } /* * ! * * Printable Selects * * Copyright 2011, EtnasSoft * */ $("select.printable-select").each(function(i){ var $el = $(this); var $options = $el.find("option"); $el.after(""); var $curPrintBox = $( "#sel" + i ); $options.each(function() { $curPrintBox.append("
  • "+$(this).text()+"
  • "); }); }); /* * ! jCarousel - Riding carousels with jQuery http://sorgalla.com/jcarousel/ * * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com) Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL * (http://www.opensource.org/licenses/gpl-license.php) licenses. * * Built on top of the jQuery library http://jquery.com * * Inspired by the "Carousel Component" by Bill Scott http://billwscott.com/carousel/ */ (function(g){var q={vertical:!1,rtl:!1,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,setupCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,animationStepCallback:null,buttonNextHTML:"
    ",buttonPrevHTML:"
    ",buttonNextEvent:"click",buttonPrevEvent:"click", buttonNextCallback:null,buttonPrevCallback:null,itemFallbackDimension:null},m=!1;g(window).bind("load.jcarousel",function(){m=!0});g.jcarousel=function(a,c){this.options=g.extend({},q,c||{});this.autoStopped=this.locked=!1;this.buttonPrevState=this.buttonNextState=this.buttonPrev=this.buttonNext=this.list=this.clip=this.container=null;if(!c||c.rtl===void 0)this.options.rtl=(g(a).attr("dir")||g("html").attr("dir")||"").toLowerCase()=="rtl";this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical? this.options.rtl?"right":"left":"top";for(var b="",d=a.className.split(" "),f=0;f").parent();if(this.container.size()===0)this.container=this.clip.wrap("
    ").parent();b!==""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1&&this.container.wrap('
    ');this.buttonPrev=g(".jcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null)this.buttonPrev=g(this.options.buttonPrevHTML).appendTo(this.container);this.buttonPrev.addClass(this.className("jcarousel-prev"));this.buttonNext= g(".jcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null)this.buttonNext=g(this.options.buttonNextHTML).appendTo(this.container);this.buttonNext.addClass(this.className("jcarousel-next"));this.clip.addClass(this.className("jcarousel-clip")).css({position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden",position:"relative",top:0,margin:0,padding:0}).css(this.options.rtl?"right":"left",0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"}); !this.options.vertical&&this.options.rtl&&this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl");var j=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null,b=this.list.children("li"),e=this;if(b.size()>0){var h=0,i=this.options.offset;b.each(function(){e.format(this,i++);h+=e.dimension(this,j)});this.list.css(this.wh,h+100+"px");if(!c||c.size===void 0)this.options.size=b.size()}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display", "block");this.funcNext=function(){e.next()};this.funcPrev=function(){e.prev()};this.funcResize=function(){e.resizeTimer&&clearTimeout(e.resizeTimer);e.resizeTimer=setTimeout(function(){e.reload()},100)};this.options.initCallback!==null&&this.options.initCallback(this,"init");!m&&g.browser.safari?(this.buttons(!1,!1),g(window).bind("load.jcarousel",function(){e.setup()})):this.setup()};var f=g.jcarousel;f.fn=f.prototype={jcarousel:"0.2.8"};f.fn.extend=f.extend=g.extend;f.fn.extend({setup:function(){this.prevLast= this.prevFirst=this.last=this.first=null;this.animating=!1;this.tail=this.resizeTimer=this.timer=null;this.inTail=!1;if(!this.locked){this.list.css(this.lt,this.pos(this.options.offset)+"px");var a=this.pos(this.options.start,!0);this.prevFirst=this.prevLast=null;this.animate(a,!1);g(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize);this.options.setupCallback!==null&&this.options.setupCallback(this)}},reset:function(){this.list.empty();this.list.css(this.lt, "0px");this.list.css(this.wh,"10px");this.options.initCallback!==null&&this.options.initCallback(this,"reset");this.setup()},reload:function(){this.tail!==null&&this.inTail&&this.list.css(this.lt,f.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=!1;this.options.reloadCallback!==null&&this.options.reloadCallback(this);if(this.options.visible!==null){var a=this,c=Math.ceil(this.clipping()/this.options.visible),b=0,d=0;this.list.children("li").each(function(f){b+=a.dimension(this, c);f+1this.options.size)c=this.options.size;for(var b=a;b<=c;b++){var d=this.get(b);if(!d.length||d.hasClass("jcarousel-item-placeholder"))return!1}return!0}, get:function(a){return g(">.jcarousel-item-"+a,this.list)},add:function(a,c){var b=this.get(a),d=0,p=g(c);if(b.length===0)for(var j,e=f.intval(a),b=this.create(a);;){if(j=this.get(--e),e<=0||j.length){e<=0?this.list.prepend(b):j.after(b);break}}else d=this.dimension(b);p.get(0).nodeName.toUpperCase()=="LI"?(b.replaceWith(p),b=p):b.empty().append(c);this.format(b.removeClass(this.className("jcarousel-item-placeholder")),a);p=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible): null;d=this.dimension(b,p)-d;a>0&&a=this.first&&a<=this.last)){var b=this.dimension(c);athis.options.size?this.options.size:a);for(var d=this.first>a,g=this.options.wrap!="circular"&&this.first<=1?1:this.first,j=d?this.get(g): this.get(this.last),e=d?g:g-1,h=null,i=0,k=!1,l=0;d?--e>=a:++ethis.options.size)))j=this.get(this.index(e)),j.length&&(h=this.add(e,j.clone(!0)));j=h;l=this.dimension(h);k&&(i+=l);if(this.first!==null&&(this.options.wrap=="circular"||e>=1&&(this.options.size===null||e<= this.options.size)))b=d?b+l:b-l}for(var g=this.clipping(),m=[],o=0,n=0,j=this.get(a-1),e=a;++o;){h=this.get(e);k=!h.length;if(h.length===0){h=this.create(e).addClass(this.className("jcarousel-item-placeholder"));if(j.length===0)this.list.prepend(h);else j[d?"before":"after"](h);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size))j=this.get(this.index(e)),j.length&&(h=this.add(e,j.clone(!0)))}j=h;l=this.dimension(h);if(l===0)throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting..."); this.options.wrap!="circular"&&this.options.size!==null&&e>this.options.size?m.push(h):k&&(i+=l);n+=l;if(n>=g)break;e++}for(h=0;h0&&(this.list.css(this.wh,this.dimension(this.list)+i+"px"),d&&(b-=i,this.list.css(this.lt,f.intval(this.list.css(this.lt))-i+"px")));i=a+o-1;if(this.options.wrap!="circular"&&this.options.size&&i>this.options.size)i=this.options.size;if(e>i){o=0;e=i;for(n=0;++o;){h=this.get(e--);if(!h.length)break;n+=this.dimension(h);if(n>=g)break}}e=i-o+ 1;this.options.wrap!="circular"&&e<1&&(e=1);if(this.inTail&&d)b+=this.tail,this.inTail=!1;this.tail=null;if(this.options.wrap!="circular"&&i==this.options.size&&i-o+1>=1&&(d=f.intval(this.get(i).css(!this.options.vertical?"marginRight":"marginBottom")),n-d>g))this.tail=n-g-d;if(c&&a===this.options.size&&this.tail)b-=this.tail,this.inTail=!0;for(;a-- >e;)b+=this.dimension(this.get(a));this.prevFirst=this.first;this.prevLast=this.last;this.first=e;this.last=i;return b},animate:function(a,c){if(!this.locked&& !this.animating){this.animating=!0;var b=this,d=function(){b.animating=!1;a===0&&b.list.css(b.lt,0);!b.autoStopped&&(b.options.wrap=="circular"||b.options.wrap=="both"||b.options.wrap=="last"||b.options.size===null||b.last=b.first&&c<=b.last)&&(c<1||c>b.options.size)&&b.remove(c)}; this.notify("onBeforeAnimation");if(!this.options.animation||c===!1)this.list.css(this.lt,a+"px"),d();else{var f=!this.options.vertical?this.options.rtl?{right:a}:{left:a}:{top:a},d={duration:this.options.animation,easing:this.options.easing,complete:d};if(g.isFunction(this.options.animationStepCallback))d.step=this.options.animationStepCallback;this.list.animate(f,d)}}},startAuto:function(a){if(a!==void 0)this.options.auto=a;if(this.options.auto===0)return this.stopAuto();if(this.timer===null){this.autoStopped= !1;var c=this;this.timer=window.setTimeout(function(){c.next()},this.options.auto*1E3)}},stopAuto:function(){this.pauseAuto();this.autoStopped=!0},pauseAuto:function(){if(this.timer!==null)window.clearTimeout(this.timer),this.timer=null},buttons:function(a,c){if(a==null&&(a=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="first"||this.options.size===null||this.last=this.options.size))a=this.tail!==null&&!this.inTail;if(c==null&&(c=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="last"||this.first>1),!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1))c=this.tail!==null&&this.inTail;var b=this;this.buttonNext.size()>0?(this.buttonNext.unbind(this.options.buttonNextEvent+".jcarousel",this.funcNext),a&&this.buttonNext.bind(this.options.buttonNextEvent+".jcarousel",this.funcNext), this.buttonNext[a?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",a?!1:!0),this.options.buttonNextCallback!==null&&this.buttonNext.data("jcarouselstate")!=a&&this.buttonNext.each(function(){b.options.buttonNextCallback(b,this,a)}).data("jcarouselstate",a)):this.options.buttonNextCallback!==null&&this.buttonNextState!=a&&this.options.buttonNextCallback(b,null,a);this.buttonPrev.size()>0?(this.buttonPrev.unbind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev), c&&this.buttonPrev.bind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev),this.buttonPrev[c?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",c?!1:!0),this.options.buttonPrevCallback!==null&&this.buttonPrev.data("jcarouselstate")!=c&&this.buttonPrev.each(function(){b.options.buttonPrevCallback(b,this,c)}).data("jcarouselstate",c)):this.options.buttonPrevCallback!==null&&this.buttonPrevState!=c&&this.options.buttonPrevCallback(b,null,c);this.buttonNextState= a;this.buttonPrevState=c},notify:function(a){var c=this.prevFirst===null?"init":this.prevFirst=j&&k<=e)&&a(k)}}},create:function(a){return this.format("
  • ",a)},format:function(a,c){for(var a=g(a),b=a.get(0).className.split(" "),d=0;d= 31 ) return; return day_diff == 0 && ( diff < 60 && "just now" || diff < 120 && "1 minute ago" || diff < 3600 && Math.floor( diff / 60 ) + " minutes ago" || diff < 7200 && "1 hour ago" || diff < 86400 && Math.floor( diff / 3600 ) + " hours ago") || day_diff == 1 && "Yesterday" || day_diff < 7 && day_diff + " days ago" || day_diff < 31 && Math.ceil( day_diff / 7 ) + " weeks ago"; } // If jQuery is included in the page, adds a jQuery plugin to handle it as well if ( typeof jQuery != "undefined" ) jQuery.fn.prettyDate = function(){ return this.each(function(){ var date = prettyDate(this.title); if ( date ) jQuery(this).text( date ); }); }; /* * ! jQuery corner plugin: simple corner rounding Examples and documentation at: http://jquery.malsup.com/corner/ version 2.12 (23-MAY-2011) Requires jQuery v1.3.2 or later Dual * licensed under the MIT and GPL licenses: http://www.opensource.org/licenses/mit-license.php http://www.gnu.org/licenses/gpl.html Authors: Dave Methvin and Mike Alsup */ /** * corner() takes a single string argument: $('#myDiv').corner("effect corners width") * * effect: name of the effect to apply, such as round, bevel, notch, bite, etc (default is round). corners: one or more of: top, bottom, tr, tl, br, or bl. (default is all corners) * width: width of the effect; in the case of rounded corners this is the radius. specify this value using the px suffix such as 10px (yes, it must be pixels). */ (function($) { var style = document.createElement('div').style, moz = style['MozBorderRadius'] !== undefined, webkit = style['WebkitBorderRadius'] !== undefined, radius = style['borderRadius'] !== undefined || style['BorderRadius'] !== undefined, mode = document.documentMode || 0, noBottomFold = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8), expr = $.browser.msie && (function() { var div = document.createElement('div'); try { div.style.setExpression('width','0+0'); div.style.removeExpression('width'); } catch(e) { return false; } return true; })(); $.support = $.support || {}; $.support.borderRadius = moz || webkit || radius; // so you can do: if // (!$.support.borderRadius) // $('#myDiv').corner(); function sz(el, p) { return parseInt($.css(el,p))||0; }; function hex2(s) { s = parseInt(s).toString(16); return ( s.length < 2 ) ? '0'+s : s; }; function gpc(node) { while(node) { var v = $.css(node,'backgroundColor'), rgb; if (v && v != 'transparent' && v != 'rgba(0, 0, 0, 0)') { if (v.indexOf('rgb') >= 0) { rgb = v.match(/\d+/g); return '#'+ hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]); } return v; } if (node.nodeName.toLowerCase() == 'html') break; node = node.parentNode; // keep walking if transparent } return '#ffffff'; }; function getWidth(fx, i, width) { switch(fx) { case 'round': return Math.round(width*(1-Math.cos(Math.asin(i/width)))); case 'cool': return Math.round(width*(1+Math.cos(Math.asin(i/width)))); case 'sharp': return width-i; case 'bite': return Math.round(width*(Math.cos(Math.asin((width-i-1)/width)))); case 'slide': return Math.round(width*(Math.atan2(i,width/i))); case 'jut': return Math.round(width*(Math.atan2(width,(width-i-1)))); case 'curl': return Math.round(width*(Math.atan(i))); case 'tear': return Math.round(width*(Math.cos(i))); case 'wicked': return Math.round(width*(Math.tan(i))); case 'long': return Math.round(width*(Math.sqrt(i))); case 'sculpt': return Math.round(width*(Math.log((width-i-1),width))); case 'dogfold': case 'dog': return (i&1) ? (i+1) : width; case 'dog2': return (i&2) ? (i+1) : width; case 'dog3': return (i&3) ? (i+1) : width; case 'fray': return (i%2)*width; case 'notch': return width; case 'bevelfold': case 'bevel': return i+1; case 'steep': return i/2 + 1; case 'invsteep':return (width-i)/2+1; } }; $.fn.corner = function(options) { // in 1.3+ we can fix mistakes with the ready state if (this.length == 0) { if (!$.isReady && this.selector) { var s = this.selector, c = this.context; $(function() { $(s,c).corner(options); }); } return this; } return this.each(function(index){ var $this = $(this), // meta values override options o = [$this.attr($.fn.corner.defaults.metaAttr) || '', options || ''].join(' ').toLowerCase(), keep = /keep/.test(o), // keep borders? cc = ((o.match(/cc:(#[0-9a-f]+)/)||[])[1]), // corner color sc = ((o.match(/sc:(#[0-9a-f]+)/)||[])[1]), // strip color width = parseInt((o.match(/(\d+)px/)||[])[1]) || 10, // corner // width re = /round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog|invsteep|steep/, fx = ((o.match(re)||['round'])[0]), fold = /dogfold|bevelfold/.test(o), edges = { T:0, B:1 }, opts = { TL: /top|tl|left/.test(o), TR: /top|tr|right/.test(o), BL: /bottom|bl|left/.test(o), BR: /bottom|br|right/.test(o) }, // vars used in func later strip, pad, cssHeight, j, bot, d, ds, bw, i, w, e, c, common, $horz; if ( !opts.TL && !opts.TR && !opts.BL && !opts.BR ) opts = { TL:1, TR:1, BL:1, BR:1 }; // support native rounding if ($.fn.corner.defaults.useNative && fx == 'round' && (radius || moz || webkit) && !cc && !sc) { if (opts.TL) $this.css(radius ? 'border-top-left-radius' : moz ? '-moz-border-radius-topleft' : '-webkit-border-top-left-radius', width + 'px'); if (opts.TR) $this.css(radius ? 'border-top-right-radius' : moz ? '-moz-border-radius-topright' : '-webkit-border-top-right-radius', width + 'px'); if (opts.BL) $this.css(radius ? 'border-bottom-left-radius' : moz ? '-moz-border-radius-bottomleft' : '-webkit-border-bottom-left-radius', width + 'px'); if (opts.BR) $this.css(radius ? 'border-bottom-right-radius' : moz ? '-moz-border-radius-bottomright' : '-webkit-border-bottom-right-radius', width + 'px'); return; } strip = document.createElement('div'); $(strip).css({ overflow: 'hidden', height: '1px', minHeight: '1px', fontSize: '1px', backgroundColor: sc || 'transparent', borderStyle: 'solid' }); pad = { T: parseInt($.css(this,'paddingTop'))||0, R: parseInt($.css(this,'paddingRight'))||0, B: parseInt($.css(this,'paddingBottom'))||0, L: parseInt($.css(this,'paddingLeft'))||0 }; if (typeof this.style.zoom != undefined) this.style.zoom = 1; // force // 'hasLayout' // in IE if (!keep) this.style.border = 'none'; strip.style.borderColor = cc || gpc(this.parentNode); cssHeight = $(this).outerHeight(); for (j in edges) { bot = edges[j]; // only add stips if needed if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) { strip.style.borderStyle = 'none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none'); d = document.createElement('div'); $(d).addClass('jquery-corner'); ds = d.style; bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild); if (bot && cssHeight != 'auto') { if ($.css(this,'position') == 'static') this.style.position = 'relative'; ds.position = 'absolute'; ds.bottom = ds.left = ds.padding = ds.margin = '0'; if (expr) ds.setExpression('width', 'this.parentNode.offsetWidth'); else ds.width = '100%'; } else if (!bot && $.browser.msie) { if ($.css(this,'position') == 'static') this.style.position = 'relative'; ds.position = 'absolute'; ds.top = ds.left = ds.right = ds.padding = ds.margin = '0'; // fix ie6 problem when blocked element has a border width if (expr) { bw = sz(this,'borderLeftWidth') + sz(this,'borderRightWidth'); ds.setExpression('width', 'this.parentNode.offsetWidth - '+bw+'+ "px"'); } else ds.width = '100%'; } else { ds.position = 'relative'; ds.margin = !bot ? '-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px' : (pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px'; } for (i=0; i < width; i++) { w = Math.max(0,getWidth(fx,i, width)); e = strip.cloneNode(false); e.style.borderWidth = '0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px'; bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild); } if (fold && $.support.boxModel) { if (bot && noBottomFold) continue; for (c in opts) { if (!opts[c]) continue; if (bot && (c == 'TL' || c == 'TR')) continue; if (!bot && (c == 'BL' || c == 'BR')) continue; common = { position: 'absolute', border: 'none', margin: 0, padding: 0, overflow: 'hidden', backgroundColor: strip.style.borderColor }; $horz = $('
    ').css(common).css({ width: width + 'px', height: '1px' }); switch(c) { case 'TL': $horz.css({ bottom: 0, left: 0 }); break; case 'TR': $horz.css({ bottom: 0, right: 0 }); break; case 'BL': $horz.css({ top: 0, left: 0 }); break; case 'BR': $horz.css({ top: 0, right: 0 }); break; } d.appendChild($horz[0]); var $vert = $('
    ').css(common).css({ top: 0, bottom: 0, width: '1px', height: width + 'px' }); switch(c) { case 'TL': $vert.css({ left: width }); break; case 'TR': $vert.css({ right: width }); break; case 'BL': $vert.css({ left: width }); break; case 'BR': $vert.css({ right: width }); break; } d.appendChild($vert[0]); } } } } }); }; $.fn.uncorner = function() { if (radius || moz || webkit) this.css(radius ? 'border-radius' : moz ? '-moz-border-radius' : '-webkit-border-radius', 0); $('div.jquery-corner', this).remove(); return this; }; // expose options $.fn.corner.defaults = { useNative: true, // true if plugin should attempt to use native browser // support for border radius rounding metaAttr: 'data-corner' // name of meta attribute to use for options }; })(jQuery); // set body classes (function () { // get ie version return undefined for no ie var ie = (function () { var u, v = 3, d = document.createElement('div'), a = d.getElementsByTagName('i'); while (d.innerHTML = '', a[0]); return v > 4 ? v : u; }()); var $trim = function (str) { return str.replace(/^\s+|\s+$/g, ''); }; var $clean = function (str) { return $trim(str.replace(/\s+/g, ' ')); }; var b = document.getElementsByTagName('body')[0], c = (ie) ? 'ie ie' + ie : 'no-ie', s = (b.className.length) ? $clean(b.className).split(' ') : []; // no body tag if (b === undefined) { return; } // no class names if (!s.length) { b.className = c; return; } // remove no-js for (var i = 0; i < s.length; i += 1) { if (s[i] == 'no-js') { s.splice(i, 1); break; } } // add ie s.push(c); // set body class names b.className = s.join(' '); }()); /* inicio de codigo generado por accenture */ function agregarClickVerDetalleRanking( ) { /** * Selecting a ranking from the list * * Used on - All IE Ranking Module (all-ie-ranking-module.php) * * @param object * @return void */ $('#all-ie-ranking-module ul li').click( function(e){ e.preventDefault(); $('.current', '#all-ie-ranking-module ul').removeClass('current'); var $this = $(this).addClass('current'); // Aquí lanzo la petición AJAX para cargar todo el contenido // posterior. // $.ajax(); var idRankingJQuery =$(this).find('input[name="idRankingJQuery"]').val(); var idMedioJQuery = $(this).find('input[name="idMedioJQuery"]').val(); var formDetalle = document.getElementById('formDetalle'); // Aquí debería inyectarse la respuesta del server en la página. verDetalle(formDetalle, idRankingJQuery, idMedioJQuery); $('#ie-ranking-detail-wrap-module').show( 'normal', function(){ var target_offset = $(this).offset(), target_top = target_offset.top; $('html, body').animate({scrollTop:target_top}, 500); }); $('.ie-ranking-detail-wrap-content ul li').click( function(e){ e.preventDefault(); $('.current', '.ie-ranking-detail-wrap-content ul').removeClass('current'); var $this = $(this).addClass('current'); var rank_id = $this.attr('id'); $('.see-more-information, .ie-ranking-detail-content').hide(); $('#details-' + rank_id ).show(); } ); }); /***/ // call Init PrettyBox initPrettyBox(); } function initPrettyBox() { // Init PrettyBox (Lightbox) var prettyPhotoInits = new prettyBoxDefaults, prettyPhotoBigInits = new prettyBoxDefaults, prettyPhotoSmall = new prettyBoxDefaults; prettyPhotoBigInits.default_width = 700; prettyPhotoSmall.default_width = 400; $("a[rel^='prettyPhoto']").prettyPhoto(prettyPhotoInits); $("a[rel^='prettyPhotoSmall']").prettyPhoto(prettyPhotoSmall); $("a[rel^='prettyPhotoBig']").prettyPhoto(prettyPhotoBigInits); $("a[rel^='prettyPhotoMap']").prettyPhoto({ custom_markup: '

    Admissions

    ', changepicturecallback: function(){ initializeGoogleMaps(); }, theme: 'grey_rounded', show_title: false, default_width: 780, default_height: 400, deeplinking: false, social_tools: '' }); // Pop-up para la app de Linkedin var prettyPhotoAppLinkedin = new prettyBoxDefaults; prettyPhotoAppLinkedin.default_width = 800; prettyPhotoAppLinkedin.default_height = 540; prettyPhotoAppLinkedin.before = function (){ if($('#enlace-li-destacado > iframe').attr('src') == '') $('#enlace-li-destacado > iframe').attr('src', 'https://ie.w1.friend2friend.com/'); }; // Para herramientas en rend_ge_funcionalidades y enlace en destacados // portada $("a[href^='#enlace-li-destacado']").prettyPhoto(prettyPhotoAppLinkedin); } function showHideTabsCampusLocalization( ) { /** * Show/Hide Tabs content * * Used on - OurHistory Module (our-history-module.php) * * @param object * @return void */ $('.tab_system a').click( function(e){ e.preventDefault(); var $this = $(this), $tab = ( $this.attr('href') ).substr( 1, ( $this.attr('href') ).length ) ; // No permitimos click sobre la pestana activa if($this.parent().hasClass('current')) return false; $('#' + $tab ).parent().children('div').hide().end().end().show(); // TODO : corregir todos estos hacks!! // Hacking the paginator for various instances if( typeof staff != "undefined" && (staff instanceof Paginator) ) staff.drawPages(); if( typeof staff2 != "undefined" && (staff2 instanceof Paginator) ) staff2.drawPages(); if( typeof team_staff != "undefined" && (team_staff instanceof Paginator) ) team_staff.drawPages(); if( typeof departments != "undefined" && (departments instanceof Paginator) ) departments.drawPages(); if( typeof organization_list != "undefined" && (organization_list instanceof Paginator) ) organization_list.drawPages(); if( typeof organization_adjuncts_list != "undefined" && (organization_adjuncts_list instanceof Paginator) ) organization_adjuncts_list.drawPages(); if( typeof research_groups != "undefined" && (research_groups instanceof Paginator) ) research_groups.drawPages(); if( typeof scholarships_paginator != "undefined" && (scholarships_paginator instanceof Paginator) ) scholarships_paginator.drawPages(); if( typeof loans_paginator != "undefined" && (loans_paginator instanceof Paginator) ) loans_paginator.drawPages(); if( typeof professors_adjunct != "undefined" && (professors_adjunct instanceof Paginator) ) professors_adjunct.drawPages(); if( typeof vip_podcasts_publications != "undefined" && (vip_podcasts_publications instanceof Paginator) ) vip_podcasts_publications.drawPages(); // Hacking for the Dropdowns Init (forms) if( $('#loans').length > 0 ) initDropDowns(); if( $('#staff').length > 0 ) initDropDowns(); if( $('#mentors').length > 0 ) initDropDowns(); // Hacking for the Google maps on GettingAround // if( $('#map-locators-around').length > 0 && typeof map2 == // "undefined" ) GettingAround(); // Hacking for the Google maps on Campus Maps if( $('#clubs-around-world-tab').length > 0 /* * && typeof map2 == "undefined" */ ) initMap2(); if( $('#student-alumni-nationalities-tab').length > 0 /* * && typeof map3 == "undefined" */ ) initMap3(); if( $('#faculty-nationalities').length > 0 /* * && typeof map4 == "undefined" */ ) initMap4(); // Hacking for equalCols if( $('#' + $tab).find('.equalCols2').length > 0 ){ $('#' + $tab).find('.equalCols2').equalCols().removeClass('equalCols2').addClass('equalCols'); } // $this.parents('ul').find('.current').removeClass('current'); $this.parent().addClass('current'); } ); // Getting routes in Google Maps for "How to get to IE" $('#campus-localization-tab-content .getting a').click( function(e){ e.preventDefault(); var addressFrom = $(this).attr('rel'); ieLocations.getIEInitialize( addressFrom ); }); $('#search-custom-route').submit( function(e){ e.preventDefault(); var addressFrom = $(this).find('#address-input').val(); ieLocations.getIEInitialize( addressFrom ); }); // Underground $('.by-tube').click( function(e){ tubeStations(); } ); $('#campus-localization-module-tabs li:first a').click( function(e){ e.preventDefault(); ieLocations.getIEInitialize(); }); $('#campus-localization-module-tabs li:last a, .getting-around a').click( function(e){ e.preventDefault(); var addressFrom = $(this).attr('rel'); var indexOpt = $(this).index('.getting-around a'); if(indexOpt != -1){ $('.getting-around').find('.main-ie').removeClass('main-ie'); $(this).addClass('main-ie'); }else{ indexOpt = 0; } var arrDetails = [ { tel : '+34 91 568 96 01', fax : '+34 91 568 96 11', lectures_theathers: 'A-203, A-205, A-301, A-304, B-203, B-302, B-305, C-201, C-202, C-301', study_rooms : 'A-203, A-205, A-301, A-304, B-203, B-302, B-305, C-201, C-202, C-301', thumb : 'http://ie-business-school.secuoyas.com.es/images/mocks/mock-sede-map.png' }, { tel : '+34 91 568 96 02', fax : '+34 91 568 96 11', lectures_theathers: 'A-203, A-205, A-301, A-304, B-203, B-302, B-305, C-201, C-202, C-301', study_rooms : 'A-203, A-205, A-301, A-304, B-203, B-302, B-305, C-201, C-202, C-301', thumb : 'http://ie-business-school.secuoyas.com.es/images/mocks/mock-sede-map.png' }, { tel : '+34 91 568 96 03', fax : '+34 91 568 96 11', lectures_theathers: 'A-203, A-205, A-301, A-304, B-203, B-302, B-305, C-201, C-202, C-301', study_rooms : 'A-203, A-205, A-301, A-304, B-203, B-302, B-305, C-201, C-202, C-301', thumb : 'http://ie-business-school.secuoyas.com.es/images/mocks/mock-sede-map.png' }, { tel : '+34 91 568 96 04', fax : '+34 91 568 96 11', lectures_theathers: 'A-203, A-205, A-301, A-304, B-203, B-302, B-305, C-201, C-202, C-301', study_rooms : 'A-203, A-205, A-301, A-304, B-203, B-302, B-305, C-201, C-202, C-301', thumb : 'http://ie-business-school.secuoyas.com.es/images/mocks/mock-sede-map.png' }, { tel : '+34 91 568 96 05', fax : '+34 91 568 96 11', lectures_theathers: 'A-203, A-205, A-301, A-304, B-203, B-302, B-305, C-201, C-202, C-301', study_rooms : 'A-203, A-205, A-301, A-304, B-203, B-302, B-305, C-201, C-202, C-301', thumb : 'http://ie-business-school.secuoyas.com.es/images/mocks/mock-sede-map.png' } ]; var name = $(this).html(); var details = ''; details += '
    ' + name + '
    '; details += '
    '; details += '

    '+ name + '

    '; details += 'Swichboard:'; details += 'TEL: ' + arrDetails[indexOpt].tel + ''; details += 'FAX: ' + arrDetails[indexOpt].fax + ''; details += 'Lecture theathers:'; details += '' + arrDetails[indexOpt].lectures_theathers + ''; details += 'Study rooms:'; details += '' + arrDetails[indexOpt].study_rooms + ''; details += '
    '; $('#locators-around-details').html(details).show(); // gettingAround.getIEInitialize( addressFrom ); } ); } function addEventToScholarshipsList( ) { // Expand Advance Searchs where avaible $('.expand-container').click( function(e){ e.preventDefault(); var $this = $(this); $this.toggleClass('expanded'); $this.parents('.content').find('.container-to-expand').slideToggle(); alinear(); } ); return; } /* inicio de codigo generado por accenture */ function validarFormulario(){ /* * ! * * Simple Validation Form * * */ $('.validate').submit( function(e){ // Required $(this).find('.required').each( function(){ var $this = $(this); if( $this.val() === ""){ isError($this); }else{ isNotError($this); } }); $('.check').each( function(){ var $this = $(this); if( !$(this).is(':checked') ){ isError($this); }else{ isNotError($this); } }); $('.selectrequired').each( function(){ var $this = $(this); if( $this.val() === ""){ isError($this); }else{ isNotError($this); } }); // Email $('.validate_email').each( function(){ var emailPattern = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/; var $this = $(this); if( !( $this.val() ).match( emailPattern ) ){ isError($this); }else{ isNotError($this); } }); // Numbers $(this).find('.numeric').each( function(){ var $this = $(this); if($this.val()!=""){ if( $.isNumeric( $this.val() ) ){ isNotError($this); }else{ isError($this); } } } ); function isError($this){ $this.addClass('error'); $this.parent().find('span.error-message').removeClass('hide'); } function isNotError($this){ $this.removeClass('error'); $this.parent().find('span.error-message').addClass('hide'); } if( $(this).find('.error').length > 0 ) { e.preventDefault(); } else { // form ok and send by ajax if ( $(this).find('input[name="rend_askByProgram"]').length > 0 ) { e.preventDefault(); enviarCorreoAjax(document.formCorreo); } if ( $(this).find('input[name="rend_research_group"]').length > 0 ) { e.preventDefault(); enviarCorreoAjaxRG(document.formCorreoGroup); } if ( $(this).find('input[name="rend_scholarships"]').length > 0 ) { e.preventDefault(); buscarScholarship(document.formBuscarScholarship); } if ( $(this).find('input[name="rend_buscadorPublicaciones"]').length > 0 ) { e.preventDefault(); buscarPublicaciones(document.formBuscarPublicaciones); } if ( $(this).find('input[name="rend_formularioFaqs"]').length > 0 ) { e.preventDefault(); updateTotal(); } // form ok and not send by ajax --> send the form without ajax // Creacion de URL para GA var urlGA = 'http://www.ie.edu/IE/programas/FinInfoMaster.php'; var idioma = $('.validate_idioma').attr('value'); var nombreCortoPrg = $('.validate_programa').attr('value'); if(idioma != null && nombreCortoPrg != null){ urlGA = urlGA + '?idioma=' + idioma + '&program=' + nombreCortoPrg + '-' + idioma.toUpperCase() + 'RAPIDO'; //alert('\n' + urlGA); $('#hide_frame').attr({src: urlGA}); } } }); } // Init Carrousels where avaible function initCarrouselCircular( ) { if( $('.carousel-circular').length > 0 ){ var num_items = $('.carousel-circular>li').length; var start_item = 1; $('.carousel-circular').jcarousel({ scroll: 1, start: start_item }); } } function addEventToShowSpecialTermsAndBack( ) { // Show Special terms inside Light boxes $('.terms-special').live( 'click', function(e){ e.preventDefault(); // e.stopPropagation(); var $this = $(this); var $form = $this.parents('form'); var $toShow = $form.parent().find('#terms-box-module'); var formHeight = $form.height(); $form.hide("slide", { direction: "left" }, 400, function(){ $toShow.css({ 'height': formHeight + 100, 'overflow' : 'auto' }).show("slide", { direction: "right" }, 400).find('.terms-buttons a').addClass('special-case'); $('.pp_content_container .back-publication').addClass('back-form').removeClass('back-publication').html('< < Back to Form'); }); } ); $('.back-form').live('click', function(e){ var $this = $(this); e.preventDefault(); e.stopPropagation(); $this.parent().find('#terms-box-module').hide("slide", { direction: "right" }, 400, function(){ $this.parent().find('form').show("slide", { direction: "left" }, 400); $this.addClass('back-publication').removeClass('back-form').html('< < Back to publication'); }); } ); } function addEventAcceptOrRejectTerms( ) { // Accept or Reject Terms $('a[href="#terms-box-module"]').click( function(){ $('#terms.pending').removeClass('pending'); $(this).parents('p').find('#terms').addClass('pending'); }); $('a[href="#terms-box-module1"]').click( function(){ $('#terms.pending').removeClass('pending'); $(this).parents('p').find('#terms').addClass('pending'); }); $('.terms-buttons .accept').live('click', function(e){ e.preventDefault(); if( !$(this).hasClass('special-case') ){ $('#terms.pending').attr('checked', 'checked'); $.prettyPhoto.close(); }else{ // Caso especial de los sliders var $request_form = $(this).parents('#book-request-form'); $request_form.find('#terms').attr('checked', 'checked'); $request_form.find('.back-form').click(); } }); $('.terms-buttons .reject').live('click', function(e){ e.preventDefault(); if( !$(this).hasClass('special-case') ){ $('#terms.pending').removeAttr('checked'); $.prettyPhoto.close(); }else{ // Caso especial de los sliders var $request_form = $(this).parents('#book-request-form'); $request_form.find('#terms').removeAttr('checked'); $request_form.find('.back-form').click(); } }); } function sliderVerticalControls( ) { /** * Slide vertical content * * Used on - Upcoming Events Module (upcoming-events-module.php) * * @param object * @return void */ $('.slider-vertical-controls a').click( function(e){ e.preventDefault(); var $this = $(this), $module = $this.parents('.module'), $list = $module.find('ul.slides'), number_slides = $list.find('li').length; // Avoid unactive control if( !$this.hasClass('active') ) return false; $this.removeClass('active'); var height_to_scroll_default = $list.children('li').outerHeight(), height_to_scroll = ( $list.children('li').outerHeight() ) * 4, direction = ( $this.hasClass('up') ) ? '+' : '-', max_slide_down = (number_slides - 4) * height_to_scroll_default; // For IE if( $('body').hasClass('ie') ) height_to_scroll += 10; $list.animate({ 'top' : direction + '=' + ( height_to_scroll ) },{ 'duration' : 2000, complete : function(){ $this.addClass('active'); check_controls(); } }); function check_controls(){ if( parseInt( $list.css('top'), 10 ) == 0 ){ $module.find('a.up').removeClass('active'); }else{ $module.find('a.up').addClass('active'); } if( parseInt( $list.css('top'), 10 ) <= (0 - max_slide_down) ){ $module.find('a.down').removeClass('active'); }else{ $module.find('a.down').addClass('active'); } } } ); } function isException( _bool ) { // print in footer "Exception javascript" Exception javascript var style_debug = 'style="color: #EAEAEA; background-color: transparent;"'; if (_bool) $('#colophon p').append('

    Exception javascript

    '); // Exception // Error // Internet // Explorer } function alertdebug( str ) { var style_debug = 'style="color: '+$('body').css('background-color')+'; background-color: transparent;"'; // $('#container').append('

    '+str+'

    '); return; } function loadScriptVuit( ) { alertdebug('datosAjax.length='+$('#datosAjax').length); alertdebug('datosAjaxEventos.length='+$('#datosAjaxEventos').length); if ($('#datosAjax').length==0 && $('#datosAjaxEventos').length==0 ) return; if ( typeof VignettePortal == "undefined" || VignettePortal == null) { $.getScript('//portal/jslib/vapajaxlibrary.js', function(data, textStatus, jqxhr) { alertdebug('GET VignettePortal='+VignettePortal); alertdebug('GET VignettePortal.portalContext='+VignettePortal.portalContext); }); } else { alertdebug('EXIST VignettePortal='+VignettePortal); alertdebug('EXIST VignettePortal.portalContext='+VignettePortal.portalContext); } if ( typeof vuit == "undefined" || vuit == null) { $.getScript('/portal/jslib/vuit/vuit.js.uncompressed.js', function(data, textStatus, jqxhr) { alertdebug('GET vuit='+vuit); alertdebug('GET vuit.locale='+vuit.locale); }); } else { alertdebug('EXIST vuit='+vuit); alertdebug('EXIST vuit.locale='+vuit.locale); } return; } $(document).ready( function(){ loadScriptVuit(); }); function searchFaqList(){ // Animate anchor link FAQs $('#search-faqs-list a').click(function(e){ e.preventDefault(); var full_url = this.href, parts = full_url.split("#"), trgt = parts[1]; $('.faqs-list-module.faqs-related-list-module').fadeOut( function(){ $('#program option:first').attr('selected', 'selected'); $('.faqs-list-module').not('.faqs-related-list-module').fadeIn( function(){ var target_offset = $("#"+trgt).offset(), target_top = target_offset.top; $('html, body').animate({scrollTop:target_top}, 500); }); }); }); } function dropdownsManagementAreas(){ // Dropdowns Management Areas $('.list-dropdown').click( function(e){ e.preventDefault(); var $this = $(this), $parent = $this.parent(); $parent.parent().find('.extra-info-container').hide(); if($parent.hasClass('expanded')){ $parent.parent().find('.expanded').find('p').slideUp().end().removeClass('expanded'); }else{ $parent.parent().find('.expanded').find('p').slideUp().end().removeClass('expanded'); $parent.addClass('expanded').find('p').slideDown(); $this.parent().find('.extra-info-container').show(); } } ); } function GoToContactFAQs(){ // Go to contact on FAQs $('#goContact').click( function(e){ e.preventDefault(); var target_offset = $("#faqs-research-module").offset(), target_top = target_offset.top; $('html, body').animate({scrollTop:target_top}, 500); } ); } /* fin de codigo generado por accenture */ /* Metodo para mostrar documentos en una nueva ventana */ function descargarDocumento(path){ var res = window.open(path, '', 'width=400,height=400,left=200,top=200,resizable'); return false; } function descargarDocumento(path,w,h){ var res = window.open(path, '', 'width=' + w + ',height=' + h + ',left=200,top=200,resizable'); return false; } /** * * @param {Object} * str */ function normalizarTexto(str){ var map = { 'À': 'A', '�': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE', 'Ç': 'C', 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ì': 'I', '�': 'I', 'Î': 'I', '�': 'I', '�': 'D', 'Ñ': 'N', 'Ò': 'O', 'Ó': 'O', 'Ô': 'O', 'Õ': 'O', 'Ö': 'O', 'Ø': 'O', 'Ù': 'U', 'Ú': 'U', 'Û': 'U', 'Ü': 'U', '�': 'Y', 'ß': 's', 'à': 'a', 'á': 'a', 'â': 'a', 'ã': 'a', 'ä': 'a', 'å': 'a', 'æ': 'ae', 'ç': 'c', 'è': 'e', 'é': 'e', 'ê': 'e', 'ë': 'e', 'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i', 'ñ': 'n', 'ò': 'o', 'ó': 'o', 'ô': 'o', 'õ': 'o', 'ö': 'o', 'ø': 'o', 'ù': 'u', 'ú': 'u', 'û': 'u', 'ü': 'u', 'ý': 'y', 'ÿ': 'y', 'Ā': 'A', '�': 'a', 'Ă': 'A', 'ă': 'a', 'Ą': 'A', 'ą': 'a', 'Ć': 'C', 'ć': 'c', 'Ĉ': 'C', 'ĉ': 'c', 'Ċ': 'C', 'ċ': 'c', 'Č': 'C', '�': 'c', 'Ď': 'D', '�': 'd', '�': 'D', 'đ': 'd', 'Ē': 'E', 'ē': 'e', 'Ĕ': 'E', 'ĕ': 'e', 'Ė': 'E', 'ė': 'e', 'Ę': 'E', 'ę': 'e', 'Ě': 'E', 'ě': 'e', 'Ĝ': 'G', '�': 'g', 'Ğ': 'G', 'ğ': 'g', 'Ġ': 'G', 'ġ': 'g', 'Ģ': 'G', 'ģ': 'g', 'Ĥ': 'H', 'ĥ': 'h', 'Ħ': 'H', 'ħ': 'h', 'Ĩ': 'I', 'ĩ': 'i', 'Ī': 'I', 'ī': 'i', 'Ĭ': 'I', 'ĭ': 'i', 'Į': 'I', 'į': 'i', 'İ': 'I', 'ı': 'i', 'IJ': 'IJ', 'ij': 'ij', 'Ĵ': 'J', 'ĵ': 'j', 'Ķ': 'K', 'ķ': 'k', 'Ĺ': 'L', 'ĺ': 'l', 'Ļ': 'L', 'ļ': 'l', 'Ľ': 'L', 'ľ': 'l', 'Ŀ': 'L', 'ŀ': 'l', '�': 'L', 'ł': 'l', 'Ń': 'N', 'ń': 'n', 'Ņ': 'N', 'ņ': 'n', 'Ň': 'N', 'ň': 'n', 'ʼn': 'n', 'Ō': 'O', '�': 'o', 'Ŏ': 'O', '�': 'o', '�': 'O', 'ő': 'o', 'Œ': 'OE', 'œ': 'oe', 'Ŕ': 'R', 'ŕ': 'r', 'Ŗ': 'R', 'ŗ': 'r', 'Ř': 'R', 'ř': 'r', 'Ś': 'S', 'ś': 's', 'Ŝ': 'S', '�': 's', 'Ş': 'S', 'ş': 's', 'Š': 'S', 'š': 's', 'Ţ': 'T', 'ţ': 't', 'Ť': 'T', 'ť': 't', 'Ŧ': 'T', 'ŧ': 't', 'Ũ': 'U', 'ũ': 'u', 'Ū': 'U', 'ū': 'u', 'Ŭ': 'U', 'ŭ': 'u', 'Ů': 'U', 'ů': 'u', 'Ű': 'U', 'ű': 'u', 'Ų': 'U', 'ų': 'u', 'Ŵ': 'W', 'ŵ': 'w', 'Ŷ': 'Y', 'ŷ': 'y', 'Ÿ': 'Y', 'Ź': 'Z', 'ź': 'z', 'Ż': 'Z', 'ż': 'z', 'Ž': 'Z', 'ž': 'z', 'ſ': 's', 'ƒ': 'f', 'Ơ': 'O', 'ơ': 'o', 'Ư': 'U', 'ư': 'u', '�': 'A', 'ǎ': 'a', '�': 'I', '�': 'i', 'Ǒ': 'O', 'ǒ': 'o', 'Ǔ': 'U', 'ǔ': 'u', 'Ǖ': 'U', 'ǖ': 'u', 'Ǘ': 'U', 'ǘ': 'u', 'Ǚ': 'U', 'ǚ': 'u', 'Ǜ': 'U', 'ǜ': 'u', 'Ǻ': 'A', 'ǻ': 'a', 'Ǽ': 'AE', 'ǽ': 'ae', 'Ǿ': 'O', 'ǿ': 'o' }; var res = '';// Está variable almacenará el valor de str, pero sin acentos // y tildes for (var i = 0; i < str.length; i++) { c = str.charAt(i); res += map[c] || c; } return res; } /** * Decodifica el texto pasado por parametro a UTF-8 * * @param {Object} * str_data */ function utf8_decode(str_data) { // http://kevin.vanzonneveld.net // + original by: Webtoolkit.info (http://www.webtoolkit.info/) // + input by: Aman Gupta // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Norman "zEh" Fuchs // + bugfixed by: hitwork // + bugfixed by: Onno Marsman // + input by: Brett Zamir (http://brett-zamir.me) // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // * example 1: utf8_decode('Kevin van Zonneveld'); // * returns 1: 'Kevin van Zonneveld' var tmp_arr = [], i = 0, ac = 0, c1 = 0, c2 = 0, c3 = 0; str_data += ''; while (i < str_data.length) { c1 = str_data.charCodeAt(i); if (c1 < 128) { tmp_arr[ac++] = String.fromCharCode(c1); i++; } else if (c1 > 191 && c1 < 224) { c2 = str_data.charCodeAt(i + 1); tmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = str_data.charCodeAt(i + 1); c3 = str_data.charCodeAt(i + 2); tmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return tmp_arr.join(''); } /** * Codifica el texto pasado por parametro a UTF-8 * * @param {Object} * argString */ function utf8_encode(argString) { // http://kevin.vanzonneveld.net // + original by: Webtoolkit.info (http://www.webtoolkit.info/) // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: sowberry // + tweaked by: Jack // + bugfixed by: Onno Marsman // + improved by: Yves Sucaet // + bugfixed by: Onno Marsman // + bugfixed by: Ulrich // + bugfixed by: Rafal Kukawski // + improved by: kirilloid // * example 1: utf8_encode('Kevin van Zonneveld'); // * returns 1: 'Kevin van Zonneveld' if (argString === null || typeof argString === "undefined") { return ""; } var string = (argString + ''); // .replace(/\r\n/g, "\n").replace(/\r/g, // "\n"); var utftext = '', start, end, stringl = 0; start = end = 0; stringl = string.length; for (var n = 0; n < stringl; n++) { var c1 = string.charCodeAt(n); var enc = null; if (c1 < 128) { end++; } else if (c1 > 127 && c1 < 2048) { enc = String.fromCharCode((c1 >> 6) | 192, (c1 & 63) | 128); } else { enc = String.fromCharCode((c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128); } if (enc !== null) { if (end > start) { utftext += string.slice(start, end); } utftext += enc; start = end = n + 1; } } if (end > start) { utftext += string.slice(start, stringl); } return utftext; } /** * Comprueba que navegador y de que version estamos usando. Devuelve una cadena con el formato 'XX-VV' donde XX es el navegador y VV la version de tal modo que: Internet Explorer: * IE-9.0 Firefox: FF-20 Google Chrome: GC-26 Safari: SF-5 * * Si no detrectara el navegador devuelve 'XX-VV' */ function obtenerNavegador() { /* * Variables para cada navegador, la funcion indexof() si no encuentra la cadena devuelve -1, las variables se quedaran sin valor si la funcion indexof() no ha encontrado la * cadena. */ var is_safari = navigator.userAgent.toLowerCase().indexOf('safari/') > -1; var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome/') > -1; var is_firefox = navigator.userAgent.toLowerCase().indexOf('firefox/') > -1; var is_ie = navigator.userAgent.toLowerCase().indexOf('msie ') > -1; /* * Detectando si es Safari, vereis que en esta condicion preguntaremos por chrome ademas, esto es porque el la cadena de texto userAgent de Safari es un poco especial y muy * parecida a chrome debido a que los dos navegadores usan webkit. */ if (is_safari && !is_chrome) { /* * Buscamos la cadena 'Version' para obtener su posicion en la cadena de texto, para ello utilizaremos la funcion, tolowercase() e indexof() que explicamos anteriormente */ var posicion = navigator.userAgent.toLowerCase().indexOf('Version/'); /* * Una vez que tenemos la posición de la cadena de texto que indica la version capturamos la subcadena con substring(), como son 4 caracteres los obtendremos de 9 al 12 que * es donde acaba la palabra 'version'. Tambien podraimos obtener la version con navigator.appVersion, pero la gran mayoria de las veces no es la version correcta. */ var ver_safari = navigator.userAgent.toLowerCase().substring(posicion + 9, posicion + 12); // Convertimos la cadena de texto a float y mostramos la version y el // navegador ver_safari = parseFloat(ver_safari); return 'SF-' + ver_safari; } else { // Detectando si es Chrome if (is_chrome) { var posicion = navigator.userAgent.toLowerCase().indexOf('chrome/'); var ver_chrome = navigator.userAgent.toLowerCase().substring(posicion + 7, posicion + 11); // Comprobar version ver_chrome = parseFloat(ver_chrome); return 'GC-' + ver_chrome; } else { // Detectando si es Firefox if (is_firefox) { var posicion = navigator.userAgent.toLowerCase().lastIndexOf('firefox/'); var ver_firefox = navigator.userAgent.toLowerCase().substring(posicion + 8, posicion + 12); // Comprobar version ver_firefox = parseFloat(ver_firefox); return 'FF-' + ver_firefox; } else { // Detectando Cualquier version de IE if (is_ie) { var posicion = navigator.userAgent.toLowerCase().lastIndexOf('msie '); var ver_ie = navigator.userAgent.toLowerCase().substring(posicion + 5, posicion + 8); // Comprobar version ver_chrome = parseFloat(ver_ie); return 'IE-' + ver_ie; } else { // Si no es ninguno return 'XX-VV'; } } } } } /** * Comprueba se la cadena s1 esta contenido en la cadena s2. * * @param {Object} * s1 * @param {Object} * s2 */ function contiene(s1, s2){ if (s1 != '') { return (s2.indexOf(s1) != -1); } else { return false; } } /*************************************/ /*RMJ 15/07/14 */ // Extend Alumni Details on slider $('.alumni-slider-imba img').hover( function(e){ // Avoid behaviour for the Flex Content Module if($(this).parents('#flex-content-module').length > 0) return false; var $this = $(this), $currentLi =$this.parents('li'), $currentUl = $currentLi.parent(), $currentDetails = $currentLi.find('.alumni-slider-details-imba'); $('.right', $currentUl).removeClass('right'); // Fix IE7 z-index bug (crazy mode!) $currentUl.find('li').css({ 'z-index' : 1 }); $currentLi.css({ 'z-index' : 99999 }); var ulLeft = $currentUl.position(); var scrollTimes = Math.abs( parseInt(ulLeft.left, 10) / 143 ); // 143 es lo que avanza en pixeles el carrusel a cada scroll var imgSpecial = scrollTimes + 2; // 3 es el numero de imagenes que tiene el carrusel en pantalla al mismo tiempo var currentImgNumber = ( $currentLi.index() ) + 1; var cDirection = 'left'; if( currentImgNumber > imgSpecial){ // En este caso, el slide se tiene que abrir hacia la izquierda cDirection = 'right'; $currentDetails.addClass('right'); } $('.alumni-slider-details-imba', '.alumni-slider-imba').not($currentDetails).hide(); if( $currentDetails.is(':visible') ){ $currentDetails.hide("slide", { direction: cDirection }, 100); }else{ $currentDetails.show("slide", { direction: cDirection }, 100); } } ); /*$('.alumni-slider-imba img').mouseout( function(e){ var $this = $(this), $currentLi =$this.parents('li'), $currentUl = $currentLi.parent(), $currentDetails = $currentLi.find('.alumni-slider-details-imba'); $currentDetails.hide(); });*/ // Closing Alumni Details with its button $('.close-extend').click( function(e){ e.preventDefault(); $(this).parent().hide(); } ); // Closing Alumni Details on slider when scrolling $('.jcarousel-prev, .jcarousel-next').live('click', function(){ var $this = $(this), $currentCarrusel = $this.parent(); if( $currentCarrusel.find('.alumni-slider-details-imba').length > 0 ){ $currentCarrusel.find('.alumni-slider-details-imba').hide(); } }); // Extend Alumni Details on Flex Content Module $('#flex-content-module img').click( function(e){ var $this = $(this), $currentDiv =$this.parent(), $currentUl = $currentDiv.parents('ul'), $currentDetails = $currentDiv.find('.alumni-slider-details-imba'); $('.right', $currentUl).removeClass('right'); // Fix IE7 z-index bug (crazy mode!) $currentUl.find('.alumni-person').css({ 'z-index' : 1 }); $currentDiv.css({ 'z-index' : 99999 }); var imgSpecial = 8; // 6 es el numero de imagenes que tiene el carrusel en // pantalla al mismo tiempo var currentImgNumber = ( $currentDiv.index() ) + 1; var cDirection = 'left'; if( currentImgNumber == imgSpecial || currentImgNumber == imgSpecial / 2 ){ // El condicional OR es porque en este caso, hay dos columnas con fotos // En este caso, el slide se tiene que abrir hacia la izquierda cDirection = 'right'; $currentDetails.addClass('right'); } $('#flex-content-module .alumni-slider-details-imba').not($currentDetails).hide(); if( $currentDetails.is(':visible') ){ $currentDetails.hide("slide", { direction: cDirection }, 400); }else{ $currentDetails.show("slide", { direction: cDirection }, 400); } } ); /*FIN RMJ 15/07/14 */ /*****************************************/