/* * 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: '
' + $program_description + '
'; $program_balloon += '' + $program_description + '
'; $program_balloon += '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 += ''+ 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 += '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 */ /*****************************************/