<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/************************ Vertical Tabs Starts ************************/
/* LAST UPDATE: 22/08/2019
   REASON: PROGRAM WIDGET - Add Slide In/Out Menu
*/
/************************ CONFIGURATION PLACES IN HERE ************************/
var mobileSize = 1400; //means 1415 in css
var lastWidgetPos = 0;
var minScreenHeight = 965; //* in order to work on abs and fix pos 965
/************************ END OF CONFIGURATION ************************/


/************************************************************************
	THESE ARE PATCH UPDATE TO THE WIDGET INC BUG FIXES.
	ALL PATCHES SHOULD BE PUTTING INSIDE HERE.
*************************************************************************/
function showProgramAvailabilityOnSm() {
	if($('#program-availability-sm-tbl').length) {

		var cloneAvailabilityTbl = $('#program-availability-lg-tbl').children().clone(true);
		if($(window).width() &lt;= mobileSize) { //* 1280 in css
			$('#program-availability-sm-tbl').html(cloneAvailabilityTbl);
		} else {
			$('#program-availability-sm-tbl').html('');
		}
	}
}

function fixWidgetOnSmallHeightScreen() { //* Solution to make the widget works on screen height below 765px
	if($(window).height() &lt;= minScreenHeight) {
		if($('.vertical-tab').hasClass('desktop-widget')) { //* check if widget is on desktop platform
			if($('.vertical-tab').css('position') == 'fixed') {
				$('.vertical-tab').css('position','absolute');
			}
			$('.vertical-tab-overlay').addClass('fixed').css({'overflow':'auto'});
		}
	}
}

function fixScrollOnAbsolutePos() { //* Fix the bugs when widget is on absolute pos

	if($('.vertical-tab').hasClass('mobile-widget')) { //* On Mobile
		if($('#anchor-mobile').length) {
			var anchor_mobile = $('#anchor-mobile').offset().top + 17;
			if($(window).scrollTop() &lt;= anchor_mobile) {
				if($('.vertical-tab').css('position') == 'absolute') {
					$('.vertical-tab').css({'position':'fixed'});
				}
			}
		}
	}
	else { //* On large screen
		if($(".scroller-anchor").length) {
			var scroller_anchor = $(".scroller-anchor").offset().top;
			if($(window).scrollTop() &gt;= scroller_anchor) {
				$('.vertical-tab').css({'position':'fixed'});
			}
		}
	}
}

function reduceWidgetPosOnDesktop() { //* Temporary fix to reduce the space on top of widget
	if($('.vertical-tab').hasClass('desktop-widget')) {

		if($('.vertical-tab').css('position') == 'fixed') {
			$('.vertical-tab').css({'padding-top':'0','top':'30px'});
		}
	}
}

function preventWidgetOverlapFooter() { //* This function will prevent widget overlap the footer
  if($('footer').length) {
    var footerPosition = $('footer').offset().top;
    var widgetHeight = $('.vertical-tab').outerHeight(true);
    if($('.vertical-tab').length) {
      var widgetPosition = $('.vertical-tab').offset().top + widgetHeight;
    }
    var shiftWidgetUp = footerPosition - widgetPosition;

    if(widgetPosition &gt;= footerPosition) { //* if widget overlaps footer then put widget on the top

       $('.vertical-tablinks').css({
         'position': 'relative',
       'top': shiftWidgetUp + 'px'
       });

    }
    else {

        $('.vertical-tablinks').css({
           'position':'relative',
           'top': 'unset',
           'top': 'auto'
        });
  }
  }
}

function fixAlignWidgetIcon() {
	if($('.vertical-tab').hasClass('mobile-widget') &amp;&amp; $('.vertical-tab').hasClass('horizontal-tab')) {
		$('.vertical-tablinks .tablinks span').css('display','none !important');
	}
}

function reduceTopWidgetSpacingOnAbs(canDo) { //* This will reduce 1/2 space above widget on absolute pos

	if($('.vertical-tab').hasClass('desktop-widget') &amp;&amp; !$('.vertical-tab').hasClass('small-screen-mode')) { //* Only check for desktop platform

		if($('.vertical-tab').css('position') == 'absolute') {
			if(canDo == true) { //* trigger when open the tab
				$('.vertical-tab').css({'padding-top':'20px'});
			} else { //* trigger when close the tab
				$('.vertical-tab').css({'padding-top':'40px'});
			}
		}
	}
}

function moveWidgetUpOnAbsForPathway(canDo) {
	if(canDo == true) {
		if($('.vertical-tab').hasClass('desktop-widget') &amp;&amp; $('.vertical-tab').css('position') == 'absolute') { //* only on small screen and on abs
	$('.vertical-tab-overlay').addClass('float-widget-on-abs-pathways');
		}

	} else {
		$('.vertical-tab-overlay').removeClass('float-widget-on-abs-pathways');
	}
}

function equalDivs(container) {
    var currentTallest = 0,
    currentRowStart = 0,
    rowDivs = new Array(),
    $el,
    topPosition = 0;
    $(container).each(function() {

        $el = $(this);
        $($el).height('auto')
        topPostion = $el.position().top;

        if (currentRowStart != topPostion) {
            for (currentDiv = 0 ; currentDiv &lt; rowDivs.length ; currentDiv++) {
                rowDivs[currentDiv].height(currentTallest);
            }
        rowDivs.length = 0; // empty the array
        currentRowStart = topPostion;
        currentTallest = $el.height();
        rowDivs.push($el);
        } else {
            rowDivs.push($el);
            currentTallest = (currentTallest &lt; $el.height()) ? ($el.height()) : (currentTallest);
        }
        for (currentDiv = 0 ; currentDiv &lt; rowDivs.length ; currentDiv++) {
            rowDivs[currentDiv].height(currentTallest);
        }
    });
}

/************************ END OF PATCHING ************************/

/* Slide In/Out Menu Feature. Go live after approved */
$(document).on('click', '#arrow-tab', function(e) {
	e.preventDefault();
	if($('.vertical-tab').hasClass('desktop-widget')) {
		if($(this).hasClass('show')) {

			$('.f-load').hide(function() {
				$('.arrow').css('transform','rotate(130deg)');
				$('#arrow-tab').removeClass('show');
			});
		} else {
			$('.f-load').show(function() {
				$('.arrow').css('transform','rotate(-45deg)');
				$('#arrow-tab').addClass('show');

			});
		}
	}
});

function hideWidgetText(mobileSize) { //* Hide widget text on screen less than mobileSize
		if($(window).width() &lt;= mobileSize) {
			$('a.tablinks').find('span').css('display','none');
			$('#arrow-tab').removeClass('show');
			$('#arrow-helptext-sm').hide();
		}
		else {
			//$('a.tablinks').find('span').css('display','inline-block');
		}
}

/* End Of Slide In/Out */

function pathWayTabArrow() { //* Toggle up and down arrow icon in pathway tab
	var tabCount = 0;
	$('body').on('click', '.pathway-tab-trans', function(e) {
	//$('.pathway-tab-trans').on('click', function(e) {
		//e.preventDefault();
		var arrow = $(this).find('.btn-pathway').find('.widget-arr &gt; em');
		var scrollTo = $(this).position().top;

		if($(this).find('.btn-pathway').hasClass('collapsed')) {
			arrow.removeClass('icon-chevron-down').addClass('icon-chevron-up');

			setTimeout(function(){
                $('#pathways.vertical-tabcontent').animate({
                    scrollTop: scrollTo
                }, 800);
            }, 100);

		} else {
			arrow.removeClass('icon-chevron-up').addClass('icon-chevron-down');
		}
	});
}

function WidgetOnScreenState() {
	if($(window).width() &lt;= mobileSize) {
		$('.vertical-tab').addClass('mobile-widget').removeClass('desktop-widget');
	} else {
		$('.vertical-tab').addClass('desktop-widget').removeClass('mobile-widget');
	}
}

function stopBodyScrollingOnMobile (bool) { //* stop body scroll on mobile
	if(bool === true) {
		if($('.vertical-tab').hasClass('mobile-widget')) {
				$('body, html').addClass('no-scroll-on-mobile');
				$('.vertical-tab-overlay').css({
					'-webkit-overflow-scrolling':'touch',
				});
		} else {
			$('body, html').addClass('no-scroll-on-desktop');
		}
	}
	else {
		if($('.vertical-tab').hasClass('mobile-widget')) {
			$('.vertical-tab').css({'height':'auto'});
		}
		$('body, html').removeClass('no-scroll-on-mobile').removeClass('no-scroll-on-desktop');
	}
}

function restoreWidgetPos() {
	if($('.vertical-tab').hasClass('mobile-widget')) {
			$('html,body').animate({scrollTop: lastWidgetPos});
	}
}


function repositionWidgetOnMobile() {
	if($('.vertical-tab').hasClass('mobile-widget')) { //* On Mobile
		if($('#anchor-mobile').length) {
			var anchor_mobile = $('#anchor-mobile').offset().top + 17;
			if($(window).scrollTop() &gt;= anchor_mobile) {
				$('.vertical-tab').css({
					'position':'fixed',
					'top': '0px',
					'padding-top': '0',
				});
			} else {
				$('.vertical-tab').css({
					'position':'absolute',
					'top': anchor_mobile + 'px',
					'padding-top': '0',
				});
			}
		}

	} else { //* On Large screen

		if($(".scroller-anchor").length) {
			var scroller_anchor = $(".scroller-anchor").offset().top + 30;
			if ($(this).scrollTop() &gt;= scroller_anchor) {
	            $('.vertical-tab').css({
	                'position': 'fixed',
	                'top': '30px',
	                'height':'auto',
	                'padding-top':'0'
	    		});
		    }
		    else
		    {
		        $('.vertical-tab').css({
		            'position': 'absolute',
		            'top': 'initial',
		            'top': 'auto',
		            'padding-top': '40px' //Remember to change back to 40px in live site
				});
		        if($('.vertical-tab-overlay').hasClass('active')) { //* this needs to be applied only when the tab is openned.
			        reduceTopWidgetSpacingOnAbs(true);
		        }
		    }
		}
	}
}


function showWidgetArrow(obj) { //* show arrow if content is scrollable
	var innerHeight = $(obj).innerHeight();
	var scrollHeight = $(obj).prop('scrollHeight');
	if(innerHeight &lt; scrollHeight) {
		$(obj).find('.widget-arrow').fadeIn(500);
	}
}

function showToolTip() {
	//* simple powerful tooltip
	    $('.info-btn').each(function() { //* Tool tip function uses in Contact us Tab
		    var count_info_click = 0;
		   	$(this).on('click', function(e) {
			    e.preventDefault();

				var tooltipText = $(this).find('.tooltip-info').text($(this).attr('data-content'));
				if(count_info_click % 2 === 0){
					$(this).find('.tooltip-info').fadeIn(500);
				} else {
					$(this).find('.tooltip-info').fadeOut(500);
				}
				count_info_click = count_info_click + 1;
	    	});
	    });
}

function showTab (targetedTab) {
	//hideWidgetText(mobileSize);
	    if($('.vertical-tab').hasClass('desktop-widget')) { //* not trigger on mobile size

		    if(!$('.vertical-tab').hasClass('small-screen-mode')) {
			   	if ($('.vertical-tab').css('position') == 'absolute') {
					$('html,body').animate({scrollTop:parseInt($(".scroller-anchor").offset().top - 125)});
	    		}
		    }
	    }


	    $('.vertical-tabcontent').hide();
	    $('.vertical-tabcontent-holder').hide();
	    if (!targetedTab.hasClass("active")) {
/*
			if($('.vertical-tab').hasClass('horizontal-tab')) {
				$('.f-load').css('display','none');
			}
*/
	        $('.vertical-tab-overlay').addClass("active");
	        if ($('.vertical-tab').css('position') == 'fixed') {
	            $('.vertical-tab-overlay').addClass("fixed");
	        }
	        $('.vertical-tabcontent-holder').show();
	        $('.vertical-tab a').removeClass("active");

	        $('html, body').css({
		            'overflow-x': 'unset',
	        });

	        $('.vertical-tab').css('width', '100%');
	        stopBodyScrollingOnMobile (true)
	        targetedTab.addClass("active");
	        $displayDiv = $(targetedTab.attr('href'));
	        $($displayDiv).find('a[data-toggle="collapse"]').removeClass('active');
	        $($displayDiv).find('.collapse').removeClass('in').height(0);

	        if($(window).width() &lt;= mobileSize) { //* small screen like iphone plus
	            $displayDiv.css({
		                'height': 'calc(100vh - 28vh)',
					    'overflow': 'auto',
					    'display': 'block',
					    'max-height': 'unset'
	            });
	        }
	        else { //* larger screen size
		        var wheight = 0;
		        if($('.vertical-tab').css('position') == 'absolute' &amp;&amp; $('.vertical-tab').hasClass('small-screen-mode')) {
			        wheight = 200;
		        } else {
			        wheight = 250;
		        }
		        $displayDiv.css({
			        'max-height': $(window).height() - wheight + 'px',
			        'min-height': '500px'
			        });
	        }

	        reduceTopWidgetSpacingOnAbs(true);
	        $displayDiv.show();
	    }
	    else {
	        $('.vertical-tab').removeClass('horizontal-tab');
			restoreWidgetPos();
	        $('.vertical-tab a').removeClass("active");
	        $('.vertical-tab-overlay').removeClass("active");
	        $('.vertical-tab-overlay').removeClass("fixed");
	        stopBodyScrollingOnMobile (false)
	        $('.vertical-tab').css({'width': 'auto'});
	        if($(window).height() &lt;= minScreenHeight) {
		        $("html, body").animate({scrollTop: ($(window).scrollTop() + 1)});
	        }
			reduceTopWidgetSpacingOnAbs(false);
			moveWidgetUpOnAbsForPathway(false)
	    }
}


//* Start Window event
$(window).on('mousewheel DOMMouseScroll', function(event) { //* This to ensure func works on all browsers
	if( event.originalEvent.detail &gt; 0 || event.originalEvent.wheelDelta &lt; 0 ) {
    	hideWidgetText(mobileSize);
  	} else {
    	hideWidgetText(mobileSize);
  	}
});

$(window).on('touchmove', function() { //* event trigger only on mobile
	hideWidgetText(mobileSize);
});


$(window).on('resize', function() {
	setTimeout(WidgetOnScreenState(), 500);
	setTimeout(repositionWidgetOnMobile(), 1000);
	showProgramAvailabilityOnSm();
	equalDivs(".semester-pair .semester-group");
});

$(window).on("debouncedresize", function( event ) {
	reduceWidgetPosOnDesktop();
	if($('.vertical-tab').hasClass('desktop-widget')) {
		var wheight = 0;
	    if($('.vertical-tab').css('position') == 'absolute' &amp;&amp; $('.vertical-tab').hasClass('small-screen-mode')) {
	        wheight = 200;
	    } else {
	        wheight = 250;
	    }
		$('.vertical-tabcontent').css('max-height', $(window).height() - wheight + 'px');

		//add checking if screen height is less than minScreenHeight
		if($(window).height() &lt;= minScreenHeight) {
			$('.vertical-tab').addClass('small-screen-mode');
		} else {
			$('.vertical-tab').removeClass('small-screen-mode');
		}

	}
});

$(window).on('load', function() {

	if($( "#user_location" ).length) {
		//Auto complete for input field
		var available_countries = [];
		var api_countries = 'https://humber.ca/hq/api/Academic_equivalency/country_lists';
		$.ajax({
		method: "GET",
		url: api_countries,
		}).done(function(data) {
			for(var i=0; i &lt; data.length; i++) {
				available_countries.push(data[i].name);
			}
			//* Load resource to input fields

			$( "#user_location" ).autocomplete({
				source: available_countries
			});
		});
	}

})

$(window).scroll(function(e) {
	if($(".scroller-anchor").length) {
		var scroller_anchor = $(".scroller-anchor").offset().top;
	}
    preventWidgetOverlapFooter();
    repositionWidgetOnMobile();

});

$(document).on('click', function (e) { //* close tab whenever user click outside of tab area
            if ($('.vertical-tabcontent-holder').css('display') == 'block') {
                var widgetContent = $('.vertical-tablinks, a.tablinks,  .vertical-tabcontent-holder, .ui-autocomplete');

                if($(window).width() &gt; mobileSize) { //* apply to larger screen
	                if (!widgetContent.is(e.target) &amp;&amp; (widgetContent.has(e.target).length === 0)) {
                    	$('.vertical-tab .close-vertical-tabcontent').trigger('click');
                	}
	            }
            }

});

//* End Window event

$(function() {
	lastWidgetPos = 0;
	pathWayTabArrow();
	showProgramAvailabilityOnSm();
	setTimeout(WidgetOnScreenState(), 500);
	if($('.vertical-tab').hasClass('mobile-widget')) {
			repositionWidgetOnMobile();
	}
    if ($('.vertical-tab').length) {
        showToolTip();
	    //* Show tab content when url including #
        var hashIt = new HashStack(2, false);
        var currentHash = hashIt.get();
        if (currentHash) {
            var targetedTab =  $('.vertical-tab .vertical-tablinks a[href="#'+currentHash+'"]');
            setTimeout(showTab(targetedTab), 300);
        }

        $('.vertical-tab .vertical-tablinks').on('click', 'a', function (e) {
	        ga('send', 'event', 'Button', 'Click', $(this).attr('href') + ' widget tab - ' + program_name);
            if($(this).attr('href') == '#go-to-apprentice-link') {
		        $('.vertical-tab-overlay, .vertical-tabcontent-holder, .vertical-tabcontent').css('display','none');
		        e.preventDefault();
		        window.location.href = 'https://humber.ca/admissions/apply/apprenticeships.html';
	        }
	        else {
		        e.preventDefault();
	        }


			if($('.vertical-tab').hasClass('mobile-widget')) {
				$('#arrow-helptext-sm').hide();
				if(!$('.vertical-tab').hasClass('horizontal-tab')) {
					lastWidgetPos = $(window).scrollTop();
					$('.vertical-tab').addClass('horizontal-tab').css({
					'height':'100%'
                	});
                	fixScrollOnAbsolutePos();
				}
                $('.vertical-tabcontent-holder').css({
	                    'display': 'block',
					    'float': 'right',
					    'height': 'calc(100vh - 50px)',
					    'padding': '25px'
                });
            }
            else {
	             $('.vertical-tabcontent-holder').css({
	                'height':'auto',
	                'padding-bottom':'25px',
	                'float':'left'
                });
                $('.vertical-tab').removeClass('horizontal-tab');
            }
            moveWidgetUpOnAbsForPathway(true);
            showTab($(this));
            //fixScrollOnAbsolutePos();
            reduceWidgetPosOnDesktop();
			fixWidgetOnSmallHeightScreen();

        });

        $('.vertical-tab .close-vertical-tabcontent').on('click', function (e) {
            e.preventDefault();
            $('.vertical-tab a').removeClass("active");
            $('.vertical-tab').removeClass('horizontal-tab');
            restoreWidgetPos();
            $('.vertical-tabcontent-holder').slideUp();
            $('.vertical-tabcontent').slideUp();
            $('.vertical-tab-overlay').removeClass("active");
            $('.vertical-tab-overlay').removeClass("fixed");
			stopBodyScrollingOnMobile(false);
            $('.vertical-tab').css('width', 'auto');
            repositionWidgetOnMobile();
        });

        //detect location
        $('#findLocation').on('click', function(){
            $('.countryAddmissionReq').html('');
            $.ajax({
    		method: "GET",
    		url: 'https://humber.ca/site-config/get-location.html',
        	}).done(function(data) {
	        	var country = $(data).text();
            	$("input[name='user_location']").val(country);
            	$('#showCountryAddmissionReq').trigger('click');
            })
        });

        $('#showCountryAddmissionReq').on('click', function(){
	        $('.countryAddmissionReq').html('');
	        var degree_requirement_title = '&lt;p&gt;&lt;strong&gt;Admission to a Bachelorâ€™s Degree program&lt;/strong&gt;&lt;/p&gt;';
			var diploma_requirement_title = '&lt;p&gt;&lt;strong&gt;Admission to a Diploma program&lt;/strong&gt;&lt;/p&gt;';
			var graduate_requirement_title = '&lt;p&gt;&lt;strong&gt;&lt;span xss="removed"&gt;Admission to a Graduate Certificate program&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;';
			var college_certificate_title = '&lt;p&gt;&lt;strong&gt;&lt;span xss="removed"&gt;Admission to a Ontario College Certificate program&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;';
	        var academic_equivalencies_requirements = '';
	        //*default text
	        var academic_degree_default_txt = '&lt;p&gt;&lt;em&gt;To be eligible you must possess the equivalent of an Ontario Secondary School Diploma (OSSD) and required courses as noted in the course list.&lt;/em&gt;&lt;/p&gt;';
	        var academic_diploma_default_txt = '&lt;p&gt;&lt;em&gt;To be eligible you must possess the equivalent of an Ontario Secondary School Diploma (OSSD) and required courses as noted in the course list.&lt;/em&gt;&lt;/p&gt;';
	        var academic_graduate_default_txt = '&lt;p&gt;&lt;em&gt;To be eligible for admission you must possess a bachelorâ€™s degree or advanced diploma.&lt;/em&gt;&lt;/p&gt;';

            var userCountry = $.trim($("input[name='user_location']").val().toLowerCase());
            if ( userCountry ) {
                $.ajax({
            		method: "GET",
            		url: 'https://humber.ca/hq/api/Academic_equivalency/country/'+ userCountry,
            		success: function(data) {
		            	var academic_equivalencies_requirements = '';

		            			            	if(data.length &gt; 0 || data !== ""){

			            	if(data.requirements_diploma === null &amp;&amp; data.requirements_graduate === null &amp;&amp; data.requirements_degree === "") {
			            academic_equivalencies_requirements = '&lt;p&gt;Detection is showing that you are in Canada and will not work. Please type in your country of origin. If Canadian, use the Academic Requirements on the left.';	            	}
		            	else {
				            	if(program_type.search('Diploma') &gt; -1) {
								academic_equivalencies_requirements = (data.requirements_diploma === null || data.requirements_diploma === '') ? '&lt;p&gt;No requirements found for this country&lt;/p&gt;' : diploma_requirement_title + data.requirements_diploma + academic_diploma_default_txt;
								}
								else if(program_type.search('Ontario Graduate Certificate') &gt; -1 || program_type.search('Preparatory Semester') &gt; -1) {
									academic_equivalencies_requirements = (data.requirements_graduate === null || data.requirements_graduate === '') ? '&lt;p&gt;No requirements found for this country&lt;/p&gt;' : graduate_requirement_title + data.requirements_graduate + academic_graduate_default_txt;
								}
								else if(program_type.search('Ontario College Certificate') &gt; -1) {
									academic_equivalencies_requirements = (data.requirements_diploma === null || data.requirements_diploma === '') ? '&lt;p&gt;No requirements found for this country&lt;/p&gt;' : college_certificate_title + data.requirements_diploma + academic_diploma_default_txt;
								}
								else if(program_type.search('Degree') &gt; -1) {
									academic_equivalencies_requirements = (data.requirements_degree === null || data.requirements_degree === '') ? '&lt;p&gt;No requirements found for this country&lt;/p&gt;' : degree_requirement_title + data.requirements_degree + academic_degree_default_txt;
								}else {
									academic_equivalencies_requirements = '';
								}
		            		}

		            	} else {

			            	academic_equivalencies_requirements = '&lt;p&gt;No requirements found for this country.&lt;/p&gt;';

		            	}


                	$('.countryAddmissionReq').html(academic_equivalencies_requirements);
            		},
            		error: function(e) {
	            		if(e.status === 400) {
		            		$('.countryAddmissionReq').html('&lt;p&gt;Requirements are not available for this country.&lt;/p&gt;');
	            		}
            		}
            	});
            }
            else{
                $('#findLocation').trigger('click');
            }
        });
    }

});
/****** Vertical Tabs Ends ********/




/****** Imported from humber-corporate-menu.js ***/

$(document).ready(function () {
    $(document).on('click', '.refundLink', function(e){
        e.preventDefault();
        var content = $(this).attr('data-content');
        $.fancybox({
            'content' :content,
            'maxWidth': 1170,
            'height': 'auto',
            'autoSize': false
        });
    });

    $('select.program-date-select').change(function() {
		if($(this).val().length &gt; 0) {
			window.location = window.location.pathname+'?year='+$(this).val();
		} else {
			window.location = window.location.pathname;
		}
	});

	//local storage solution to close the humber corporate alert
    //if a change in the alert is detected php will insert some js to clear the flag
    //var object = {value: 0, expires: 0}//clear local storage - for testing
    //localStorage.setItem('humberCorporateAlertClosed', JSON.stringify(object));//clear local storage - for testing
	var humberCorporateAlertClosed = JSON.parse(localStorage.getItem('humberCorporateAlertClosed'));

    if (humberCorporateAlertClosed) {
        var humberCorporateAlertClosedExpires = humberCorporateAlertClosed.expires;
        var now = new Date().getTime().toString();

        //check and clear expires if needed
        if (humberCorporateAlertClosedExpires &lt; now) {
            var object = {value: 0, expires: 0}
            localStorage.setItem('humberCorporateAlertClosed', JSON.stringify(object));
            $('.humber-corporate-alert').show();
        }else{
            //ntd - alert is hidden from css
        }

        //reload var
        humberCorporateAlertClosed = JSON.parse(localStorage.getItem('humberCorporateAlertClosed'));

        if (humberCorporateAlertClosed.value == 1) {
            //ntd - alert should be hidden from css
        }else{
            $('.humber-corporate-alert').show();
        }

    }else{
        //alert should show by default if local storage empty
        $('.humber-corporate-alert').show();
    }
    $('.humber-corporate-alert-close-btn').click(function(e){
        e.preventDefault();
        $('.humber-corporate-alert').hide();
        var object = {value: 1, expires: new Date().getTime() + 24*3600000}
        //var object = {value: 1, expires: new Date().getTime()}
        localStorage.setItem('humberCorporateAlertClosed', JSON.stringify(object));
    });

    $('body').click(function() {
       if($('form input[type="search"]').width() &gt; 0) {
           if(!$('form input[type="search"]').is(':focus')) {
                $('form#search-form input[type="search"]').css({
                    'width': '0',
                    'padding': '0',
                    'margin': '0',
                    'border': 'none'
                });
            }
       }
    });

    $('body').on('click', '.id-modal', function(e){
        e.preventDefault();
        var content = $($(this).attr('href')).html();
        $.fancybox({
            'content' : content,
            'autoSize' : false,
            'height'   : 'auto',
            beforeLoad : function() {
                if ($(window).width() &gt; 979) {
                    this.width = '50%';
                }
            }
        });
    });

    $("#inputCanadianCitizen").on('change', function() {
        var val = this.value;
        if (val === "No") {
            $(".contact-destination").hide();
        }
        else {
            $(".contact-destination").show();
        }
    });

    $('.collapsed-program-data').remove();
    $( window ).resize(function() {
        if ($(window).width() &lt;= 970) {
            $('.program-details-data-wrp .program-details-data').hide();
        }
        else {
            $('.collapsed-program-data').remove();
        }
    });

/**************** program details functionality (Remove it after bringing over vertical tabs widget) ********/
    if ($('.SectionGenericBlockItem-SchoolProgramDetails').length) {
        $('.SectionGenericBlockItem-SchoolProgramDetails .nav-tabs li a').on('click', function(e){
            var $target = $($(this).attr('href'));
            if ($(window).width() &lt;= 970) {
                if ($(this).parent().hasClass('active')) {
                    $(this).parent().next().slideUp();
                    $(this).parent().removeClass('active');
                }else{
                    $('.program-details-data').slideUp();
                    $(this).parent().after($($target).clone().addClass('collapsed-program-data'));
                    $(this).parent().next().slideDown();
                    $('.SectionGenericBlockItem-SchoolProgramDetails .nav-tabs li a').parent().removeClass('active');
                    $(this).parent().addClass('active');
                }
            }else{
                if ($(this).parent().hasClass('active')) {
                    $($(this).attr("href")).toggleClass('active');
                    $('.SectionGenericBlockItem-SchoolProgramDetails .nav-tabs li').removeClass('active');
                    $('.tab-pane').slideUp('fast');
                    e.preventDefault();
                    e.stopPropagation();
                }else{
                    //open
                    $('.SectionGenericBlockItem-SchoolProgramDetails .nav-tabs li').removeClass('active');
                    $(this).parent().addClass('active');
                    $('.tab-pane').slideUp('fast');
                    setTimeout(function(){ $target.slideDown('fast'); },200);
                }
            }
        });
    }
/************************************************************************************************************/

    $(".popout-btn").click(function() {
        var thisbtn = $(this);
        var content = $(this).data("content");

        if (!$("." + content).hasClass("showing")) {
            $("." + content).addClass("showing").slideDown("fast");
            arrowUp(thisbtn);
            $('html,body').animate({
                scrollTop: $("." + content).offset().top - 300
            }, 1000);
        }
        else {
            $("." + content).removeClass("showing").slideUp("fast");
            arrowDown(thisbtn);
        }
    });
    $(".popout-exclusive-btn").click(function(e) {
			e.preventDefault();
			e.stopPropagation( );

        var thisbtn = $(this);
        var content = $(this).data("content");

        if (!$("." + content).hasClass("showing")) {
            $(".popout-content").removeClass("showing").slideUp("fast");
            $("." + content).addClass("showing").slideDown("fast");
            if ($(".clicked").length) {
                arrowDown($('.clicked'));
                arrowUp(thisbtn);
            }
            else {
                arrowUp(thisbtn);
                setTimeout(function() {
									$('html,body').animate({
											scrollTop: $("." + content).offset().top - 300
									}, 1000);
								}, 500);
            }
        }
        else {
            $(".popout-content").removeClass("showing").slideUp("fast");
            arrowDown(thisbtn);
        }
    });
    $(".close-section").click(function(e) {
        e.preventDefault();
    	var prevSection = $(this).parent().closest("section").prev().offset().top;
        $(this).parent().closest("div").slideUp().removeClass("showing");
        $('html,body').animate({
            scrollTop: prevSection
        }, 1000);
        arrowDown($('.clicked'));
    });
    $(".collapse-btn").click(function() {
    	var prevSection = $(this).parent().closest("section").prev().offset().top;
        $(this).parent().closest("section").slideUp().removeClass("showing");
        $('html,body').animate({
            scrollTop: prevSection - 100
        }, 1000);
        arrowDown($('.clicked'));
    });

    $('body').on('click', '.open-secondary', function(e){
        e.preventDefault();
        var href = $(this).attr('href');
        var offset = $('.SectionGenericBlockItem-SchoolProgramDetails').offset().top + $('.SectionGenericBlockItem-SchoolProgramDetails').height();
        if ($(this).hasClass("clicked")) {
            $('.close-secondary').parents('section').hide();
            $(this).removeClass("clicked");
        }
        else {
            $(href).show();
            $('html,body').animate({
                scrollTop: offset
            }, 500);
            $(this).addClass("clicked");
        }
    });

    $('.close-secondary').click( function(e) {
        e.preventDefault();
        $(this).parents('section').hide();
        $('.open-secondary').removeClass("clicked");
    })

    function arrowUp( button ) {
			button.find('em').removeClass('icon-chevron-down').addClass(' icon-chevron-up clicked');
		}

		function arrowDown( button ) {
			button.find('em').removeClass('icon-chevron-up clicked').addClass(' icon-chevron-down');
		}

/*
    var notifications_url = window.location.protocol + '//humber.ca/hq/api/notifications/index/group/1';
    if (window.location.href.indexOf("humber.ca/realestate") &gt; -1) {
        notifications_url = window.location.protocol + '//humber.ca/hq/api/notifications/index/group/2';
    }

    $.ajax({
        method: "GET",
        url: notifications_url,
    }).done(function(notifications) {
    	var $latestNotification;
        if (typeof($.cookie('last_viewed_notification')) !== 'undefined') {
            $.each(notifications, function(key, notification) {
                if(notification.id == $.cookie('last_viewed_notification')) {
                    $latestNotification = notifications[key + 1];
                    return false;
                }
                else{
                    $latestNotification = notifications[0];
                }
            });
        }
        else {
            $latestNotification = notifications[0];
        }
        if ($latestNotification !== undefined) {
            $('body').append('&lt;div class="notification-popup"&gt;&lt;div class="notification-image"&gt;&lt;img src="//humber.ca/assets/images/notifications/'+ $latestNotification.icon +'"&gt;&lt;/div&gt;&lt;div class="notification-details"&gt;&lt;div class="close-notification"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="30" height="30" viewBox="0 0 252 252" style=";fill:#000000;" class="icon icons8-cancel"&gt;&lt;g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"&gt;&lt;path d="M0,252v-252h252v252z" fill="none"&gt;&lt;/path&gt;&lt;g id="Layer_1"&gt;&lt;path d="M236.25,126c0,60.88425 -49.36575,110.25 -110.25,110.25c-60.88425,0 -110.25,-49.36575 -110.25,-110.25c0,-60.88425 49.36575,-110.25 110.25,-110.25c60.88425,0 110.25,49.36575 110.25,110.25z" fill="#000000"&gt;&lt;/path&gt;&lt;path d="M155.694,81.459l14.847,14.847l-74.235,74.235l-14.847,-14.847z" fill="#ffffff"&gt;&lt;/path&gt;&lt;path d="M170.541,155.694l-14.847,14.847l-74.235,-74.235l14.847,-14.847z" fill="#ffffff"&gt;&lt;/path&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;'+ $latestNotification.description+'&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;');

            setTimeout(function(){ $('.notification-popup').css('right','0px'); }, 50);

            $('.close-notification').on('click', function() {
                $('.notification-popup').css('right','-1000%');
                $.cookie('last_viewed_notification', $latestNotification.id , { expires: 30, path: '/' });
            });
        }
    });
*/
//     var notifications_url = window.location.protocol + '//humber.ca/hq/api/notifications/index/custom_groups/1_3';
//     if (window.location.href.indexOf("humber.ca/realestate") &gt; -1) {
//         notifications_url = window.location.protocol + '//humber.ca/hq/api/notifications/index/group/2';
//     }
//
//     $.ajax({
//         method: "GET",
//         url: notifications_url,
//     }).done(function(notifications) {
//     	var $latestNotification;
//     	var totalNumberOfNotifications = notifications.length;
//     	var numberOfUnseenNotifications;
//         if (typeof($.cookie('last_viewed_notification')) !== 'undefined') {
//             $.each(notifications, function(key, notification) {
//                 if(notification.id == $.cookie('last_viewed_notification')) {
//                     var isSlider = (notifications[key + 1] ?
//                                                 (notifications[key + 1].notification_location != "2" ? 1 : 0)
//                                                  : 0)
//                     $latestNotification = isSlider ? notifications[key + 1] : undefined;
//                     numberOfUnseenNotifications = totalNumberOfNotifications - (key + 1);
//                     return false;
//                 }
//                 else{
//                     if ($latestNotification == undefined) {
//                         $latestNotification = (notifications[key] ?
//                                                             (notifications[key].notification_location != "2" ? notifications[key] : undefined)
//                                                              : undefined);
//                         numberOfUnseenNotifications = totalNumberOfNotifications;
//                     }
//                 }
//             });
//         }
//         else {
//
//             $.each(notifications, function(key, notification) {
//                 if ($latestNotification == undefined) {
//
//                     $latestNotification = (notifications[key] ?
//                                                         (notifications[key].notification_location != "2" ? notifications[key] : undefined)
//                                                          : undefined);
//                     numberOfUnseenNotifications = totalNumberOfNotifications;
//                 }
//             });
//
//         }
//
//         if ($latestNotification !== undefined) {
//             $('body').append('&lt;div class="notification-popup"&gt;&lt;div class="notification-image"&gt;&lt;img alt="notification icon" src="//humber.ca/assets/images/notifications/'+ $latestNotification.icon +'"&gt;&lt;/div&gt;&lt;div class="notification-details"&gt;&lt;div class="close-notification"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="30" height="30" viewBox="0 0 252 252" style=";fill:#000000;" class="icon icons8-cancel"&gt;&lt;g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"&gt;&lt;path d="M0,252v-252h252v252z" fill="none"&gt;&lt;/path&gt;&lt;g id="Layer_1"&gt;&lt;path d="M236.25,126c0,60.88425 -49.36575,110.25 -110.25,110.25c-60.88425,0 -110.25,-49.36575 -110.25,-110.25c0,-60.88425 49.36575,-110.25 110.25,-110.25c60.88425,0 110.25,49.36575 110.25,110.25z" fill="#000000"&gt;&lt;/path&gt;&lt;path d="M155.694,81.459l14.847,14.847l-74.235,74.235l-14.847,-14.847z" fill="#ffffff"&gt;&lt;/path&gt;&lt;path d="M170.541,155.694l-14.847,14.847l-74.235,-74.235l14.847,-14.847z" fill="#ffffff"&gt;&lt;/path&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;'+ $latestNotification.description+'&lt;a class="read-all-alerts-btn" href="https://humber.ca/alerts.html" title="Alerts and Notifications"&gt;Read all alerts &lt;em style="font-size:12px;" class="icon-chevron-right"&gt;&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;');
//
//             $('.alerts-icon').attr('id', 'alert-icon');
//             $('.alerts-icon').data('alert_number', numberOfUnseenNotifications);
//             $('.alerts-icon').html('&lt;div class="alert-number"&gt;'+numberOfUnseenNotifications+'&lt;/div&gt;&lt;span&gt;Alerts&lt;/span&gt;');
//
//             setTimeout(function(){ $('.notification-popup').css('right','0px'); }, 50);
//
//             $('.close-notification').on('click', function() {
//                 $('.notification-popup').css('right','-1000%');
//                 $.cookie('last_viewed_notification', $latestNotification.id , { expires: 30, path: '/' });
//                 var numberOfUnseenNotificationsLeft = $('.humber-corporate-menu-side-items-list').find('#alert-icon').data('alert_number') - 1;
//                 if (numberOfUnseenNotificationsLeft) {
//                     $('.humber-corporate-menu-side-items-list').find('#alert-icon div.alert-number').html(numberOfUnseenNotificationsLeft);
//                 }
//                 else {
//                     $('.humber-corporate-menu-side-items-list').find('#alert-icon').html('&lt;img src="https://humber.ca/assets/images/notification_alerts.png" alt="Alerts and Notifications icon" width="35"&gt;&lt;span&gt;Alerts&lt;/span&gt;');
//                 }
//
//             });
//         }
//         else {
//             if (numberOfUnseenNotifications) {
//                 $('.alerts-icon').attr('id', 'alert-icon');
//                 $('.alerts-icon').data('alert_number', numberOfUnseenNotifications);
//                 $('.alerts-icon').html('&lt;div class="alert-number"&gt;'+numberOfUnseenNotifications+'&lt;/div&gt;&lt;span&gt;Alerts&lt;/span&gt;');
//             }
//             else {
//                 $('.alerts-icon').html('&lt;img src="https://humber.ca/assets/images/notification_alerts.png" alt="Alerts and Notifications icon" width="35"&gt;&lt;span&gt;Alerts&lt;/span&gt;');
//             }
//         }
//     });

 /******************* Curricullum program btns ******************/
    $('.program-btns').on('click', function() {
        equalDivs(".semester-pair .semester-group");
    });

});</pre></body></html>