- Calculator
- School ranking
- Best schools
- Course types
- Map
- City information
- FAQ
- Related destinations
Best Spanish schools in Madrid by category - student age group, value for money
TOP Rated by
Students < 18 years
#1 Vamos
Students < 18 years
5.0 (2)
More schools
#2 Don Quijote
Students < 18 years
4.5 (2)
#3 Academia Contacto
Students < 18 years
4.4 (5)
See all 33 Spanish courses for teenagers and children in Madrid
TOP Rated by
Students 18-30 years
#1 Academia Contacto
Students 18-30 years
4.3 (23)
TOP Rated by
Students 31-49 years
#1 Academia Contacto
Students 31-49 years
4.7 (22)
More schools
#2 Estudio Sampere
Students 31-49 years
4.5 (4)
#3 Enforex
Students 31-49 years
4.2 (12)
TOP Rated by
Students 50+ years
#1 AIL
Students 50+ years
5.0 (7)
More schools
#2
Students 50+ years
5.0 (2)
#3 Academia Contacto
Students 50+ years
4.4 (16)
TOP Rated by
Students all ages
#1 Vamos
Students all ages
5.0 (3)
More schools
#2 AIL
Students all ages
4.9 (9)
#3
Students all ages
4.8 (5)
TOP Rated by
Quality of teaching
#1
Quality of teaching
5.0 (5)
More schools
#2 Vamos
Quality of teaching
5.0 (3)
#3 AIL
Quality of teaching
4.7 (7)
TOP Rated by
Leisure programme
#1
Leisure programme
5.0 (3)
More schools
#2 AIL
Leisure programme
4.6 (7)
#3 Vamos
Leisure programme
4.5 (2)
TOP Rated by
Value for money
#1 Vamos
Value for money
5.0 (3)
More schools
#2 AIL
Value for money
4.8 (8)
#3
Value for money
4.8 (4)
TOP Rated by
Location of school
#1 Vamos
Location of school
5.0 (3)
More schools
#2 Don Quijote
Location of school
5.0 (2)
#3 Estudio Sampere
Location of school
4.7 (7)
Madrid's language schools ranking
based on student ratings
Sort by: Best rated (overall)|Most popular|Best rated teaching quality|Best rated social activities|Lowest price
A minimum of 2 student ratings per school is required for a school to be ranked. Schools with just 1 rating are displayed after schools with 2 or more ratings.
All 301 Spanish schools in Spain
Spanish course types in Madrid
-
General Spanish courses
Generic Spanish courses cover the four main elements of a language: writing, reading, speaking and listening. They are available for all levels.
- (100)
- Standard Spanish Course - Madrid (66)
- (45)
- Combi: Group + Private - Madrid (23)
- Small Group (max 6 students) - Madrid (18)
- Senior (50 plus) - Madrid (7)
- Evening - Madrid (6)
- Language Year - Madrid (4)
- Travelling Classroom - Madrid (3)
- Weekend - Madrid (3)
- Super Intensive Spanish (+35h) - Madrid (1)
- Afternoon - Madrid (1)
-
Private Spanish courses
Private Spanish classes are designed as a pack of lessons available in various formations. Students can have their one-to-one lessons in the school or online.
- Private lesson (One-to-One) - Madrid (77)
-
Spanish exam preparation courses
Spanish exam preparation courses are for students who need a certification of their Spanish level for University entry, employment or immigration.
- DELE - Madrid (22)
- SIELE - Madrid (8)
- Other exams - Madrid (7)
- CCSE - Madrid (1)
- TELC - Madrid (1)
-
Junior Spanish courses
Junior Spanish courses are available as a day course or as a package with accommodation and activities included. These are often divided into two age ranges; children and teens.
- (33)
-
Spanish plus activity courses
Spanish plus activity courses are available in different combinations, so students can select the option most suitable to their timetable to enjoy their chosen hobby.
- (11)
- (5)
- (5)
- (4)
- (3)
- (2)
- (1)
- (1)
- (1)
-
Business Spanish courses
Private or group business classes teach the Spanish terminology in a general business environment or specialise in a particular field of interest.
- Business Spanish Private - Madrid (15)
- Business Spanish Group - Madrid (2)
- Spanish for Fashion - Madrid (1)
-
Work & Study Spanish programmes
Work & Study programmes are designed to improve the student's Spanish level and provide real life work experience in Spanish to enhance their CV and stand out from competition.
- Internship - Madrid (9)
- Academic Preparation - Madrid (2)
- (2)
- (1)
- See AlsoLearn Spanish Madrid, Cervantes Language school in MadridVamos Madrid | Spanish School in MadridThe Best Spanish Language Courses In Madrid
Specialty courses Spanish
Lessons that do not follow the normal structure of a Spanish language course in a classroom are found in the Specialty course category.
- Teacher Training - Madrid (11)
- School Trips / Groups - Madrid (2)
-
English, Arabic ...
- English courses - Madrid (4)
- Arabic courses - Madrid (1)
- French courses - Madrid (1)
Interested in online courses?
Have a look at our top picks of Live Online Spanish courses at the best prices.
Madrid ratings & opinions
How our students rated their experience in Madrid
4.6
Overall attractiveness of Madrid
210 authentic ratings from students who reserved a course with us in Madrid
Nightlife
4.4
Friendliness of locals
4.6
Interesing things to do
4.6
Geographic setting
3.9
Public transport
4.6
Climate
4.2
Cleanliness
4.2
Affordability
4.2
Shopping
4.4
Safety
4.6
What our students said about Madrid
5.0
Madrid is a fabulous place, even though I have been to Spain many times I'd never been able to spend any time there. It really has something for everyone, from exceptional museums to parks, restaurants and plays and music bars and ... something for everyone. The only real risk is doing too much. The metro works extremely well in Madrid and it's easy to get around.
Show more
Jonathan
4.0
The transport is very convenient. With a youth card of 20 euros, you can take all kinds of transportation in Madrid for a month, and you can go to some nearby cities. People in the city are friendly, but most of them don't speak English. Overall consumption is about the same as in Germany.
Show more
Chuxuan
China
4.0
Very expensive for students like us. Great nightlife but the bars are also quite expensive and the police are very controlling. Nobody speaks English which is great for learning Spanish but at the same time people are not very friendly when they notice you don't speak Spanish.
Show more
Martin
Germany
5.0
A beautiful, vibrant city with a wonderful balance of Nature in parks and surrounding areas!! Such a clean and well organized easy metro system and the city is kept clean and safe. Very easy to live and love Madrid!!
Show more
Robin
4.0
Madrid is a big city, and as a big urban area has its pros and cons. It's a great city to visit however you must be careful in tourist areas.
Show more
Carlos
Italy
5.0
In my opinion, Madrid is a nice, clean and safe city with many attractions. Not exactly a tourist city so it is affordable
Show more
Naz
5.0
I love Madrid! More typical Spanish than Barcelona. If you want to get to know the Spanish life, Madrid can show you.
Show more
Gloria
Netherlands
4.0
Very open and clearly laid out, lots within walking distance, many parks and squares....
Show more
Marion
Germany
5.0
Madrid is lovely, but I had to take the train for 45 minutes to get there.
Show more
Hanne Disa Asping
Denmark
5.0
I'll be recommending Madrid to all my friends, especially for its art.
Show more
Evelyne
Switzerland
5.0
Beautiful city, lots of places to visit: museums, parks, exhibitions.
Show more
Elena
Israel
5.0
I did not use public transport, so I have no opinion about it.
Show more
Ellen Heidi
Norway
5.0
A cosmopolitan city and very nice and helpful people.
Show more
Olga
Germany
4.0
Culturally very diverse, lots of good museums.
Show more
Rudolf
Austria
5.0
Love Madrid, great city with lots of fun!!!
Show more
Saga
Sweden
5.0
Great, great attitude to life, Pura Vida!
Show more
Carola
Germany
5.0
A safe, tolerant and interesting city.
Show more
Ab
Netherlands
3.0
One of the best cities in the world.
Show more
Richard
What school directors said about Madrid
The capital of Spain offers much more than any other Spanish town. Vibrant city, full of life, thousand things going on every singe day.
Show more
Mario CalvoDirector of Academia Contacto, lives in Madrid since 2000
Madrid, is a bustling, lively, and exciting city. It possesses a charming and unique personality; a capital of people who will make you feel at home.
Show more
Pedro Sánchez PuertasDirector of Cronopios Idiomas, lives in Madrid since 2005
Most recent student reviews of language schools in Madrid
Nice teachers who always try to involve all participants!
11 March 2024
Course: Intensive Course 20 - 2 weeks
Student age: 66 years
Show more
4.2 | 14 reviews
GottfriedEstudio Sampere
Super nice teacher, good organisation.
27 November 2023
Course: Intensive 20 - 1 week
Student age: 50 years
Show more
4.5 | 66 reviews
SusanneAcademia Contacto
Great teachers, everyone is very kind and ready to help if there is a problem.
16 October 2023
Course: Intensive 20 - 2 weeks
Student age: 19 years
Show more
4.5 | 66 reviews
MartinAcademia Contacto
the professionalism of the teachers, the excellent organisation and the diversity of the students
15 August 2023
Course: Intensive 20 - 2 weeks
Student age: 62 years
Show more
4.5 | 66 reviews
EvelyneAcademia Contacto
Super friendly teachers, great atmosphere
16 July 2023
Course: Intensive 25 - 7 weeks
Student age: 19 years
Show more
4.5 | 66 reviews
MariamAcademia Contacto
It's great that the school offers so many different activities! It's a good way to learn about the city and meet new people.
23 June 2023
Course: Intensive Course - 15 weeks
Student age: 25 years
Show more
4.9 | 9 reviews
MargauxAIL
everything was great, I'll be happy to come back next year...
3 May 2023
Course: Intensive Course 20 - 2 weeks
Student age: 57 years
Show more
4.2 | 14 reviews
MonikaEstudio Sampere
The teachers are fantastic and professional, the school management is kind and professional.
There are not many activities for female students in the school, the club exchange twice a week, there is no group outing for the new students, in my opinion it is very important. The school management can organize a drink for the newcomers at the bar.
31 October 2022
Course: Intensive 25 - 4 weeks
Student age: 36 years
Show more
4.5 | 66 reviews
YuliaAcademia Contacto
I liked the contact with the teachers. The teachers are very friendly and know the Spanish language very well and the differences it has with other languages. I love the activities of the 50+ program that give you the opportunity to get to know some people from other countries well.
3 August 2022
Course: Semi-Intensive Course - 2 weeks
Student age: 64 years
Show more
4.9 | 9 reviews
Marie-LucieAIL
A harmonious and suitable environment for what they propose. Teachers are well prepared to work with students from all over the world. My suggestion for the students is to book at least a 4-week course. I believe that short courses are not that efficient.
2 August 2022
Course: Intensive 20 - 4 weeks
Student age: 60 years
Show more
4.5 | 66 reviews
CarlosAcademia Contacto
In the morning until half past one, in the afternoon the possibility to work on location in a free room with good WiFi.
5 July 2022
Course: Intensive Spanish 20 - 1 week
Student age: 54 years
Show more
5.0 | 1 review
AbExpanish
All the teachers are very friendly, warm and patient. Any questions, they are happy to help.The teaching system is very clear. The curriculum structure, and there are textbooks dedicated to te school.The location is in the city center, close to the Iglesia and Bilbao metro stations, and right next to the Plaza de Chamberi bus stop. There are Carrefour supermarkets and many bakeries nearby.
20 June 2022
Course: Intensive 20 - 2 weeks
Student age: 18 years
Show more
4.5 | 66 reviews
ChuxuanAcademia Contacto
We felt very comfortable. Very nice staff and teachers. Very good excursion destinations.
Very good and recommendable school.
13 June 2022
Course: Intensive Course - 1 week
Student age: 53 years
Show more
4.9 | 9 reviews
OlgaAIL
Excellent location right next to Plaza de Olavide, and wonderfully kind, helpful and organized Director and Office Manager! The Director and Office Manager provide very good support, information and suggestions for living in Madrid! A very friendly school with kind teachers, fun international students and good quality learning and teaching! The classes are small 6-10 students for quicker Spanish learning and speaking! If you do not come to Spain with a foundation in Spanish, the Director and Office Manager will assist you with the right teacher, who will provide organized learning and English explanations, and you can continue learning at Level 1 for as long as needed.
10 June 2022
Course: Intensive 20 - 32 weeks
Student age: 57 years
Show more
4.5 | 66 reviews
RobinAcademia Contacto
Very good teachers, developed a lot and the school is very well located in the city.
2 May 2022
Course: Intensive 20 - 16 weeks
Student age: 20 years
Show more
4.5 | 66 reviews
SagaAcademia Contacto
Very familiar, everyone is very helpful, not overcrowded
31 January 2022
Course: Intensive Course 20 - 3 weeks
Student age: 58 years
Show more
4.2 | 14 reviews
RudolfEstudio Sampere
Information about Madrid
Why Madrid? Madrid is strategically located in the centre of Spain and is the headquarters of the Spanish Government as well as home to the Royal Family. The city's main street, the Gran Vía, is lined with shops, banks, offices, bars and cinemas. Madrid's infectious and colourful fiestas punctuate the year, with each barrio (district) trying to outdo the other in its celebrations.
What we like about Madrid
- Lively night scene.
- Great variety of Spanish food options.
- Lots of history and culture to learn about.
- Great public transportation system.
What we dislike about Madrid
- No mediterranean beaches.
- City centre is expensive.
Key Facts about Madrid
Population: 3,256,000
Time zone: +1h. (GMT +1)
Region: Madrid, Provincia de Madrid
Currency: EUR (1 EUR = 0.8584 GBP)
Visa: Nationals from United Kingdom do not require a visa to study short term courses up to 90 days. Check visa requirements for nationals from other countries.
Visa requirements data last updated on 01 Dec. 2022(Source)
For the most up-to-date visa information please consult with the embassy or consulate of Spain in your country. List of embassies and consulates of Spain on the official website - Ministerio de Asuntos Exteriores, Union Europea y Cooperacion.
High season: July
Low season: December
Average course price per week: 244 €
Cost of Living:
* 100 = prices in London
- Price index excluding rent: 72* (28% cheaper than London)
- Price index including rent: 63* (37% cheaper than London)
- Price index food only:55* (45% cheaper than London)
- Big Mac price (Spain average): 4.40 €
(7% more expensive than in United Kingdom)
Mains electricity:
- Residential voltage: 230 V
- Frequency: 50 Hz
Weather in Madrid
Climate Table
Legend:
Midday Temperature
Night-time Temperature
Hours of Sunshine
566891113119655
Rainfall
40mm40mm30mm40mm40mm20mm10mm10mm30mm40mm60mm40mm
Events in Madrid
Best time to take a language course in Madrid
March
Art Madrid
06 March 2024 - 10 March 2024Exhibition of contemporary paintings, sculptures, photographs and audiovisual arts in the Galeria de Cristal.
April
EDP Rock´n´Roll Marathon Madrid
28 April 2024Race through the streets of Madrid in one of several races held this weekend. The Rock'n'Roll Marathon Series also includes great live shows.
August
Fiestas de la Paloma
12 August 2024 - 15 August 2024Long standing festival of photography and the visual arts.
What to do in Madrid
El Prado Museum
Royal Palace
Retiro Park
Fine Arts Circle
Plaza de la Villa Square
Gran Vía
Plaza Mayor Square
Centro
Barrio de La Latina
Barrio de Salamanca
Malasaña
Madrid
Arrival airport
Adolfo Suárez Madrid Barajas (MAD) - 14 km. from Madrid city center
Public transportation to city center:
Every 30 minutes, 25minutes.
Main stops: Aeropuerto T4, Fuente de la Mora, Chamartin, Nuevos Ministerios, Recoletos
Every 10 minutes, 55minutes.
Main stops: Aeropuerto T4, Aeropuerto T2, Aeropuerto 1, Metro O Donnell, Cibeles
Taxi:25 minutes drive to city center of Madrid
Public transportation in Madrid
Q&A - Questions and answers about Madrid
I would like to know how much the Italian course costs for 24 weeks and also if the classes are face-to-face or virtual.
“At present (2023) we do not offer Italian courses in Madrid or in any other Spanish city, but we can offer you Italian courses in Italy (Roma, Milan, Florence...).”
Rubén De Haro, LanguageCourse.Net - Apr 17, 2023
Can I book a Spanish language course in Madrid?
“Yes, we have many excellent partner schools in Madrid offering Spanish courses.”
Sawsan Zein, LanguageCourse.Net - Dec 11, 2022
My daughter is studying Spanish and is coming to Madrid and would like a 3-day intensive language experience. What are the options?
“All the intensive courses with group lessons take place on weekdays, from Monday to Friday (5 consecutive days). Considering that your daughter has a tight schedule, we would recommend private lessons for her. Private classes are fully personalized and give the student the opportunity to establish their own schedule and pace of learning. These classes are excellent for improving and progressing in specific areas, such as phonetics or reading comprehension and vocabulary.”
Ana Carolina Dos Santos, LanguageCourse.Net - Dec 01, 2022
`; } } jQuery("#activeFilters, #activeFiltersBot").html(htmlFilters);var results_ids = "#filterResult";if (intersec.length > 2) {results_ids += ", #filterResultBot";} else {jQuery("#filterResultBot").css('display', 'none');}if (jQuery("#juniorIntro, #topCityWrap").length > 0) { if (htmlFilters) {jQuery("#juniorIntro, #topCityWrap").fadeOut(400, function() {jQuery(results_ids).css('display', 'inline-block');scroll_if_anchor('#filterResult'); }); }} else {jQuery(results_ids).css('display', 'inline-block');scroll_if_anchor('#filterResult');} if (!htmlFilters) { jQuery("#filterResult, #filterResultBot").css('display', 'none'); }jQuery("#filterNum, #filterNumBot").text(replacedString); // check if there's no checkbox filter checked before hiding the whole filterResult} else if (!jQuery(".filterIndicator").hasClass("isACheckBox") && !jQuery(".filterIndicator").hasClass("isADropDown")) { jQuery("#filterResult, #filterResultBot").css('display', 'none'); jQuery("#juniorIntro, #topCityWrap").fadeIn();} else { // if there are checkbox filter checked but no other filter running, update the message accordingly and remove all non-checkboxes pills (.filterIndicator) var str; if (intersec.length > 0) { if (intersec.length == 1) { str = "FAQ about schools in Madrid
How long does it take to complete A2 level?
“If you have already completed A1 it takes approximately 8 weeks to complete A2 if you study 20 lessons per week. If you are a complete beginner it will take 4-6 additional weeks.”
Louise Granath, Language Travel Consultant from LanguageCourse.Net - Nov 17, 2023
I am a senior interested in taking a 3-week Spanish immersion course with other seniors. I prefer Madrid or Barcelona. Which city would be best for me?
“Barcelona is the perfect destination if you want to see the sites of Antoni Gaudí, enjoy a vibrant culinary scene, and spend time on the beach. Conversely, if you're looking for a less crowded, more affordable immersion in Spanish history and art galleries, Madrid is the place.”
Maksym Sterpul, Language Travel Consultant from LanguageCourse.Net - Nov 16, 2023
I am 56 and would like to do a course with people from different age groups. Is that possible?
“Yes, it is possible. Most schools prefer to group students by language level, not age. ”
Robin Rebecca Pietersma, Language Travel Consultant from LanguageCourse.Net - Jul 07, 2023
I was looking for a one-week Spanish course for adult beginners with a personal teacher.
“Undoubtedly the best option for a week is the teacher's home programme, which allows you to make the most of your time, or alternatively a private tuition course. We will be happy to provide you with quotes and information for both options as soon as you send us more information about the period you are interested in.”
Antonio Zoppo, Language Travel Consultant from LanguageCourse.Net - Jan 09, 2023
Other destinations that were popular to combine with courses in Madrid
Barcelona
33 schools
Malaga
26 schools
Salamanca
18 schools
Valencia
26 schools
Didn't find what you are looking for?
Interested in a specific type of course? See our reviews of or other 39 different Spanish course types in Madrid.
Interested in language travel to other cities? Have a look at Spanish language schools in other cities in Spain such as Alcala de Henares, Alicante, Almeria, Almuñécar, Barbate (Cadiz) ...
, Barcelona, Bilbao, Cadiz, Castelldefels, Conil de la Frontera, Denia, El Médano (Tenerife), El Puerto de Santa María, Elche, Gijón, Girona, Granada, Ibiza, Jaén, Jerez de la Frontera, Lanzarote, Las Palmas, Leon, Logroño, Mahón (Menorca), Malaga, Marbella, Murcia, Nerja, Palma de Mallorca, Pamplona, Platja d'Aro (Costa Brava), Prado del Rey, Puzol (Valencia), Salamanca, San Pedro de Alcántara, San Sebastian, Santander, Santiago de Compostela, Sevilla, Soria, Tarragona, Tenerife, Valencia, Vejer de la Frontera, Vigo, Zaragoza or see our list of all schools in Spain. You may also want to consult options outside Spain for learning Spanish.
Show more
Questions about Spanish schools in Madrid?
Get free advice from our language travel experts to help you find the best school for you.
Send a questionOr+1-646 503 18 10 / +44-330 124 03 17
course in matches the following filters: "; } else { str = " courses in match the following filters: "; } } else { str = "No results found that match the following filters:"; } var replacedString = str.replace(" ", intersec.length ); jQuery("#juniorIntro").hide(400); jQuery(".topCityWrap").slideUp(); jQuery("#filterNum, #filterNumBot").text(replacedString); jQuery('.filterIndicator:not(.isACheckBox):not(.isADropDown)').remove(); }} function setCookie(name, value) { document.cookie = name + "=" + (value || "") + "; path=/"; } let setupPaginationObj = false; function storeFunctionCall(functionName, parameters) { if (isFacetJs) { if (!setupPaginationObj && paginationFunctionCall) { paginatedFiltersObj = paginationFunctionCall; paginatedFiltersObj.url = currentURL; setupPaginationObj = true; } const filterName = paginatedFiltersObj[functionName]; if (functionName === "filter_dropdown") { filterName[parameters[1]] = parameters[0]; } else if (functionName === "filter_checkbox") { !filterName[parameters[2]] && (filterName[parameters[2]] = []); // Add/remove value depending on "isChecked" if (parameters[1]) { if (!filterName[parameters[2]].includes(parameters[0])) { filterName[parameters[2]].push(parameters[0]); } } else { filterName[parameters[2]] = filterName[parameters[2]].filter(item => item !== parameters[0]); } } else if (functionName === "filter_rating") { paginatedFiltersObj[functionName] = parameters[0]; } else if (functionName === "filter_lessons" || functionName === "filter_students" || functionName === "filter_price_per_lesson" || functionName === "filter_prices") { filterName[0] = parameters[0]; filterName[1] = parameters[1]; } setCookie('functionCallPagination', JSON.stringify(paginatedFiltersObj)); } else { setCookie('functionCall', JSON.stringify({functionName, parameters, rangeSliderIndex: handleIndex})); document.getElementById("cover-spin").style.display = "block"; // IF (in age filter an age of less than 16 years has been selected) => load the junior course page instead of standard course page. if (1 && parameters[1] === "student_age_filter" && parameters[0] < 16) { window.location = "/schools-madrid/junior"; } else { window.location = "/schools-madrid/general"; } } }function filter_accommo(enable_acco_list) {filter_results['accommo'] = [];if (enable_acco_list.length > 0) {for (var i = filter_results['all'].length - 1; i >= 0; i--) {var id = filter_results['all'][i];if (schools[id]['accommo_types'].length > 0) {var inters = enable_acco_list.filter(function(value) {return -1 !== schools[id]['accommo_types'].indexOf(value)});if (inters.length > 0) {filter_results['accommo'].push(id);}}}} else {// No filterfilter_results['accommo'] = filter_results['all'];}apply_all_filters();}function filter_subcats(enable_cat_list) {filter_results['subcats'] = [];if (enable_cat_list.length > 0) {for (var i = filter_results['all'].length - 1; i >= 0; i--) {var id = filter_results['all'][i];if (enable_cat_list.includes(parseInt(schools[id]['subcategory'])))filter_results['subcats'].push(id);}}apply_all_filters();}function filter_lessons(min, max) { storeFunctionCall('filter_lessons', [...arguments]); if (!isFacetJs) return;filter_results['lessons'] = [];for (var i = filter_results['all'].length - 1; i >= 0; i--) {var id = filter_results['all'][i];if (schools[id]['lessons_per_week'].length > 0) {if (parseInt(schools[id]['lessons_per_week']) >= min && parseInt(schools[id]['lessons_per_week']) <= max) {filter_results['lessons'].push(id);}}}apply_all_filters();}function filter_students(min, max) { storeFunctionCall('filter_students', [...arguments]); if (!isFacetJs) return;filter_results['students'] = [];for (var i = filter_results['all'].length - 1; i >= 0; i--) {var id = filter_results['all'][i];if (schools[id]['max_students'].length > 0) {if (parseInt(schools[id]['max_students']) >= min && parseInt(schools[id]['max_students']) <= max) {filter_results['students'].push(id);}}}apply_all_filters();}function filter_rating(min) { storeFunctionCall('filter_rating', [...arguments]); if (!isFacetJs) return;if (min > 0) {filter_results['rating'] = [];for (var i = filter_results['all'].length - 1; i >= 0; i--) {var id = filter_results['all'][i];if (schools[id]['rating'].length > 0) {if (parseFloat(schools[id]['rating']) >= min) {filter_results['rating'].push(id);}}}} else {// No filterfilter_results['rating'] = filter_results['all'];}apply_all_filters();} function filter_checkbox(checkboxValue, isChecked, filterType) { storeFunctionCall('filter_checkbox', [...arguments]); if (!isFacetJs) return; const checkboxValueToNum = +checkboxValue; const checkedCheckboxes = jQuery(`#${filterType} input:checked`); const type = filterType.replace("checkBox_", ""); const checksLength = checkedCheckboxes.length; // Reset array if previously zero checks (isChecked && checksLength === 1) && (filter_results[type] = []); for (let i = filter_results['all'].length - 1; i >= 0; i--) { const id = filter_results['all'][i]; // Normalize course value as an array always to simplify further calculations const courseVal = Array.isArray(schools[id][type]) ? schools[id][type].map(Number) : [+schools[id][type]]; const filterArr = filter_results[type]; // Determine if checkboxValue is an array and handle accordingly const matchCondition = courseVal.includes(checkboxValueToNum); if (matchCondition) { // Include the course id in the filter array if the checked checkbox value is in the looping course value and not already present in the filter array if (isChecked) { !filterArr.includes(id) && filterArr.push(id); // Remove the course id from the filter array if the unchecked checkbox value is in the looping course value and doesn't match to other checked values in the case there are currently other checked checkboxes } else if (!isChecked) { // Before removing the current looping course, ensure no other checked checkboxes match any of its course values const allCheckedValues = checkedCheckboxes.map(function() { return +jQuery(this).val(); }).get(); const isPresentInOtherChecks = courseVal.some(val => allCheckedValues.includes(+val)); if (!isPresentInOtherChecks) { const index = filterArr.indexOf(id); if (index > -1) filterArr.splice(index, 1); } } } } // Reset array if currently zero checks if (checksLength === 0) { filter_results[type] = filter_results['all'].slice(); // slice with empty parameter to create a shallow copy of the array } apply_all_filters(false, true, type, checksLength === 0); } function filter_dropdown(dropDownValue, filterType) { storeFunctionCall('filter_dropdown', [...arguments]); if (!isFacetJs) return; const type = filterType.replace("_filter", ""); // Reset array if val is "0" if (dropDownValue === 0) { filter_results[type] = filter_results['all'].slice(); } else { for (let i = filter_results['all'].length - 1; i >= 0; i--) { const id = filter_results['all'][i]; const courseVal = schools[id][type]; const filterArr = filter_results[type]; let matchCondition = false; if (type === "course_duration") { matchCondition = courseVal.map(Number).includes(dropDownValue); } if (type === "student_age") { const [minAge, maxAge] = courseVal; matchCondition = (+minAge === 0 || +minAge <= dropDownValue) && (+maxAge === 0 || +maxAge >= dropDownValue); if (dropDownValue <= 17) { jQuery("#juniorCoursesSpecialMsg").show(); } } if (matchCondition) { !filterArr.includes(id) && filterArr.push(id); } else { const index = filterArr.indexOf(id); if (index > -1) filterArr.splice(index, 1); } } } apply_all_filters(false, false, type, false, true); }function filter_prices(min, max) { storeFunctionCall('filter_prices', [...arguments]); if (!isFacetJs) return;filter_results['prices'] = [];for (var i = filter_results['all'].length - 1; i >= 0; i--) {var id = filter_results['all'][i];if (schools[id]['course_price'].length > 0) {if (parseInt(schools[id]['course_price']) >= min && parseInt(schools[id]['course_price']) <= max)filter_results['prices'].push(id);}}apply_all_filters();} function filter_price_per_lesson(min, max) { storeFunctionCall('filter_price_per_lesson', [...arguments]); if (!isFacetJs) return; filter_results['price_per_lesson'] = []; for (var i = filter_results['all'].length - 1; i >= 0; i--) { var id = filter_results['all'][i]; if (schools[id]['price_per_lesson'].length > 0) { if (parseInt(schools[id]['price_per_lesson']) >= min && parseInt(schools[id]['price_per_lesson']) <= max) filter_results['price_per_lesson'].push(id); } } apply_all_filters(); }function onChangeSubcatFilter() {var cat_list = [];var subcatNavSpan = document.querySelectorAll("#subcatNav ul li span");for (var i = 0, len = subcatNavSpan.length; i < len; i++) {if (subcatNavSpan[i].getElementsByTagName("input")[0].checked) {cat_list.push( parseInt( subcatNavSpan[i].attributes['cat_type'].value ) );}}filter_subcats(cat_list);}function reset_subcats() {filter_results['subcats'] = filter_results['all'];var subcatNavSpan = document.querySelectorAll("#subcatNav ul li span");for (var i = 0, len = subcatNavSpan.length; i < len; i++) {subcatNavSpan[i].getElementsByTagName("input")[0].checked = true;}apply_all_filters();}function onChangeAccoFilter() {var acco_list = [];var accommoNavSpan = document.querySelectorAll("#accommoNav ul li span");for (var i = 0, len = accommoNavSpan.length; i < len; i++) {if (accommoNavSpan[i].getElementsByTagName("input")[0].checked) {acco_list.push( parseInt( accommoNavSpan[i].attributes['acco_type'].value ) );}};filter_accommo(acco_list);}function reset_accommo() {filter_results['accommo'] = filter_results['all'];var accommoNavSpan = document.querySelectorAll("#accommoNav ul li span");for (var i = 0, len = accommoNavSpan.length; i < len; i++) {accommoNavSpan[i].getElementsByTagName("input")[0].checked = false;};apply_all_filters();}function reset_prices() {filter_results['prices'] = filter_results['all'];jQuery("#coursePrice_left").text(rangesSliders["course_price"][0]);jQuery("#coursePrice_right").text(rangesSliders["course_price"][1]);jQuery('#sliderRange_coursePrice').slider("option", "values", [rangesSliders["course_price"][0], rangesSliders["course_price"][1]]);apply_all_filters();} function reset_price_per_lesson() { filter_results['price_per_lesson'] = filter_results['all']; jQuery("#pricePerLesson_left").text(rangesSliders["price_per_lesson"][0]); jQuery("#pricePerLesson_right").text(rangesSliders["price_per_lesson"][1]); jQuery('#sliderRange_pricePerLesson').slider("option", "values", [rangesSliders["price_per_lesson"][0], rangesSliders["price_per_lesson"][1]]); apply_all_filters(); }function reset_lessons() {filter_results['lessons'] = filter_results['all'];jQuery("#numOfLessons_left").text(rangesSliders["lessons_per_week"][0]);jQuery("#numOfLessons_right").text(rangesSliders["lessons_per_week"][1]);jQuery('#sliderRange_numOfLessons').slider("option", "values", [rangesSliders["lessons_per_week"][0], rangesSliders["lessons_per_week"][1]]);apply_all_filters();}function reset_students() {filter_results['students'] = filter_results['all'];jQuery("#numOfStudents_left").text(rangesSliders["max_students"][0]);jQuery("#numOfStudents_right").text(rangesSliders["max_students"][1]);jQuery('#sliderRange_numOfStudents').slider("option", "values", [rangesSliders["max_students"][0], rangesSliders["max_students"][1]]);apply_all_filters();}function reset_rating() {filter_rating(0);jQuery('#ratingStarsLeftBar use').removeClass('starFiltselected');} function reset_checkbox(type) { jQuery(`#checkBox_${type} input:checked`).click(); } function reset_student_age() { jQuery('#student_age_filter ul li:first-child a').click(); } function reset_course_duration() { jQuery('#course_duration_filter ul li:first-child a').click(); }function filter_details(filter, value) {var detail = "";var starEl = jQuery('#ratingStarsLeftBar .starFiltselected');var ratingValue = parseInt(starEl.last().data('value'), 10) || value;switch(filter) {case "lessons": detail = ": [" + jQuery('#sliderRange_numOfLessons').slider("option", "values")[0] + " - " + jQuery('#sliderRange_numOfLessons').slider("option", "values")[1] + "]"; break;case "students": detail = ": [" + jQuery('#sliderRange_numOfStudents').slider("option", "values")[0] + " - " + jQuery('#sliderRange_numOfStudents').slider("option", "values")[1] + "]"; break;case "prices": detail = ": [" + jQuery('#sliderRange_coursePrice').slider("option", "values")[0] + "€ - " + jQuery('#sliderRange_coursePrice').slider("option", "values")[1] + "€]"; break; case "price_per_lesson": detail = ": [" + jQuery('#sliderRange_pricePerLesson').slider("option", "values")[0] + "€ - " + jQuery('#sliderRange_pricePerLesson').slider("option", "values")[1] + "€]"; break;case "rating": detail = ": [" + ratingValue +" stars or better]"; break;case "accommo": detail += ": " + jQuery("#checkBox_accommo input:checked").map(function() { return jQuery(this).parent().text().trim(); }).get().join(', '); break; case "school": detail += ": " + jQuery("#checkBox_school input:checked").map(function() { return jQuery(this).parent().text().trim(); }).get().join(', '); break; case "cities": detail += ": " + jQuery("#checkBox_cities input:checked").map(function() { return jQuery(this).parent().text().trim(); }).get().join(', '); break; case "room_occupancy": detail += ": " + jQuery("#checkBox_room_occupancy input:checked").map(function() { return jQuery(this).parent().text().trim(); }).get().join(', '); break; case "language_level": detail += ": " + jQuery("#checkBox_language_level input:checked").map(function() { return jQuery(this).parent().text().trim(); }).get().join(', '); break; case "accommodation_type": detail += ": " + jQuery("#checkBox_accommodation_type input:checked").map(function() { return jQuery(this).parent().text().trim(); }).get().join(', '); break; case "meal_plans": detail += ": " + jQuery("#checkBox_meal_plans input:checked").map(function() { return jQuery(this).parent().text().trim(); }).get().join(', '); break; case "course_duration": const cDurVal = jQuery("#course_duration_dd_filter .sel_filter").text(); detail += ": " + cDurVal + " " + (+cDurVal === 1 ? "week" : "weeks"); break; case "student_age": detail += ": " + jQuery("#student_age_dd_filter .sel_filter").text() + " years old"; break;default:;}return detail;} Warning!
Please choose a Monday as a course starting date.
";if (pc_result['prices']['discount_tuition'] > 0) {tpl += "
";if (pc_result['prices']['accommodation_accom'] > 0 && pc_result['prices']['includes_accommodation'] != 1) {tpl += "
";}if (pc_result['prices']['inscription']>0) {tpl += "
";}if (pc_result['prices']['includes_accommodation'] != 1 && pc_result['prices']['accommodation_fee']>0) {tpl += "
";}if (pc_result['prices']['hs_course'] > 0 && selected_date!=0) {tpl += "
";}if (pc_result['prices']['hs_accommodation'] > 0 && selected_date!=0) {tpl += "
";}if (pc_result['prices']['hasCourseOffer'] == true && pc_result['prices']['offerCourseDiscount'] > 0) {tpl += "
";}if (pc_result['prices']['hasAccommodationOffer'] == true && pc_result['prices']['offerAccommodationDiscount'] > 0) {tpl += "
";}tpl += "
";var total = pc_result['prices']['total'];var total_nodiscount = pc_result['prices']['subtotal'] + pc_result['prices']['offerCourseDiscount'] + pc_result['prices']['offerAccommodationDiscount'];if (selected_date==0) {var hs_course = parseInt(pc_result['prices']['hs_course']);if (isNaN(hs_course)) {hs_course=0;}var hs_accommo = parseInt(pc_result['prices']['hs_accommodation']);if (isNaN(hs_accommo)) {hs_accommo=0;}total -= ( hs_course + hs_accommo);total_nodiscount -= ( hs_course + hs_accommo);}if (total_nodiscount > total) {tpl += "
";if (selected_date!=0) {tpl += "Total final price including seasonal supplements, school registration fees and applicable sales tax.";} else {tpl += "Total final price including school registration fees and applicable sales tax.";}//tpl += jQuery("#courseSelected_" + school_id).attr("extra-info");tpl += jQuery("#infotooltip_" + school_index).attr("extra-info");jQuery("#infotooltip_" + school_index).attr("data-original-title", tpl);}
");const alterTooltipf = function() {if (jQuery(".mobileCloseTooltip").length == 0) {jQuery('.tooltip-inner').prepend(newInsert);}}if (aDataToggleTooltip.length !== 0 ) {let i;for (i = aDataToggleTooltip.length - 1; i >= 0; i--) {const el = jQuery(aDataToggleTooltip[i]);el.on('inserted.bs.tooltip', alterTooltipf)}}}// touch screen device detectionif ( ("ontouchstart" in window || window.DocumentTouch && document instanceof DocumentTouch) === true ) {// put close button in tooltips when touchscreen is detected setTimeout(function() { itsTouchScreen(); }, 2500);}function destroyFlagToolEtc() {// destroy language flags tooltip when mobile// Mobile search box micro-plugin variables// const searchQuery = jQuery("#search_query");// destroy the flags info tooltip in mobileif (typeof(flagsTooltip.tooltip) === 'function') {flagsTooltip.tooltip('destroy');}langListPop.off('hide.bs.popover');// turn off the event to re-init the tooltip after flags selector popover hideslangListPop.on('show.bs.popover', function() {langListPop.off('hide.bs.popover');});/** Mobile search box micro-plugin **/// start with transparent in order to don't hide magnifying glass icon// searchQuery.css('background-color', 'transparent');// bind focus event// searchQuery.on('focus', function() {// const that = jQuery(this);// to calculate search box deployment final width// const totalSearchFieldWidth = jQuery("#cBoxTabWrap").outerWidth() - jQuery("#searchForm_small").outerWidth() - 87;// background-color play to always show icon and have white background in search field// that.css('background-color', '#fff');// Show 'searchPlaceholderVar' variable is defined in the 'page_header.tpl' then animate the search field// that.attr('placeholder', searchPlaceholderVar).animate({// width: totalSearchFieldWidth,// }, 400, "swing", function() { // jQuery("#magniFyingGlass").hide(); // jQuery("#closeSearchBar").show(); // });// });//bind blur event// searchQuery.on('blur', function() {// const that = jQuery(this);// const glyphiconSearch = jQuery("#searchForm_small").find(".fa-search");// //contactBoxPhonesMobText.css('color', '');// // z-index play// glyphiconSearch.css('z-index', '4');// that.animate({// // animate back to zero width to close the field// width: 0,// }, 400, function() { // // jQuery("#magniFyingGlass").show(); // // jQuery("#closeSearchBar").hide();// // // background and z-index play// // that.css('background-color', 'transparent');// // glyphiconSearch.css('z-index', '');// });// });/** END OF => Mobile search box micro-plugin **/}// La siguiente función "slidingMenu();" sirve para mostrar y ocultar el sliding facetted menú lateral en el responsive modefunction slidingMenu() {// toggle side menuconst leftMenuBtns = jQuery("#filterMobBut, #cbp-spmenu-s2, #showLeft, #closeButtonSlideMenuTop, #closeButtonSlideMenuBot");// elements for toggling classes overconst bodyContent = jQuery("#body_content");const menuLeft = jQuery("#cbp-spmenu-s2");const closeButTopEl = jQuery('#closeButtonSlideMenuTop')[0];const closeButBotEl = jQuery('#closeButtonSlideMenuBot')[0];leftMenuBtns.on('click', function(event) {const transitionEvent = whichTransitionEvent();// No need of using event.stopPropagation() anymore writing the condition below!// to check if click is originated from outside the side menu itself// https://css-tricks.com/dangers-stopping-event-propagation/#article-header-id-2if (!jQuery(event.target).closest('#wrapSlideMenu').length || (event.target == closeButTopEl && event.currentTarget.id != "cbp-spmenu-s2") || (event.target == closeButBotEl && event.currentTarget.id != "cbp-spmenu-s2") ) {menuLeft.toggleClass('cbp-spmenu-open');// triggered only when closing the sidebar, so detect the transition end before changing z-indexif (bodyContent.hasClass('cbp-spmenu-opened')) {// .one() => because if the event handler is not removed after its called, the class will be removed from the second triggering and so on (the handler continue running if not cancelled)menuLeft.one(transitionEvent, function() {bodyContent.removeClass('cbp-spmenu-opened');});} else {// triggered only when opening the sidebar: no need of changing z-indexbodyContent.addClass('cbp-spmenu-opened');}}});}// END of slidingMenu() logicif (currentSize.width <= 1024) {slidingMenu();}// trigger reflows on resize width from desktop to mobilejQuery(window).on('widthOnlyResizedMobile', function() {var leftMenuBtns = jQuery("#filterMobBut, #cbp-spmenu-s2, #showLeft, #closeButtonSlideMenuTop, #closeButtonSlideMenuBot");leftMenuBtns.off('click');slidingMenu();}); /***********************************//** Main school_overview reflows **//*********************************/// school_overview repositions when resizing from desktop to mobilefunction mobileResp() {const contentPanel = jQuery("#content_panel");const schoolContainer = contentPanel.find(".schoolContainer");let starting_date = jQuery("#calendar_date").val();const schoolDetailsDropWrap = contentPanel.find(".schoolDetailsDropWrap");const resultsDetails2 = jQuery(".resultsDetails2"); // const reflowBlocks = jQuery(".reflowBlocks");const ratingWrap = jQuery(".ratingBlockWrap").find(".ratingWrap");// var textInsideCalc = jQuery('.textInsideCalc');// var calcModal = jQuery("#calcModal");// calcModal.appendTo(textInsideCalc);// modal changes on resizejQuery(".modal-backdrop").css('display', '');// calcModal.addClass('modal fade').removeClass('modalDisplay');jQuery("#decorator_xx10").addClass('modal-dialog');// jQuery("#modalContent").addClass('modal-content');// school_overview FACETS onlycontentPanel.find(".wrappableDivFacets").addClass('collapse').css('height', '');/*reflowBlocks.each(function() { const that = jQuery(this); const closest = that.closest(".middleAndResults"); closest.find(".resultsDetails2").insertAfter(that); that.insertAfter(closest.find(".mainRatingWrap")); });*/ resultsDetails2.each(function() { const that = jQuery(this); that.insertAfter(that.closest(".middleAndResults").find(".reflowBlocks")); });schoolDetailsDropWrap.each(function(){const that = jQuery(this);that.closest(".middleAndResults").find('.buttonToSchoolWrap').appendTo(that.closest('.schoolRightContentWrap'));// that.parent().find('.resultsLogos').after(that.find('.school_overview_p_inside_box_results'));if (that.hasClass('secondarySchoolBlock')) {that.appendTo(that.closest('.middleTop').find('.contentSideImg'));}});ratingWrap.each(function() {const that = jQuery(this);that.after(that.prev());});schoolContainer.each(function() {const that = jQuery(this);that.find(".resultsBand").prependTo(that.find(".middleTop"));// schoolDetailsDropWrap.css('width', '');that.find(".newBadge").insertAfter(that.find(".schoolPictWrap"));that.find(".schoolStrenghtsWrap").appendTo(that.find(".resultsDetails2")); that.find(".schoolDetailsDropWrap").insertAfter(that.find(".mainRatingWrap"));});// school_overview calculator partjQuery("#mob_duration_sel").html(jQuery("#duration_sel").html());if (starting_date == "") {starting_date = jQuery("#calendar_date_intro").html();jQuery("#calendarIndicator").html("+").addClass("calNumEmpty").removeClass("calNumFilled");} else if (typeof(starting_date) !== 'undefined') {jQuery("#calendarIndicator").html( starting_date.substr(0, starting_date.indexOf(' ')) ).addClass("calNumFilled").removeClass("calNumEmpty");}// jQuery("#mob_calendar_date").html(starting_date);jQuery("#mob_course_category_sel").html(jQuery("#course_category_sel").html());jQuery("#mob_accommodation_type_sel").html(jQuery("#accommodation_type_sel").html());jQuery(".modal-backdrop").css('display', '');// calcModal.addClass('modal fade').removeClass('modalDisplay');jQuery("#decorator_xx10").addClass('modal-dialog');// jQuery("#modalContent").addClass('modal-content');jQuery("span.city_video_big").addClass("city_video").removeClass("city_video_big");// school_overview secondary schools collapsibles// jQuery('[id^=schoolAltRatings], [id^=dataSchool]').collapse('show');// jQuery('[id^=S_Name]').removeClass("DDColl").addClass("DDExp");}// Main school_overview desktop repositionsfunction schoolOverviewReposition() {const contentPanel = jQuery("#content_panel");const schoolContainer = contentPanel.find(".schoolContainer");const schoolRightContentWrap = jQuery(".schoolRightContentWrap");const resultsDetails2_1 = jQuery(".resultsDetails2_1");const ratingWrap = jQuery(".ratingBlockWrap").find(".ratingWrap");const middleWrap = jQuery('.middleWrap');// var boxedBottWrap = jQuery('#boxedBottWrap');// var calcModal = jQuery("#calcModal");// calcModal.appendTo(boxedBottWrap);schoolContainer.each(function() {const that = jQuery(this);that.find(".resultsBand").insertBefore(that.find(schoolRightContentWrap));that.find(".newBadge").prependTo(that.find(".buttonToSchoolWrap"));that.find(".schoolStrenghtsWrap").insertAfter(that.find(".middleBot")); that.find(".schoolDetailsDropWrap ").appendTo(that.find(".middleTop"))// To avoid elements repositioning flashes during page load// that.find(".contentSideImg, .schoolDetailsDropWrap, .buttonToSchoolWrap").show();});schoolRightContentWrap.each(function() {const that = jQuery(this);// https://es.stackoverflow.com/questions/61505/c%C3%B3mo-hacer-para-aplicar-important-de-css-con-jquery-javascriptif (that.find(".schoolDetailsDropWrap")[0]) {// that.find(".schoolDetailsDropWrap")[0].style.setProperty('width', '88%', 'important');that.find(".buttonToSchoolWrap").appendTo(that.find(resultsDetails2_1));}});// resultsDetails2_1.each(function() {// const that = jQuery(this);// that.closest(".middleAndResults").find(".reflowBlocks").insertAfter(that.closest(".middleAndResults").find(".head_yellow_7"));// });middleWrap.each(function(){const that = jQuery(this);that.after(that.find(".resultsDetails2"));// that.find(".school_overview_p_inside_box_results").prependTo(that.find(".schoolDetailsDropWrap"));});ratingWrap.each(function() {const that = jQuery(this);that.next().after(that);});contentPanel.find(".schoolDetailsDropWrap").find(".wrappableDiv").unwrap();// calcModal.removeClass('modal fade').addClass('modalDisplay');jQuery("#decorator_xx10").removeClass('modal-dialog');// jQuery("#modalContent").removeClass('modal-content');jQuery("span.city_video").addClass("city_video_big").removeClass("city_video");// school_overview FACETS onlycontentPanel.find(".wrappableDivFacets").removeClass('collapse').css('height', 'auto');// school_overview secondary schools collapsibles// jQuery('[id^=schoolPicture]').collapse('hide').height('0px');// jQuery('[id^=S_Name]').removeClass("DDExp").addClass("DDColl");} function trimSchoolDescriptions(textLength, removeLink = false) { function trimToWords(text, wordCount) { // Remove line breaks and extra spaces text = text.replace(/\s+/g, ' ').trim(); const words = text.split(' '); if (words.length <= wordCount) { return text; } let trimmed = words.slice(0, wordCount).join(' '); // Remove any non-alphanumeric characters from the end of the trimmed text trimmed = trimmed.replace(/[^a-zA-Z0-9]+$/, ''); return trimmed + ' ...'; } const elements = document.querySelectorAll('.school_overview_p_inside_box_results_inside'); for (let i = 0; i < elements.length; i++) { const originalText = elements[i].textContent || elements[i].innerText; elements[i].textContent = trimToWords(originalText, textLength); } }if (currentSize.width >= 1025) {schoolOverviewReposition(); trimSchoolDescriptions(22);// const bar_flags_new = jQuery("#bar_flags_new").detach();// bar_flags_new.appendTo("#searchFormSmallWrap");} else { trimSchoolDescriptions(12, true); } jQuery('[id^=schoolPicture]').collapse('hide').height('0px');// trigger reflows to be done in mobile mode when resizing from desktop to mobilejQuery(window).on('widthOnlyResizedMobile', mobileResp);// ... and viceversajQuery(window).on('widthOnlyResizedDesktop', function() {// const mainRatingWrap = jQuery(".mainRatingWrap");schoolOverviewReposition();// jQuery(".resultsDetails2_1").each(function() {// const that = jQuery(this);// that.closest(".middleAndResults").find(mainRatingWrap).prependTo(that);// });});/**************************//** Main school reflows **//************************/function allPagesDesktopReflows() {// const bar_flags_new = jQuery("#bar_flags_new").detach();// ALL pages => flags widget// bar_flags_new.appendTo("#searchFormSmallWrap");// ALL pages => "wechat" "whatsapp" "kakao" & "skype"jQuery("#contactBoxSkype").insertAfter("#contactBoxPhones"); // ALL pages => cBox jQuery("#contactBoxChat").insertBefore("#contactBoxTextareaDiv");// ALL PAGES (footer)// ALL pages where we use bootstrap modalsjQuery('.modal-backdrop.fade.in').css('display', 'none');// All pages but UG (header)jQuery("#searchFormSmallWrap").prependTo("#headSearchBar");} // remove placeholder on focus event jQuery("#searchBarMob .search_query, .searchQueryWrap .search_query").on('focus', function() { jQuery(this).removeAttr('placeholder'); });flagsTooltipInit = function() {if (typeof jQuery().tooltip === 'function') {// destroy lang flags tooltip if flags popover is shownlangListPop.on('show.bs.popover', function() {flagsTooltip.tooltip('destroy');});if (currentSize.width <= 1024) {if (typeof(flagsTooltip.tooltip) === 'function') {flagsTooltip.tooltip('destroy');}} else {if (!windowMatchObj.mqoh.matches) {// re-init lang flags tooltip when flags popover is hiddenlangListPop.on('hide.bs.popover', function() {jQuery('[data-toggle="tooltipTop"]').tooltip({trigger : 'hover',placement: 'top'});});}if (windowMatchObj.mqoh.matches) {if (typeof(flagsTooltip.tooltip) === 'function') {flagsTooltip.tooltip('destroy');langListPop.off('hide.bs.popover');}}}}}// avoid hiding flags selector if the cBox is overlapping itfunction avoidHidingFlags() {if (windowMatchObj.mqoh.matches) { const contactBoxWrapper = jQuery('#contactBoxWrapper');langListPop.on('show.bs.popover', function () {contactBoxWrapper.css('z-index', '10');});langListPop.one('hide.bs.popover', function () {contactBoxWrapper.css('z-index', '');if (typeof(flagsTooltip.tooltip) === 'function') {flagsTooltip.tooltip('destroy');}});flagsTooltip.on('show.bs.tooltip', function () {if (typeof(flagsTooltip.tooltip) === 'function') {flagsTooltip.tooltip('destroy');}});} else {langListPop.off('show.bs.popover hidden.bs.popover');flagsTooltipInit();}}avoidHidingFlags();windowMatchObj.mqoh.addListener(avoidHidingFlags);jQuery(window).on('widthOnlyResized', function() {// restart bind and width in case of window resize in order to don't hide magnifying glass icon// jQuery("#search_query").off('focus blur').css('width', '');});if (currentSize.width <= 1024) {destroyFlagToolEtc();}if (currentSize.width >= 1025) {allPagesDesktopReflows(); } // remove heading middle line if 2 lines if (!(jQuery('#school_overview').length && currentSize.width <= 1024)) { const h2Elements = jQuery('h2'); for (let i = 0; i < h2Elements.length; i++) { const el = jQuery(h2Elements[i]); if (el.find('.titleSep').height() > 40) { el.addClass('removeBorderBottom'); } }; }// execute destroy language flags tooltip + mobile searchbar (triggered only on mobile and only on resize from desktop mode)jQuery(window).on('widthOnlyResizedMobile', function() {// const bar_flags_new = jQuery("#bar_flags_new").detach();destroyFlagToolEtc();// bar_flags_new.appendTo(jQuery("#cBoxTabWrap"));jQuery("#contactBoxChat").insertAfter("#contactBoxTextareaDiv");jQuery("#searchFormSmallWrap").insertAfter("#contactBoxChat");if (typeof getLangSuggestion === "function") {getLangSuggestion(0);}reInitPopover('#changeLanguageFlags'); jQuery("#contactBoxSkype").insertBefore("#sendBlockWrap");});// Triggered only on desktop and only on resize from mobile modejQuery(window).on('widthOnlyResizedDesktop', function() {// ALL PAGES => re-init the tooltip if previously destroyed on mobileallPagesDesktopReflows();if (typeof(flagsTooltip.tooltip) === 'function') {// IMPORTANT: .tooltip('destroy') is asynchronous, and immediate creation of another popover fails, while the previous one is being destroyed [same that happens with .popover('destroy') method].// https://stackoverflow.com/questions/27238938/bootstrap-popover-destroy-recreate-works-only-every-second-time#answer-27345242setTimeout(function() {flagsTooltip.tooltip({trigger : 'hover',placement: 'top'});}, 200);}// ALL PAGES => re-init event handler if previously turned off on mobilelangListPop.on('show.bs.popover', function() {// re-init lang flags tooltip when flags popover is hiddenlangListPop.on('hide.bs.popover', function() {setTimeout(function() {flagsTooltip.tooltip({trigger : 'hover',placement: 'top'});}, 200);});});reInitPopover('body');});}); /* CLOSING BIG WINDOW ONLOAD FUNCTION */
';// right template when container distance to right is more than 300px in desktop mode or the cBox is closed} else if ( distanceToRight > 300 || !contactBoxStatuses.locked ) {return '
';}// always bottom template when mobile mode} else if ( windowWidth <= 1024 ) {return '
';}};if (typeof jQuery().tooltip === 'function') {// init price calculator or price breakdown tooltipstooltipPC.tooltip({trigger : 'hover',placement: function (tooltip, button) { if (jQuery(button).hasClass('carouselTooltipBtn')) { return 'bottom'; }const distanceToRight = distanceOfPCToRight();const windowWidth = window.innerWidth;if (windowWidth >= 1025) {// left show when container distance to right is less than 300px in desktop mode or the cBox is openedif ( distanceToRight <= 300 || contactBoxStatuses.locked ) {return 'left';// right show when container distance to right is more than 300px in desktop mode or the cBox is closed} else if ( distanceToRight > 300 || !contactBoxStatuses.locked ) {return 'right';}// always bottom show when mobile mode} else if ( windowWidth <= 1024 ) {return 'bottom';}},html: true,// get templatetemplate: templateTooltipPC()});};// conditionals to right/left/bottom open tooltips -- first select each tooltipfor (i = tooltipPC.length - 1; i >= 0; i--) {// when tooltip is completely visible, alter its HTML inserting or removing classes:jQuery(tooltipPC[i]).on('inserted.bs.tooltip', function() {const windowWidth = window.innerWidth;if (windowWidth >= 1025) {// left show when container distance to right is less than 300px in desktop mode and the cBox is openedif ( distanceOfPCToRight() <= 300 || contactBoxStatuses.locked ) {jQuery('.tooltip').removeClass("tri-left tri-up").addClass("tri-right tri-down");// right show when container distance to right is more than 300px in desktop mode and the cBox is closed} else if ( distanceOfPCToRight() > 300 || !contactBoxStatuses.locked ) {jQuery('.tooltip').removeClass("tri-right tri-up").addClass("tri-left tri-down");}// always bottom show when mobile mode} else if ( windowWidth <= 1024 ) {jQuery('.tooltip').removeClass("tri-down tri-right tri-left").addClass("tri-up");}});}};jQuery(window).on('load', function() {setTimeout(function() {// execute tooltip function above on window loadinitTooltipPC();}, 2000);});jQuery(window).on('load', function() {// university detailsif (jQuery('.ranking-table.variant').length > 0) {jQuery('.ranking-table.variant .provider').tooltip({html: true,template: '
',title: 'loading...',placement: function (tooltip, button) {const windowWidth = window.innerWidth;if( windowWidth <= 1024 ) { placement = 'bottom';} else { placement = 'right';}return placement;},trigger: 'hover click'}).on('show.bs.tooltip', function() {const that = jQuery(this);const title = that.find('.primary_indicators').html();// 'data-original-title' => https://stackoverflow.com/questions/9501921/change-twitter-bootstrap-tooltip-content-on-clickthat.attr('data-original-title', title).tooltip('fixTitle');});} if (window.innerWidth >= 1025) { !jQuery("#radios_lists").length && showAgentImg(); cBoxDesktopReflows(); jQuery("#searchBarMob input").prop('disabled', true); jQuery("#searchBarDesk input").prop('disabled', false); } else { jQuery("#buttonToChat, #contactBoxTextareaDiv, #proActiveBubbleWrapMob").on('click', showAgentImg); jQuery("#proActiveBubbleWrapMob .closeContactBox").on('click', function(e) { e.stopPropagation(); jQuery("#proActiveBubbleWrapMob").fadeOut(300); }); jQuery("#searchBarDesk input").prop('disabled', true); jQuery("#searchBarMob input").prop('disabled', false); } function cBoxDesktopReflows() { jQuery("#contactBoxAgent").insertAfter(jQuery("#closingTab")); } function showAgentImg() { const cBoxAgent = jQuery("#contactBoxAgent"); if (document.getElementById('contactBoxSkype')?.innerHTML !== '') { const cBoxImg = document.getElementById("cBoxImg"); cBoxImg && cBoxImg.setAttribute("src", cBoxImg.getAttribute('data-image')); cBoxAgent.show(); const theSkypeImg = document.getElementById("theSkypeImg"); theSkypeImg && theSkypeImg.setAttribute("src", theSkypeImg.getAttribute('data-image')); const theKakaoImg = document.getElementById("theKakaoImg"); theKakaoImg && theKakaoImg.setAttribute("src", theKakaoImg.getAttribute('data-image')); const theWechatImg = document.getElementById("theWechatImg"); theWechatImg && theWechatImg.setAttribute("src", theWechatImg.getAttribute('data-image')); const weChatQRImg = document.getElementById("weChatQRImg"); weChatQRImg && weChatQRImg.setAttribute("src", weChatQRImg.getAttribute('data-image')); const theWhatsAppImg = document.getElementById("theWhatsAppImg"); theWhatsAppImg && theWhatsAppImg.setAttribute("src", theWhatsAppImg.getAttribute('data-image')); } else { cBoxAgent.hide(); setTimeout(showAgentImg, 100); } } jQuery(window).on('widthOnlyResizedMobile', function() { jQuery("#contactBoxAgent").insertAfter(jQuery("#closingFunctions")); jQuery("#searchBarDesk input").prop('disabled', true); jQuery("#searchBarMob input").prop('disabled', false); }); jQuery(window).on('widthOnlyResizedDesktop', function() { cBoxDesktopReflows(); jQuery("#searchBarMob input").prop('disabled', true); jQuery("#searchBarDesk input").prop('disabled', false); }); const contentList = jQuery("#content_list"); const scrollingWidget = jQuery(".scrollingWidget") let scrollTimeout; // Init each scrolling widget scrollingWidget.each(function() { const $this = jQuery(this); let buttonClickInProgress = false; const contentListInt = $this.find(".contentListInt"); const navScrollRight = $this.find(".nav_scrollRight"); const navScrollLeft = $this.find(".nav_scrollLeft"); // Run the scroll buttons logic only if needed if (contentListInt[0].scrollWidth > contentListInt[0].clientWidth + 5) { // Init scroll buttons navScrollRight.css({'display': '', 'opacity': 1}); navScrollLeft.css({'display': '', 'opacity': 0}); // Scroll right navScrollRight.click(function() { buttonClickInProgress = true; showOrHideNvBtn(navScrollLeft, 1); contentListInt.animate({ scrollLeft: "+=200px" }, 300, function() { // Hide the right button once reaching the end of the scroll if (Math.ceil(contentListInt.scrollLeft() + contentListInt.innerWidth()) >= contentListInt.prop('scrollWidth')) { showOrHideNvBtn(navScrollRight, 0); } setTimeout(function() { buttonClickInProgress = false }, 300); }); }); // Scroll left navScrollLeft.click(function() { buttonClickInProgress = true; contentListInt.animate({ scrollLeft: "-=200px" }, 300, function() { showOrHideNvBtn(navScrollRight, 1); // Hide the left button once reaching the beginning of the scroll if (contentListInt.scrollLeft() === 0) { showOrHideNvBtn(navScrollLeft, 0); } setTimeout(function() { buttonClickInProgress = false }, 300); }); }); // In case of manual scroll instead of using the buttons contentListInt.scroll(function() { // Don't run it if its a button scroll if (buttonClickInProgress) return; // Hide the buttons when the user scrolls navScrollRight.css({ opacity: 0, 'pointer-events': 'none' }); navScrollLeft.css({ opacity: 0, 'pointer-events': 'none' }); // Clear the old setTimeout if still triggering scroll events scrollTimeout && clearTimeout(scrollTimeout); // Set a timeout to show the buttons after the user stops scrolling scrollTimeout = setTimeout(function() { if (Math.ceil(contentListInt.scrollLeft() + contentListInt.innerWidth()) < contentListInt.prop('scrollWidth')) { showOrHideNvBtn(navScrollRight, 1); } if (contentListInt.scrollLeft() > 0) { showOrHideNvBtn(navScrollLeft, 1); } }, 300); }); } }); // If its affixed/un-affixed (affix/unaffix triggers the scroll event too) contentList.on('affixed.bs.affix affixed-top.bs.affix', function() { buttonClickInProgress = true; setTimeout(function() { buttonClickInProgress = false; }, 300); }); // Show/hide button helper function showOrHideNvBtn(btn, showHide) { btn.animate({ opacity: showHide }, 30, function() { btn.css({ 'pointer-events': showHide === 1 ? 'auto' : 'none' }); }); } });