// var gClickFlag = false;
var gResizeInitCount = 0;
function veo_commonInit()
{
var gIsAutoPlay = true;
$.each($(".topSlider .sliderItem"), function(_i, _el){
if($(_el).find('.videoWrapper').data("video") !== undefined){
gIsAutoPlay = false;
}
});
$(".topSlider").slick
(
{
dots: true,
infinite: true,
speed: 300,
slidesToShow: 1,
adaptiveHeight: true,
fade: true,
autoplay: gIsAutoPlay,
autoplaySpeed: 5000
}
);
$(".topSlider").on
(
"beforeChange",
function(pEvent, pSlick, pCurrentSlide, pNextSlide)
{
var _video = $(".topSlider").find(".sliderItem[data-slick-index=" + pNextSlide + "]").find(".videoWrapper").data("video");
$(".topSlider").find(".sliderItem").removeClass("active");
$(".topSlider").find(".sliderItem[data-slick-index=" + pNextSlide + "]").addClass("active");
updateSliderVideo($(".topSlider"), $(".topSlider").find(".sliderItem[data-slick-index=" + pNextSlide + "]"), _video);
}
);
/*
$(".topSlider").on
(
"afterChange",
function(pEvent, pSlick, pCurrentSlide)
{
}
);
*/
$(".topSlider").find(".sliderItem").removeClass("active");
$(".topSlider").find(".sliderItem[data-slick-index=0]").addClass("active");
updateSliderVideo($(".topSlider"), $(".topSlider").find(".sliderItem.active"), $(".topSlider").find(".sliderItem.active").find(".videoWrapper").data("video"));
$(window).scroll
(
function()
{
updateHistoryScroll();
}
);
updateHistoryScroll();
$(window).on
(
"resize",
function(pEvent, pResponsive_str)
{
gResizeInitCount++;
if ((gResizeInitCount < 2) || ($(window).width() != gDisplayWidth))
{
gDisplayWidth = $(window).width();
$("html, body").removeClass("transitionFreeze").addClass("transitionFreeze");
if ($(".campusMenuWrapper").length > 0)
{
updateCampusMenu($(".campusMenuWrapper").find("#"));
}
if ($(".learningwithusMenuWrapper").length > 0)
{
updateLearningwithusMenu($(".learningwithusMenuWrapper").find("#"));
}
if ($(".tabMenuWrapper").length > 0)
{
if(gCurrentTab != '') {
updateTabMenu(gCurrentTab);
}
// 20180115 call closeFaqItems() only when it is declared
if (typeof closeFaqItems !== 'undefined' && typeof closeFaqItems === 'function') {
closeFaqItems();
}
}
setTimeout
(
function ()
{
$("html, body").removeClass("transitionFreeze");
},
10
);
}
}
);
}
function veo_campusInit()
{
$(".campusMenu").find("input[type='radio']").on
(
"change",
function (pEvent)
{
updateCampusMenu($(pEvent.currentTarget));
}
);
gDisplayWidth = $(window).width();
gCurrentCampusSection = $(".campusMenuWrapper").find("#").val();
$(".campusMenuWrapper").find("#").trigger("click");
updateCampusMenu($(".campusMenuWrapper").find("#"));
}
function veo_learningwithusInit()
{
$(".learningwithusMenu").find("input[type='radio']").on
(
"change",
function (pEvent)
{
updateLearningwithusMenu($(pEvent.currentTarget));
}
);
gDisplayWidth = $(window).width();
gCurrentLearningwithusSection = $(".learningwithusMenuWrapper").find("#").val();
$(".learningwithusMenuWrapper").find("#").trigger("click");
}
function updateSliderVideo(pSlider, pSliderItem, pVideo)
{
var _html = null;
var _popVideoType = pSliderItem.data("type");
var _popVideo = pSliderItem.data("id");
_html = '';
if (pVideo != undefined)
{
if ($("body").hasClass("deviceDesktop"))
{
_html += '';
}
}
if ((_popVideoType != undefined) && (_popVideoType != ""))
{
_html += '';
}
pSliderItem.find(".videoWrapper").html(_html);
}
function updateHistoryScroll()
{
var _i = null;
var _scrollTop = $(this).scrollTop();
_i = $(".historyTimeline").find(".historyTimestamp").length - 1;
while (_i > 0)
{
if ((_scrollTop + ($(window).height() * 0.5)) >= $(".historyTimeline").find(".historyTimestamp").eq(_i).offset().top)
{
break;
}
_i--;
}
$(".historyTimeline").find(".historyTimestamp").removeClass("active");
$(".historyTimeline").find(".historyTimestamp").eq(_i).addClass("active");
}