/* Author: Designkitchen, Chicago Booth */ $.noConflict(); jQuery(document).ready(function ($) { startTimer(); /// Highlights open in new window $('.module.highlights ul a').click(function () { window.open($(this).attr('href')); return false; }); /// BEGIN HOME PAGE VID // Video Variables var homevideoUrl; var homeclipTitle; var homepageName = "Home"; var homeplayerName = "ChicagoBooth.edu"; var sw = $('#feature-slider').width(); var sh = $('#feature-slider').height() - $('.thumb-nav').height(); var homeTimer; var slideCount = $('.thumb-nav li').length; var currSlide = $('.thumb-nav li').filter('.current').index(); var nextSlide = currSlide + 1; var fadeSpeed = 1000; //alert(currSlide); //Start slides timer functions function startTimer() { homeTimer = setInterval(function () { $('.slide').eq(currSlide).fadeOut(fadeSpeed); $('.slide,.thumb-nav li').removeClass('current'); $('.slide').eq(nextSlide).addClass('current').fadeIn(fadeSpeed); $('.thumb-nav li').eq(nextSlide).addClass('current'); currSlide = nextSlide; nextSlide = currSlide + 1 < slideCount ? currSlide + 1 : 0; }, 10000); } $('.thumb-nav li a').click(function () { $('.slide .overlay').remove(); clearInterval(homeTimer); }); //End slides timer functions // Start resize window functions $(window).resize(function () { overReloc(); }); function overReloc() { sh = $('#feature-slider').height() - $('.thumb-nav').height(); $('.overlay').width('100%'); $('.overlay').height(sh); var ml = ($('.overlay').width() - $('#feature-video').width()) / 2; var mt = ($('.overlay').height() - $('#feature-video').height()) / 2; //$('#feature-video').css('margin-top', mt); //alert(navigator.userAgent); if (navigator.userAgent.toLocaleLowerCase().indexOf('msie 7') == -1) { $('#feature-video').css('margin-left', ml); } } //End resize window functions function overclick() { $('.slide .overlay').click(function () { $(this).remove(); }); } /*$("a.play-home, a.play-more").click(function () { homevideoUrl = $(this).attr('href'); homeclipTitle = $(this).data("name"); //Clears the http address in IE to prevent streaming errors var homeslicetxt = 'http://www.chicagobooth.edu/'; if (homevideoUrl.indexOf(homeslicetxt) >= 0) { homevideoUrl = homevideoUrl.slice(homeslicetxt.length, homevideoUrl.length); } //Stops slides clearInterval(homeTimer); return false; });*/ $('a.play-home, a.play-more').click(function () { homevideoUrl = $(this).attr('href'); homeclipTitle = $(this).data("name"); //Clears the http address in IE to prevent streaming errors var homeslicetxt = 'http://www.chicagobooth.edu/'; if (homevideoUrl.indexOf(homeslicetxt) >= 0) { homevideoUrl = homevideoUrl.slice(homeslicetxt.length, homevideoUrl.length); } //Stops slides clearInterval(homeTimer); $(this).parents('.slide').append('
'); $('.overlay').width('100%'); $('.overlay').height(sh); overclick(); $('.overlay').append('
'); //alert(navigator.userAgent); if (navigator.userAgent.toLocaleLowerCase().indexOf('ipad') > -1 || navigator.userAgent.toLocaleLowerCase().indexOf('iphone') > -1) { var ipslice = '23245'; homevideoUrl = homevideoUrl.slice(ipslice.length, homevideoUrl.length); $('#feature-video').html(''); } else { $player = $f("feature-video", { src: "http://scripts.chicagobooth.edu/flowplayer/flowplayer.commercial-3.2.7.swf", wmode: 'opaque' }, { key: '#$3928646d7fbd6b51616', plugins: { rtmp: { url: 'http://scripts.chicagobooth.edu/flowplayer/flowplayer.rtmp-3.2.3.swf', netConnectionUrl: 'rtmp://cp23245.edgefcs.net/ondemand', // make the rtmp plugin query the stream length from the server durationFunc: 'getStreamLength' } }, clip: { // it's possible to stream audio by using the RTMP plugin provider: 'rtmp', autoPlay: true, scale: true, url: 'mp4:' + homevideoUrl, onBegin: function (clip) { }, onStart: function (clip) { mediaInit(homepageName + ' : ' + homeclipTitle, parseInt(clip.fullDuration), homeplayerName); }, onPause: function (clip) { mediaStop(homepageName + ' : ' + homeclipTitle, parseInt(this.getTime())); }, onResume: function (clip) { mediaResume(homepageName + ' : ' + homeclipTitle, parseInt(this.getTime())); }, onBeforeSeek: function (clip) { mediaStop(homepageName + ' : ' + homeclipTitle, parseInt(this.getTime())); }, onSeek: function (clip, endtime) { mediaResume(homepageName + ' : ' + homeclipTitle, parseInt(this.getTime())); }, onStop: function (clip) { mediaStop(homepageName + ' : ' + homeclipTitle, parseInt(this.getTime())); }, onFinish: function (clip) { mediaDone(homepageName + ' : ' + homeclipTitle, parseInt(this.getTime())); overclick(); } } }); } overReloc(); return false; }); //// END HOME PAGE VID /* Mega Menu Helpers */ // Mega Menu Hover Intent $(".site-nav li.has-drop").hoverIntent({ sensitivity: 7, interval: 100, timeout: 200, over: function () { var listItem = $(this); //listItem.addClass("hover").find('.mm-drop').fadeIn(200, function(){ listItem.find('.mm-drop').show(0, function () { listItem.addClass("hover"); }); }, out: function () { var listItem = $(this); listItem.find('.mm-drop').fadeOut(100, function () { //listItem.find('.mm-drop').hide(0, function(){ listItem.removeClass("hover"); }); } }); // Mega Menu Height Columns var mmcolumns = $('.mm-drop-container').find('.subnav'); for (var i = 0; i < mmcolumns.length; i++) { var section = mmcolumns[i].children; for (var j = 0; j < section.length; j++) { section[j].style.height = section[j].clientHeight + 'px'; } } // Mega Menu Border var mmtallestProgramsSecondRow = 0, mmtallestProgramsFirstRow = 0, mmtallestAboutUs = 0, mmcolumnsDl = $('.mm-drop-container').find('.subnav dl'); //Get the max maximum height in About Us Nav for (var i = 0; i < 5; i++) { var section = mmcolumnsDl[i]; if (section != null && mmtallestAboutUs < section.clientHeight) mmtallestAboutUs = section.clientHeight; } //Set the height to maximum height for (var k = 0; k < 5; k++) { if (mmcolumnsDl[k] != null) mmcolumnsDl[k].style.height = mmtallestAboutUs + 'px'; } //For the first row of Programs, Get the maximum height for (var i = 5; i < 9; i++) { var section = mmcolumnsDl[i]; if (section != null && mmtallestProgramsFirstRow < section.clientHeight) mmtallestProgramsFirstRow = section.clientHeight; } //For the first row of Programs, set the maximum height for (var k = 5; k < 9; k++) { if (mmcolumnsDl[k] != null) mmcolumnsDl[k].style.height = mmtallestProgramsFirstRow + 'px'; } //For the second row of Programs, Get the maximum height for (var i = 9; i < mmcolumnsDl.length; i++) { var section = mmcolumnsDl[i]; if (section != null && mmtallestProgramsSecondRow < section.clientHeight) mmtallestProgramsSecondRow = section.clientHeight; } //For the second row of Programs, set the maximum height for (var k = 9; k < mmcolumnsDl.length; k++) { if (mmcolumnsDl[k] != null) mmcolumnsDl[k].style.height = mmtallestProgramsSecondRow + 'px'; } /// BEGIN FANCYBOX // Video Variables var videoUrl; var clipTitle; var FPclipTitle; var FPpageName; var pageName = "Home"; var playerName = "ChicagoBooth.edu"; $("a.play, a.play-profile, a.play-btn, a.view-video, a.play-html5").click(function () { videoUrl = $(this).attr('href'); clipTitle = $(this).data("name"); var slicetxt = 'http://www.chicagobooth.edu/'; if (videoUrl.indexOf(slicetxt) >= 0) { videoUrl = videoUrl.slice(slicetxt.length, videoUrl.length); } return false; }); $("a.play").fancybox({ 'transitionIn': 'fade', 'transitionOut': 'fade', 'speedIn': 300, 'speedOut': 300, 'autoDimensions': false, 'width': 780, 'height': 480, 'titleShow': false, 'overlayShow': true, 'overlayOpacity': 0.7, 'overlayColor': '#000000', 'type': 'swf', 'onStart': function () { $player = $f("fancybox-content", { src: "http://scripts.chicagobooth.edu/flowplayer/flowplayer.commercial-3.2.7.swf", wmode: 'opaque' }, { key: '#$3928646d7fbd6b51616', plugins: { rtmp: { url: 'http://scripts.chicagobooth.edu/flowplayer/flowplayer.rtmp-3.2.3.swf', netConnectionUrl: 'rtmp://cp23245.edgefcs.net/ondemand', // make the rtmp plugin query the stream length from the server durationFunc: 'getStreamLength' } }, clip: { // it's possible to stream audio by using the RTMP plugin provider: 'rtmp', autoPlay: true, scale: true, url: 'mp4:' + videoUrl, onBegin: function (clip) { }, onStart: function (clip) { mediaInit(pageName + ' : ' + clipTitle, parseInt(clip.fullDuration), playerName); }, onPause: function (clip) { mediaStop(pageName + ' : ' + clipTitle, parseInt(this.getTime())); }, onResume: function (clip) { mediaResume(pageName + ' : ' + clipTitle, parseInt(this.getTime())); }, onBeforeSeek: function (clip) { mediaStop(pageName + ' : ' + clipTitle, parseInt(this.getTime())); }, onSeek: function (clip, endtime) { mediaResume(pageName + ' : ' + clipTitle, parseInt(this.getTime())); }, onStop: function (clip) { mediaStop(pageName + ' : ' + clipTitle, parseInt(this.getTime())); }, onFinish: function (clip) { mediaDone(pageName + ' : ' + clipTitle, parseInt(this.getTime())); $.fancybox.close(); } } }); } }); //// END FANCYBOX try { //Contact Executive Module $('.contact-exec.module li a.exec-loc').click(function () { $(this).parent().siblings().find('.contact-info').not(':hidden').slideUp(); $(this).siblings().slideToggle(); return false; }); } catch (err) { } //added by Booth for share us menu //Share Social StickyScroll try { $('#sharemenu').containedStickyScroll({ unstick: false, closeChar: '' }); } catch (err) { } $('#sharemenu').parent().height($('#sharemenu').parents('.row').height() - 200); //removed the -num // #main Random Background Images for static only var bgImagePool = { "full-time": ["full-time-1.jpg", "full-time-2.jpg", "full-time-3.jpg"], "exec-mba": ["exec-mba-1.jpg", "exec-mba-2.jpg", "exec-mba-3.jpg"], "evening": ["evening-1.jpg", "evening-2.jpg", "evening-3.jpg"], "weekend": ["weekend-1.jpg", "weekend-2.jpg", "weekend-3.jpg"], "phd": ["phd-1.jpg", "phd-2.jpg"], "summer-scholars": ["sbsp-1.jpg", "sbsp-2.jpg", "sbsp-3.jpg"], "alumni": ["alumni-1.jpg"], "newsroom": ["newsroom-1.jpg"], "reconnect": ["reconnect-1.jpg"] }; var pathArray = window.location.pathname.split('/'); if ($.isArray(bgImagePool[pathArray[2]])) { $('#main').css({ 'background-image': 'url(/css/img/main-bgs/' + bgImagePool[pathArray[2]][Math.floor(Math.random() * bgImagePool[pathArray[2]].length)] + ')' }); } else if (pathArray[1] == "search.aspx") { $('#main').css({ 'background-image': 'url()' }); } else if(pathArray[1]=="alumni"){} else { $('#main').css({ 'background-image': 'url()' }); } $("label.infield").inFieldLabels(); // Breadcrumb Helper var breadcrumbItems = $('.breadcrumbs li'); breadcrumbItems.each(function (i) { $(this).css("z-index", breadcrumbItems.length - i); }); // Footer (must use window load because of @font-face and height calc) $(window).load(function () { var footerPanels = $('#footer .connect .panel'), footerSocialLinks = $('#footer .social a'); footerSocialLinks.first().addClass("active"); footerSocialLinks.on("click mouseover", function (e) { e.preventDefault(); footerSocialLinks.removeClass("active"); var filterVal = $(this).attr("class"), activeFooterPanel = footerPanels.filter('.' + filterVal); footerPanels.hide(); activeFooterPanel.show(); $(this).addClass("active"); footerPanels.parent().stop().animate({ height: activeFooterPanel.outerHeight() + 'px' }, 200); }); }); // Tabs $('.nav-tabs-holder.paneled').panelTabs(); // Table Sort var sortTables = $('table .type-int, table .type-string').addClass("sort").closest('table').addClass("sortable"); sortTables.stupidtable(); sortTables.on("click", "th.sort", function (e) { e.preventDefault(); var clickedHeading = $(this); clickedHeading.addClass("sorted").siblings("th").removeClass("sorted asc desc"); if (clickedHeading.hasClass("asc")) { clickedHeading.removeClass("asc").addClass("desc"); } else { clickedHeading.removeClass("desc").addClass("asc"); } }); // Homepage Feature $('#feature-slider').xl({ slideShowSpeed: 1000, transitionEffect: 'fade', sequenceMode: 'normal', anchoring: 'left center', anchoringImg: 'left center', after: function (slide) { $('.discussion-pane', slide).jScrollPane(); } //Callback: function(slider) - Fires after each slider animation completes }); // Image Gallery $('.flexslider.image-gallery').flexslider({ animation: "fade", //String: Select your animation type, "fade" or "slide" slideDirection: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical" slideshow: false, //Boolean: Animate slider automatically slideshowSpeed: 3000, //Integer: Set the speed of the slideshow cycling, in milliseconds animationDuration: 600, //Integer: Set the speed of animations, in milliseconds directionNav: false, //Boolean: Create navigation for previous/next navigation? (true/false) controlNav: true, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage keyboardNav: true, //Boolean: Allow slider navigating via keyboard left/right keys mousewheel: false, //Boolean: Allow slider navigating via mousewheel prevText: "Previous", //String: Set the text for the "previous" directionNav item nextText: "Next", //String: Set the text for the "next" directionNav item pausePlay: false, //Boolean: Create pause/play dynamic element pauseText: 'Pause', //String: Set the text for the "pause" pausePlay item playText: 'Play', //String: Set the text for the "play" pausePlay item randomize: false, //Boolean: Randomize slide order slideToStart: 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide) animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended. pauseOnHover: true, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering controlsContainer: "", //Selector: Declare which container the navigation elements should be appended too. Default container is the flexSlider element. Example use would be ".flexslider-container", "#container", etc. If the given element is not found, the default action will be taken. manualControls: "", //Selector: Declare custom control navigation. Example would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs. start: function () { }, //Callback: function(slider) - Fires when the slider loads the first slide before: function () { }, //Callback: function(slider) - Fires asynchronously with each slider animation after: function () { }, //Callback: function(slider) - Fires after each slider animation completes end: function () { } //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous) }); // Video Gallery $('.flexslider.video-gallery').flexslider({ animation: "slide", //String: Select your animation type, "fade" or "slide" slideDirection: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical" slideshow: false, //Boolean: Animate slider automatically animationDuration: 600, //Integer: Set the speed of animations, in milliseconds directionNav: true, //Boolean: Create navigation for previous/next navigation? (true/false) controlNav: false, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage keyboardNav: true, //Boolean: Allow slider navigating via keyboard left/right keys mousewheel: false, //Boolean: Allow slider navigating via mousewheel prevText: "Previous", //String: Set the text for the "previous" directionNav item nextText: "Next", //String: Set the text for the "next" directionNav item minItems: 3, animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end controlsContainer: "", //Selector: Declare which container the navigation elements should be appended too. Default container is the flexSlider element. Example use would be ".flexslider-container", "#container", etc. If the given element is not found, the default action will be taken. manualControls: "", //Selector: Declare custom control navigation. Example would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs. start: function () { }, //Callback: function(slider) - Fires when the slider loads the first slide before: function () { }, //Callback: function(slider) - Fires asynchronously with each slider animation after: function () { }, //Callback: function(slider) - Fires after each slider animation completes repositionTooltips(); end: function () { } //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous) }); $('.flexslider.video-gallery .sub-slide').on("click", "a", function (e) { e.preventDefault(); //$('.video-holder').find('iframe').attr("src", $(this).data("videosrc")); //FPclipTitle = $(this).data("name"); //FPpageName = window.location.pathname; $(this).parent().addClass("selected").siblings().removeClass("selected"); if ($('html').hasClass("touch") == false) { $f('vid-disp').stop(); $('#vid-disp').hide(); $('#flowplayer').show(); } $('#flowplayer').attr("href", $(this).attr("href")).data("name", $(this).data("name")).find('img').attr("src", $(this).find('img').attr("src").replace("_thumb", "")); }); $('#flowplayer').click(function () { if ($('html').hasClass("touch") == false) { $(this).hide(); $('#vid-disp').show(); var vidu = $(this).attr("href"); FPclipTitle = $(this).data("name"); FPpageName = window.location.pathname; $f("vid-disp", { src: "http://scripts.chicagobooth.edu/flowplayer/flowplayer.commercial-3.2.15.swf" }, { key: '#$3928646d7fbd6b51616', clip: { url: vidu, autoPlay: true, onBegin: function (clip) { }, onStart: function (clip) { mediaInit(FPpageName + ' : ' + FPclipTitle, parseInt(clip.fullDuration), playerName); }, onPause: function (clip) { mediaStop(FPpageName + ' : ' + FPclipTitle, parseInt(this.getTime())); }, onResume: function (clip) { mediaResume(FPpageName + ' : ' + FPclipTitle, parseInt(this.getTime())); }, onBeforeSeek: function (clip) { mediaStop(FPpageName + ' : ' + FPclipTitle, parseInt(this.getTime())); }, onSeek: function (clip, endtime) { mediaResume(FPpageName + ' : ' + FPclipTitle, parseInt(this.getTime())); }, onStop: function (clip) { mediaStop(FPpageName + ' : ' + FPclipTitle, parseInt(this.getTime())); }, onFinish: function (clip) { mediaDone(FPpageName + ' : ' + FPclipTitle, parseInt(this.getTime())); } } }); return false; } }); // Static site Flowplayer Implementation // var FPclipTitle = $('#flowplayer').data("name"); if ($('#flowplayer').length !== 0) { $f("vid-disp", { src: "http://scripts.chicagobooth.edu/flowplayer/flowplayer.commercial-3.2.7.swf", wmode: 'opaque' }, { //flowplayer vid-disp key: '#$3928646d7fbd6b51616', clip: { autoPlay: true, scale: true, onBegin: function (clip) { }, onStart: function (clip) { mediaInit(FPpageName + ': ' + FPclipTitle, parseInt(clip.fullDuration), playerName); }, onPause: function (clip) { mediaStop(FPpageName + ': ' + FPclipTitle, parseInt(this.getTime())); }, onResume: function (clip) { mediaResume(FPpageName + ': ' + FPclipTitle, parseInt(this.getTime())); }, onBeforeSeek: function (clip) { mediaStop(FPpageName + ': ' + FPclipTitle, parseInt(this.getTime())); }, onSeek: function (clip, endtime) { mediaResume(FPpageName + ': ' + FPclipTitle, parseInt(this.getTime())); }, onStop: function (clip) { mediaStop(FPpageName + ': ' + FPclipTitle, parseInt(this.getTime())); }, onFinish: function (clip) { mediaDone(FPpageName + ': ' + FPclipTitle, parseInt(this.getTime())); } } }); } /* Mega Menu Helpers */ // Mega Menu Hover Intent $(".site-nav li.has-drop").hoverIntent({ sensitivity: 7, interval: 100, timeout: 200, over: function () { var listItem = $(this); //listItem.addClass("hover").find('.mm-drop').fadeIn(200, function(){ listItem.find('.mm-drop').show(0, function () { listItem.addClass("hover"); }); }, out: function () { var listItem = $(this); listItem.find('.mm-drop').fadeOut(100, function () { //listItem.find('.mm-drop').hide(0, function(){ listItem.removeClass("hover"); }); } }); // Mega Menu Height Columns var mmcolumns = $('.mm-drop-container').find('.subnav'); for (var i = 0; i < mmcolumns.length; i++) { var section = mmcolumns[i].children; for (var j = 0; j < section.length; j++) { section[j].style.height = section[j].clientHeight + 'px'; } } // Mega Menu Border var mmtallestProgramsSecondRow = 0, mmtallestProgramsFirstRow = 0, mmtallestAboutUs = 0, mmcolumnsDl = $('.mm-drop-container').find('.subnav dl'); //Get the max maximum height in About Us Nav for (var i = 0; i < 5; i++) { var section = mmcolumnsDl[i]; if (section != null && mmtallestAboutUs < section.clientHeight) mmtallestAboutUs = section.clientHeight; } //Set the height to maximum height for (var k = 0; k < 5; k++) { if (mmcolumnsDl[k] != null) mmcolumnsDl[k].style.height = mmtallestAboutUs + 'px'; } //For the first row of Programs, Get the maximum height for (var i = 5; i < 9; i++) { var section = mmcolumnsDl[i]; if (section != null && mmtallestProgramsFirstRow < section.clientHeight) mmtallestProgramsFirstRow = section.clientHeight; } //For the first row of Programs, set the maximum height for (var k = 5; k < 9; k++) { if (mmcolumnsDl[k] != null) mmcolumnsDl[k].style.height = mmtallestProgramsFirstRow + 'px'; } //For the second row of Programs, Get the maximum height for (var i = 9; i < mmcolumnsDl.length; i++) { var section = mmcolumnsDl[i]; if (section != null && mmtallestProgramsSecondRow < section.clientHeight) mmtallestProgramsSecondRow = section.clientHeight; } //For the second row of Programs, set the maximum height for (var k = 9; k < mmcolumnsDl.length; k++) { if (mmcolumnsDl[k] != null) mmcolumnsDl[k].style.height = mmtallestProgramsSecondRow + 'px'; } // Exchange Debate Gallery $('.flexslider.exchange-debate-gallery').flexslider({ animation: "slide", //String: Select your animation type, "fade" or "slide" slideDirection: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical" slideshow: false, //Boolean: Animate slider automatically animationDuration: 600, //Integer: Set the speed of animations, in milliseconds directionNav: true, //Boolean: Create navigation for previous/next navigation? (true/false) controlNav: true, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage keyboardNav: true, //Boolean: Allow slider navigating via keyboard left/right keys mousewheel: false, //Boolean: Allow slider navigating via mousewheel prevText: "Previous", //String: Set the text for the "previous" directionNav item nextText: "Next", //String: Set the text for the "next" directionNav item animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end controlsContainer: ".debate-nav-container", //Selector: Declare which container the navigation elements should be appended too. Default container is the flexSlider element. Example use would be ".flexslider-container", "#container", etc. If the given element is not found, the default action will be taken. manualControls: "", //Selector: Declare custom control navigation. Example would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs. start: function () { }, //Callback: function(slider) - Fires when the slider loads the first slide before: function (slider) { $('.debate-slide-overlay').fadeOut('slow', function () { }); }, //Callback: function(slider) - Fires asynchronously with each slider animation after: function (slider) { $(slider.slides[slider.currentSlide]).find('.debate-slide-overlay').fadeIn('slow', function () { }); }, //Callback: function(slider) - Fires after each slider animation completes end: function () { } //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous) }); // FAQ toggle woggles $('.faq-query').on("click", function (e) { e.preventDefault(); var tt = $(this).closest('.faq-pair'); tt.toggleClass("active"); $('.faq-pair').not(tt).removeClass("active"); $('.faq-pair').not(tt).find(".toggle-text span").text("Show"); var ttxtVal = tt.is('.active') ? 'Hide' : 'Show'; tt.find('.toggle-text span').text(ttxtVal); }); $("ul.faq-links li a").click(function () { var ec = $(this).attr("href"); var dc = $(ec).offset().top; /* $("html:not(:animated),body:not(:animated)").animate({scrollTop: dc-15}, 1000); */ return false; }); /* TOOLTIPS ------------ */ var repositionTooltips = function () { }; if ($('html').hasClass("touch") === false) { $(this).tooltips(); repositionTooltips = function () { $.fn.tooltips("reload"); //$.fn.tooltips("init"); } } var datelineArray = $(".dateline-holder").children(); var currentDateline; for (i = 0; i < datelineArray.length; i++) { currentDateline = datelineArray[i]; if ($(".timeline-right .datebox").height() < $(".timeline-left .datebox").height()) { $(currentDateline).addClass("right-dateline"); $(".timeline-right .datebox").append(currentDateline) } else { $(currentDateline).addClass("left-dateline"); $(".timeline-left .datebox").append(currentDateline) } } /* TIMELINE ------ */ //HACK - for height adjustment for left timeline container if ($(".timeline-left .datebox").height() > $(".timeline-right .datebox").height()) { $(".timeline-right .datebox").height($(".timeline-left .datebox").height - $(".timeline .timeline-right .datebox").css("padding-top")) } // Reveal Lightbox with iframe handler to clear/remove lingering iframe var revealWithIframe = $(".lightbox-content iframe").closest(".reveal-modal"); revealWithIframe.bind("reveal:close", function () { $(this).find(".lightbox-content iframe").attr("src", ""); }); revealWithIframe.bind("reveal:open", function () { var vid = $(this).find(".lightbox-content").data("videosrc"); $(this).find(".lightbox-content iframe").attr("src", vid); }); $(".reveal-modal").appendTo("body"); $('.exchange-topic .exchange-topic-comments .discussion-pane').jScrollPane(); // Exchange Opinion Click Handler $(".opinion-read").click(function (event) { var target = "#" + $(event.currentTarget).parents(".opinion-list-item").data("fullOpinion"); $(".exchange-topic-overlay").fadeIn('slow', function () { }); $(target).animate({ left: '0' }, 500, function () { }); //Exchange scrollbar initialize $('.exchange-topic .exchange-topic-overlay .discussion-pane').jScrollPane(); }); //Exchange Opinion Close Click Handler $(".opinion-close").click(function () { $(".exchange-topic-opinion").animate({ left: '-1600' }, 500, function () { }); $(".exchange-topic-overlay").fadeOut('slow', function () { }); }); //Program Dropdown Change Handler $('.concentrations').change(function (evt) { window.location = $(this).find('option:selected').data('url'); }); /* // Maps Code var gmapsModule = (function () { // privates var markers = []; var map, infoWin, infoBox, markerImage = '/img/map-marker.png', //bounds = new google.maps.LatLngBounds(),======================================== //center = new google.maps.LatLng(0, 0), mapOptions = { zoom: 10, //center: center,========================================== //mapTypeId: google.maps.MapTypeId.ROADMAP }; // InfoBox Stuff var infoBoxOptions = { content: "" , disableAutoPan: false , maxWidth: 0 //, pixelOffset: new google.maps.Size(-160, -230)===================================== , zIndex: null , boxClass: "infobox" , boxStyle: { width: "320px" } , closeBoxMargin: "10px 22px 0 0" , closeBoxURL: "/img/map-infobox-close.png" //, infoBoxClearance: new google.maps.Size(12, 12)===================================== , isHidden: false , pane: "floatPane" , enableEventPropagation: false }; function attachInfo(marker) { google.maps.event.addListener(marker, 'click', function () { //infoWin.setContent(marker.info); //infoWin.open(map, marker); infoBox.setContent(marker.info); infoBox.open(map, marker); }); } // Return an object exposed to the public return { init: function (el) { map = new google.maps.Map(el, mapOptions); //infoWin = new google.maps.InfoWindow({ maxWidth: 300 }); infoBox = new InfoBox(infoBoxOptions); for (var i = 0; i < gmapsLocs.length; i++) { var loc = gmapsLocs[i]; var myLatlng = new google.maps.LatLng(loc[1], loc[2]); var marker = new google.maps.Marker({ map: map, animation: google.maps.Animation.DROP, title: loc[0], position: myLatlng, zIndex: loc[3], icon: loc[4], shadow: loc[5] }); marker.info = loc[6]; bounds.extend(myLatlng); attachInfo(marker); } if (gmapsLocs.length == 1) { map.setCenter(bounds.getCenter()); map.setZoom(14); } else { map.fitBounds(bounds); } } }; } ()); // Use GMAPS Module var mapDOM = $('.gmaps')[0]; if (mapDOM) { google.maps.event.addDomListener(window, 'load', gmapsModule.init(mapDOM)); } */ //used to fill xml charts $("#ft-events-asia").load('/programs/full-time/admissions/events/includes/ft-events-asia.aspx'); $("#ft-events-europe").load('/programs/full-time/admissions/events/includes/ft-events-europe.aspx'); $("#ft-events-latin-america").load('/programs/full-time/admissions/events/includes/ft-events-latin-america.aspx'); $("#ft-events-middle-east").load('/programs/full-time/admissions/events/includes/ft-events-middle-east.aspx'); $("#ft-events-north-america").load('/programs/full-time/admissions/events/includes/ft-events-north-america.aspx'); //evening event calendar feeds $("#ew-events-info-sessions").load('/programs/evening/admissions/events/includes/ew-events-info-sessions.aspx'); $("#ew-events-diversity").load('/programs/evening/admissions/events/includes/ew-events-diversity.aspx'); $("#ew-events-receptions").load('/programs/evening/admissions/events/includes/ew-events-receptions.aspx'); $("#ew-events-conversations").load('/programs/evening/admissions/events/includes/ew-events-conversations.aspx'); //EXP $("#exec-events-asia").load('/programs/exec-mba/admissions/events/includes/exec-events-asia.aspx'); $("#exec-events-diversity").load('/programs/exec-mba/admissions/events/includes/exec-events-diversity.aspx'); $("#exec-info-sessions").load('/programs/exec-mba/admissions/events/includes/exec-info-sessions.aspx'); $("#exec-info-sessions-na").load('/programs/exec-mba/admissions/events/includes/exec-info-sessions-na.aspx'); $("#exec-exp-days").load('/programs/exec-mba/admissions/events/includes/exec-exp-days.aspx'); $("#exec-road-shows-na").load('/programs/exec-mba/admissions/events/includes/exec-road-shows-na.aspx'); //used to updated the upcoming event feeds $("#full-time-feed").load('/programs/full-time/admissions/events/includes/ft-upcoming-events.aspx'); $("#evening-feed").load('/programs/evening/admissions/events/includes/eve-upcoming-events.aspx'); $("#exec-mba-feed").load('/programs/exec-mba/admissions/events/includes/exec-upcoming-events.aspx'); $("#weekend-feed").load('/programs/weekend/admissions/events/includes/wkd-upcoming-events.aspx'); //agency saved this feed with a space });