function bootCollapse() { $('.collapse:not(.in)').css('height',0); } function stripOutNestedUl() { $('#mainNav li:not(:has(a))').remove() $('#mainNav ul:not(:has(li))').remove(); } function dupeTopAsFirstChild() { $('#mainNav > li').each(function() { var $this = $(this); $this.clone().prependTo($this.find('>ul')); $this.find('>ul>li:first>a:eq(1)').remove(); $this.find('>ul>li:first,>ul>li:first>a').removeClass(); $this.find('>ul>li:first>a').removeAttr('data-target').removeAttr('data-toggle').wrap('

'); }); } function stripWcmShimFromAccordion() { $accord = $('ul.tabTarget > li > div.wcmshim:empty'); if ($accord.length > 0) { $accord.parent().next().addClass('current').prev().remove(); } } function identifyLastAccordionHeader() { // Why set id and not class? I think this is very old $('div.accordion:not([id]) > div:last-child').prev().attr('id','acc_last'); } function setNavState() { var topNav = $("#mainNav > li"); var currentNav,deepNav,currentLoc = document.location.href.replace(/.*\/\//,'').replace(/index\.html/,'').substring(document.domain.length); if($("#menu li.selected").length > 0) { currentNav = $("#mainNav > li.selected"); deepNav = currentNav.find('.selected:last'); } else { currentNav = topNav.filter(function() { return currentLoc.indexOf($(this).children('a').attr('href')) != -1; }); deepNav = currentNav.find(':not(.alias):has(>a[href="'+currentLoc+'"]):first'); } currentNav.addContextNavs(deepNav); } function keepFooterBelowLeftNav() { var lh = $('.leftCol').height(), wh = $('#wrapper').height(); if (wh < lh) { $('#wrapper').append('
'); } } function appendQuickNavThenSort() { var quickNav = $(".audience ul li:last").prevAll(); $('
  • Educator Resources
  • ').insertBefore(quickNav.last()); // $('
  • FashionClub.com
  • ').insertAfter(quickNav.last()); $(".audience ul li:lt("+quickNav.length+")").sortElements(); } function addSidebarFrames() { $('.rightCol > aside').addClass('sidebar') $('.sidebar').each(function() { $this = $(this); var inner = $('
    ').append('').append($this.html()) $this.html(inner); }) } function nestOptionalCourses() { if (typeof(curricOR) !== 'undefined') { $(curricOR.key).each(function(i) { var pkey = this; $('div.accordion').each(function(j) { var $accrd = $(this); var $ORs = $('
    '); var $pivot = $accrd.find('>div.accordion-group:has(.list-category:contains("'+pkey+'"))'); $(curricOR[pkey]).each(function(k) { var ORkey = this; var $OR = $accrd.find('>div.accordion-group:has(.list-category:contains("'+ORkey+'"))'); if ($OR.length && curricOR['supress'+(j+1)] && curricOR['supress'+(j+1)].indexOf(ORkey) >= 0) { var repl = new RegExp(',?'+ORkey,'i'); curricOR[pkey] = curricOR[pkey].join(',').replace(repl,'').replace(/^,/,'').split(','); if (!curricOR[pkey][0]) curricOR[pkey] = []; $pivot.find('.list-title').text($pivot.find('.list-title').text()+' -OR-') $OR.addClass('curricOR'); if ( k < curricOR[pkey].length - 1 ) { $OR.find('.list-title').text($(this).text()+' -OR-'); } else { $OR.find('h5:last').empty(); } $ORs.append($OR); } }) $pivot.after($ORs.html()); }) }) } } function listenToPanedTabs() { $(".tabbable:has(.tab-pane) .nav-tabs a, .tabbable:has(.tab-pane) .nav-pills a").click(function (e) { e.preventDefault(); $(this).tab('show'); }) } function initTabsAccordions() { // Might be old. Needed for accordion turndowns var tabCall=$('div.tabs,ul.nav-tabs,ul.nav-pills'); var accordionCall=$('div[id*="accordion"]'); if ( tabCall.length > 0 ) { tabCall.tabAccord(); } else if ( accordionCall.length > 0 ) { $('.accordion[id]').on('show hide', function (n) { $(n.target).siblings('.accordion-heading').find('.accordion-toggle i').toggleClass('icon-chevron-up icon-chevron-down'); }) } } function carouselFilmstrip() { var FLVfallback = (function FLVfallback(){ var player = {}; return { init: function init(id,src,sz,poster) { sz = sz || ['100%','100%']; if ( !player['player'+id] ) player['player'+id] player['player'+id] = new FAVideo(id,src,0,0,{ autoPlay:false, autoLoad:false, previewImagePath:poster}); player['player'+id].setSkinPath('/peripheral/assets/admissions/fidm_orange.swf'); player['player'+id].setSize(sz[0],sz[1]); player['player'+id].setSkinAutoHide(true); player['player'+id].play() }, teardown: function(objName) { objName = 'player'+objName; if (player[objName]) { player[objName].stop() delete(player[objName]) } } } })() $('.carousel').length && $('.carousel').carousel({interval:null}); if ($('.filmstrip .carousel').length) { $('.filmstrip .carousel-control').on('click', function(e) { var $this = $(this), $tab = $this.parent().parent().find('.nav-tabs li.active, .nav-pills li.active'), $lateral = $this.hasClass('left') ? $tab.prev() : $tab.next(); e.preventDefault(); $lateral.length && $lateral.find('a').click(); }) if ($().swipe) { //Enable swiping... $(".filmstrip").swipe( { //Generic swipe handler for all directions swipeLeft:function(event, direction, distance, duration, fingerCount) { $('.right.carousel-control',this).click(); }, swipeRight: function() { $('.left.carousel-control',this).click(); }, //Default is 75px, set to 0 for demo so any distance triggers swipe threshold:75 }); } $('.filmstrip .tabbable').scrollLeft(-($('.filmstrip .tabbable .nav-tabs, .filmstrip .tabbable .nav-pills').offset().left - $('.filmstrip .tabbable').offset().left - ($('.filmstrip .tabbable').width()*2)))//*1.5 + $('.filmstrip .tabbable .nav-tabs li:first, .filmstrip .tabbable .nav-pills li:first').width()*.5 $('.filmstrip .nav-tabs a, .filmstrip .nav-pills a').click(function (e) { var $this = $(this), $li = $this.parent(), $ul = $li.parent(), $crop = $ul.parent(), $carousel = $li.parent().parent().parent().find('.carousel'), $art = $carousel.eq(0).find('.item.art:eq(0)'); $ul.css({width: ($li.width() * $ul.find('li').length) + 14}); artSz = $art.length ? [ $art.width(), $art.height() ] : ['100%','100%'], $carouselIn = $carousel.eq(0).find('.carousel-inner'), carouselSz = [$carouselIn.width(), ( $carouselIn.height() > $carouselIn.width()*0.1 && $carouselIn.height() > $carouselIn.width()*0.5625 ) ? $carouselIn.height() : $carouselIn.width()*0.5625], currSlide = $li.prevAll().length, //slidemid = ($crop.width()*.5) - ($li.width()*.5), leftJustify = $li.offset().left - $ul.offset().left + $crop.width(), e.preventDefault(); $carousel.eq(0).find('.compound').css({minWidth:artSz[0]});//,minHeight:artSz[1]; $crop.animate({scrollLeft: leftJustify});// - slidemid //add slidemid back to center $(this).tab('show'); $carousel.carousel(currSlide); }) } else { $('.carousel:not(.slideshow)').on('click', '.item.link:has(a)', function() { $(this).find('a')[0].click() }).find('.item:has(a)').addClass('link').find("a").each(function(i) {this.href=this.href+"?icid=slide";}) } if ($('.carousel:not(.slideshow)').length) { var $carousel = $('.carousel:not(.slideshow)'); $carousel.each(function(i) { var $this = $(this), artWidth = $this.find('.item img:eq(0)').attr('width') || 640; $this.find('.item').map(function(j) { $this.find('ol.carousel-indicators').append('
  • '); }); $this.find('ol.carousel-indicators li:eq(0)').addClass('active'); $this.find('.carousel-control').attr('href','#'+$this.attr('id')); $this.css('maxWidth',artWidth+'px'); }) if ($().swipe) { //Enable swiping... $(".carousel").swipe( { //Generic swipe handler for all directions swipeLeft:function(event, direction, distance, duration, fingerCount) { $('.right.carousel-control',this).click(); }, swipeRight: function() { $('.left.carousel-control',this).click(); }, //Default is 75px, set to 0 for demo so any distance triggers swipe threshold:75 }); } $carousel.on('slide', function() { var $thisCarousel = $(this).closest('.carousel'), $iframe = $thisCarousel.find('.item.rich.active iframe'); if ( $iframe.length > 0 ) { $iframe[0].contentWindow.postMessage( {"method":"pause"}, 'https://player.vimeo.com/' ) } var $videoActive = $thisCarousel.find('.item.active video'), $videoFlashActive = $videoActive.find('.flashplay'); if ($videoActive.length > 0) { IEvid && FLVfallback.teardown($videoFlashActive.attr('id')) || $videoActive[0].pause && $videoActive[0].pause(); } }) $carousel .on('click', '.item video', function() { this.play() }) if (IEvid) { var $flashinit = $('.carousel .item.active video .flashplay'); var initSz = []; initSz.push($flashinit && $flashinit.closest('.carousel-inner').width() || 0) initSz.push(initSz[0]*0.5625); FLVfallback.init($flashinit.attr('id'),$flashinit.data('src'),initSz,$flashinit.attr('poster')) }; } } function anchorLinkToTabs() { var tabprefix = "tab_"; // Javascript to enable link to tab $('.nav-tabs a, .nav-pills a').on('shown',function() { var newhash = this.href.replace(/[^#]*(#.*)/,"$1"); var $newhashPane = $(newhash); window.location.hash = '#'+tabprefix+newhash.substring(1); if ($(window).height()<$(this).offset().top-$(window).scrollTop()) { $('html,body').animate({scrollTop:$(this).offset().top}, 'fast') } }) var hash = document.location.hash; if (document.location.hash.substring(1,5) === tabprefix) { var decodedHash = hash.replace(tabprefix,"") var $hashPane = $(decodedHash) var $hashTab = $('.nav-tabs a[href='+decodedHash+'], .nav-pills a[href='+decodedHash+']') if ( $hashTab.length ) { if ( $hashTab.parents('.filmstrip').length ) { $hashTab.click(); } else { $hashTab.tab('show'); } } } } function modalVideoPlayer() { var $modalVideo = $('.modal:has(.flashplay)') if (IEvid) { var $flashDiv = $modalVideo.find('.flashplay'); $modalVideo.each(function() { $(this).on('shown', function() { var fwidth = $modalVideo.find('.modal-body').width() FLVfallback.init( $flashDiv.attr('id'), $flashDiv.data('src'), [fwidth,fwidth*0.5625], $modalVideo.find('video').attr('poster') ) }).on('hide', function() { FLVfallback.teardown($flashDiv.attr('id')); }) }) } $('.modal').on('hidden', function () { $vid = $(this).find('video'); $vid[0].pause && $vid[0].pause(); }) } function hideNestedClassHover() { $("*:hover > .hover").css("display","none"); } function convertDropdownToDrawers() { $('#menu .nav:not(.pull-right) .dropdown-menu').each(function() { var $this = $(this); // var $thisli = $this.addClass('unit size1of4').find('>li') var $thisli = $this.find('>li:not(.weak)'); $this.find('ul').remove(); var splitter = Math.ceil($thisli.length/4); var newDiv = $(''); newDiv.insertBefore($this); $this.find('>li:lt('+splitter+')').remove().appendTo(newDiv.find('ul:eq(0)')); $this.find('>li:lt('+splitter+')').remove().appendTo(newDiv.find('ul:eq(1)')); $this.find('>li:lt('+splitter+')').remove().appendTo(newDiv.find('ul:eq(2)')); $this.remove().appendTo(newDiv); }) } function addDegreeLabels() { $('#menu .promote div.dropdown-menu > ul > li > a').each(function() { $(this).append(''); }) } function navDegreeToggle(focus) { var $liDegree = $('.leftCol .nav-collapse') var focused = new RegExp(focus+',?'); /* var hiddendegrees = ',aa,adv,b' hiddendegrees = hiddendegrees.replace(focused,'').substring(1).split(',') $(hiddendegrees).each(function(i) { $liDegree.removeClass('degree-'+hiddendegrees[i]) }) $liDegree.addClass('degree-' +focus);*/ $liDegree.toggleClass('degree-' +focus); var cookieVal = $.cookie('degree') || ''; cookieVal = cookieVal.replace(focused,'').replace(/(.),$/,'$1'); var cookieArr = cookieVal.substring(1).split(','); if (cookieVal === ',' && !$liDegree.hasClass('degree-' + focus)) { $.removeCookie('degree',{path:'/'}); } else if (cookieArr.length > 1) { $liDegree.removeClass('degree-aa').removeClass('degree-adv').removeClass('degree-b'); $.removeCookie('degree',{path:'/'}); } else if ($liDegree.hasClass('degree-' + focus)) { var newVal = cookieVal + ',' + focus; newVal = newVal.replace(/,+/g,',') $.cookie('degree',newVal,{path:'/'}); } else { $.cookie('degree',cookieVal,{path:'/'}); } } function insertDegreeToggle() { if (document.location.href.toLowerCase().indexOf("/en/majors") !== -1){ $('.leftCol .nav-collapse').prepend('

    Majors by degree:

    ') $('.degree-focus [data-degree]').parent().click(function() {navDegreeToggle($("[data-degree]", this).data('degree'))}) var setVal = $.cookie('degree') || ','; setVal = setVal.substring(1).split(','); $(setVal).each(function(i) { $('.leftCol [data-degree="'+setVal[i]+'"]').parent().click(); }) } } function textSwap(jqobj,msg,limit) { if (limit!=null && msg.length > limit) msg = msg.substring(0,limit) + '…'; $(jqobj).html(msg); } function disableIt() { for (i=0;i<(a=disableIt.arguments).length;i+=2) { $("#" + a[i]).get(0).disabled = a[i+1]; } } function fixSearch() { var searchForm = $("#gs"); if (searchForm.length>0) { // searchForm.get(0).setAttribute('action','http://search.fidm.com/search'); searchForm.get(0).setAttribute('action','http://google.com/search'); searchForm.find('input[type="hidden"]').remove(); var inputArray = new Array() inputArray[inputArray.length] = new Array('as_sitesearch','fidm.edu') inputArray[inputArray.length] = new Array('hl','en') inputArray[inputArray.length] = new Array('lr','') for (j=0;j'); } }} function popAlert() { var msg = '

    IMPORTANT NOTICE:

    FIDM is continually working to improve our technology to better serve you. As part of this ongoing effort, we will be doing maintenance on this site starting Friday, December 12 at 4:00 PM (Pacific.) The site will be unavailable until Monday, December 15.

    We apologize for this inconvenience.

    '; $('body').append(msg); } function fixedBottomShareBar() { var $sharecount = $('#sharecount'); var shareCode = '
    '; shareCode += '
    ' /*shareCode += '';*/ shareCode += ''; shareCode += '
    '; // shareCode += ''; shareCode += '
    '; //shareCode += '
    '; //shareCode += '
    '; //shareCode += 'Share this page'; //shareCode += '
    '; /*setTimeout(function() { if ($sharecount.length > 0 && document.domain == 'fidm.edu' && Wibiya.data && Wibiya.data.mobileAgent ) {*/ $sharecount.css('backgroundColor','#F60'); $sharecount.append(shareCode); var $sharescript = $('